]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Add deb template files and deb configs examples
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 15 Aug 2015 23:39:08 +0000 (01:39 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 16 Aug 2015 11:08:23 +0000 (13:08 +0200)
gui/baculum/examples/deb-template/baculum-apache.conf [new file with mode: 0644]
gui/baculum/examples/deb-template/baculum-lighttpd.conf [new file with mode: 0644]
gui/baculum/examples/deb-template/baculum-lighttpd.service [new file with mode: 0644]
gui/baculum/examples/deb-template/baculum.users [new file with mode: 0644]
gui/baculum/examples/deb/baculum-apache.conf [new file with mode: 0644]
gui/baculum/examples/deb/baculum-lighttpd.conf [new file with mode: 0644]
gui/baculum/examples/deb/baculum.lighttpd.conf [deleted file]
gui/baculum/examples/deb/baculum.startup [new file with mode: 0755]

diff --git a/gui/baculum/examples/deb-template/baculum-apache.conf b/gui/baculum/examples/deb-template/baculum-apache.conf
new file mode 100644 (file)
index 0000000..7dc51c2
--- /dev/null
@@ -0,0 +1,46 @@
+Listen 9095
+
+<VirtualHost *:9095>
+       DocumentRoot %DOCUMENTROOT
+       ServerName localhost
+       CustomLog %LOGDIR/baculum-access.log combined
+       ErrorLog %LOGDIR/baculum-error.log
+       <Directory %DOCUMENTROOT>
+               Options +FollowSymLinks
+               RewriteEngine On
+               RewriteCond %{REQUEST_FILENAME} !-d
+               RewriteCond %{REQUEST_FILENAME} !-f
+               RewriteRule ^(.*)$ index.php/$1 [L]
+               AuthType Basic
+               AuthName "Baculum Auth"
+               AuthUserFile %DOCUMENTROOT/protected/Data/baculum.users
+               Require valid-user
+       </Directory>
+       <Directory %DOCUMENTROOT/protected>
+               Order Deny,Allow
+               Deny from all
+       </Directory>
+       <Directory %DOCUMENTROOT/framework>
+               Order Deny,Allow
+               Deny from all
+       </Directory>
+       <Directory %DOCUMENTROOT/framework/Wsat/themes>
+               Order Deny,Allow
+               Deny from all
+       </Directory>
+       <Directory %DOCUMENTROOT/framework/Web/Javascripts/source>
+               <ifModule mod_gzip.c>
+                       mod_gzip_on Yes
+                       mod_gzip_dechunk Yes
+                       mod_gzip_item_include file \.js$
+                       mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
+               </ifModule>
+               <ifModule mod_expires.c>
+                       ExpiresActive On
+                       ExpiresDefault "access plus 864000 seconds"
+               </ifModule>
+               <ifModule mod_headers.c>
+                       Header set Cache-Control "max-age=864000, private"
+               </ifModule>
+       </Directory>
+</VirtualHost>
diff --git a/gui/baculum/examples/deb-template/baculum-lighttpd.conf b/gui/baculum/examples/deb-template/baculum-lighttpd.conf
new file mode 100644 (file)
index 0000000..74defe9
--- /dev/null
@@ -0,0 +1,103 @@
+# Baculum WebGUI tool for Bacula Community
+#
+# Web Server Configuration
+#
+
+server.port           = 9095
+server.username       = "www-data"
+server.groupname      = "www-data"
+server.document-root  = "%DOCUMENTROOT"
+server.errorlog       = "%LOGDIR/baculum-error.log"
+accesslog.filename    = "%LOGDIR/baculum-access.log"
+server.pid-file       = "/var/run/baculum.pid"
+
+server.modules = (
+       "mod_auth",
+       "mod_alias",
+       "mod_rewrite",
+       "mod_setenv",
+       "mod_fastcgi",
+       "mod_access",
+       "mod_accesslog"
+)
+
+auth.backend = "htpasswd"
+auth.backend.htpasswd.userfile = "%DOCUMENTROOT/protected/Data/baculum.users"
+auth.require = ( "/" => (
+       "method" => "basic",
+       "realm" => "Baculum Auth",
+       "require" => "valid-user"
+       )
+)
+
+index-file.names = ( "index.php" )
+
+static-file.exclude-extensions = ( ".php" )
+
+dir-listing.encoding  = "utf-8"
+
+mimetype.assign = (
+       ".html" => "text/html",
+       ".gif" => "image/gif",
+       ".png" => "image/png",
+       ".ico" => "image/x-icon",
+       ".css" => "text/css",
+       ".js" => "application/javascript"
+)
+
+alias.url = (
+       "/" => "%DOCUMENTROOT/"
+)
+
+fastcgi.server = (
+       ".php"=> (
+               (
+                       "bin-path"=>"/usr/bin/php-cgi",
+                       "socket"=>"/tmp/php.sock",
+                       "max-procs" => 1,
+                       "bin-environment" => (
+                               "PHP_FCGI_CHILDREN" => "4",
+                               "PHP_FCGI_MAX_REQUESTS" => "10000"
+                       ),
+                       "bin-copy-environment" => (
+                               "PATH",
+                               "SHELL",
+                               "USER"
+                       ),
+                       "broken-scriptfilename" => "enable"
+               )
+       )
+)
+
+url.rewrite-once = (
+       "^/themes/(.+)$" => "/themes/$1",
+       "^/assets/(.+)$" => "/assets/$1",
+       "^/(.+)$" => "/index.php/$1"
+)
+
+url.access-deny = (
+    "^%DOCUMENTROOT/protected/",
+    "^%DOCUMENTROOT/framework/",
+
+    # Wsat is not used by Baculum. Added here for not storing
+    # framework Apache specific .htaccess files
+    "^%DOCUMENTROOT/framework/Wsat/themes/"
+)
+
+### Enable compressing dynamic content ###
+
+# disable mod_compress when request a php file
+$HTTP["url"] !~ "\.php$" {
+       compress.filetype = (
+               "text/plain",
+               "text/html",
+               "text/javascript",
+               "text/css",
+               "text/xml"
+       )
+}
+
+# enable mod_setenv for framework source files:
+$HTTP["url"] =~ "^%DOCUMENTROOT/framework/Web/Javascripts/source/" {
+       setenv.add-response-header = ("Content-Encoding" => "gzip")
+}
diff --git a/gui/baculum/examples/deb-template/baculum-lighttpd.service b/gui/baculum/examples/deb-template/baculum-lighttpd.service
new file mode 100644 (file)
index 0000000..b54937e
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Baculum WebGUI Bacula Community tool
+After=network.target
+
+[Service]
+PIDFile=/var/run/baculum.pid
+ExecStart=/usr/sbin/lighttpd -f %CONFDIR/baculum-lighttpd.conf
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/gui/baculum/examples/deb-template/baculum.users b/gui/baculum/examples/deb-template/baculum.users
new file mode 100644 (file)
index 0000000..1375f69
--- /dev/null
@@ -0,0 +1 @@
+admin:YWG41BPzVAkN6
\ No newline at end of file
diff --git a/gui/baculum/examples/deb/baculum-apache.conf b/gui/baculum/examples/deb/baculum-apache.conf
new file mode 100644 (file)
index 0000000..0d7473b
--- /dev/null
@@ -0,0 +1,46 @@
+Listen 9095
+
+<VirtualHost *:9095>
+       DocumentRoot /usr/share/baculum/htdocs
+       ServerName localhost
+       CustomLog /var/log/apache2/baculum-access.log combined
+       ErrorLog /var/log/apache2/baculum-error.log
+       <Directory /usr/share/baculum/htdocs>
+               Options +FollowSymLinks
+               RewriteEngine On
+               RewriteCond %{REQUEST_FILENAME} !-d
+               RewriteCond %{REQUEST_FILENAME} !-f
+               RewriteRule ^(.*)$ index.php/$1 [L]
+               AuthType Basic
+               AuthName "Baculum Auth"
+               AuthUserFile /usr/share/baculum/htdocs/protected/Data/baculum.users
+               Require valid-user
+       </Directory>
+       <Directory /usr/share/baculum/htdocs/protected>
+               Order Deny,Allow
+               Deny from all
+       </Directory>
+       <Directory /usr/share/baculum/htdocs/framework>
+               Order Deny,Allow
+               Deny from all
+       </Directory>
+       <Directory /usr/share/baculum/htdocs/framework/Wsat/themes>
+               Order Deny,Allow
+               Deny from all
+       </Directory>
+       <Directory /usr/share/baculum/htdocs/framework/Web/Javascripts/source>
+               <ifModule mod_gzip.c>
+                       mod_gzip_on Yes
+                       mod_gzip_dechunk Yes
+                       mod_gzip_item_include file \.js$
+                       mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
+               </ifModule>
+               <ifModule mod_expires.c>
+                       ExpiresActive On
+                       ExpiresDefault "access plus 864000 seconds"
+               </ifModule>
+               <ifModule mod_headers.c>
+                       Header set Cache-Control "max-age=864000, private"
+               </ifModule>
+       </Directory>
+</VirtualHost>
diff --git a/gui/baculum/examples/deb/baculum-lighttpd.conf b/gui/baculum/examples/deb/baculum-lighttpd.conf
new file mode 100644 (file)
index 0000000..d676efc
--- /dev/null
@@ -0,0 +1,103 @@
+# Baculum WebGUI tool for Bacula Community
+#
+# Web Server Configuration
+#
+
+server.port           = 9095
+server.username       = "www-data"
+server.groupname      = "www-data"
+server.document-root  = "/usr/share/baculum/htdocs"
+server.errorlog       = "/var/log/lighttpd/baculum-error.log"
+accesslog.filename    = "/var/log/lighttpd/baculum-access.log"
+server.pid-file       = "/var/run/baculum.pid"
+
+server.modules = (
+       "mod_auth",
+       "mod_alias",
+       "mod_rewrite",
+       "mod_setenv",
+       "mod_fastcgi",
+       "mod_access",
+       "mod_accesslog"
+)
+
+auth.backend = "htpasswd"
+auth.backend.htpasswd.userfile = "/usr/share/baculum/htdocs/protected/Data/baculum.users"
+auth.require = ( "/" => (
+       "method" => "basic",
+       "realm" => "Baculum Auth",
+       "require" => "valid-user"
+       )
+)
+
+index-file.names = ( "index.php" )
+
+static-file.exclude-extensions = ( ".php" )
+
+dir-listing.encoding  = "utf-8"
+
+mimetype.assign = (
+       ".html" => "text/html",
+       ".gif" => "image/gif",
+       ".png" => "image/png",
+       ".ico" => "image/x-icon",
+       ".css" => "text/css",
+       ".js" => "application/javascript"
+)
+
+alias.url = (
+       "/" => "/usr/share/baculum/htdocs/"
+)
+
+fastcgi.server = (
+       ".php"=> (
+               (
+                       "bin-path"=>"/usr/bin/php-cgi",
+                       "socket"=>"/tmp/php.sock",
+                       "max-procs" => 1,
+                       "bin-environment" => (
+                               "PHP_FCGI_CHILDREN" => "4",
+                               "PHP_FCGI_MAX_REQUESTS" => "10000"
+                       ),
+                       "bin-copy-environment" => (
+                               "PATH",
+                               "SHELL",
+                               "USER"
+                       ),
+                       "broken-scriptfilename" => "enable"
+               )
+       )
+)
+
+url.rewrite-once = (
+       "^/themes/(.+)$" => "/themes/$1",
+       "^/assets/(.+)$" => "/assets/$1",
+       "^/(.+)$" => "/index.php/$1"
+)
+
+url.access-deny = (
+    "^/usr/share/baculum/htdocs/protected/",
+    "^/usr/share/baculum/htdocs/framework/",
+
+    # Wsat is not used by Baculum. Added here for not storing
+    # framework Apache specific .htaccess files
+    "^/usr/share/baculum/htdocs/framework/Wsat/themes/"
+)
+
+### Enable compressing dynamic content ###
+
+# disable mod_compress when request a php file
+$HTTP["url"] !~ "\.php$" {
+       compress.filetype = (
+               "text/plain",
+               "text/html",
+               "text/javascript",
+               "text/css",
+               "text/xml"
+       )
+}
+
+# enable mod_setenv for framework source files:
+$HTTP["url"] =~ "^/usr/share/baculum/htdocs/framework/Web/Javascripts/source/" {
+       setenv.add-response-header = ("Content-Encoding" => "gzip")
+}
diff --git a/gui/baculum/examples/deb/baculum.lighttpd.conf b/gui/baculum/examples/deb/baculum.lighttpd.conf
deleted file mode 100644 (file)
index f0e6f98..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-# Baculum WebGUI tool for Bacula Community
-#
-# Web Server Configuration
-#
-
-server.port           = 9095
-server.username       = "www-data"
-server.groupname      = "www-data"
-server.document-root  = "/usr/share/baculum/htdocs"
-server.errorlog       = "/var/log/baculum/baculum-error.log"
-accesslog.filename    = "/var/log/baculum/baculum-access.log"
-server.pid-file       = "/var/run/baculum.pid"
-
-server.modules = (
-        "mod_auth",
-        "mod_alias",
-        "mod_rewrite",
-        "mod_fastcgi",
-        "mod_accesslog"
-)
-auth.backend          = "htpasswd"
-auth.backend.htpasswd.userfile = "/usr/share/baculum/htdocs/protected/Data/baculum.users"
-auth.require = ( "/" => (
-        "method" => "basic",
-        "realm" => "Baculum Auth",
-        "require" => "valid-user"
-))
-
-index-file.names      = ( "index.php" )
-
-static-file.exclude-extensions = ( ".php" )
-
-dir-listing.encoding  = "utf-8"
-
-mimetype.assign = (
-   ".html" => "text/html",
-   ".gif" => "image/gif",
-   ".png" => "image/png",
-   ".ico" => "image/x-icon",
-   ".css" => "text/css",
-   ".js" => "application/javascript",
-)
-
-alias.url = (
-   "/" => "/usr/share/baculum/htdocs/"
-)
-
-fastcgi.server = (".php"=>((
-  "bin-path"=>"/usr/bin/php5-cgi",
-  "socket"=>"/tmp/php5.sock",
-  "max-procs" => 1,
-  "bin-environment" => (
-    "PHP_FCGI_CHILDREN" => "4",
-    "PHP_FCGI_MAX_REQUESTS" => "10000"
-  ),
-  "bin-copy-environment" => (
-   "PATH", "SHELL", "USER"
-  ),
-  "broken-scriptfilename" => "enable"
-)))
-
-url.rewrite-once = (
-   "^/themes/(.+)$" => "/themes/$1",
-   "^/assets/(.+)$" => "/assets/$1",
-   "^/(.+)$" => "/index.php/$1"
-)
diff --git a/gui/baculum/examples/deb/baculum.startup b/gui/baculum/examples/deb/baculum.startup
new file mode 100755 (executable)
index 0000000..27f6fb3
--- /dev/null
@@ -0,0 +1,93 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          baculum
+# Required-Start:    $local_fs $remote_fs $network $syslog $named
+# Required-Stop:     $local_fs $remote_fs $network $syslog $named
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start/stop Baculum
+# Description:       Start the Baculum WebGUI Bacula Community tool.
+#  This script uses Lighttpd web server for working Baculum WebGUI tool.
+### END INIT INFO
+
+DESC="Baculum WebGUI Bacula Community tool"
+NAME=baculum
+SCRIPTNAME=/etc/init.d/$NAME
+DAEMON=/usr/sbin/lighttpd
+DAEMON_OPTS="-f /etc/baculum/baculum-lighttpd.conf"
+PIDFILE="/var/run/$NAME.pid"
+
+test -x $DAEMON || exit 0
+
+check_syntax()
+{
+    $DAEMON -t $DAEMON_OPTS > /dev/null || exit $?
+}
+
+. /lib/lsb/init-functions
+
+case "$1" in
+    start)
+        check_syntax
+        log_daemon_msg "Starting $DESC" $NAME
+        if ! start-stop-daemon --start --oknodo --quiet \
+            --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
+        then
+            log_end_msg 1
+        else
+            log_end_msg 0
+        fi
+        ;;
+    stop)
+        log_daemon_msg "Stopping $DESC" $NAME
+        if start-stop-daemon --stop --retry 30 --oknodo --quiet \
+            --pidfile $PIDFILE --exec $DAEMON
+        then
+            rm -f $PIDFILE
+            log_end_msg 0
+        else
+            log_end_msg 1
+        fi
+        ;;
+    reload|force-reload)
+        check_syntax
+        log_daemon_msg "Reloading $DESC configuration" $NAME
+        if start-stop-daemon --stop --signal INT --quiet \
+            --pidfile $PIDFILE --exec $DAEMON
+        then
+            rm $PIDFILE
+            if start-stop-daemon --start --quiet  \
+                --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS ; then
+                log_end_msg 0
+            else
+                log_end_msg 1
+            fi
+        else
+            log_end_msg 1
+        fi
+        ;;
+    reopen-logs)
+        log_daemon_msg "Reopening $DESC logs" $NAME
+        if start-stop-daemon --stop --signal HUP --oknodo --quiet \
+            --pidfile $PIDFILE --exec $DAEMON
+        then
+            log_end_msg 0
+        else
+            log_end_msg 1
+        fi
+        ;;
+    restart)
+        check_syntax
+        $0 stop
+        $0 start
+        ;;
+    status)
+        status_of_proc -p "$PIDFILE" "$DAEMON" lighttpd && exit 0 || exit $?
+        ;;
+    *)
+        echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
+        exit 1
+        ;;
+esac
+
+exit 0
\ No newline at end of file