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

Remove need to manage parameters.yml file; adapt to version 2.3

This commit is contained in:
Jimmy Monin 2017-12-13 21:54:22 +01:00
parent 37402611f8
commit c05c1504f5
3 changed files with 19 additions and 60 deletions

View file

@ -1,50 +0,0 @@
parameters:
database_driver: pdo_mysql
database_host: localhost
database_port: 3306
database_name: {DBNAME}
database_user: {DBUSER}
database_password: {DBPASS}
database_path: null
database_table_prefix: null
database_socket: null
database_charset: utf8mb4
mailer_transport: smtp
mailer_host: localhost
mailer_user: null
mailer_password: null
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
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
# sites credentials
sites_credentials: {}

View file

@ -86,11 +86,16 @@ ynh_system_user_create $app # Create a dedicated system user
# Copy and set Wallabag dist configuration
wb_conf="${TMPDIR}/app/config/parameters.yml"
cp ../conf/parameters.yml "$wb_conf"
ynh_replace_string "{DBNAME}" "${db_name}" "$wb_conf"
ynh_replace_string "{DBUSER}" "${db_user}" "$wb_conf"
ynh_replace_string "{DBPASS}" "${db_pwd}" "$wb_conf"
ynh_replace_string "{DESKEY}" "${deskey}" "$wb_conf"
cp ${TMPDIR}/app/config/parameters.yml.dist $wb_conf
ynh_replace_string "fosuser_registration: true" "fosuser_registration: false" "$wb_conf"
ynh_replace_string "database_name: wallabag" "database_name: ${db_name}" "$wb_conf"
ynh_replace_string "database_user: root" "database_user: ${db_user}" "$wb_conf"
ynh_replace_string "database_password: ~" "database_password: ${db_pwd}" "$wb_conf"
ynh_replace_string "database_table_prefix: wallabag_" "database_table_prefix: null" "$wb_conf"
ynh_replace_string "secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv" "secret: ${deskey}" "$wb_conf"
ynh_replace_string "domain_name: https://your-wallabag-url-instance.com" "domain_name: https://$domain$path_url" "$wb_conf"
# Restrict rights to Wallabag user only
chmod 600 "$wb_conf"

View file

@ -89,11 +89,15 @@ ynh_system_user_create $app # Create dedicated user if not existing
# Copy and set Wallabag dist configuration
wb_conf="${TMPDIR}/app/config/parameters.yml"
cp ../conf/parameters.yml "$wb_conf"
ynh_replace_string "{DBNAME}" "${db_name}" "$wb_conf"
ynh_replace_string "{DBUSER}" "${db_user}" "$wb_conf"
ynh_replace_string "{DBPASS}" "${db_pwd}" "$wb_conf"
ynh_replace_string "{DESKEY}" "${deskey}" "$wb_conf"
cp ${TMPDIR}/app/config/parameters.yml.dist $wb_conf
ynh_replace_string "fosuser_registration: true" "fosuser_registration: false" "$wb_conf"
ynh_replace_string "database_name: wallabag" "database_name: ${db_name}" "$wb_conf"
ynh_replace_string "database_user: root" "database_user: ${db_user}" "$wb_conf"
ynh_replace_string "database_password: ~" "database_password: ${db_pwd}" "$wb_conf"
ynh_replace_string "database_table_prefix: wallabag_" "database_table_prefix: null" "$wb_conf"
ynh_replace_string "secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv" "secret: ${deskey}" "$wb_conf"
ynh_replace_string "domain_name: https://your-wallabag-url-instance.com" "domain_name: https://$domain$path_url" "$wb_conf"
# Replace files and set permissions
ynh_secure_remove "${final_path}/var/cache"