diff --git a/www/webacula/Makefile b/www/webacula/Makefile new file mode 100644 index 00000000000..f2c903a0718 --- /dev/null +++ b/www/webacula/Makefile @@ -0,0 +1,49 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2011/03/21 18:01:08 ajacoutot Exp $ + +COMMENT= bacula(8) web interface + +DISTNAME= webacula-5.0.3 + +CATEGORIES= www sysutils + +HOMEPAGE= http://webacula.sourceforge.net/ + +# GPLv3 +PERMIT_PACKAGE_CDROM= Yes +PERMIT_PACKAGE_FTP= Yes +PERMIT_DISTFILES_CDROM= Yes +PERMIT_DISTFILES_FTP= Yes + +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=webacula/} + +RUN_DEPENDS= www/php5/extensions,-gd \ + php5-pdo_pgsql-*|php5-pdo_mysql-*|php5-pdo_sqlite-*:www/php5/extensions,-pdo_pgsql \ + www/zendframework + +NO_BUILD= Yes +NO_REGRESS= Yes +PKG_ARCH= * + +PREFIX= /var/www +INSTDIR= ${PREFIX}/webacula +TINSTDIR= ${TRUEPREFIX}/webacula +SUBST_VARS= INSTDIR TINSTDIR + +do-install: + mv ${WRKSRC} ${INSTDIR} + ${SUBST_CMD} ${INSTDIR}/application/config.ini +.for i in install/webacula_mysql_create_database.sh \ + install/webacula_postgresql_create_database.sh \ + install/webacula_postgresql_make_tables.sh \ + application/config.ini + mv ${INSTDIR}/$i ${INSTDIR}/$i.dist +.endfor + ${SUBST_CMD} -c ${FILESDIR}/webacula.conf \ + ${INSTDIR}/webacula.conf.dist + ${SUBST_CMD} -c ${FILESDIR}/webacula-chroot-bconsole.sh \ + ${INSTDIR}/webacula-chroot-bconsole + find ${INSTDIR} -type f -name \*.orig -or -name \*.gitignore \ + -or -name \*.project -or -name \*.beforesubst | xargs rm + chown -R ${BINOWN}:${BINGRP} ${INSTDIR} + +.include diff --git a/www/webacula/distinfo b/www/webacula/distinfo new file mode 100644 index 00000000000..456e75a2256 --- /dev/null +++ b/www/webacula/distinfo @@ -0,0 +1,5 @@ +MD5 (webacula-5.0.3.tar.gz) = CjuR41079VRX9MeLOILCwg== +RMD160 (webacula-5.0.3.tar.gz) = 547z1TuRTW40n+rLgN9p15RYMMY= +SHA1 (webacula-5.0.3.tar.gz) = o/o/AaRqrCuWrLwixmJbVJcH/ag= +SHA256 (webacula-5.0.3.tar.gz) = X1+/Dkae4MW/skFu7oyaocpYd12bjrrAHN2HzzW3hMg= +SIZE (webacula-5.0.3.tar.gz) = 425748 diff --git a/www/webacula/files/webacula-chroot-bconsole.sh b/www/webacula/files/webacula-chroot-bconsole.sh new file mode 100644 index 00000000000..6aa65e069b9 --- /dev/null +++ b/www/webacula/files/webacula-chroot-bconsole.sh @@ -0,0 +1,50 @@ +#!/bin/sh +# +# make bconsole(8) available in Apache chroot(8) + +# WARNING: /var/www/bin/sh , /var/www/usr/libexec/ld.so and +# /var/www/lib/* make be shared by other executables in the chroot(8) + +if [ "$(id -u)" -ne 0 ]; then + echo " *** Error: need root privileges to run this script" + exit 1 +fi + +do_enable() { + mkdir -p /var/www{${SYSCONFDIR}/bacula,/usr/lib,/usr/libexec,${LOCALBASE}/{lib,sbin}} + cp -p ${LOCALBASE}/sbin/bconsole /var/www${LOCALBASE}/sbin + cp -p ${SYSCONFDIR}/bacula/bconsole.conf /var/www${SYSCONFDIR}/bacula/ + for i in $(ldd ${LOCALBASE}/sbin/bconsole | grep 'lib/' | awk '{ print $7 }') ; do \ + cp -p $i /var/www$i + done + cp -p /bin/sh /var/www/bin/ + cp -p /usr/libexec/ld.so /var/www/usr/libexec/ + chown -R www /var/www${SYSCONFDIR}/bacula/ /var/www${LOCALBASE}/sbin/bconsole + chmod 0500 /var/www${SYSCONFDIR}/bacula/ + chmod 0100 /var/www${LOCALBASE}/sbin/bconsole + chmod 0400 /var/www${SYSCONFDIR}/bacula/bconsole.conf +} + +do_disable() { + rm -rf /var/www${SYSCONFDIR}/bacula \ + /var/www/usr/local/sbin/bconsole \ + /var/www/usr/libexec/ld.so \ + /var/www/bin/sh + for i in $(ldd ${LOCALBASE}/sbin/bconsole | grep 'lib/' | awk '{ print $7 }') ; do \ + rm -f /var/www/$(echo $i | sed -e 's,\.so.*,,')* + done + rmdir /var/www{/etc,${LOCALBASE}/{lib,sbin},${LOCALBASE},/usr/lib,/usr/libexec,/usr} 2>/dev/null +} + +case $1 in +enable) + do_disable + do_enable + ;; +disable) + do_disable + ;; +*) + echo "usage: ${0##*/} {enable|disable}" + ;; +esac diff --git a/www/webacula/files/webacula.conf b/www/webacula/files/webacula.conf new file mode 100644 index 00000000000..a4820ea6cf8 --- /dev/null +++ b/www/webacula/files/webacula.conf @@ -0,0 +1,19 @@ +Alias /webacula ${TINSTDIR}/html + + + php_value max_execution_time 3600 + + + + RewriteEngine on + Options FollowSymLinks + AllowOverride All + Order deny,allow + # allow authenticated users access from LAN and localhost + Allow from 127.0.0.1 + Allow from 192.168.255.0/255.255.255.0 + AuthType Basic + AuthName "Webacula" + AuthUserFile /var/www/conf/webacula.users + Require valid-user + diff --git a/www/webacula/patches/patch-application_config_ini b/www/webacula/patches/patch-application_config_ini new file mode 100644 index 00000000000..47d9a6fd2ee --- /dev/null +++ b/www/webacula/patches/patch-application_config_ini @@ -0,0 +1,38 @@ +$OpenBSD: patch-application_config_ini,v 1.1.1.1 2011/03/21 18:01:09 ajacoutot Exp $ +--- application/config.ini.orig Mon Mar 21 15:13:26 2011 ++++ application/config.ini Mon Mar 21 15:15:41 2011 +@@ -10,20 +10,20 @@ db.config.host = localhost + db.config.username = root + db.config.password = + db.config.dbname = bacula +-;; for Sqlite db.config.dbname = "/full patch/bacula.db" ++;; for Sqlite db.config.dbname = "/full_path_to/bacula.db" + + ;; see http://www.php.net/timezones + ; def.timezone = "UTC" +-def.timezone = "Europe/Minsk" ++def.timezone = "Europe/London" + + ;; if locale undefined, webacula use autodetect + ;; avaliable locales : en, de, fr, pt_BR, ru, it, es + ; locale = "en" + + ;; see INSTALL file for details +-bacula.sudo = "/usr/bin/sudo" +-bacula.bconsole = "/sbin/bconsole" +-bacula.bconsolecmd = "-n -c /etc/bacula/bconsole.conf" ++bacula.sudo = "" ++bacula.bconsole = "${LOCALBASE}/sbin/bconsole" ++bacula.bconsolecmd = "-n -c ${SYSCONFDIR}/bacula/bconsole.conf" + + ;; Directory "tmpdir" which will be saved the file, which contains a list of files to restore. + ;; This directory and files in it should be available to read the Director service. +@@ -73,7 +73,7 @@ db.config.host = localhost + db.config.username = wbuser + db.config.password = "wbpass" + db.config.dbname = webacula +-;; for Sqlite db.config.dbname = "/var/lib/sqlite/webacula.db" ++;; for Sqlite db.config.dbname = "/var/db/sqlite/webacula.db" + + email.to_admin = root@localhost + email.from = webacula@localhost diff --git a/www/webacula/patches/patch-html_index_php b/www/webacula/patches/patch-html_index_php new file mode 100644 index 00000000000..7bb3149e0e8 --- /dev/null +++ b/www/webacula/patches/patch-html_index_php @@ -0,0 +1,11 @@ +$OpenBSD: patch-html_index_php,v 1.1.1.1 2011/03/21 18:01:09 ajacoutot Exp $ +--- html/index.php.orig Mon Mar 21 14:34:46 2011 ++++ html/index.php Mon Mar 21 14:35:23 2011 +@@ -34,6 +34,7 @@ if ( APPLICATION_ENV == 'development') { + // PATH_SEPARATOR ":" + set_include_path('.' . PATH_SEPARATOR . '../library' . PATH_SEPARATOR . '../application/models/' . + PATH_SEPARATOR . '../application/forms/' . ++ PATH_SEPARATOR . '/zendframework/' . + PATH_SEPARATOR . get_include_path() ); + + include "Zend/Loader.php"; diff --git a/www/webacula/patches/patch-install_webacula_postgresql_create_database_sh b/www/webacula/patches/patch-install_webacula_postgresql_create_database_sh new file mode 100644 index 00000000000..b3373aa3b1e --- /dev/null +++ b/www/webacula/patches/patch-install_webacula_postgresql_create_database_sh @@ -0,0 +1,14 @@ +$OpenBSD: patch-install_webacula_postgresql_create_database_sh,v 1.1.1.1 2011/03/21 18:01:09 ajacoutot Exp $ +--- install/webacula_postgresql_create_database.sh.orig Mon Mar 21 12:16:46 2011 ++++ install/webacula_postgresql_create_database.sh Mon Mar 21 12:17:02 2011 +@@ -12,8 +12,8 @@ db_name="webacula" + db_user="wbuser" + db_password="wbpass" + +-psql -f - -d template1 $* </webacula/ + +*** WARNING! +By default *anyone* can access the webacula interface. +A sample commented configuration for http basic authentication is +available in /var/www/conf/modules.sample/webacula.conf and you are +STRONGLY ADVISED to enable and edit it to your needs. + +Bacula messages configuration +----------------------------- + +To show messages of the Job output, you must change the "catalog' line +from the "Messages" block in ${SYSCONFDIR}/bacula/bacula-dir.conf to +read: + catalog = all, !skipped, !saved + +i.e. +Messages { + Name = Standard + + catalog = all, !skipped, !saved +} + +The reload bacula-dir(8): + # /etc/rc.d/bacula_dir reload diff --git a/www/webacula/pkg/UNMESSAGE b/www/webacula/pkg/UNMESSAGE new file mode 100644 index 00000000000..28ba2067fe0 --- /dev/null +++ b/www/webacula/pkg/UNMESSAGE @@ -0,0 +1,10 @@ +To completely deinstall webacula you need to perform the following steps +as root: + # rm -f /var/www/conf/modules/webacula.conf + # ${INSTDIR}/webacula-chroot-bconsole disable + +*** WARNING *** +/var/www/bin/sh, /var/www/usr/libexec/ld.so and files under +/var/www/lib/ may be shared by other executable(s) in the chroot(8), so +when running 'webacula-chroot-bconsole disable', make sure nothing else +uses these files or you will need to reinstall them manually