From cabb7027fc12f9890d435df65c50fd6e776e1a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 27 Aug 2022 15:17:48 +0200 Subject: [PATCH] Revert "move config file to datadir" This reverts commit 15e535af8a04da680fdc8a8e046fc79094eab47d. --- conf/config.json | 2 +- conf/nginx.conf | 8 ++++---- conf/systemd.service | 2 +- doc/DISCLAIMER.md | 4 +--- scripts/install | 6 +++--- scripts/upgrade | 3 +-- 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/conf/config.json b/conf/config.json index 73059de..5ea577b 100644 --- a/conf/config.json +++ b/conf/config.json @@ -8,7 +8,7 @@ "server": { "host": "127.0.0.1", "port": __PORT__, - "store_path": "__DATADIR__/tube.db", + "store_path": "tube.db", "upload_path": "__DATADIR__/uploads", "max_upload_size": __MAX_UPLOAD_SIZE__ }, diff --git a/conf/nginx.conf b/conf/nginx.conf index a2ed48d..98419f0 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -9,8 +9,8 @@ location __PATH__/ { # Set max upload size client_max_body_size 10G; - proxy_connect_timeout 1200; - proxy_send_timeout 1200; - proxy_read_timeout 1200; - send_timeout 1200; + proxy_connect_timeout 1200; + proxy_send_timeout 1200; + proxy_read_timeout 1200; + send_timeout 1200; } diff --git a/conf/systemd.service b/conf/systemd.service index 931ca47..4060fbd 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__FINALPATH__/ -ExecStart=__FINALPATH__/tube -c __DATADIR__/config.json +ExecStart=__FINALPATH__/tube -c __FINALPATH__/config.json # Sandboxing options to harden security # Depending on specificities of your service/app, you may need to tweak these diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index dab582f..841b1cd 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -4,8 +4,6 @@ Your video files are stored by default in `/home/yunohost.app/tube/videos`. -You can configure options in this file `/home/yunohost.app/tube/config.json` using the [documentation](https://git.mills.io/prologic/tube#configuration). Remember to restart Tube service if you change your configuration file. +You can configure options in this file `/var/www/tube/config.json` using the [documentation](https://git.mills.io/prologic/tube#configuration). Remember to restart Tube service if you change your configuration file. RSS feed address is available at `https://your_domain.tld/feed.xml` - -The data directory with uploaded videos and the configuration file is untouched when upgrading the app. If you want to delete the data directory with the application, use the `--purge` option: `sudo yunohost app remove tube --purge` diff --git a/scripts/install b/scripts/install index e735054..0c89db7 100755 --- a/scripts/install +++ b/scripts/install @@ -129,10 +129,10 @@ chown -R $app:www-data "$datadir" #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template="../conf/config.json" --destination="$datadir/config.json" +ynh_add_config --template="../conf/config.json" --destination="$final_path/config.json" -chmod 400 "$datadir/config.json" -chown $app:$app "$datadir/config.json" +chmod 400 "$final_path/config.json" +chown $app:$app "$final_path/config.json" #================================================= # SETUP SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index df83e5b..190286b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,7 +20,6 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) -datadir=$(ynh_app_setting_get --app=$app --key=datadir) max_upload_size=$(ynh_app_setting_get --app=$app --key=max_upload_size) feed_title=$(ynh_app_setting_get --app=$app --key=feed_title) @@ -124,7 +123,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH + ynh_setup_source --dest_dir="$final_path" --source_id=$YNH_ARCH --keep="config.json" fi chmod 750 "$final_path"