1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/forgejo_ynh.git synced 2024-09-03 18:36:26 +02:00

fix many SC2086 linter warning

This commit is contained in:
OniriCorpe 2024-05-04 01:24:34 +02:00
parent 33b34f15e4
commit 15dd23b336
6 changed files with 61 additions and 61 deletions

View file

@ -7,26 +7,26 @@
function set_forgejo_login_source() { function set_forgejo_login_source() {
ynh_print_info --message="Creating forgejo login source" ynh_print_info --message="Creating forgejo login source"
pushd "$install_dir" pushd "$install_dir"
ynh_exec_as $app ./forgejo admin auth add-ldap-simple --security-protocol "Unencrypted" --name "YunoHost LDAP" --host "localhost" --port "389" --skip-tls-verify --user-search-base "ou=users,dc=yunohost,dc=org" --user-dn "uid=%s,ou=Users,dc=yunohost,dc=org" --user-filter "(&(objectclass=posixAccount)(uid=%s)(permission=cn=$app.main,ou=permission,dc=yunohost,dc=org))" --admin-filter "(permission=cn=forgejo.admin,ou=permission,dc=yunohost,dc=org)" --username-attribute "uid" --firstname-attribute "givenName" --surname-attribute "sn" --email-attribute "mail" ynh_exec_as "$app" ./forgejo admin auth add-ldap-simple --security-protocol "Unencrypted" --name "YunoHost LDAP" --host "localhost" --port "389" --skip-tls-verify --user-search-base "ou=users,dc=yunohost,dc=org" --user-dn "uid=%s,ou=Users,dc=yunohost,dc=org" --user-filter "(&(objectclass=posixAccount)(uid=%s)(permission=cn=$app.main,ou=permission,dc=yunohost,dc=org))" --admin-filter "(permission=cn=forgejo.admin,ou=permission,dc=yunohost,dc=org)" --username-attribute "uid" --firstname-attribute "givenName" --surname-attribute "sn" --email-attribute "mail"
popd popd
} }
function enable_login_source_sync() { function enable_login_source_sync() {
ynh_print_info --message="Set forgejo login source as synchronizable" ynh_print_info --message="Set forgejo login source as synchronizable"
# Enable login source synchronisation manualy because forgejo command does not allow it (https://codeberg.org/forgejo/forgejo/issues/952) # Enable login source synchronisation manualy because forgejo command does not allow it (https://codeberg.org/forgejo/forgejo/issues/952)
ynh_psql_execute_as_root --database $db_name --sql "update login_source set is_sync_enabled = true where type = 5 and name = 'YunoHost LDAP'" ynh_psql_execute_as_root --database "$db_name" --sql "update login_source set is_sync_enabled = true where type = 5 and name = 'YunoHost LDAP'"
} }
function create_forgejo_api_user() { function create_forgejo_api_user() {
ynh_print_info --message="Creating forgejo api user" ynh_print_info --message="Creating forgejo api user"
forgejo_api_user=yunohost_api forgejo_api_user=yunohost_api
forgejo_api_pwd=$(ynh_string_random --length=24) forgejo_api_pwd=$(ynh_string_random --length=24)
ynh_app_setting_set --app=$app --key=forgejo_api_user --value=$forgejo_api_user ynh_app_setting_set --app="$app" --key=forgejo_api_user --value="$forgejo_api_user"
ynh_app_setting_set --app=$app --key=forgejo_api_pwd --value=$forgejo_api_pwd ynh_app_setting_set --app="$app" --key=forgejo_api_pwd --value="$forgejo_api_pwd"
pushd "$install_dir" pushd "$install_dir"
ynh_exec_as $app ./forgejo admin user create --username $forgejo_api_user --password $forgejo_api_pwd --email admin@${domain} --admin --must-change-password=false ynh_exec_as "$app" ./forgejo admin user create --username "$forgejo_api_user" --password "$forgejo_api_pwd" --email "admin@${domain}" --admin --must-change-password=false
forgejo_api_token=$(ynh_exec_as $app ./forgejo admin user generate-access-token --username $forgejo_api_user --token-name "admin" --scopes "write:admin" --raw | tail -1) forgejo_api_token=$(ynh_exec_as "$app" ./forgejo admin user generate-access-token --username "$forgejo_api_user" --token-name "admin" --scopes "write:admin" --raw | tail -1)
ynh_app_setting_set --app=$app --key=forgejo_api_token --value=$forgejo_api_token ynh_app_setting_set --app="$app" --key=forgejo_api_token --value="$forgejo_api_token"
popd popd
} }
@ -35,18 +35,18 @@ function set_users_login_source() {
for username in $(ynh_user_list); do for username in $(ynh_user_list); do
ynh_print_info --message="Updating forgejo user login type for ${username}" ynh_print_info --message="Updating forgejo user login type for ${username}"
ynh_psql_execute_as_root --database $db_name --sql "update public.user set login_source = (select id from login_source where name = 'YunoHost LDAP' and type = 5), login_name = name, login_type = 5 where name = '${username}'" ynh_psql_execute_as_root --database "$db_name" --sql "update public.user set login_source = (select id from login_source where name = 'YunoHost LDAP' and type = 5), login_name = name, login_type = 5 where name = '${username}'"
done done
} }
function synchronize_users() { function synchronize_users() {
ynh_print_info --message="Synchronizing forgejo users" ynh_print_info --message="Synchronizing forgejo users"
# Fetch the token independently such that it's redacted by Yunohost logging mechanism # Fetch the token independently such that it's redacted by Yunohost logging mechanism
forgejo_api_token=$(ynh_app_setting_get --app=$app --key=forgejo_api_token) forgejo_api_token=$(ynh_app_setting_get --app="$app" --key=forgejo_api_token)
# Remove trailing slash from path # Remove trailing slash from path
local no_trailing_slash_path=${path%/} local no_trailing_slash_path=${path%/}
# User synchronization must be launched using API : no cli exists for this purpose (https://codeberg.org/forgejo/forgejo/issues/953) # User synchronization must be launched using API : no cli exists for this purpose (https://codeberg.org/forgejo/forgejo/issues/953)
curl --url https://${domain}${no_trailing_slash_path}/api/v1/admin/cron/sync_external_users -X POST -H "Authorization: token $forgejo_api_token" -kfsS curl --url "https://${domain}${no_trailing_slash_path}/api/v1/admin/cron/sync_external_users" -X POST -H "Authorization: token $forgejo_api_token" -kfsS
} }

