mirror of
https://github.com/YunoHost-Apps/beehive_ynh.git
synced 2024-09-03 18:06:24 +02:00
commit
202a69df53
2 changed files with 13 additions and 10 deletions
|
@ -80,6 +80,7 @@ pushd "$tmpdir"
|
|||
popd
|
||||
ynh_secure_remove "$tmpdir"
|
||||
export PATH=$PATH:/usr/local/go/bin
|
||||
export GOPATH=/usr/local/go/bin
|
||||
|
||||
|
||||
#=================================================
|
||||
|
@ -133,6 +134,13 @@ ynh_add_systemd_config --service="$app" --template="systemd.service" --others_va
|
|||
|
||||
chown -R $app: $final_path
|
||||
|
||||
#=================================================
|
||||
# SETUP LOGROTATE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring log rotation..." --weight=1
|
||||
|
||||
ynh_use_logrotate
|
||||
|
||||
#=================================================
|
||||
# INTEGRATE SERVICE IN YUNOHOST
|
||||
#=================================================
|
||||
|
@ -158,7 +166,7 @@ ynh_script_progression --message="Configuring permissions..." --weight=1
|
|||
|
||||
|
||||
# Only the admin can access the admin panel of the app (if the app has an admin panel)
|
||||
ynh_permission_create --permission="admin" --url="/" --allowed=$admin
|
||||
ynh_permission_update --permission "main" --remove all_users --add $admin
|
||||
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -20,6 +20,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
|
@ -79,6 +80,8 @@ then
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=1
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
export PATH=$PATH:/usr/local/go/bin
|
||||
export GOPATH=/usr/local/go/bin
|
||||
pushd "$final_path"
|
||||
git pull
|
||||
make
|
||||
|
@ -121,7 +124,7 @@ ynh_system_user_create --username=$app
|
|||
ynh_script_progression --message="Upgrading systemd configuration..." --weight=1
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config --service="$app" --template="systemd.service" --others_var="port domain path"
|
||||
ynh_add_systemd_config --service="$app" --template="systemd.service" --others_var="port domain"
|
||||
|
||||
|
||||
#=================================================
|
||||
|
@ -155,14 +158,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|||
|
||||
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# UPGRADE FAIL2BAN
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reconfiguring Fail2Ban..." --weight=1
|
||||
|
||||
# Create a dedicated Fail2Ban config
|
||||
ynh_add_fail2ban_config --logpath="/var/log/nginx/${domain}-error.log" --failregex="Regex to match into the log for a failed login"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue