diff --git a/conf/nginx.conf b/conf/nginx.conf index 6327eff..86c09ea 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,8 +1,6 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - - # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; @@ -10,7 +8,6 @@ location __PATH__/ { proxy_pass http://localhost:__PORT__; -### End of PHP configuration part # Include SSOWAT user panel. include conf.d/yunohost_panel.conf.inc; diff --git a/conf/systemd.service b/conf/systemd.service index 89f1038..1161ec2 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -12,7 +12,7 @@ Restart=always StandardOutput=/var/log/__APP__/__APP__.log StandardError=/var/log/__APP__/__APP__.log SyslogIdentifier=__APP__ -Environment=GOPATH=/usr/local/go/bin +#Environment=GOPATH=/usr/local/go/bin [Install] WantedBy=multi-user.target \ No newline at end of file diff --git a/manifest.json b/manifest.json index 20b2747..8585ad9 100644 --- a/manifest.json +++ b/manifest.json @@ -5,14 +5,14 @@ "description": { "en": "A flexible event/agent & automation system " }, - "version": "28.01.2021~ynh1", + "version": "0.4.0~ynh1", "url": "https://github.com/muesli/beehive", "license": "AGPL-1.0-or-later", "maintainer": { "name": "Anmol Sharma" }, "requirements": { - "yunohost": ">= 4.1.3" + "yunohost": ">= 4.2.4" }, "multi_instance": true, "services": [ diff --git a/scripts/remove b/scripts/remove index b2b4819..6efd1b3 100755 --- a/scripts/remove +++ b/scripts/remove @@ -41,7 +41,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config - #================================================= # REMOVE DEPENDENCIES #================================================= @@ -66,8 +65,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." - # Remove the dedicated NGINX config ynh_remove_nginx_config - - #================================================= # REMOVE LOGROTATE CONFIGURATION #================================================= @@ -76,16 +73,6 @@ ynh_script_progression --message="Removing logrotate configuration..." --weight # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# CLOSE A PORT -#================================================= - -if yunohost firewall list | grep -q "\- $port$" -then - ynh_script_progression --message="Closing port $port..." --weight=1 - ynh_exec_warn_less yunohost firewall disallow TCP $port -fi - #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 657e874..61159df 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,17 +58,22 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --weight=1 + ynh_script_progression --message="Upgrading source files..." --time --weight=1 # Download, check integrity, uncompress and patch the source from app.src - export PATH=$PATH:/usr/local/go/bin - export GOPATH=/usr/local/go/bin - pushd "$final_path" - git pull - make - popd + ynh_setup_source --dest_dir="$final_path" fi +# FIXME: this should be managed by the core in the future +# Here, as a packager, you may have to tweak the ownerhsip/permissions +# such that the appropriate users (e.g. maybe www-data) can access +# files in some cases. +# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder - +# this will be treated as a security issue. +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= @@ -92,13 +97,6 @@ ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username=$app - -#================================================= -# SPECIFIC UPGRADE -#================================================= -# ... -#================================================= - #================================================= # SETUP SYSTEMD #================================================= @@ -107,7 +105,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight= # Create a dedicated systemd config ynh_add_systemd_config --service="$app" --template="systemd.service" --others_var="port domain" - #================================================= # GENERIC FINALIZATION #================================================= @@ -144,11 +141,9 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= ynh_script_progression --message="Configuring permissions..." --weight=1 - # Only the admin can access the admin panel of the app (if the app has an admin panel) ynh_permission_update --permission "main" --remove all_users --add $admin - #================================================= # RELOAD NGINX #=================================================