mirror of
https://github.com/YunoHost-Apps/invoiceninja5_ynh.git
synced 2024-09-03 19:26:23 +02:00
Fix
This commit is contained in:
parent
b07939f0e7
commit
d1c6dc5db7
3 changed files with 65 additions and 30 deletions
57
conf/default.env
Normal file
57
conf/default.env
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
APP_NAME="Invoice Ninja"
|
||||||
|
APP_ENV=production
|
||||||
|
APP_KEY=base64:3E5HVZ/T+VbZu+oA4GNlwnvwFe3jNtkGbR95K0uwr7A=
|
||||||
|
APP_DEBUG=false
|
||||||
|
|
||||||
|
APP_URL=http://localhost
|
||||||
|
|
||||||
|
DB_CONNECTION=mysql
|
||||||
|
MULTI_DB_ENABLED=false
|
||||||
|
|
||||||
|
DB_HOST=localhost
|
||||||
|
DB_DATABASE=__DB_NAME__
|
||||||
|
DB_USERNAME=__DB_NAME__
|
||||||
|
DB_PASSWORD=__DB_PWD__
|
||||||
|
DB_PORT=3306
|
||||||
|
|
||||||
|
DEMO_MODE=false
|
||||||
|
|
||||||
|
BROADCAST_DRIVER=log
|
||||||
|
LOG_CHANNEL=stack
|
||||||
|
CACHE_DRIVER=file
|
||||||
|
QUEUE_CONNECTION=sync
|
||||||
|
SESSION_DRIVER=file
|
||||||
|
SESSION_LIFETIME=120
|
||||||
|
|
||||||
|
REDIS_HOST=127.0.0.1
|
||||||
|
REDIS_PASSWORD=null
|
||||||
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
MAIL_MAILER=smtp
|
||||||
|
MAIL_HOST=smtp.__DOMAIN__
|
||||||
|
MAIL_PORT=25
|
||||||
|
MAIL_USERNAME=null
|
||||||
|
MAIL_PASSWORD=null
|
||||||
|
MAIL_ENCRYPTION=null
|
||||||
|
MAIL_FROM_ADDRESS='__EMAIL__'
|
||||||
|
MAIL_FROM_NAME='__EMAIL_NAME__'
|
||||||
|
|
||||||
|
POSTMARK_API_TOKEN=
|
||||||
|
REQUIRE_HTTPS=false
|
||||||
|
|
||||||
|
GOOGLE_MAPS_API_KEY=
|
||||||
|
ERROR_EMAIL=
|
||||||
|
TRUSTED_PROXIES=
|
||||||
|
|
||||||
|
NINJA_ENVIRONMENT=selfhost
|
||||||
|
|
||||||
|
#options - snappdf / phantom / hosted_ninja
|
||||||
|
PDF_GENERATOR=phantom
|
||||||
|
|
||||||
|
PHANTOMJS_KEY='__PHANTOMJS_KEY__'
|
||||||
|
PHANTOMJS_SECRET=__APP_KEY__
|
||||||
|
|
||||||
|
UPDATE_SECRET=__API_SECRET__
|
||||||
|
|
||||||
|
COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
|
||||||
|
SENTRY_LARAVEL_DSN=https://cc7e8e2c678041689e53e409b7dba236@sentry.invoicing.co/5
|
|
@ -6,14 +6,12 @@
|
||||||
|
|
||||||
YNH_PHP_VERSION="7.3"
|
YNH_PHP_VERSION="7.3"
|
||||||
|
|
||||||
nodejs_version=12
|
|
||||||
|
|
||||||
# dependencies used by the app
|
# dependencies used by the app
|
||||||
#pkg_dependencies="phantomjs gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget"
|
#pkg_dependencies="phantomjs gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget"
|
||||||
|
pkg_dependencies="phantomjs"
|
||||||
|
|
||||||
extra_php_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mysql"
|
extra_php_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-gmp php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-bcmath php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-pdo php${YNH_PHP_VERSION}-tokenizer php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mysql"
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# PERSONAL HELPERS
|
# PERSONAL HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -55,8 +55,8 @@ ynh_app_setting_set --app=$app --key=api_secret --value="$(ynh_string_random --l
|
||||||
ynh_app_setting_set --app=$app --key=app_key --value="$(ynh_string_random --length=32)"
|
ynh_app_setting_set --app=$app --key=app_key --value="$(ynh_string_random --length=32)"
|
||||||
ynh_app_setting_set --app=$app --key=phantomjs_key --value="$(ynh_string_random --length=32)"
|
ynh_app_setting_set --app=$app --key=phantomjs_key --value="$(ynh_string_random --length=32)"
|
||||||
|
|
||||||
ynh_app_setting_set --app=$app --key=mail_from_address --value="$(ynh_user_get_info $admin mail)"
|
ynh_app_setting_set --app=$app --key=email --value="$(ynh_user_get_info $admin mail)"
|
||||||
ynh_app_setting_set --app=$app --key=mail_from_name --value="$(ynh_user_get_info $admin firstname) $(ynh_user_get_info $admin lastname)"
|
ynh_app_setting_set --app=$app --key=email__name --value="$(ynh_user_get_info $admin firstname) $(ynh_user_get_info $admin lastname)"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD MODIFICATIONS
|
# STANDARD MODIFICATIONS
|
||||||
|
@ -77,10 +77,7 @@ ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Installing dependencies..."
|
ynh_script_progression --message="Installing dependencies..."
|
||||||
|
|
||||||
#ynh_install_app_dependencies $pkg_dependencies
|
ynh_install_app_dependencies $pkg_dependencies
|
||||||
|
|
||||||
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
|
||||||
ynh_use_nodejs
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
|
@ -106,7 +103,7 @@ chown -R $app:www-data "$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
# NGINX CONFIGURATION
|
# NGINX CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring nginx web server..."
|
ynh_script_progression --message="Configuring NGINX web server..."
|
||||||
|
|
||||||
# Create a dedicated nginx config
|
# Create a dedicated nginx config
|
||||||
ynh_add_nginx_config
|
ynh_add_nginx_config
|
||||||
|
@ -114,7 +111,7 @@ ynh_add_nginx_config
|
||||||
#=================================================
|
#=================================================
|
||||||
# PHP-FPM CONFIGURATION
|
# PHP-FPM CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Configuring php-fpm..."
|
ynh_script_progression --message="Configuring PHP-FPM..."
|
||||||
|
|
||||||
# Create a dedicated php-fpm config
|
# Create a dedicated php-fpm config
|
||||||
ynh_add_fpm_config --package="$extra_php_dependencies"
|
ynh_add_fpm_config --package="$extra_php_dependencies"
|
||||||
|
@ -127,24 +124,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Modifying a config file..."
|
ynh_script_progression --message="Modifying a config file..."
|
||||||
|
|
||||||
config="$final_path/.env"
|
ynh_add_config --template="../conf/default.env" --destination="$final_path/.env"
|
||||||
ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$config"
|
|
||||||
|
|
||||||
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$config"
|
|
||||||
|
|
||||||
ynh_replace_string --match_string="__API_SECRET__" --replace_string="$(ynh_app_setting_get --app=$app --key=api_secret)" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__APP_KEY__" --replace_string="$(ynh_app_setting_get --app=$app --key=app_key)" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__PHANTOMJS_KEY__" --replace_string="$(ynh_app_setting_get --app=$app --key=phantomjs_jey)" --target_file="$config"
|
|
||||||
|
|
||||||
ynh_replace_string --match_string="__MAIL_FROM_ADDRESS__" --replace_string="$(ynh_app_setting_get --app=$app --key=mail_from_address)" --target_file="$config"
|
|
||||||
ynh_replace_string --match_string="__MAIL_FROM_NAME__" --replace_string="$(ynh_app_setting_get --app=$app --key=mail_from_name)" --target_file="$config"
|
|
||||||
|
|
||||||
# Calculate and store the config file checksum into the app settings
|
|
||||||
ynh_store_file_checksum --file="$config"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BUILD THE APPLICATION
|
# BUILD THE APPLICATION
|
||||||
|
@ -177,7 +157,7 @@ chmod 644 "/etc/cron.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# RELOAD NGINX
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Reloading nginx web server..."
|
ynh_script_progression --message="Reloading NGINX web server..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue