1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/owncloud_ynh.git synced 2024-09-03 19:56:25 +02:00
This commit is contained in:
Éric Gaspar 2023-09-05 10:55:58 +02:00
parent a5228c819c
commit f4969482e9
7 changed files with 28 additions and 26 deletions

View file

@ -1,15 +1,9 @@
OCIS_INSECURE=true
OCIS_URL=https://__DOMAIN__
PROXY_HTTP_ADDR=127.0.0.1:__PORT__
OCIS_BASE_DATA_PATH=__DATA_DIR__
FORCE_CONFIG_OVERWRITE=true
PROXY_HTTP_ADDR=127.0.0.1:9200
PROXY_TLS=false
OCIS_INSECURE=false
OCIS_LOG_LEVEL=warn
OCIS_CONFIG_DIR=__INSTALL_DIR__
ADMIN_PASSWORD=__PASSWORD__
OCIS_CONFIG_DIR=/etc/ocis
OCIS_BASE_DATA_PATH=__DATA_DIR__

View file

@ -1,17 +1,14 @@
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
location __PATH__/ {
proxy_pass https://127.0.0.1:__PORT__;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
# OIDC Tokens in headers are quite large and can exceed default limits of reverse proxies
proxy_buffers 4 256k;
proxy_buffer_size 128k;
proxy_busy_buffers_size 256k;
# Disable checking of client request body size
client_max_body_size 0;
proxy_pass http://127.0.0.1:__PORT__;
proxy_set_header Host $host;
}

View file

@ -5,8 +5,7 @@ Description=ownCloud Infinite Scale server
Type=simple
User=__APP__
Group=__APP__
Environment=PROXY_HTTP_ADDR=127.0.0.1:__PORT__
Environment=OCIS_URL=https://__DOMAIN__
EnvironmentFile=/etc/ocis/ocis.env
ExecStart=__INSTALL_DIR__/ocis server
Restart=always

View file

@ -39,6 +39,12 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP VARIOUS FILES
#=================================================
ynh_backup --src_path="/etc/ocis/"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -16,10 +16,12 @@ ynh_script_progression --message="Setting up source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$install_dir"
mkdir -p /etc/ocis
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
chown -R $app:$app "/etc/ocis"
chmod +x $install_dir/ocis
#=================================================
@ -38,19 +40,19 @@ 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="../conf/.env" --destination="$install_dir/.env"
ynh_add_config --template="../conf/.env" --destination="/etc/ocis/ocis.env"
#chmod 600 "$install_dir/.env"
#chown $app:$app "$install_dir/.env"
chmod 600 "/etc/ocis/ocis.env"
chown $app:$app "/etc/ocis/ocis.env"
#=================================================
# INSTALL OWNCLOUD
#=================================================
ynh_script_progression --message="Installing $app..." --weight=3
(cd "$install_dir" && ./ocis init --insecure=true --force-overwrite=true --admin-password=$password --config-path=$install_dir/.ocis/config)
(cd "$install_dir" && ./ocis init --insecure=true --force-overwrite=true --admin-password $password --config-path "/etc/ocis")
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"

View file

@ -28,6 +28,8 @@ ynh_remove_systemd_config
# Remove the dedicated NGINX config
ynh_remove_nginx_config
ynh_secure_remove --file="/etc/ocis"
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -43,6 +43,8 @@ systemctl enable $app.service --quiet
yunohost service add $app --description="File sharing platform" --log="/var/log/$app/$app.log"
ynh_restore_file --origin_path="/etc/ocis/"
#=================================================
# START SYSTEMD SERVICE
#=================================================