1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monica_ynh.git synced 2024-09-03 19:46:23 +02:00
This commit is contained in:
ericgaspar 2022-05-09 16:56:28 +02:00
parent 15f09c4711
commit 966fe1ef79
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 8 additions and 20 deletions

View file

@ -145,8 +145,8 @@ DAV_ENABLED=true
# This is to make sure that only the mobile application that you approve can
# access the route to let your users sign in with their credentials
# Note: the official mobile application is not currently available on the stores.
MOBILE_CLIENT_ID=__MOBILE_ID__
MOBILE_CLIENT_SECRET=__MOBILE_KEY__
MOBILE_CLIENT_ID=MOBILE_ID
MOBILE_CLIENT_SECRET=MOBILE_KEY
# Allow to access general statistics about your instance through a public API
# call

View file

@ -10,7 +10,7 @@ YNH_PHP_VERSION="7.4"
YNH_COMPOSER_VERSION="2.3.3"
pkg_dependencies="php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-iconv php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-mysqli php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-redis php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip"
pkg_dependencies="php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-dom php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-iconv php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-mysqli php${YNH_PHP_VERSION}-opcache php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-zip"
#=================================================
# PERSONAL HELPERS

View file

@ -130,16 +130,7 @@ chown -R $app:www-data "$final_path"
#=================================================
ynh_script_progression --message="Adding a configuration file..."
config="$final_path/.env"
cp ../conf/.env "$config"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
ynh_replace_string --match_string="__RANDOM_KEY__" --replace_string="$random_key" --target_file="$config"
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$config"
ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$config"
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config"
ynh_replace_string --match_string="__EMAIL__" --replace_string="$email" --target_file="$config"
ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$config"
ynh_add_config --template="../conf/.env" --destination="$final_path/.env"
#=================================================
# DEPLOY
@ -156,19 +147,16 @@ pushd "$final_path"
ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan passport:client --password -n > key.txt
mobile_id=$( cd $final_path && tail -2 key.txt | head -1 | cut -c 12- )
mobile_key=$( cd $final_path && tail -1 key.txt | cut -c 16- )
ynh_replace_string --match_string="__MOBILE_ID__" --replace_string="$mobile_id" --target_file="$config"
ynh_replace_string --match_string="__MOBILE_KEY__" --replace_string="$mobile_key" --target_file="$config"
ynh_replace_string --match_string="MOBILE_ID" --replace_string="$mobile_id" --target_file="$final_path/.env"
ynh_replace_string --match_string="MOBILE_KEY" --replace_string="$mobile_key" --target_file="$final_path/.env"
ynh_app_setting_set --app=$app --key=mobile_id --value=$mobile_id
ynh_app_setting_set --app=$app --key=mobile_key --value=$mobile_key
ynh_secure_remove --file="$final_path/key.txt"
ynh_exec_warn_less ynh_exec_as $app php$phpversion artisan config:cache
popd
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$config"
chmod 400 "$config"
chown $app:$app "$config"
chmod 400 "$final_path/.env"
chown $app:$app "$final_path/.env"
update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION}