3 # Alias: Use multisite cookie auth
6 # Multisite provides a cookie based authentication which can be
7 # used as alternative to the default basic authentication.
8 # The cookie authentication is done by multisite. The cookie can
9 # also be used by other addons like NagVis. This is switched
17 echo "on: use cookie authentication"
18 echo "off: use basic authentication"
21 APACHE_CFG
=${OMD_ROOT}/etc
/apache
/conf.d
/cookie_auth.conf
22 NAGVIS_CFG
=${OMD_ROOT}/etc
/nagvis
/conf.d
/cookie_auth.ini.php
23 PNP_CFG
=${OMD_ROOT}/etc
/pnp4nagios
/config.d
/cookie_auth.php
24 WIKI_CFG
=${OMD_ROOT}/etc
/dokuwiki
/cookie_auth.php
25 if [ "$2" == "on" ]; then
26 cat > $APACHE_CFG <<EOF
27 <LocationMatch ^/${OMD_SITE}/(omd|wiki|nagvis|check_mk|pnp4nagios)>
34 cat > $NAGVIS_CFG <<EOF
36 logonmodule="LogonMultisite"
37 logon_multisite_htpasswd="/omd/sites/$OMD_SITE/etc/htpasswd"
38 logon_multisite_secret="/omd/sites/$OMD_SITE/etc/auth.secret"
39 logon_multisite_serials="/omd/sites/$OMD_SITE/etc/auth.serials"
44 // Created by OMD hook MULTISITE_COOKIE_AUTH
47 \$conf['authtype'] = 'multisite';
48 \$conf['superuser'] = '@admin';
49 \$conf['multisite']['authfile'] = '/omd/sites/$OMD_SITE/var/check_mk/wato/auth/auth.php';
50 \$conf['multisite']['auth_secret'] = '/omd/sites/$OMD_SITE/etc/auth.secret';
51 \$conf['multisite']['auth_serials'] = '/omd/sites/$OMD_SITE/etc/auth.serials';
52 \$conf['multisite']['htpasswd'] = '/omd/sites/$OMD_SITE/etc/htpasswd';
58 // Created by OMD hook MULTISITE_COOKIE_AUTH
60 // Using the multisite cookie based authentication when no
61 // REMOTE_USER available.
63 \$conf['auth_multisite_enabled'] = TRUE;
64 \$conf['auth_multisite_htpasswd'] = '/omd/sites/$OMD_SITE/etc/htpasswd';
65 \$conf['auth_multisite_secret'] = '/omd/sites/$OMD_SITE/etc/auth.secret';
66 \$conf['auth_multisite_serials'] = '/omd/sites/$OMD_SITE/etc/auth.serials';
67 \$conf['auth_multisite_login_url'] = '/$OMD_SITE/check_mk/login.py';
71 [ -f $APACHE_CFG ] && rm $APACHE_CFG
72 [ -f $NAGVIS_CFG ] && rm $NAGVIS_CFG
73 [ -f $PNP_CFG ] && rm $PNP_CFG
74 [ -f $WIKI_CFG ] && rm $WIKI_CFG