1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pixelfed_ynh.git synced 2024-09-03 20:06:04 +02:00

Merge pull request #4 from yalh76/APP_KEY

App key
This commit is contained in:
yalh76 2019-04-12 00:30:59 +02:00 committed by GitHub
commit 0511966540
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -1,6 +1,6 @@
APP_NAME=__APP__ APP_NAME=__APP__
APP_ENV=production APP_ENV=production
APP_KEY= APP_KEY=__APP_KEY__
APP_DEBUG=false APP_DEBUG=false
APP_URL=https://__DOMAIN__ APP_URL=https://__DOMAIN__

View file

@ -23,6 +23,7 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path_url="/" path_url="/"
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
app_key=$(ynh_string_random 32)
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -44,6 +45,7 @@ ynh_webpath_register "$app" "$domain" "$path_url"
ynh_app_setting_set "$app" domain "$domain" ynh_app_setting_set "$app" domain "$domain"
ynh_app_setting_set "$app" path "$path_url" ynh_app_setting_set "$app" path "$path_url"
ynh_app_setting_set "$app" is_public "$is_public" ynh_app_setting_set "$app" is_public "$is_public"
ynh_app_setting_set "$app" app_key "$app_key"
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -129,6 +131,7 @@ config="$final_path/.env"
cp ../conf/.env "$config" cp ../conf/.env "$config"
ynh_replace_string "__APP__" "$app" "$config" ynh_replace_string "__APP__" "$app" "$config"
ynh_replace_string "__APP_KEY__" "$app_key" "$config"
ynh_replace_string "__DOMAIN__" "$domain" "$config" ynh_replace_string "__DOMAIN__" "$domain" "$config"
ynh_replace_string "__PATH__" "$path_url" "$config" ynh_replace_string "__PATH__" "$path_url" "$config"
ynh_replace_string "__DB_NAME__" "$db_name" "$config" ynh_replace_string "__DB_NAME__" "$db_name" "$config"

View file

@ -169,10 +169,8 @@ popd
# STORE THE CHECKSUM OF THE CONFIG FILE # STORE THE CHECKSUM OF THE CONFIG FILE
#================================================= #=================================================
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum "$config"
ynh_backup_if_checksum_is_different "$config" ynh_backup_if_checksum_is_different "$config"
# Recalculate and store the checksum of the file for the next upgrade. # Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum "$config" ynh_store_file_checksum "$config"