Add missing quotes

This commit is contained in:
Josué Tille 2024-04-27 00:07:37 +02:00
parent b2c1604b83
commit 0614ab83dc
No known key found for this signature in database
GPG Key ID: 5F259226AD51F2F5
4 changed files with 18 additions and 18 deletions

View File

@ -3,7 +3,7 @@
#=================================================
systemd_match_start_line='Starting new Web server: tcp:127.0.0.1:'
ssh_port=$(yunohost settings get security.ssh.ssh_port)
ssh_port="$(yunohost settings get security.ssh.ssh_port)"
#=================================================
# DEFINE ALL COMMON FONCTIONS
@ -15,10 +15,10 @@ _set_permissions() {
chmod +x "$install_dir/gitea"
chown -R "$app:$app" "$data_dir"
find $data_dir \( \! -perm -o= \
-o \! -user $app \
-o \! -group $app \) \
-exec chown $app:$app {} \; \
find "$data_dir" \( \! -perm -o= \
-o \! -user "$app" \
-o \! -group "$app" \) \
-exec chown "$app:$app" {} \; \
-exec chmod u=rwX,g=rX,o= {} \;
chmod -R u=rwX,g=,o= "$data_dir/.ssh"

View File

@ -9,7 +9,7 @@ source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
if systemctl is-active $app.service --quiet; then
if systemctl is-active "$app".service --quiet; then
ynh_print_warn --message="It's hightly recommended to make your backup when the service is stopped. Please stop $app service with this command before to run the backup 'systemctl stop $app.service'"
fi

View File

@ -17,10 +17,10 @@ source /usr/share/yunohost/helpers
ynh_script_progression --message='Creating base directory...'
if [ -n "$(ls -A $data_dir)" ]; then
if [ -n "$(ls -A "$data_dir")" ]; then
old_data_dir_path="${data_dir}_$(date '+%Y%m%d.%H%M%S')"
ynh_print_warn "Data directory was not empty. Data was moved to $old_data_dir_path"
mkdir -p $old_data_dir_path
mkdir -p "$old_data_dir_path"
mv -t "$old_data_dir_path" "$data_dir"/*
fi
@ -42,10 +42,10 @@ _set_permissions
ynh_script_progression --message="Configuring application, step 1/2..."
internal_token=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret INTERNAL_TOKEN)
secret_key=$(ynh_exec_as "$app" "$install_dir/gitea" generate secret SECRET_KEY)
lfs_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)
internal_token="$(ynh_exec_as "$app" "$install_dir/gitea" generate secret INTERNAL_TOKEN)"
secret_key="$(ynh_exec_as "$app" "$install_dir/gitea" generate secret SECRET_KEY)"
lfs_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=internal_token --value="$internal_token"
ynh_app_setting_set --app="$app" --key=secret_key --value="$secret_key"

View File

@ -9,7 +9,7 @@
source _common.sh
source /usr/share/yunohost/helpers
upgrade_type=$(ynh_check_app_version_changed)
upgrade_type="$(ynh_check_app_version_changed)"
#=================================================
# STANDARD UPGRADE STEPS
@ -69,12 +69,12 @@ chmod -R u=rwX,g=rX,o= "$install_dir"
chmod +x "$install_dir/gitea"
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"
fi
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"
fi
@ -85,12 +85,12 @@ if [[ -n "${lfs_key:-}" ]]; then
fi
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"
fi
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"
fi
@ -98,7 +98,7 @@ fi
# MIGRATION STEP Fix regression linked to 77c3678 and #76
#=================================================
list_param_sql=$(yunohost user list --output-as json | jq -c '.users | keys' | sed 's|\[|\(|' | sed 's|\]|\)|')
list_param_sql="$(yunohost user list --output-as json | jq -c '.users | keys' | sed 's|\[|\(|' | sed 's|\]|\)|')"
ynh_replace_string --match_string=__APP__ --replace_string="$app" --target_file=./fix_user_db_for_local_users.sql
ynh_replace_string --match_string=__USER_LIST__ --replace_string="$list_param_sql" --target_file=./fix_user_db_for_local_users.sql
ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" < ./fix_user_db_for_local_users.sql