summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xetc/init.d/commission8
-rwxr-xr-xetc/init.d/commission-php-fpm2
-rw-r--r--etc/lighttpd-commission.conf24
3 files changed, 20 insertions, 14 deletions
diff --git a/etc/init.d/commission b/etc/init.d/commission
index 03bec24..b9f8174 100755
--- a/etc/init.d/commission
+++ b/etc/init.d/commission
@@ -10,14 +10,14 @@ PIDFILE=/var/run/lighttpd-commission.pid
CONF_DIR=/var/config
ENABLED=yes
-[ -f "/etc/default/${NAME}" ] && . "/etc/default/${NAME}"
-
PASSWORDS=$(passwd -Sa | egrep '^[^[:space:]]+[[:space:]]P[[:space:]]' | wc -l)
if (($PASSWORDS == 0)) ; then
# No password, so indicate commissioning mode
# php-fpm-commision will be turned on as well
- rm -f /etc/default/$NAME
- ENABLED="yes"
+ rm -f "/run/mt-commission"
+else
+ ENABLED="no"
+ echo 'ENABLED="no"' >"/run/mt-commission"
fi
[ -f "/etc/default/no-${NAME}" ] && . "/etc/default/no-${NAME}"
diff --git a/etc/init.d/commission-php-fpm b/etc/init.d/commission-php-fpm
index 95de811..6867177 100755
--- a/etc/init.d/commission-php-fpm
+++ b/etc/init.d/commission-php-fpm
@@ -22,7 +22,7 @@ php_fpm_PID="/var/run/${NAME}.pid"
php_opts="-R --fpm-config $php_fpm_CONF --pid $php_fpm_PID"
ENABLED=yes
-[ -f "/etc/default/commission" ] && . "/etc/default/commission"
+[ -f "/run/mt-commission" ] && . "/run/mt-commission"
wait_for_pid () {
try=0
diff --git a/etc/lighttpd-commission.conf b/etc/lighttpd-commission.conf
index 5317eb5..d6ecb32 100644
--- a/etc/lighttpd-commission.conf
+++ b/etc/lighttpd-commission.conf
@@ -13,7 +13,7 @@
# - saves memory
server.modules = (
# "mod_rewrite",
-# "mod_redirect",
+ "mod_redirect",
# "mod_alias",
"mod_access",
# "mod_cml",
@@ -136,7 +136,7 @@ static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
######### Options that are good to be but not neccesary to be changed #######
## bind to port (default: 80)
-server.port = 80
+#server.port = 80
## bind to localhost (default: all interfaces)
#server.bind = "grisu.home.kneschke.de"
@@ -235,13 +235,19 @@ ssl.engine = "enable"
ssl.pemfile = "/var/config/server.pem"
$SERVER["socket"] == ":443" {
-ssl.engine = "enable"
-ssl.pemfile = "/var/config/server.pem"
-ssl.use-sslv3 = "enable"
-ssl.openssl.ssl-conf-cmd = ("Protocol" => "-ALL, -TLSv1, -SSLv3")
-server.document-root = "/www/commission"
-} else $HTTP["host"] =~ "^(.+)(:[0-9]+)?$" {
- url.redirect = ( "^/(.*)$" => "https://%1:443/$1" )
+ ssl.engine = "enable"
+ ssl.pemfile = "/var/config/server.pem"
+ ssl.use-sslv3 = "enable"
+ server.document-root = "/www/commission"
+}
+
+$SERVER["socket"] == ":80" {
+ # $HTTP["host"] =~ "(.*)" {
+ # url.redirect = ( "^/(.*)" => "https://%1/$1" )
+ # }
+ $HTTP["host"] =~ ".*" {
+ url.redirect = (".*" => "https://%0$0")
+ }
}
#### status module