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

change the way the __KEY__ is configured

This commit is contained in:
Thomas 2024-03-25 20:38:08 +01:00 committed by GitHub
parent a062224dda
commit fbe9509e86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 9 deletions

View file

@ -26,7 +26,7 @@ SITE_OWNER=__EMAIL__
# Otherwise, change it to a string of exactly 32 chars or use command # Otherwise, change it to a string of exactly 32 chars or use command
# `php artisan key:generate` to generate it. # `php artisan key:generate` to generate it.
APP_KEY= APP_KEY=__KEY__
# This variable must match your installation's external address. # This variable must match your installation's external address.
@ -39,7 +39,7 @@ APP_URL=http://__DOMAIN__
# uncomment the following line and set this var with the CDN url. # uncomment the following line and set this var with the CDN url.
# Otherwise, let this line commented. # Otherwise, let this line commented.
ASSET_URL=/ ASSET_URL=http://__DOMAIN__
# The domain subdirectory from which you want to serve 2FAuth. # The domain subdirectory from which you want to serve 2FAuth.

View file

@ -26,6 +26,10 @@ ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
# key for the .env __KEY__
key=$(ynh_string_random --length=45 | base64)
ynh_app_setting_set --app=$app --key=key --value=$key
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -75,7 +79,6 @@ pushd $install_dir
php$phpversion artisan passport:install -n php$phpversion artisan passport:install -n
php$phpversion artisan storage:link -n php$phpversion artisan storage:link -n
php$phpversion artisan config:cache -n php$phpversion artisan config:cache -n
php$phpversion artisan key:generate -n
popd popd
chmod 775 "$install_dir" chmod 775 "$install_dir"

View file

@ -38,6 +38,11 @@ if [ -z "${fpm_usage:-}" ]; then
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
fi fi
if [ -z "${key:-}" ]; then
key=$(ynh_string_random --length=45 | base64)
ynh_app_setting_set --app=$app --key=key --value=$key
fi
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
@ -65,15 +70,13 @@ ynh_add_nginx_config
#================================================= #=================================================
# ADD A CONFIGURATION # ADD A CONFIGURATION
#================================================= #=================================================
#ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_script_progression --message="Upgrading a configuration file..." --weight=1
#email=$(ynh_user_get_info --username=$admin --key=mail)
# Setup application config # Setup application config
#ynh_add_config --template=".env.example" --destination="$install_dir/.env" ynh_add_config --template=".env.example" --destination="$install_dir/.env"
#chmod 644 "$install_dir/.env" chmod 644 "$install_dir/.env"
#chown $app:$app "$install_dir/.env" chown $app:$app "$install_dir/.env"
#================================================= #=================================================
# INSTALL 2FAUTH WITH COMPOSER # INSTALL 2FAUTH WITH COMPOSER