add ente web and public albums static sites
This commit is contained in:
53
setup_ente_web.sh
Normal file
53
setup_ente_web.sh
Normal file
@ -0,0 +1,53 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Exit immediately if a command exits with a non-zero status.
|
||||
set -e
|
||||
|
||||
# set the local repo location
|
||||
LOCAL_REPO="~/src/ente"
|
||||
|
||||
cd $LOCAL_REPO/web
|
||||
|
||||
yarn install
|
||||
yarn build:photos # puts the built files in the web/apps/photos/out directory
|
||||
|
||||
sudo cp -r apps/photos/out /var/www/ente/photos
|
||||
|
||||
# configure nginx to serve the photos app on ente.sa.vin
|
||||
sudo tee /etc/nginx/sites-available/ente.sa.vin.conf > /dev/null <<EOL
|
||||
server {
|
||||
listen 80;
|
||||
server_name ente.sa.vin;
|
||||
|
||||
location / {
|
||||
root /var/www/ente/photos;
|
||||
index index.html;
|
||||
try_files \$uri /index.html;
|
||||
}
|
||||
}
|
||||
EOL
|
||||
|
||||
# create a symbolic link to enable the site
|
||||
sudo ln -s /etc/nginx/sites-available/ente.sa.vin.conf /etc/nginx/sites-enabled/
|
||||
|
||||
# Also configure nginx to serve the same photos app on entep.sa.vin
|
||||
sudo tee /etc/nginx/sites-available/entep.sa.vin.conf > /dev/null <<EOL
|
||||
server {
|
||||
listen 80;
|
||||
server_name entep.sa.vin;
|
||||
|
||||
location / {
|
||||
root /var/www/ente/photos;
|
||||
index index.html;
|
||||
try_files \$uri /index.html;
|
||||
}
|
||||
}
|
||||
EOL
|
||||
|
||||
# reload nginx to apply changes
|
||||
sudo systemctl reload nginx
|
||||
|
||||
# use certbot to add SSL certificate for the photos app
|
||||
sudo certbot --nginx -d ente.sa.vin -d entep.sa.vin
|
||||
|
||||
echo "Ente web app has been set up successfully. Access the app at https://ente.sa.vin or https://entep.sa.vin"
|
@ -19,8 +19,8 @@ go build -o museum cmd/museum/main.go
|
||||
sudo cp museum $INSTALL_DIR
|
||||
|
||||
# Create a new user and group named 'museum'
|
||||
sudo groupadd -r museum
|
||||
sudo useradd -r -g museum -d $LIB_DIR -s /sbin/nologin -c "museum user" museum
|
||||
sudo groupadd -r museum || true
|
||||
sudo useradd -r -g museum -d $LIB_DIR -s /sbin/nologin -c "museum user" museum || true
|
||||
|
||||
|
||||
sudo mkdir -p $LIB_DIR
|
||||
|
Reference in New Issue
Block a user