diff --git a/conf/.env b/conf/.env index da1aee0..3be25ab 100644 --- a/conf/.env +++ b/conf/.env @@ -1,17 +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=__INSTALL_DIR__ +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 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..1643ab8 100644 --- a/manifest.toml +++ b/manifest.toml @@ -71,13 +71,13 @@ ram.runtime = "50M" [resources.install_dir] [resources.data_dir] + subdirs = ["config"] [resources.ports] [resources.permissions] main.url = "/" main.auth_header = false - api.url = "/api" api.auth_header = false api.show_tile = false diff --git a/scripts/install b/scripts/install index f0a37d2..cbe9fe2 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/config/ocis.env" +chown $app:$app "$data_dir/config/ocis.env" #================================================= # INSTALL OWNCLOUD @@ -52,12 +52,13 @@ 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" 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..2cd3f72 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -20,13 +20,22 @@ 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 #================================================= 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" @@ -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