mirror of
https://github.com/YunoHost-Apps/strut_ynh.git
synced 2024-09-03 20:26:33 +02:00
37 lines
1 KiB
Bash
37 lines
1 KiB
Bash
#!/bin/bash
|
|
|
|
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
|
|
set -e
|
|
|
|
# Get app instance name
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
# Retrieve arguments
|
|
domain=$(sudo yunohost app setting $app domain)
|
|
path=$(sudo yunohost app setting $app path)
|
|
public_site=$(sudo yunohost app setting $app public_site)
|
|
|
|
# Copy files to the right place
|
|
final_path=/var/www/$app
|
|
sudo mkdir -p $final_path
|
|
sudo cp -a ../sources/* $final_path
|
|
|
|
# Set permissions to roundcube directory
|
|
sudo chown -R www-data: $final_path
|
|
|
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf*
|
|
sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf*
|
|
|
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
|
|
|
# Reload Nginx
|
|
sudo service nginx reload
|
|
|
|
# SSO configuration
|
|
sudo yunohost app setting $app skipped_uris -v "/"
|
|
if [ "$public_site" = "No" ];
|
|
then
|
|
sudo yunohost app setting $app protected_uris -v "/index.html,/scripts"
|
|
fi
|
|
sudo yunohost app ssowatconf
|