View file

@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=2 ynh_script_progression --message="Stopping a systemd service..." --weight=2
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/forgejo.log" ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/forgejo.log"
#================================================= #=================================================
# MODIFY URL IN NGINX CONF # MODIFY URL IN NGINX CONF
@ -34,7 +34,7 @@ ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
ynh_exec_warn_less ynh_add_config --template="../conf/app.ini" --destination="$install_dir/custom/conf/app.ini" ynh_exec_warn_less ynh_add_config --template="../conf/app.ini" --destination="$install_dir/custom/conf/app.ini"
chmod 640 "$install_dir/custom/conf/app.ini" chmod 640 "$install_dir/custom/conf/app.ini"
chown $app:$app "$install_dir/custom/conf/app.ini" chown "$app:$app" "$install_dir/custom/conf/app.ini"
#================================================= #=================================================
# GENERIC FINALISATION # GENERIC FINALISATION
@ -43,7 +43,7 @@ chown $app:$app "$install_dir/custom/conf/app.ini"
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=2 ynh_script_progression --message="Starting a systemd service..." --weight=2
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/forgejo.log" --line_match="Starting new Web server: tcp:127.0.0.1:" ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/forgejo.log" --line_match="Starting new Web server: tcp:127.0.0.1:"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -20,20 +20,20 @@ chmod +x "$install_dir/forgejo"
mkdir -p "$install_dir/custom/conf" mkdir -p "$install_dir/custom/conf"
chmod -R o-rwx "$install_dir/custom" chmod -R o-rwx "$install_dir/custom"
chown -R $app:$app "$install_dir/custom" chown -R "$app:$app" "$install_dir/custom"
#================================================= #=================================================
# KEYS GENERATION # KEYS GENERATION
#================================================= #=================================================
secret_key=$($install_dir/forgejo generate secret SECRET_KEY) secret_key=$("$install_dir/forgejo" generate secret SECRET_KEY)
lfs_jwt_secret=$($install_dir/forgejo generate secret JWT_SECRET) lfs_jwt_secret=$("$install_dir/forgejo" generate secret JWT_SECRET)
internal_token=$($install_dir/forgejo generate secret INTERNAL_TOKEN) internal_token=$("$install_dir/forgejo" generate secret INTERNAL_TOKEN)
oauth2_jwt_secret=$($install_dir/forgejo generate secret JWT_SECRET) oauth2_jwt_secret=$("$install_dir/forgejo" generate secret JWT_SECRET)
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=internal_token --value=$internal_token ynh_app_setting_set --app="$app" --key=internal_token --value="$internal_token"
ynh_app_setting_set --app=$app --key=oauth2_jwt_secret --value=$oauth2_jwt_secret ynh_app_setting_set --app="$app" --key=oauth2_jwt_secret --value="$oauth2_jwt_secret"
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
@ -44,7 +44,7 @@ ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
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"
chmod 640 "$install_dir/custom/conf/app.ini" chmod 640 "$install_dir/custom/conf/app.ini"
chown $app:$app "$install_dir/custom/conf/app.ini" chown "$app:$app" "$install_dir/custom/conf/app.ini"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
@ -70,7 +70,7 @@ ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate --logfile "/var/log/$app" --nonappend ynh_use_logrotate --logfile "/var/log/$app" --nonappend
chown -R $app:$app "/var/log/$app" chown -R "$app:$app" "/var/log/$app"
chmod u=rwX,g=rX,o= "/var/log/$app" chmod u=rwX,g=rX,o= "/var/log/$app"
#================================================= #=================================================
@ -78,7 +78,7 @@ chmod u=rwX,g=rX,o= "/var/log/$app"
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description="Forgejo" --log="/var/log/$app/forgejo.log" yunohost service add "$app" --description="Forgejo" --log="/var/log/$app/forgejo.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -86,7 +86,7 @@ yunohost service add $app --description="Forgejo" --log="/var/log/$app/forgejo.l
ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_script_progression --message="Starting a systemd service..." --weight=3
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/forgejo.log" --line_match="Starting new Web server: tcp:127.0.0.1:" ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/forgejo.log" --line_match="Starting new Web server: tcp:127.0.0.1:"
#================================================= #=================================================
# SETUP FAIL2BAN # SETUP FAIL2BAN

