From 2aee94ba3cbd2e46732a89b7d4f70a3269bb98cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:08:37 +0200 Subject: [PATCH 1/8] Update .env --- conf/.env | 6 ------ 1 file changed, 6 deletions(-) diff --git a/conf/.env b/conf/.env index da1aee0..04dbc44 100644 --- a/conf/.env +++ b/conf/.env @@ -1,17 +1,11 @@ TZ=__TIMEZONE__ - OCIS_URL=https://__DOMAIN__ PROXY_HTTP_ADDR=127.0.0.1:__PORT__ PROXY_TLS=true OCIS_INSECURE=true - OCIS_LOG_LEVEL=warn - OCIS_FORCE_CONFIG_OVERWRITE=true - OCIS_CONFIG_DIR=__INSTALL_DIR__ OCIS_BASE_DATA_PATH=__DATA_DIR__ - OCIS_DEFAULT_LANGUAGE=__LANGUAGE__ - #OCIS_EXCLUDE_RUN_SERVICES=thumbnails From cf92e1c5b5341c678e40a1c6e715a85c17fc4ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:24:52 +0200 Subject: [PATCH 2/8] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index f0a37d2..bd6a66c 100755 --- a/scripts/install +++ b/scripts/install @@ -52,7 +52,7 @@ chown $app:$app "$install_dir/ocis.env" ynh_script_progression --message="Installing $app..." --weight=3 pushd "$install_dir" - ./ocis init --insecure=true --force-overwrite=true --admin-password=$password --config-path=$install_dir + ./ocis init --insecure=true --force-overwrite=true --admin-password=$password #--config-path=$install_dir popd chmod 750 "$install_dir" From 9ff5b4883e22036cf0337fd8857e62d98ecbf3b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:28:27 +0200 Subject: [PATCH 3/8] fix --- conf/.env | 2 +- conf/systemd.service | 2 +- manifest.toml | 1 + scripts/install | 8 ++++---- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/conf/.env b/conf/.env index 04dbc44..64c9bec 100644 --- a/conf/.env +++ b/conf/.env @@ -5,7 +5,7 @@ PROXY_TLS=true OCIS_INSECURE=true OCIS_LOG_LEVEL=warn OCIS_FORCE_CONFIG_OVERWRITE=true -OCIS_CONFIG_DIR=__INSTALL_DIR__ +OCIS_CONFIG_DIR=__DATA_DIR__/config/ OCIS_BASE_DATA_PATH=__DATA_DIR__ OCIS_DEFAULT_LANGUAGE=__LANGUAGE__ #OCIS_EXCLUDE_RUN_SERVICES=thumbnails diff --git a/conf/systemd.service b/conf/systemd.service index c7cf706..9130d78 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -5,7 +5,7 @@ Description=ownCloud: Infinite Scale server Type=simple User=__APP__ Group=__APP__ -EnvironmentFile=__INSTALL_DIR__/ocis.env +EnvironmentFile=__DATA_DIR__/config/ocis.env ExecStart=__INSTALL_DIR__/ocis server Restart=always diff --git a/manifest.toml b/manifest.toml index 1bc8395..2f5e09c 100644 --- a/manifest.toml +++ b/manifest.toml @@ -71,6 +71,7 @@ ram.runtime = "50M" [resources.install_dir] [resources.data_dir] + subdirs = ["config"] [resources.ports] diff --git a/scripts/install b/scripts/install index bd6a66c..cc91e15 100755 --- a/scripts/install +++ b/scripts/install @@ -41,10 +41,10 @@ yunohost service add $app --description="File sharing platform" --log="/var/log/ #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=1 -ynh_add_config --template=".env" --destination="$install_dir/ocis.env" +ynh_add_config --template=".env" --destination="$data_dir/config/ocis.env" -chmod 400 "$install_dir/ocis.env" -chown $app:$app "$install_dir/ocis.env" +chmod 400 "$data_dir/ocis.env" +chown $app:$app "$data_dir/ocis.env" #================================================= # INSTALL OWNCLOUD @@ -52,7 +52,7 @@ chown $app:$app "$install_dir/ocis.env" ynh_script_progression --message="Installing $app..." --weight=3 pushd "$install_dir" - ./ocis init --insecure=true --force-overwrite=true --admin-password=$password #--config-path=$install_dir + ./ocis init --insecure=true --force-overwrite=true --admin-password=$password --config-path=$data_dir/config/ popd chmod 750 "$install_dir" From d130ed96be4f251e2b13c3b8d11e523e461b0778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:31:02 +0200 Subject: [PATCH 4/8] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index cc91e15..783ba98 100755 --- a/scripts/install +++ b/scripts/install @@ -43,8 +43,8 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template=".env" --destination="$data_dir/config/ocis.env" -chmod 400 "$data_dir/ocis.env" -chown $app:$app "$data_dir/ocis.env" +chmod 400 "$data_dir/config/ocis.env" +chown $app:$app "$data_dir/config/ocis.env" #================================================= # INSTALL OWNCLOUD From 5d548d8de606f099dfac583835b4f3aa31f205e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:39:05 +0200 Subject: [PATCH 5/8] cleaning --- scripts/install | 1 + scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 783ba98..cbe9fe2 100755 --- a/scripts/install +++ b/scripts/install @@ -58,6 +58,7 @@ popd chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" +chown $app:$app "$data_dir/config/ocis.yaml" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index 00701f3..900e77a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,7 +26,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" 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="$install_dir" --full_replace=1 --keep="ocis.env ocis.yaml" +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" From 746ab6087770aa37a7b2cd81e6c5ff5e31775748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 20 Jun 2024 09:39:37 +0200 Subject: [PATCH 6/8] Update manifest.toml --- manifest.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 2f5e09c..1643ab8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -78,7 +78,6 @@ ram.runtime = "50M" [resources.permissions] main.url = "/" main.auth_header = false - api.url = "/api" api.auth_header = false api.show_tile = false From 27d1d2a3e2f5af15d0c9a5620442306ba440d99d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:32:44 +0200 Subject: [PATCH 7/8] Update .env --- conf/.env | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conf/.env b/conf/.env index 64c9bec..5bb65b8 100644 --- a/conf/.env +++ b/conf/.env @@ -1,11 +1,17 @@ TZ=__TIMEZONE__ OCIS_URL=https://__DOMAIN__ +OCIS_PUBLIC_URL=https://__DOMAIN__ PROXY_HTTP_ADDR=127.0.0.1:__PORT__ PROXY_TLS=true -OCIS_INSECURE=true +OCIS_INSECURE=false OCIS_LOG_LEVEL=warn OCIS_FORCE_CONFIG_OVERWRITE=true OCIS_CONFIG_DIR=__DATA_DIR__/config/ +#OCIS_FORCE_CONFIG_OVERWRITE=true OCIS_BASE_DATA_PATH=__DATA_DIR__ OCIS_DEFAULT_LANGUAGE=__LANGUAGE__ + #OCIS_EXCLUDE_RUN_SERVICES=thumbnails + +# Set this to true if you want to enforce passwords on all public shares. +OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD=false From f4573dbf3a1eb6eb448699e3aa0618b1d9cc5147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 20 Jun 2024 11:54:40 +0200 Subject: [PATCH 8/8] fix --- conf/.env | 2 +- scripts/upgrade | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/conf/.env b/conf/.env index 5bb65b8..3be25ab 100644 --- a/conf/.env +++ b/conf/.env @@ -1,6 +1,6 @@ TZ=__TIMEZONE__ OCIS_URL=https://__DOMAIN__ -OCIS_PUBLIC_URL=https://__DOMAIN__ +#OCIS_PUBLIC_URL=https://__DOMAIN__ PROXY_HTTP_ADDR=127.0.0.1:__PORT__ PROXY_TLS=true OCIS_INSECURE=false diff --git a/scripts/upgrade b/scripts/upgrade index 900e77a..2cd3f72 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,6 +20,15 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 + +if [[ -f "$install_dir/ocis.yaml" ]]; then + mv "$install_dir/ocis.yaml" "$data_dir/config/ocis.yaml" +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -48,12 +57,12 @@ yunohost service add $app --description="File sharing platform" --log="/var/log/ #================================================= # ADD A CONFIGURATION #================================================= -#ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression --message="Adding a configuration file..." --weight=1 -#ynh_add_config --template=".env" --destination="$install_dir/ocis.env" +ynh_add_config --template=".env" --destination="$install_dir/ocis.env" -#chmod 400 "$install_dir/ocis.env" -#chown $app:$app "$install_dir/ocis.env" +chmod 400 "$install_dir/ocis.env" +chown $app:$app "$install_dir/ocis.env" #================================================= # START SYSTEMD SERVICE