Add nginx site definition for GNU Health, properly capitalize Sao name
This commit is contained in:
parent
4173d96e84
commit
7f9da048ba
17
gnuhealth.sh
17
gnuhealth.sh
@ -5,12 +5,12 @@ SOURCE_DIR=$(realpath $(dirname "${0}"))
|
|||||||
# Install dependencies for GNU Health
|
# Install dependencies for GNU Health
|
||||||
apt-get -y --no-install-recommends install python3 python3-virtualenv virtualenv
|
apt-get -y --no-install-recommends install python3 python3-virtualenv virtualenv
|
||||||
|
|
||||||
# Add NodeJS repository for SAO (Tryton web client)
|
# Add NodeJS repository for Sao (Tryton web client)
|
||||||
wget https://deb.nodesource.com/gpgkey/nodesource.gpg.key -O - | apt-key add -
|
wget https://deb.nodesource.com/gpgkey/nodesource.gpg.key -O - | apt-key add -
|
||||||
echo 'deb https://deb.nodesource.com/node_8.x xenial main' > /etc/apt/sources.list.d/nodejs.list
|
echo 'deb https://deb.nodesource.com/node_8.x xenial main' > /etc/apt/sources.list.d/nodejs.list
|
||||||
apt-get -y update
|
apt-get -y update
|
||||||
|
|
||||||
# Install dependencies for SAO (Tryton web client)
|
# Install dependencies for Sao (Tryton web client)
|
||||||
apt-get -y --no-install-recommends install nodejs
|
apt-get -y --no-install-recommends install nodejs
|
||||||
|
|
||||||
# Download GNU Health
|
# Download GNU Health
|
||||||
@ -19,7 +19,7 @@ tar xzf /tmp/gnuhealth.tgz -C /srv
|
|||||||
mv /srv/gnuhealth-3.2.8 /srv/gnuhealth
|
mv /srv/gnuhealth-3.2.8 /srv/gnuhealth
|
||||||
rm -f /tmp/gnuhealth.tgz
|
rm -f /tmp/gnuhealth.tgz
|
||||||
|
|
||||||
# Clone SAO (Tryton web client) repository
|
# Clone Sao (Tryton web client) repository
|
||||||
git clone --depth 1 https://github.com/tryton/sao /srv/gnuhealth/sao
|
git clone --depth 1 https://github.com/tryton/sao /srv/gnuhealth/sao
|
||||||
|
|
||||||
# Create Python virtualenv
|
# Create Python virtualenv
|
||||||
@ -39,7 +39,7 @@ chown -R gnuhealth:gnuhealth /srv/gnuhealth
|
|||||||
# Install GNU Health
|
# Install GNU Health
|
||||||
sudo -u gnuhealth -i /srv/gnuhealth/gnuhealth-setup install
|
sudo -u gnuhealth -i /srv/gnuhealth/gnuhealth-setup install
|
||||||
|
|
||||||
# Install SAO (Tryton web client)
|
# Install Sao (Tryton web client)
|
||||||
sudo -u gnuhealth npm install --production --prefix /srv/gnuhealth/sao
|
sudo -u gnuhealth npm install --production --prefix /srv/gnuhealth/sao
|
||||||
sudo -u gnuhealth bash -c 'cd /srv/gnuhealth/sao && /srv/gnuhealth/sao/node_modules/grunt-cli/bin/grunt'
|
sudo -u gnuhealth bash -c 'cd /srv/gnuhealth/sao && /srv/gnuhealth/sao/node_modules/grunt-cli/bin/grunt'
|
||||||
|
|
||||||
@ -58,6 +58,13 @@ systemctl daemon-reload
|
|||||||
systemctl enable gnuhealth
|
systemctl enable gnuhealth
|
||||||
systemctl start gnuhealth
|
systemctl start gnuhealth
|
||||||
|
|
||||||
|
# Create nginx site definition
|
||||||
|
cp ${SOURCE_DIR}/gnuhealth/etc/nginx/sites-available/gnuhealth /etc/nginx/sites-available/gnuhealth
|
||||||
|
ln -s /etc/nginx/sites-available/gnuhealth /etc/nginx/sites-enabled/gnuhealth
|
||||||
|
|
||||||
|
# Restart nginx
|
||||||
|
systemctl restart nginx
|
||||||
|
|
||||||
# Add portal application definition
|
# Add portal application definition
|
||||||
${SOURCE_DIR}/basic/portal-app-manager.py gnuhealth "{host}:8006" admin "${GNUHEALTH_ADMIN_PWD}"
|
${SOURCE_DIR}/basic/portal-app-manager.py gnuhealth "https://{host}:8006/" admin "${GNUHEALTH_ADMIN_PWD}"
|
||||||
${SOURCE_DIR}/basic/portal-app-manager.py gnuhealth-clients
|
${SOURCE_DIR}/basic/portal-app-manager.py gnuhealth-clients
|
||||||
|
22
gnuhealth/etc/nginx/sites-available/gnuhealth
Normal file
22
gnuhealth/etc/nginx/sites-available/gnuhealth
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
server {
|
||||||
|
listen 8006 ssl http2;
|
||||||
|
listen [::]:8006 ssl http2;
|
||||||
|
|
||||||
|
access_log /var/log/nginx/gnuhealth.access.log;
|
||||||
|
error_log /var/log/nginx/gnuhealth.error.log;
|
||||||
|
|
||||||
|
root /srv/gnuhealth/sao;
|
||||||
|
try_files $uri @app;
|
||||||
|
|
||||||
|
location @app {
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header Proxy "";
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_read_timeout 90;
|
||||||
|
proxy_connect_timeout 90;
|
||||||
|
proxy_pass http://127.0.0.1:8097;
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,7 @@ uri = postgresql://gnuhealth:${GNUHEALTH_PWD}@localhost
|
|||||||
path = /srv/gnuhealth/attach
|
path = /srv/gnuhealth/attach
|
||||||
|
|
||||||
[web]
|
[web]
|
||||||
listen = 0.0.0.0:8006
|
listen = 127.0.0.1:8097
|
||||||
root = /srv/gnuhealth/sao
|
root = /srv/gnuhealth/sao
|
||||||
|
|
||||||
[webdav]
|
[webdav]
|
||||||
|
Loading…
Reference in New Issue
Block a user