mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
update nginx code
This commit is contained in:
parent
1b3355a610
commit
0540857af3
@ -60,12 +60,12 @@ exec > >(tee -a $UPDATE_HTML) 2>&1
|
||||
|
||||
# configure nginx for the update-page
|
||||
echo 'Configuring nginx to serve the update-page' >> $UPDATE_HTML
|
||||
rm /etc/nginx/sites-enabled/gradido.conf
|
||||
ln -s /etc/nginx/sites-available/update-page.conf /etc/nginx/sites-enabled/
|
||||
|
||||
ln -s $SCRIPT_PATH/nginx/sites-available/update-page.conf $SCRIPT_PATH/nginx/sites-enabled/default
|
||||
sudo /etc/init.d/nginx restart
|
||||
# enable https if env variable has value https
|
||||
if [ "$URL_PROTOCOL" = "https" ]; then
|
||||
certbot --nginx --non-interactive --domains $COMMUNITY_HOST
|
||||
certbot install --nginx --non-interactive --cert-name $COMMUNITY_HOST --logs-dir ./log/ --work-dir . --config-dir .
|
||||
fi
|
||||
|
||||
# stop all services
|
||||
@ -261,11 +261,10 @@ done
|
||||
|
||||
# let nginx showing gradido
|
||||
echo 'Configuring nginx to serve gradido again' >> $UPDATE_HTML
|
||||
ln -s /etc/nginx/sites-available/gradido.conf /etc/nginx/sites-enabled/
|
||||
rm /etc/nginx/sites-enabled/update-page.conf
|
||||
ln -s $SCRIPT_PATH/nginx/sites-available/gradido.conf $SCRIPT_PATH/nginx/sites-enabled/default
|
||||
sudo /etc/init.d/nginx restart
|
||||
if [ "$URL_PROTOCOL" = "https" ]; then
|
||||
certbot --nginx --non-interactive --domains $COMMUNITY_HOST
|
||||
certbot install --nginx --non-interactive --cert-name $COMMUNITY_HOST --logs-dir ./log/ --work-dir . --config-dir .
|
||||
fi
|
||||
|
||||
# keep the update log
|
||||
|
||||
@ -62,9 +62,10 @@ echo "$SECURE_MYSQL"
|
||||
# Configure nginx
|
||||
rm /etc/nginx/sites-enabled/default
|
||||
envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $SCRIPT_PATH/nginx/sites-available/gradido.conf.template > $SCRIPT_PATH/nginx/sites-available/gradido.conf
|
||||
ln -s $SCRIPT_DIR/nginx/sites-available/gradido.conf /etc/nginx/sites-available
|
||||
envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $SCRIPT_PATH/nginx/sites-available/update-page.conf.template > $SCRIPT_PATH/nginx/sites-available/update-page.conf
|
||||
ln -s $SCRIPT_PATH/nginx/sites-available/update-page.conf /etc/nginx/sites-available
|
||||
mkdir $SCRIPT_PATH/nginx/sites-enabled
|
||||
ln -s $SCRIPT_PATH/nginx/sites-available/update-page.conf $SCRIPT_PATH/nginx/sites-enabled/default
|
||||
ln -s $SCRIPT_PATH/nginx/sites-enabled/default /etc/nginx/sites-enabled
|
||||
ln -s $SCRIPT_PATH/nginx/common /etc/nginx/
|
||||
rmdir /etc/nginx/conf.d
|
||||
ln -s $SCRIPT_PATH/nginx/conf.d /etc/nginx/
|
||||
@ -128,4 +129,4 @@ crontab -l | { cat; echo "0 * * * * find /tmp -name "yarn--*" -cmin +60 -exec rm
|
||||
crontab -l | { cat; echo "0 4 * * * find /tmp -name "yarn--*" -ctime +1 -exec rm -r {} \; > /dev/null"; } | crontab -
|
||||
# Start gradido
|
||||
# Note: on first startup some errors will occur - nothing serious
|
||||
$SCRIPT_PATH/start.sh
|
||||
sudo -u gradido $SCRIPT_PATH/start.sh
|
||||
Loading…
x
Reference in New Issue
Block a user