commit 9ee20f637861a7b4d5c7be08dabb6b38dbb58057 Author: Julien Malik Date: Wed Jan 20 12:20:03 2016 +0100 First import diff --git a/README.md b/README.md new file mode 100644 index 0000000..c0f9765 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +Rspamd Web UI for YunoHost +------------------------- + +https://rspamd.com/webui/ diff --git a/conf/nginx.conf b/conf/nginx.conf new file mode 100644 index 0000000..419b950 --- /dev/null +++ b/conf/nginx.conf @@ -0,0 +1,9 @@ +location PATHTOCHANGE { + if ($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } + + proxy_pass http://localhost:11334/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; +} diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..d85121d --- /dev/null +++ b/manifest.json @@ -0,0 +1,38 @@ +{ + "name": "Rspamd UI", + "id": "rspamdui", + "description": { + "en": "Simple control interface for rspamd spam filtering system", + "fr": "Simple control interface for rspamd spam filtering system" + }, + "url": "https://rspamd.com/webui", + "maintainer": { + "name": "ju", + "email": "ju@paraiso.me" + }, + "multi_instance": "false", + "services": [ + "nginx" + ], + "arguments": { + "install": [ + { + "name": "domain", + "type": "domain", + "ask": { + "en": "Choose a domain for Rspamd UI" + }, + "example": "domain.org" + }, + { + "name": "path", + "type": "path", + "ask": { + "en": "Choose a path for Rspamd UI" + }, + "example": "/rspamd", + "default": "/rspamd" + } + ] + } +} diff --git a/scripts/install b/scripts/install new file mode 100644 index 0000000..6f42082 --- /dev/null +++ b/scripts/install @@ -0,0 +1,21 @@ +#!/bin/bash + +# Retrieve arguments +domain=$1 +path=$2 + +sudo yunohost app checkurl $domain$path -a rspamdui +if [[ ! $? -eq 0 ]]; then + exit 1 +fi + +# Check port availability +sudo yunohost app checkport 11334 +if [[ ! $? -eq 0 ]]; then + exit 1 +fi + +# Configure Nginx and reload +sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf +sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/rspamdui.conf +sudo service nginx reload diff --git a/scripts/remove b/scripts/remove new file mode 100644 index 0000000..7ae1e19 --- /dev/null +++ b/scripts/remove @@ -0,0 +1,7 @@ +#!/bin/bash + +domain=$(sudo yunohost app setting transmission domain) + +sudo rm /etc/nginx/conf.d/$domain.d/transmission.conf +sudo service nginx reload +sudo yunohost app ssowatconf diff --git a/scripts/upgrade b/scripts/upgrade new file mode 100644 index 0000000..94b1642 --- /dev/null +++ b/scripts/upgrade @@ -0,0 +1,16 @@ +#!/bin/bash + +# Retrieve arguments +domain=$(sudo yunohost app setting transmission domain) +path=$(sudo yunohost app setting transmission path) + +# Check port availability +sudo yunohost app checkport 11334 +if [[ ! $? -eq 0 ]]; then + exit 1 +fi + +# Configure Nginx and reload +sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf +sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/rspamdui.conf +sudo service nginx reload