1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wallabag2_ynh.git synced 2024-10-01 13:35:06 +02:00

Use ynh_add_config for parameters.yml instead of modifying the source file

This commit is contained in:
Salamandar 2024-03-15 13:21:59 +01:00
parent 67ac61f97a
commit 3d25d5a0d4
3 changed files with 73 additions and 23 deletions

69
conf/parameters.yml Normal file
View file

@ -0,0 +1,69 @@
# This file is a "template" of what your parameters.yml file should look like
parameters:
# Uncomment these settings or manually update your parameters.yml
# to use docker-compose
#
# database_driver: %env.database_driver%
# database_host: %env.database_host%
# database_port: %env.database_port%
# database_name: %env.database_name%
# database_user: %env.database_user%
# database_password: %env.database_password%
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: ~
database_name: __DB_NAME__
database_user: __DB_USER__
database_password: __DB_PWD__
# For SQLite, database_path should be "%kernel.project_dir%/data/db/wallabag.sqlite"
database_path: null
database_table_prefix: null
database_socket: null
# with PostgreSQL and SQLite, you must set "utf8"
database_charset: utf8mb4
domain_name: https://__DOMAIN____PATH__
server_name: "Your wallabag instance"
#mailer_dsn: smtp://user:pass@__DOMAIN__:25
mailer_dsn: sendmail://default
locale: en
# A secret key that's used to generate certain security-related tokens
secret: __DESKEY__
# two factor stuff
twofactor_auth: true
twofactor_sender: no-reply@wallabag.org
# fosuser stuff
fosuser_registration: false
fosuser_confirmation: true
# how long the access token should live in seconds for the API
fos_oauth_server_access_token_lifetime: 3600
# how long the refresh token should life in seconds for the API
fos_oauth_server_refresh_token_lifetime: 1209600
from_email: no-reply@wallabag.org
rss_limit: 50
# RabbitMQ processing
rabbitmq_host: localhost
rabbitmq_port: 5672
rabbitmq_user: guest
rabbitmq_password: guest
rabbitmq_prefetch_count: 10
# Redis processing
redis_scheme: tcp
redis_host: localhost
redis_port: 6379
redis_path: null
redis_password: null
# sentry logging
sentry_dsn: ~

View file

@ -40,19 +40,9 @@ fi
#=================================================
ynh_script_progression --message="Adding $app's configuration files..." --weight=1
# Copy and set Wallabag dist configuration
cp "$install_dir/app/config/parameters.yml.dist" "$wb_conf"
ynh_replace_string --target_file="$wb_conf" --match_string="fosuser_registration: true" --replace_string="fosuser_registration: false"
ynh_replace_string --target_file="$wb_conf" --match_string="database_name: wallabag" --replace_string="database_name: $db_name"
ynh_replace_string --target_file="$wb_conf" --match_string="database_user: root" --replace_string="database_user: $db_user"
ynh_replace_string --target_file="$wb_conf" --match_string="database_password: ~" --replace_string="database_password: $db_pwd"
ynh_replace_string --target_file="$wb_conf" --match_string="database_table_prefix: wallabag_" --replace_string="database_table_prefix: null"
ynh_replace_string --target_file="$wb_conf" --match_string="secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv" --replace_string="secret: $deskey"
ynh_replace_string --target_file="$wb_conf" --match_string="domain_name: https://your-wallabag-url-instance.com" --replace_string="domain_name: https://$domain$path"
ynh_add_config --template="parameters.yml" --destination="$wb_conf"
chmod 600 "$wb_conf"
chown -R "$app:www-data" "$install_dir"
chown "$app:www-data" "$wb_conf"
# Alias for php-cli execution command
php_exec=("php$phpversion" "$install_dir/bin/console" --no-interaction --env=prod)

View file

@ -38,18 +38,9 @@ fi
ynh_script_progression --message="Reconfiguring $app..." --weight=1
# Copy and set Wallabag dist configuration
cp "$install_dir/app/config/parameters.yml.dist" "$wb_conf"
ynh_replace_string --target_file="$wb_conf" --match_string="fosuser_registration: true" --replace_string="fosuser_registration: false"
ynh_replace_string --target_file="$wb_conf" --match_string="database_name: wallabag" --replace_string="database_name: $db_name"
ynh_replace_string --target_file="$wb_conf" --match_string="database_user: root" --replace_string="database_user: $db_user"
ynh_replace_string --target_file="$wb_conf" --match_string="database_password: ~" --replace_string="database_password: $db_pwd"
ynh_replace_string --target_file="$wb_conf" --match_string="database_table_prefix: wallabag_" --replace_string="database_table_prefix: null"
ynh_replace_string --target_file="$wb_conf" --match_string="secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv" --replace_string="secret: $deskey"
ynh_replace_string --target_file="$wb_conf" --match_string="domain_name: https://your-wallabag-url-instance.com" --replace_string="domain_name: https://$domain$path"
ynh_add_config --template="parameters.yml" --destination="$wb_conf"
chmod 600 "$wb_conf"
chown -R "$app:www-data" "$install_dir"
chown "$app:www-data" "$wb_conf"
# Alias for php-cli execution command
php_exec=("php$phpversion" "$install_dir/bin/console" --no-interaction --env=prod)