mirror of
https://github.com/YunoHost-Apps/armadietto_ynh.git
synced 2024-09-03 18:06:18 +02:00
fix details
This commit is contained in:
parent
244356b8e0
commit
7e2b72bcf9
4 changed files with 3 additions and 83 deletions
25
actions.toml
25
actions.toml
|
@ -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
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue