2016-08-20 02:31:08 +02:00
|
|
|
#/bin/bash
|
|
|
|
|
|
|
|
INSTALL_DUNITER_DEBIAN_PACKAGE () {
|
|
|
|
# Retrieve url of last version and version number
|
2016-10-11 19:30:05 +02:00
|
|
|
url=$(curl -s https://api.github.com/repos/duniter/duniter/releases | grep "browser_" | grep $arch | grep "linux" | grep "server" | head -1 | cut -d\" -f4)
|
|
|
|
version=$(echo $url | cut -d/ -f8)
|
2016-08-20 02:31:08 +02:00
|
|
|
|
|
|
|
# Retrieve debian package and install it
|
|
|
|
wget -nc --quiet $url -P /tmp
|
2016-10-11 19:30:05 +02:00
|
|
|
deb="/tmp/duniter-server-$version-linux-$arch.deb"
|
2016-10-14 14:50:13 +02:00
|
|
|
sudo dpkg -i $deb > /dev/null
|
2016-10-11 19:30:05 +02:00
|
|
|
sudo rm -f $deb
|
2016-08-20 02:31:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
CONFIG_SSOWAT_FOR_RESTRICTED_ACCESS () {
|
|
|
|
# Add admin to the allowed users
|
|
|
|
sudo yunohost app addaccess $app -u $admin
|
|
|
|
|
|
|
|
# Allow only allowed users to access admin panel
|
|
|
|
ynh_app_setting_set "$app" protected_uris "/"
|
|
|
|
|
|
|
|
# SSOwat Configuration
|
|
|
|
#ynh_app_setting_set "$app" unprotected_uris "/api/"
|
|
|
|
}
|
|
|
|
|
|
|
|
CONFIG_NGINX_FOR_WEB_ADMIN () {
|
|
|
|
# Configure Nginx
|
|
|
|
nginx_conf="../conf/nginx.conf"
|
|
|
|
#sudo sed -i "s@YNH_EXAMPLE_PATH@$path@g" $nginx_conf
|
|
|
|
sudo sed -i "s@YNH_EXAMPLE_PORT@$port@" $nginx_conf
|
|
|
|
sudo sed -i "s@YNH_EXAMPLE_DOMAIN@$domain@" $nginx_conf
|
|
|
|
sudo cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
|
|
|
|
sudo nginx -t && sudo service nginx reload
|
|
|
|
}
|