mirror of
https://github.com/YunoHost-Apps/duniter_ynh.git
synced 2024-09-03 18:26:35 +02:00
[mod] tabulations inside f()
This commit is contained in:
parent
3e379d9fa8
commit
f266234ee6
1 changed files with 34 additions and 36 deletions
|
@ -1,22 +1,21 @@
|
||||||
#/bin/bash
|
#/bin/bash
|
||||||
|
|
||||||
INSTALL_DUNITER_DEBIAN_PACKAGE () {
|
INSTALL_DUNITER_DEBIAN_PACKAGE () {
|
||||||
|
version="v1.6.25"
|
||||||
|
git_repo="https://git.duniter.org/nodes/typescript/duniter/"
|
||||||
|
if [ $arch == "x64" ]; then
|
||||||
|
middle_url="-/jobs/7062/artifacts/raw/work/bin/"
|
||||||
|
else
|
||||||
|
middle_url="uploads/722c2b2901e0c2a13ca3595eae4e696f/"
|
||||||
|
fi
|
||||||
|
deb="duniter-server-$version-linux-$arch.deb"
|
||||||
|
url="${git_repo}${middle_url}${deb}"
|
||||||
|
|
||||||
version="v1.6.25"
|
# Retrieve debian package and install it
|
||||||
git_repo="https://git.duniter.org/nodes/typescript/duniter/"
|
wget -nc --quiet $url -P /tmp
|
||||||
if [ $arch == "x64" ]; then
|
deb_path="/tmp/$deb"
|
||||||
middle_url="-/jobs/7062/artifacts/raw/work/bin/"
|
dpkg -i $deb_path > /dev/null
|
||||||
else
|
rm -f $deb_path
|
||||||
middle_url="uploads/722c2b2901e0c2a13ca3595eae4e696f/"
|
|
||||||
fi
|
|
||||||
deb="duniter-server-$version-linux-$arch.deb"
|
|
||||||
url="${git_repo}${middle_url}${deb}"
|
|
||||||
|
|
||||||
# Retrieve debian package and install it
|
|
||||||
wget -nc --quiet $url -P /tmp
|
|
||||||
deb_path="/tmp/$deb"
|
|
||||||
dpkg -i $deb_path > /dev/null
|
|
||||||
rm -f $deb_path
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIGURE_DUNITER () {
|
CONFIGURE_DUNITER () {
|
||||||
|
@ -26,35 +25,34 @@ CONFIGURE_DUNITER () {
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG_SSOWAT () {
|
CONFIG_SSOWAT () {
|
||||||
# Add admin to the allowed users
|
# Add admin to the allowed users
|
||||||
yunohost app addaccess $app -u $admin
|
yunohost app addaccess $app -u $admin
|
||||||
|
|
||||||
# Protect senstive sub-routes
|
# Protect senstive sub-routes
|
||||||
ynh_app_setting_set "$app" protected_uris "/webui","/webmin"
|
ynh_app_setting_set "$app" protected_uris "/webui","/webmin"
|
||||||
|
|
||||||
# Duniter is public app, with only some parts restricted in nginx.conf
|
# Duniter is public app, with only some parts restricted in nginx.conf
|
||||||
ynh_app_setting_set "$app" unprotected_uris "/","/modules"
|
ynh_app_setting_set "$app" unprotected_uris "/","/modules"
|
||||||
|
|
||||||
# Set URL redirection from root to webadmin
|
# Set URL redirection from root to webadmin
|
||||||
ynh_app_setting_set "$app" redirected_urls "{'$domain/':'$domain/webui'}"
|
ynh_app_setting_set "$app" redirected_urls "{'$domain/':'$domain/webui'}"
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG_NGINX () {
|
CONFIG_NGINX () {
|
||||||
# Configure Nginx
|
nginx_conf="../conf/nginx.conf"
|
||||||
nginx_conf="../conf/nginx.conf"
|
sed -i "s@YNH_EXAMPLE_PORT@$port@" $nginx_conf
|
||||||
sed -i "s@YNH_EXAMPLE_PORT@$port@" $nginx_conf
|
sed -i "s@YNH_EXAMPLE_DOMAIN@$domain@" $nginx_conf
|
||||||
sed -i "s@YNH_EXAMPLE_DOMAIN@$domain@" $nginx_conf
|
cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
cp $nginx_conf /etc/nginx/conf.d/$domain.d/$app.conf
|
service nginx reload
|
||||||
service nginx reload
|
|
||||||
}
|
}
|
||||||
|
|
||||||
REMOVE_DUNITER () {
|
REMOVE_DUNITER () {
|
||||||
# Stop duniter daemon if running
|
# Stop duniter daemon if running
|
||||||
duniter status
|
duniter status
|
||||||
if [ `echo "$?"` == 0 ]; then
|
if [ `echo "$?"` == 0 ]; then
|
||||||
duniter stop
|
duniter stop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove Duniter package
|
# Remove Duniter package
|
||||||
dpkg -r duniter
|
dpkg -r duniter
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue