mirror of
https://framagit.org/YunoHost-Apps/gitea_ynh.git
synced 2024-11-21 10:31:36 +01:00
Use = intead of space for helper args to avoid issue with parameter
This commit is contained in:
parent
a689129d2a
commit
414f6b7ad6
@ -19,23 +19,23 @@ fi
|
|||||||
ynh_print_info --message='Declaring files to be backed up...'
|
ynh_print_info --message='Declaring files to be backed up...'
|
||||||
|
|
||||||
# Copy the app source files
|
# Copy the app source files
|
||||||
ynh_backup --src_path "$install_dir"
|
ynh_backup --src_path="$install_dir"
|
||||||
|
|
||||||
# Copy the data files
|
# Copy the data files
|
||||||
ynh_backup --src_path "$data_dir" --is_big=1
|
ynh_backup --src_path="$data_dir" --is_big=1
|
||||||
|
|
||||||
# Copy the conf files
|
# Copy the conf files
|
||||||
ynh_backup --src_path "/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf"
|
||||||
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf"
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/logrotate.d/$app"
|
ynh_backup --src_path="/etc/logrotate.d/$app"
|
||||||
|
|
||||||
ynh_backup --src_path "/etc/systemd/system/$app.service"
|
ynh_backup --src_path="/etc/systemd/system/$app.service"
|
||||||
|
|
||||||
# Backup logs
|
# Backup logs
|
||||||
ynh_backup --src_path "/var/log/$app"
|
ynh_backup --src_path="/var/log/$app"
|
||||||
|
|
||||||
# Dump the database
|
# Dump the database
|
||||||
ynh_print_info --message="Backing up the MySQL database"
|
ynh_print_info --message="Backing up the MySQL database"
|
||||||
|
@ -50,7 +50,7 @@ jwt_secret=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)
|
|||||||
ynh_app_setting_set --app="$app" --key=internal_token --value="$internal_token"
|
ynh_app_setting_set --app="$app" --key=internal_token --value="$internal_token"
|
||||||
ynh_app_setting_set --app="$app" --key=secret_key --value="$secret_key"
|
ynh_app_setting_set --app="$app" --key=secret_key --value="$secret_key"
|
||||||
ynh_app_setting_set --app="$app" --key=lfs_jwt_secret --value="$lfs_jwt_secret"
|
ynh_app_setting_set --app="$app" --key=lfs_jwt_secret --value="$lfs_jwt_secret"
|
||||||
ynh_app_setting_set --app "$app" --key jwt_secret --value="$jwt_secret"
|
ynh_app_setting_set --app="$app" --key=jwt_secret --value="$jwt_secret"
|
||||||
|
|
||||||
ynh_add_config --template='app.ini' --destination="$install_dir/custom/conf/app.ini"
|
ynh_add_config --template='app.ini' --destination="$install_dir/custom/conf/app.ini"
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ ynh_add_systemd_config
|
|||||||
yunohost service add "$app" --log="/var/log/$app/gitea.log"
|
yunohost service add "$app" --log="/var/log/$app/gitea.log"
|
||||||
|
|
||||||
# Configure logrotate
|
# Configure logrotate
|
||||||
ynh_use_logrotate --logfile "/var/log/$app"
|
ynh_use_logrotate --logfile="/var/log/$app"
|
||||||
|
|
||||||
# Create a dedicated Fail2Ban config
|
# Create a dedicated Fail2Ban config
|
||||||
ynh_add_fail2ban_config --logpath="/var/log/$app/gitea.log" --failregex='.*Failed authentication attempt for .* from <HOST>' --max_retry=5
|
ynh_add_fail2ban_config --logpath="/var/log/$app/gitea.log" --failregex='.*Failed authentication attempt for .* from <HOST>' --max_retry=5
|
||||||
|
@ -34,7 +34,7 @@ yunohost service add "$app" --log="/var/log/$app/gitea.log"
|
|||||||
|
|
||||||
# SETUP FAIL2BAN
|
# SETUP FAIL2BAN
|
||||||
ynh_script_progression --message="Configuring fail2ban..."
|
ynh_script_progression --message="Configuring fail2ban..."
|
||||||
ynh_add_fail2ban_config --logpath "/var/log/$app/gitea.log" --failregex ".*Failed authentication attempt for .* from <HOST>" --max_retry 5
|
ynh_add_fail2ban_config --logpath="/var/log/$app/gitea.log" --failregex=".*Failed authentication attempt for .* from <HOST>" --max_retry=5
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
@ -18,11 +18,11 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message='Ensuring downward compatibility...' --weight=1
|
ynh_script_progression --message='Ensuring downward compatibility...' --weight=1
|
||||||
|
|
||||||
if ynh_compare_current_package_version --comparison lt --version "1.6.4~ynh1"; then
|
if ynh_compare_current_package_version --comparison=lt --version="1.6.4~ynh1"; then
|
||||||
message="Upgrade from $YNH_APP_CURRENT_VERSION was dropped. You need to run this, then upgrade to the latest version:
|
message="Upgrade from $YNH_APP_CURRENT_VERSION was dropped. You need to run this, then upgrade to the latest version:
|
||||||
sudo yunohost app upgrade $app -u https://github.com/YunoHost-Apps/gitea_ynh/commit/a9ceb157032ae2290e944c1d0a255451ff2d133d"
|
sudo yunohost app upgrade $app -u https://github.com/YunoHost-Apps/gitea_ynh/commit/a9ceb157032ae2290e944c1d0a255451ff2d133d"
|
||||||
ynh_print_info "$message"
|
ynh_print_info "$message"
|
||||||
ynh_die --message="$message" --ret_code 1
|
ynh_die --message="$message" --ret_code=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
@ -71,28 +71,28 @@ chmod +x "$install_dir/gitea"
|
|||||||
|
|
||||||
if [[ -z "${internal_token:-}" ]]; then
|
if [[ -z "${internal_token:-}" ]]; then
|
||||||
internal_token=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret INTERNAL_TOKEN)
|
internal_token=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret INTERNAL_TOKEN)
|
||||||
ynh_app_setting_set --app "$app" --key internal_token --value="$internal_token"
|
ynh_app_setting_set --app="$app" --key=internal_token --value="$internal_token"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${secret_key:-}" ]]; then
|
if [[ -z "${secret_key:-}" ]]; then
|
||||||
secret_key=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret SECRET_KEY)
|
secret_key=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret SECRET_KEY)
|
||||||
ynh_app_setting_set --app "$app" --key secret_key --value="$secret_key"
|
ynh_app_setting_set --app="$app" --key=secret_key --value="$secret_key"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${lfs_key:-}" ]]; then
|
if [[ -n "${lfs_key:-}" ]]; then
|
||||||
lfs_jwt_secret="$lfs_key"
|
lfs_jwt_secret="$lfs_key"
|
||||||
ynh_app_setting_delete --app "$app" --key lfs_key
|
ynh_app_setting_delete --app="$app" --key=lfs_key
|
||||||
ynh_app_setting_set --app "$app" --key lfs_jwt_secret --value="$lfs_jwt_secret"
|
ynh_app_setting_set --app="$app" --key=lfs_jwt_secret --value="$lfs_jwt_secret"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${lfs_jwt_secret:-}" ]]; then
|
if [[ -z "${lfs_jwt_secret:-}" ]]; then
|
||||||
lfs_jwt_secret=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)
|
lfs_jwt_secret=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)
|
||||||
ynh_app_setting_set --app "$app" --key lfs_jwt_secret --value="$lfs_jwt_secret"
|
ynh_app_setting_set --app="$app" --key=lfs_jwt_secret --value="$lfs_jwt_secret"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${jwt_secret:-}" ]]; then
|
if [[ -z "${jwt_secret:-}" ]]; then
|
||||||
jwt_secret=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)
|
jwt_secret=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)
|
||||||
ynh_app_setting_set --app "$app" --key jwt_secret --value="$jwt_secret"
|
ynh_app_setting_set --app="$app" --key=jwt_secret --value="$jwt_secret"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
@ -141,7 +141,7 @@ yunohost service add "$app" --log="/var/log/$app/gitea.log"
|
|||||||
|
|
||||||
ynh_use_logrotate --non-append
|
ynh_use_logrotate --non-append
|
||||||
|
|
||||||
ynh_add_fail2ban_config --logpath="/var/log/$app/gitea.log" --failregex=".*Failed authentication attempt for .* from <HOST>" --max_retry 5
|
ynh_add_fail2ban_config --logpath="/var/log/$app/gitea.log" --failregex=".*Failed authentication attempt for .* from <HOST>" --max_retry=5
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
|
Loading…
Reference in New Issue
Block a user