View file

@ -16,10 +16,10 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) # Remove the service from the list of services known by YunoHost (added from `yunohost service add`)
if ynh_exec_warn_less yunohost service status $app >/dev/null if ynh_exec_warn_less yunohost service status "$app" >/dev/null
then then
ynh_script_progression --message="Removing $app service integration..." --weight=1 ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove $app yunohost service remove "$app"
fi fi
# Remove the dedicated systemd config # Remove the dedicated systemd config

View file

@ -26,20 +26,20 @@ ynh_script_progression --message="Restoring $app main directory..." --weight=10
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir" chown -R "$app:$app" "$install_dir"
#================================================= #=================================================
# RESTORE THE DATA DIRECTORY # RESTORE THE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Restoring the data directory..." --weight=1 ynh_script_progression --message="Restoring the data directory..." --weight=1
ynh_restore_file --origin_path="$data_dir" --not_mandatory ynh_restore_file --origin_path="$data_dir" --not_mandatory
chown -R $app:$app "$data_dir" chown -R "$app:$app" "$data_dir"
#================================================= #=================================================
# RESTORE THE LOG DIRECTORY # RESTORE THE LOG DIRECTORY
#================================================= #=================================================
ynh_restore_file --origin_path="/var/log/$app" ynh_restore_file --origin_path="/var/log/$app"
chown -R $app:$app "/var/log/$app" chown -R "$app:$app" "/var/log/$app"
chmod u=rwX,g=rX,o= "/var/log/$app" chmod u=rwX,g=rX,o= "/var/log/$app"
#================================================= #=================================================
@ -56,7 +56,7 @@ ynh_systemd_action --action=restart --service_name=fail2ban
#================================================= #=================================================
ynh_script_progression --message="Restoring the database..." --weight=6 ynh_script_progression --message="Restoring the database..." --weight=6
ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name"
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
@ -64,7 +64,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
ynh_script_progression --message="Restoring the systemd configuration..." --weight=5 ynh_script_progression --message="Restoring the systemd configuration..." --weight=5
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable "$app.service" --quiet
#================================================= #=================================================
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION
@ -78,14 +78,14 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
yunohost service add $app --description="Forgejo" --log="/var/log/$app/forgejo.log" yunohost service add "$app" --description="Forgejo" --log="/var/log/$app/forgejo.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/forgejo.log" --line_match="Starting new Web server: tcp:127.0.0.1:" ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/forgejo.log" --line_match="Starting new Web server: tcp:127.0.0.1:"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION

