mirror of
https://github.com/YunoHost-Apps/snipeit_ynh.git
synced 2024-09-03 20:26:16 +02:00
Small fixes
This commit is contained in:
parent
e33511749a
commit
b2c5b653b6
6 changed files with 22 additions and 14 deletions
|
@ -4,7 +4,7 @@
|
||||||
APP_ENV=production
|
APP_ENV=production
|
||||||
APP_DEBUG=false
|
APP_DEBUG=false
|
||||||
APP_KEY=ChangeMe
|
APP_KEY=ChangeMe
|
||||||
APP_URL=
|
APP_URL=http://__DOMAIN__
|
||||||
APP_TIMEZONE='UTC'
|
APP_TIMEZONE='UTC'
|
||||||
APP_LOCALE=__LANGUAGE__
|
APP_LOCALE=__LANGUAGE__
|
||||||
|
|
||||||
|
@ -39,9 +39,9 @@ MAIL_PORT=25
|
||||||
MAIL_USERNAME=
|
MAIL_USERNAME=
|
||||||
MAIL_PASSWORD=
|
MAIL_PASSWORD=
|
||||||
MAIL_ENCRYPTION=null
|
MAIL_ENCRYPTION=null
|
||||||
MAIL_FROM_ADDR=snipeit@yunodomain
|
MAIL_FROM_ADDR=snipeit@__DOMAIN__
|
||||||
MAIL_FROM_NAME='Snip-IT'
|
MAIL_FROM_NAME='Snip-IT'
|
||||||
MAIL_REPLYTO_ADDR=snipeit@yunodomain
|
MAIL_REPLYTO_ADDR=snipeit@__DOMAIN__
|
||||||
MAIL_REPLYTO_NAME='Snipe-IT'
|
MAIL_REPLYTO_NAME='Snipe-IT'
|
||||||
|
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"email": "anmol@datamol.org"
|
"email": "anmol@datamol.org"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 3.8"
|
"yunohost": ">= 3.8.1"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
|
|
@ -25,6 +25,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||||
|
@ -47,7 +48,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
# BACKUP THE PHP-FPM CONFIGURATION
|
# BACKUP THE PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/php/${YNH_PHP_VERSION}/fpm/pool.d/$app.conf"
|
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE MYSQL DATABASE
|
# BACKUP THE MYSQL DATABASE
|
||||||
|
|
|
@ -97,6 +97,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=1
|
||||||
|
|
||||||
# Create a dedicated PHP-FPM config
|
# Create a dedicated PHP-FPM config
|
||||||
ynh_add_fpm_config --usage=low --footprint=low --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"
|
ynh_add_fpm_config --usage=low --footprint=low --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies"
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC SETUP
|
# SPECIFIC SETUP
|
||||||
|
@ -121,14 +122,16 @@ cp ../conf/.env $final_path/.env
|
||||||
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.env"
|
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/.env"
|
||||||
ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$final_path/.env"
|
ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$final_path/.env"
|
||||||
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$final_path/.env"
|
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_name" --target_file="$final_path/.env"
|
||||||
ynh_replace_string --match_string="yunodomain" --replace_string="$domain" --target_file="$final_path/.env"
|
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/.env"
|
||||||
ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/.env"
|
ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/.env"
|
||||||
|
|
||||||
# setup application config
|
# setup application config
|
||||||
( cd $final_path && php$YNH_PHP_VERSION artisan key:generate -n --force --env)
|
pushd "$final_path"
|
||||||
( cd $final_path && php$YNH_PHP_VERSION artisan migrate -n --force)
|
php$phpversion artisan key:generate -n --force --env
|
||||||
( cd $final_path && php$YNH_PHP_VERSION artisan config:clear -n)
|
php$phpversion artisan migrate -n --force
|
||||||
( cd $final_path && php$YNH_PHP_VERSION artisan config:cache -n)
|
php$phpversion artisan config:clear -n
|
||||||
|
php$phpversion artisan config:cache -n
|
||||||
|
popd
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STORE THE CONFIG FILE CHECKSUM
|
# STORE THE CONFIG FILE CHECKSUM
|
||||||
|
|
|
@ -26,6 +26,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
@ -103,7 +104,7 @@ ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1
|
ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name=php${YNH_PHP_VERSION}-fpm --action=reload
|
ynh_systemd_action --service_name=php$phpversion-fpm --action=reload
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -23,6 +23,7 @@ is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
||||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||||
language=$(ynh_app_setting_get --app=$app --key=language)
|
language=$(ynh_app_setting_get --app=$app --key=language)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
|
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK VERSION
|
# CHECK VERSION
|
||||||
|
@ -127,9 +128,11 @@ ynh_install_composer
|
||||||
|
|
||||||
ynh_exec_warn_less ynh_composer_exec --commands=\"dump-autoload\"
|
ynh_exec_warn_less ynh_composer_exec --commands=\"dump-autoload\"
|
||||||
|
|
||||||
( cd $final_path && php$YNH_PHP_VERSION artisan migrate -n --force)
|
pushd "$final_path"
|
||||||
( cd $final_path && php$YNH_PHP_VERSION artisan config:clear -n )
|
php$phpversion artisan migrate -n --force
|
||||||
( cd $final_path && php$YNH_PHP_VERSION artisan config:cache -n )
|
php$phpversion artisan config:clear -n
|
||||||
|
php$phpversion artisan config:cache -n
|
||||||
|
popd
|
||||||
|
|
||||||
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
||||||
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it.
|
||||||
|
|
Loading…
Add table
Reference in a new issue