From 7e2b72bcf9ca31ee61e9453e991dfcbb457fc379 Mon Sep 17 00:00:00 2001 From: bencharp Date: Tue, 18 Jan 2022 01:56:42 +0100 Subject: [PATCH] fix details --- actions.toml | 25 ------------------------- scripts/change_url | 5 ----- scripts/install | 12 +----------- scripts/upgrade | 44 ++------------------------------------------ 4 files changed, 3 insertions(+), 83 deletions(-) delete mode 100644 actions.toml diff --git a/actions.toml b/actions.toml deleted file mode 100644 index 1a1d7f4..0000000 --- a/actions.toml +++ /dev/null @@ -1,25 +0,0 @@ -[is_signup] -name = "Signup activation" -description = "Allow visitors to register and create an account?" -command = "/bin/bash scripts/actions/is_signup" -accepted_return_codes = [0] - - # [is_signup.arguments] - # [is_signup.arguments.is_signup] - # type = "boolean" - # ask.en = "Allow signup?" - # # default = false - - -[public_private] -name = "Private / Public" -description = "TODO" -command = "/bin/bash scripts/actions/public_private" -accepted_return_codes = [0] - - - [public_private.arguments] - [public_private.arguments.is_public] - type = "boolean" - ask.en = "Is it a public app?" - default = true diff --git a/scripts/change_url b/scripts/change_url index 5b25c6c..6645cc7 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -29,11 +29,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=2 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -# Add settings here as needed by your application -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name -#db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) - #================================================= # BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= diff --git a/scripts/install b/scripts/install index 44c30c5..2cad7d1 100755 --- a/scripts/install +++ b/scripts/install @@ -27,7 +27,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC -is_signup="0" +is_signup=$YNH_APP_ARG_IS_SIGNUP app=$YNH_APP_INSTANCE_NAME @@ -101,16 +101,6 @@ ynh_script_progression --message="Configuring system user..." --weight=2 # Create a system user ynh_system_user_create --username=$app -#================================================= -# ADD A CONFIGURATION -#================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 - -# ynh_add_config --template="../conf/config.yml" --destination="$final_path/config.yml" - -# chmod 400 "$final_path/config.yml" -# chown $app:$app "$final_path/config.yml" - #================================================= # SETUP SYSTEMD #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 99c18e9..0e09d5d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,7 +57,6 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - # If is_signup doesn't exist, create it if [ -z "$is_signup" ]; then is_signup="true" @@ -113,16 +112,6 @@ ynh_use_nodejs #================================================= # SPECIFIC UPGRADE -#================================================= -# ADD A CONFIGURATION -#================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=2 - -# ynh_add_config --template="../conf/config.yml" --destination="$final_path/config.yml" - -# chmod 400 "$final_path/config.yml" -# chown $app:$app "$final_path/config.yml" - #================================================= # CREATE DATA DIRECTORY #================================================= @@ -161,36 +150,6 @@ then popd fi -#================================================= -# UPDATE A CONFIG FILE -#================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=2 - -# ynh_add_config --template="../conf/config.yml" --destination="$final_path/config.yml" - -# chmod 400 "$final_path/config.yml" -# chown $app:$app "$final_path/config.yml" - -### Same as during install -### -### The file will automatically be backed-up if it's found to be manually modified (because -### ynh_add_config keeps track of the file's checksum) - -# ynh_add_config --template="some_config_file" --destination="$final_path/some_config_file" - -# FIXME: this should be handled by the core in the future -# You may need to use chmod 600 instead of 400, -# for example if the app is expected to be able to modify its own config -# chmod 400 "$final_path/some_config_file" -# chown $app:$app "$final_path/some_config_file" - -### For more complex cases where you want to replace stuff using regexes, -### you shoud rely on ynh_replace_string (which is basically a wrapper for sed) -### When doing so, you also need to manually call ynh_store_file_checksum -### -### ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/some_config_file" -### ynh_store_file_checksum --file="$final_path/some_config_file" - #================================================= # SETUP SYSTEMD #================================================= @@ -216,7 +175,8 @@ ynh_script_progression --message="Secure files and directories" --weight=1 # Set permissions to app files chown -R $app:$app "$final_path" -chmod 0700 $datadir && chown $app:$app $datadir +chmod 0700 "$datadir" +chown $app:$app "$datadir" #================================================= # INTEGRATE SERVICE IN YUNOHOST