View file

@ -21,7 +21,7 @@ upgrade_type=$(ynh_check_app_version_changed)
# STOP SYSTEMD SERVICE # STOP SYSTEMD SERVICE
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=2 ynh_script_progression --message="Stopping a systemd service..." --weight=2
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd"
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
@ -30,18 +30,18 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# Update forgejo login source (1.19.3-0~ynh2) # Update forgejo login source (1.19.3-0~ynh2)
pushd "$install_dir" pushd "$install_dir"
old_login_source_id=$(ynh_exec_as $app ./forgejo admin auth list | grep "YunoHost LDAP" | grep "via BindDN" | cut -f 1) old_login_source_id=$(ynh_exec_as "$app" ./forgejo admin auth list | grep "YunoHost LDAP" | grep "via BindDN" | cut -f 1)
if [ ! -z $old_login_source_id ]; then if [ -n "$old_login_source_id" ]; then
ynh_print_info --message="Delete obsolete forgejo login source (LDAP via BindDN)" ynh_print_info --message="Delete obsolete forgejo login source (LDAP via BindDN)"
# Ensure no user have this obsolete login source # Ensure no user have this obsolete login source
ynh_psql_execute_as_root --database $db_name --sql "update public.user set login_source = 0, login_type = 0 where login_source = ${old_login_source_id}" ynh_psql_execute_as_root --database "$db_name" --sql "update public.user set login_source = 0, login_type = 0 where login_source = ${old_login_source_id}"
# Delete old login source # Delete old login source
ynh_exec_as $app ./forgejo admin auth delete --id $old_login_source_id ynh_exec_as "$app" ./forgejo admin auth delete --id "$old_login_source_id"
fi fi
ynh_exec_as $app ./forgejo admin auth list | grep "YunoHost LDAP" | grep -q "LDAP (simple auth)" || ynh_exec_as "$app" ./forgejo admin auth list | grep "YunoHost LDAP" | grep -q "LDAP (simple auth)" ||
# create new login source if not existing # create new login source if not existing
set_forgejo_login_source set_forgejo_login_source
popd popd
@ -53,31 +53,31 @@ enable_login_source_sync
# .ssh directory should move from old home dir (data_dir) to new one # .ssh directory should move from old home dir (data_dir) to new one
# (/var/www/$app is the default value for home in resources.system_user) # (/var/www/$app is the default value for home in resources.system_user)
if [ -d "$data_dir/.ssh" ]; then if [ -d "$data_dir/.ssh" ]; then
mv "$data_dir/.ssh" /var/www/$app mv "$data_dir/.ssh" "/var/www/$app"
fi fi
# If secret_key doesn't exist, create it # If secret_key doesn't exist, create it
if [ -z ${secret_key:-} ]; then if [ -z "${secret_key:-}" ]; then
secret_key=$($install_dir/forgejo generate secret SECRET_KEY) secret_key=$("$install_dir/forgejo" 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 lfs_jwt_secret doesn't exist, create it # If lfs_jwt_secret doesn't exist, create it
if [ -z ${lfs_jwt_secret:-} ]; then if [ -z "${lfs_jwt_secret:-}" ]; then
lfs_jwt_secret=$($install_dir/forgejo generate secret JWT_SECRET) lfs_jwt_secret=$("$install_dir/forgejo" 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 internal_token doesn't exist, create it # If internal_token doesn't exist, create it
if [ -z ${internal_token:-} ]; then if [ -z "${internal_token:-}" ]; then
internal_token=$($install_dir/forgejo generate secret INTERNAL_TOKEN) internal_token=$("$install_dir/forgejo" 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 oauth2_jwt_secret doesn't exist, create it # If oauth2_jwt_secret doesn't exist, create it
if [ -z ${oauth2_jwt_secret:-} ]; then if [ -z "${oauth2_jwt_secret:-}" ]; then
oauth2_jwt_secret=$($install_dir/forgejo generate secret JWT_SECRET) oauth2_jwt_secret=$("$install_dir/forgejo" generate secret JWT_SECRET)
ynh_app_setting_set --app=$app --key=oauth2_jwt_secret --value=$oauth2_jwt_secret ynh_app_setting_set --app="$app" --key=oauth2_jwt_secret --value="$oauth2_jwt_secret"
fi fi
#================================================= #=================================================
@ -85,11 +85,11 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Setting up source files..." --weight=3 ynh_script_progression --message="Setting up source files..." --weight=3
ynh_setup_source --dest_dir=$install_dir --full_replace=1 --keep="custom .ssh" ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="custom .ssh"
xz -f -d "$install_dir/forgejo.xz" xz -f -d "$install_dir/forgejo.xz"
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:$app "$install_dir" chown -R "$app:$app" "$install_dir"
chmod +x "$install_dir/forgejo" chmod +x "$install_dir/forgejo"
#================================================= #=================================================
@ -101,7 +101,7 @@ ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+")
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"
chmod 640 "$install_dir/custom/conf/app.ini" chmod 640 "$install_dir/custom/conf/app.ini"
chown $app:$app "$install_dir/custom/conf/app.ini" chown "$app:$app" "$install_dir/custom/conf/app.ini"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD
@ -127,7 +127,7 @@ ynh_script_progression --message="Configuring log rotation..." --weight=1
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate --logfile "/var/log/$app" --nonappend ynh_use_logrotate --logfile "/var/log/$app" --nonappend
chown -R $app:$app "/var/log/$app" chown -R "$app:$app" "/var/log/$app"
chmod u=rwX,g=rX,o= "/var/log/$app" chmod u=rwX,g=rX,o= "/var/log/$app"
#================================================= #=================================================
@ -135,7 +135,7 @@ chmod u=rwX,g=rX,o= "/var/log/$app"
#================================================= #=================================================
ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 ynh_script_progression --message="Integrating service in YunoHost..." --weight=2
yunohost service add $app --description="Forgejo" --log="/var/log/$app/forgejo.log" yunohost service add "$app" --description="Forgejo" --log="/var/log/$app/forgejo.log"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
@ -143,13 +143,13 @@ yunohost service add $app --description="Forgejo" --log="/var/log/$app/forgejo.l
ynh_script_progression --message="Starting a systemd service..." --weight=3 ynh_script_progression --message="Starting a systemd service..." --weight=3
# Start a systemd service # Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/forgejo.log" --line_match="Starting new Web server: tcp:127.0.0.1:" ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/forgejo.log" --line_match="Starting new Web server: tcp:127.0.0.1:"
#================================================= #=================================================
# Synchronize users (backward compatibility 1.19.3-0~ynh3) # Synchronize users (backward compatibility 1.19.3-0~ynh3)
#================================================= #=================================================
if [ -z ${forgejo_api_user:-} ]; then if [ -z "${forgejo_api_user:-}" ]; then
create_forgejo_api_user create_forgejo_api_user
fi fi