summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2019-05-07 13:10:18 +0200
committerRamón M. Gómez <ramongomez@us.es>2019-05-07 13:10:18 +0200
commitd32a8b6f453fd0ce4d1c67d46912dbecf881191d (patch)
treebd6824af2019ed638e5de16ef215d05bc502b8f9
parent3492b43ca58e867592d2671ec04e1a3ca8a961c1 (diff)
#761 Fetching correct admin credentials; applying new permissions.
-rwxr-xr-xinstaller/opengnsys_installer.sh9
-rwxr-xr-xserver/bin/checkperms12
2 files changed, 12 insertions, 9 deletions
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh
index 6359e4eb..32c74b05 100755
--- a/installer/opengnsys_installer.sh
+++ b/installer/opengnsys_installer.sh
@@ -1071,7 +1071,10 @@ sudo -u $OPENGNSYS_CLIENT_USER php app/console doctrine:database:create --if-not
sudo -u $OPENGNSYS_CLIENT_USER php app/console doctrine:schema:update --force
echo yes | php app/console doctrine:fixtures:load
php app/console fos:user:create "$OPENGNSYS_DB_USER" "${OPENGNSYS_DB_USER}@localhost.localdomain" "$OPENGNSYS_DB_USER"
-# Generar nuevos tokens de seguridad.
+# Guardar tokens de seguridad.
+read -e ADMINID ADMINSECRET <<< \
+ "$(php app/console doctrine:query:sql "SELECT random_id, secret FROM og_core__clients WHERE id=1;" | \
+ awk -F\" '$2~/^(random_id|secret)$/ {getline; printf("%s ", $2)}')"
read -e CLIENTID CLIENTSECRET <<< \
"$(php app/console opengnsys:oauth-server:client:create --no-ansi | \
awk 'BEGIN {RS=" "}
@@ -1084,8 +1087,8 @@ tmpdir=$(sudo -u $OPENGNSYS_CLIENT_USER mktemp -d)
echo "cache = $tmpdir" > .npmrc
sudo -u $OPENGNSYS_CLIENT_USER npm install
sed -i -e "s/SERVERIP/$SERVERIP/" \
- -e "s/CLIENTID/$CLIENTID/" \
- -e "s/CLIENTSECRET/$CLIENTSECRET/" src/environments/environment.ts
+ -e "s/CLIENTID/1_$ADMINID/" \
+ -e "s/CLIENTSECRET/$ADMINSECRET/" src/environments/environment.ts
sed -i 's,base href=.*,base href="/opengnsys3/frontend/">,' src/index.html
sudo -u $OPENGNSYS_CLIENT_USER ng build
rm -fr $tmpdir
diff --git a/server/bin/checkperms b/server/bin/checkperms
index 5c558c45..ca9e1d7d 100755
--- a/server/bin/checkperms
+++ b/server/bin/checkperms
@@ -46,16 +46,16 @@ find $OPENGNSYS_DIR/images -maxdepth 1 -type f -exec chmod 664 {} \;
find $OPENGNSYS_DIR/client/{interfaceAdm,scripts} ! -name "*.txt" -exec chmod +x {} \;
chown $OPENGNSYS_USER:$OPENGNSYS_USER $OPENGNSYS_DIR/client/interfaceAdm/CambiarAcceso
chmod 700 $OPENGNSYS_DIR/client/interfaceAdm/CambiarAcceso
-chown root:root $OPENGNSYS_DIR/etc/{ogAdmServer,ogAdmAgent}*.cfg
-chmod 600 $OPENGNSYS_DIR/etc/{ogAdmServer,ogAdmAgent}*.cfg
-chown root:$APACHE_GROUP $OPENGNSYS_DIR/{www/controlacceso*.php,etc/ogAdmRepo*.cfg}
-chmod 640 $OPENGNSYS_DIR/{www/controlacceso*.php,etc/ogAdmRepo*.cfg}
-chown -R $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/www/images/{fotos,iconos}
+rm -fr $OPENGNSYS_DIR/www3/backend/var/cache/*
+mkdir -p $OPENGNSYS_DIR/www3/backend/var/{cache,logs}
+chown -R $OPENGNSYS_USER:$OPENGNSYS_USER $OPENGNSYS_DIR/www3
+chown -R $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/www3/backend/var
+chmod 777 $OPENGNSYS_DIR/www3/backend/var/{cache,logs}
mkdir -p $OPENGNSYS_DIR/www/{api,tmp}
chown -R $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/www/{api,tmp}
chown -R $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/tftpboot/menu.lst
chown -R :$OPENGNSYS_USER $OPENGNSYS_DIR/tftpboot/ogLive*
find -L $OPENGNSYS_DIR/tftpboot -type d -exec chmod 755 {} \;
find -L $OPENGNSYS_DIR/tftpboot -type f -exec chmod 644 {} \;
-chown $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/log/{ogagent,remotepc,rest}.log
+#chown $APACHE_USER:$APACHE_GROUP $OPENGNSYS_DIR/log/{ogagent,remotepc,rest}.log