mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
commit
a25853203e
4
.gitignore
vendored
4
.gitignore
vendored
@ -10,6 +10,10 @@ test/js/npm-debug.log
|
|||||||
|
|
||||||
# ./configure output
|
# ./configure output
|
||||||
config.log
|
config.log
|
||||||
|
autom4te.cache
|
||||||
|
autoscan*
|
||||||
|
config.status
|
||||||
|
Makefile
|
||||||
|
|
||||||
# cmd tester
|
# cmd tester
|
||||||
test/php/bin/extcmd_test
|
test/php/bin/extcmd_test
|
||||||
|
23
Makefile.in
23
Makefile.in
@ -6,29 +6,34 @@ INSTALL=@INSTALL@
|
|||||||
INSTALL_OPTS=@INSTALL_OPTS@
|
INSTALL_OPTS=@INSTALL_OPTS@
|
||||||
INSTALL_OPTS_WEB=@INSTALL_OPTS_WEB@
|
INSTALL_OPTS_WEB=@INSTALL_OPTS_WEB@
|
||||||
|
|
||||||
|
default:
|
||||||
|
@echo "Icinga2Web make targets: "
|
||||||
|
@printf "%b" " -install:\t\t\tInstall the application and overwrite configs\n"
|
||||||
|
@printf "%b" " -update:\t\t\tInstall the application without touching the configs\n"
|
||||||
|
@printf "%b" " -install-apache-config:\tInstall the apache configuration\n"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Installs the whole application w\o httpd configurations
|
# Installs the whole application w\o httpd configurations
|
||||||
#
|
#
|
||||||
install: install-static-files install-runtime-dirs
|
install: install-static-files install-runtime-dirs
|
||||||
|
|
||||||
|
update: install-application
|
||||||
#
|
#
|
||||||
# Removes files created by ./configure
|
# Removes files created by ./configure
|
||||||
#
|
#
|
||||||
clean:
|
clean:
|
||||||
if [ -f ./public/.htaccess ];then \
|
|
||||||
rm ./public/.htaccess; \
|
|
||||||
fi; \
|
fi; \
|
||||||
if [ -f ./Makefile ];then \
|
if [ -f ./Makefile ];then \
|
||||||
rm ./Makefile; \
|
rm ./Makefile; \
|
||||||
fi; \
|
fi; \
|
||||||
if [ -f ./etc/apache/cranberry.conf ];then \
|
if [ -f ./etc/apache/icinga2web.conf ];then \
|
||||||
rm ./etc/apache/cranberry.conf; \
|
rm ./etc/apache/icinga2web.conf; \
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Installs/copies all static files (executables, scripts, html, etc)
|
# Installs/copies all static files (executables, scripts, html, etc)
|
||||||
#
|
#
|
||||||
install-static-files: install-application copy-folder-public copy-folder-config
|
install-static-files: install-application copy-web-files-public copy-web-files-config copy-web-files-modules
|
||||||
$(INSTALL) -m 644 $(INSTALL_OPTS) "./public/.htaccess" $(DESTDIR)$(prefix)/public/.htaccess;
|
$(INSTALL) -m 644 $(INSTALL_OPTS) "./public/.htaccess" $(DESTDIR)$(prefix)/public/.htaccess;
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -45,13 +50,13 @@ install-tests: copy-folder-tests
|
|||||||
#
|
#
|
||||||
# Install configurations for apache2
|
# Install configurations for apache2
|
||||||
#
|
#
|
||||||
install-apache-configs:
|
install-apache-config:
|
||||||
$(INSTALL) -m 644 $(INSTALL_OPTS) "./etc/apache/cranberry.conf" $(WWW_CONF_PATH)/cranberry.conf;
|
$(INSTALL) -m 644 $(INSTALL_OPTS) "./etc/apache/icinga2web.conf" $(WWW_CONF_PATH)/icinga2web.conf;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Installs the php files to the prefix
|
# Installs the php files to the prefix
|
||||||
#
|
#
|
||||||
install-application: copy-php-files-application copy-php-files-library
|
install-application: copy-web-files-application copy-web-files-library
|
||||||
|
|
||||||
#
|
#
|
||||||
# Rule for coying folders and containing files (arbitary types), hidden files are excluded
|
# Rule for coying folders and containing files (arbitary types), hidden files are excluded
|
||||||
@ -74,7 +79,7 @@ copy-folder-%:
|
|||||||
#
|
#
|
||||||
# Rule for copying only php, *html, js and ini files. Hidden files are ignored
|
# Rule for copying only php, *html, js and ini files. Hidden files are ignored
|
||||||
#
|
#
|
||||||
copy-php-files-%:
|
copy-web-files-%:
|
||||||
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/$*
|
$(INSTALL) -m 755 $(INSTALL_OPTS) -d $(DESTDIR)$(prefix)/$*
|
||||||
|
|
||||||
@dirs=`find ./$* -mindepth 1 -type d `;\
|
@dirs=`find ./$* -mindepth 1 -type d `;\
|
||||||
|
65
aclocal.m4
vendored
Executable file
65
aclocal.m4
vendored
Executable file
@ -0,0 +1,65 @@
|
|||||||
|
AC_DEFUN([AC_USER_GUESS],[
|
||||||
|
$2=$3
|
||||||
|
for x in $1; do
|
||||||
|
AC_MSG_CHECKING([if user $x exists])
|
||||||
|
AS_IF([ $GREP -q "^$x:" /etc/passwd ],
|
||||||
|
[ AC_MSG_RESULT([found]); $2=$x ; break],
|
||||||
|
[ AC_MSG_RESULT([not found]) ])
|
||||||
|
done
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([AC_CHECK_PHP_MODULE],[
|
||||||
|
for x in $1;do
|
||||||
|
AC_MSG_CHECKING([if php has $x module])
|
||||||
|
AS_IF([ php -m | $GREP -iq "^$x$" ],
|
||||||
|
[ AC_MSG_RESULT([found]) ],
|
||||||
|
[ AC_MSG_ERROR([not found])])
|
||||||
|
done
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([AC_CHECK_PHP_VERSION],[
|
||||||
|
AC_MSG_CHECKING([if php has at least version $1.$2.$3])
|
||||||
|
AS_IF([ test $1 -le `php -r 'echo PHP_MAJOR_VERSION;'` && \
|
||||||
|
test $2 -le `php -r 'echo PHP_MINOR_VERSION;'` && \
|
||||||
|
test $3 -le `php -r 'echo PHP_RELEASE_VERSION;'`],
|
||||||
|
[ AC_MSG_RESULT([PHP version is correct])],
|
||||||
|
[ AC_MSG_ERROR([You need at least PHP version $1.$2.$3])])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([AC_CHECK_PHP_INCLUDE],[
|
||||||
|
AC_MSG_CHECKING([if PHP runtime dependency '$2' is available])
|
||||||
|
AS_IF([ php -r 'require "$1";' ],
|
||||||
|
[ AC_MSG_RESULT([PHP runtime dependency fulfilled])],
|
||||||
|
[ AC_MSG_ERROR([PHP runtime dependency '$2' is missing])])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([AC_GROUP_GUESS],[
|
||||||
|
$2=$3
|
||||||
|
for x in $1; do
|
||||||
|
AC_MSG_CHECKING([if group $x exists])
|
||||||
|
AS_IF([ $GREP -q "^$x:" /etc/group ],
|
||||||
|
[ AC_MSG_RESULT([found]); $2=$x ; break],
|
||||||
|
[ AC_MSG_RESULT([not found]) ])
|
||||||
|
done
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([AC_CHECK_BIN], [
|
||||||
|
AC_PATH_PROG([$1],[$2],[not found])
|
||||||
|
|
||||||
|
AS_IF([ test "XX${$1}" == "XXnot found" ],
|
||||||
|
[ AC_MSG_WARN([binary $2 not found in PATH]) ])
|
||||||
|
|
||||||
|
test "XX${$1}" == "XXnot found" && $1=""
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
AC_DEFUN([AC_PATH_GUESS], [
|
||||||
|
$2=$3
|
||||||
|
for x in $1; do
|
||||||
|
AC_MSG_CHECKING([if path $x exists])
|
||||||
|
AS_IF([test -d $x],
|
||||||
|
[AC_MSG_RESULT([found]); $2=$x; break],
|
||||||
|
[AC_MSG_RESULT([not found])]
|
||||||
|
)
|
||||||
|
done
|
||||||
|
])
|
24
config/authentication.ini.in
Normal file
24
config/authentication.ini.in
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
[ldap-authentication]
|
||||||
|
backend=ldap
|
||||||
|
hostname=@ldap_host@
|
||||||
|
port=@ldap_port@
|
||||||
|
root_dn='@ldap_rootdn@'
|
||||||
|
bind_dn='@ldap_binddn@'
|
||||||
|
bind_pw=@ldap_bindpass@
|
||||||
|
|
||||||
|
; Attributes for ldap user lookup
|
||||||
|
user.ldap_object_class=@ldap_user_objectclass@
|
||||||
|
user.ldap_name_attribute=@ldap_attribute_username@
|
||||||
|
user.password_attribute=@ldap_attribute_password@
|
||||||
|
group.ldap_object_class=@ldap_group_objectclass@
|
||||||
|
group.ldap_name_attribute=@ldap_attribute_groupname@
|
||||||
|
|
||||||
|
[internal-authentication]
|
||||||
|
backend=db
|
||||||
|
type=@internal_db_type@
|
||||||
|
host=@internal_db_host@
|
||||||
|
port=@internal_db_port@
|
||||||
|
database=@internal_db_name@
|
||||||
|
user=@internal_db_user@
|
||||||
|
password=@internal_db_pass@
|
||||||
|
|
25
config/backends.ini.in
Normal file
25
config/backends.ini.in
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
[localdb]
|
||||||
|
type = ido
|
||||||
|
host = @ido_host@
|
||||||
|
port = @ido_port@
|
||||||
|
user = @ido_user@
|
||||||
|
pass = @ido_password@
|
||||||
|
db = @ido_database@
|
||||||
|
@ido_enabled@
|
||||||
|
|
||||||
|
[locallive]
|
||||||
|
type = livestatus
|
||||||
|
socket = @livestatus_socket@
|
||||||
|
@livestatus_enabled@
|
||||||
|
|
||||||
|
[localfile]
|
||||||
|
type = statusdat
|
||||||
|
status_file = @statusdat_file@
|
||||||
|
objects_file = @objects_cache_file@
|
||||||
|
@statusdat_enabled@
|
||||||
|
|
||||||
|
;[localfailsafe]
|
||||||
|
;enabled=false
|
||||||
|
;type = combo
|
||||||
|
;backends = localdb, locallive, localfile
|
||||||
|
|
541
configure.ac
541
configure.ac
@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
|
|
||||||
AC_PREREQ([2.61])
|
AC_PREREQ([2.61])
|
||||||
AC_INIT([Cranberry], [0.0.1], [])
|
AC_INIT([Icinga2Web], [0.0.1], [])
|
||||||
AC_PREFIX_DEFAULT(/usr/local/i2)
|
AC_PREFIX_DEFAULT(/usr/local/icinga2-web)
|
||||||
|
|
||||||
if test "x$prefix" = "xNONE" ; then
|
if test "x$prefix" = "xNONE" ; then
|
||||||
installDir="/usr/local/i2"
|
installDir="/usr/local/icinga2-web"
|
||||||
prefix=$installDir
|
prefix=$installDir
|
||||||
else
|
else
|
||||||
installDir=$prefix
|
installDir=$prefix
|
||||||
@ -31,7 +31,16 @@ AC_CHECK_PHP_MODULE([sockets json])
|
|||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
|
|
||||||
|
|
||||||
|
AC_ARG_WITH([icinga2web_config_path],
|
||||||
|
AS_HELP_STRING([--with-icinga2web-config-path], [Configuration path for icinga ]),
|
||||||
|
icinga2web_config_path="'$withval'",
|
||||||
|
icinga2web_config_path="'$prefix/config/'"
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
# Users for webfiles
|
# Users for webfiles
|
||||||
|
#
|
||||||
|
|
||||||
AC_ARG_WITH([web_user],
|
AC_ARG_WITH([web_user],
|
||||||
AS_HELP_STRING([--with-web-user=USER], [username for web writable files (default www-data)]),
|
AS_HELP_STRING([--with-web-user=USER], [username for web writable files (default www-data)]),
|
||||||
web_user=$withval,
|
web_user=$withval,
|
||||||
@ -51,11 +60,15 @@ AC_ARG_WITH([web_path],
|
|||||||
)
|
)
|
||||||
|
|
||||||
AC_ARG_WITH([www_conf_path],
|
AC_ARG_WITH([www_conf_path],
|
||||||
AS_HELP_STRING([--with-http-configuration-path=PATH], [Include folder apache2 (default /etc/apache2/conf.d]),
|
AS_HELP_STRING([--with-http-configuration-path=PATH], [Include folder apache2 (default /etc/apache2/conf.d)]),
|
||||||
www_conf_path=$withval,
|
www_conf_path=$withval,
|
||||||
www_conf_path=AC_PATH_GUESS([/etc/httpd/conf.d /etc/apache2/conf.d /etc/apache/conf.d], [www_conf_path], [/etc/apache2/conf.d])
|
www_conf_path=AC_PATH_GUESS([/etc/httpd/conf.d /etc/apache2/conf.d /etc/apache/conf.d], [www_conf_path], [/etc/apache2/conf.d])
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Users and groups for installation
|
||||||
|
#
|
||||||
|
|
||||||
AC_ARG_WITH([bin_user],
|
AC_ARG_WITH([bin_user],
|
||||||
AS_HELP_STRING([--with-bin-user=USER], [user for all other files (default root)]),
|
AS_HELP_STRING([--with-bin-user=USER], [user for all other files (default root)]),
|
||||||
bin_user=$withval,
|
bin_user=$withval,
|
||||||
@ -68,10 +81,420 @@ AC_ARG_WITH([bin_group],
|
|||||||
bin_group=bin
|
bin_group=bin
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Internal database setup
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([internal_db_type],
|
||||||
|
AS_HELP_STRING([--with-internal-db-type=TYPE], [database type to use for internal database (default mysql, supported: pgsql, mysql)]),
|
||||||
|
internal_db_type=$withval,
|
||||||
|
internal_db_type=mysql
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([internal_db_name],
|
||||||
|
AS_HELP_STRING([--with-internal-db-name=NAME], [database name to use for internal database (default icinga2web)]),
|
||||||
|
internal_db_name=$withval,
|
||||||
|
internal_db_name=icinga2web
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([internal_db_host],
|
||||||
|
AS_HELP_STRING([--with-internal-db-host=HOST], [database host to use for internal database (default localhost)]),
|
||||||
|
internal_db_host=$withval,
|
||||||
|
internal_db_host=localhost
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([internal_db_port],
|
||||||
|
AS_HELP_STRING([--with-internal-db-port=PORT], [database port to use for internal database (default: 3306 for mysql, 5432 for pgsql)]),
|
||||||
|
internal_db_port=$withval,
|
||||||
|
internal_db_port=db_default_port
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([internal_db_pass],
|
||||||
|
AS_HELP_STRING([--with-internal-db-pass=PASS], [database pass to use for internal database (default icinga2web)]),
|
||||||
|
internal_db_pass=$withval,
|
||||||
|
internal_db_pass=icinga2web
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([internal_db_user],
|
||||||
|
AS_HELP_STRING([--with-internal-db-user=USER], [database user to use for internal database (default icinga2web)]),
|
||||||
|
internal_db_user=$withval,
|
||||||
|
internal_db_user=icinga2web
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Authorization method
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([internal_authentication],
|
||||||
|
AC_HELP_STRING([--with-internal-authentication], [use the internal database for authentication (default: yes)]),
|
||||||
|
internal_authentication=yes,
|
||||||
|
internal_authentication=def
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_authentication],
|
||||||
|
AC_HELP_STRING([--with-ldap-authentication], [use a ldap server for authentication (default: no)]),
|
||||||
|
ldap_authentication=yes,
|
||||||
|
ldap_authentication=no
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# LDAP Authorization
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_host],
|
||||||
|
AS_HELP_STRING([--with-ldap-host=HOST], [host to use for authentication via ldap (default localhost)]),
|
||||||
|
ldap_host=$withval,
|
||||||
|
ldap_host=localhost
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_port],
|
||||||
|
AS_HELP_STRING([--with-ldap-port=PORT], [port to use for authentication via ldap (default 389)]),
|
||||||
|
ldap_port=$withval,
|
||||||
|
ldap_port=389
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_binddn],
|
||||||
|
AS_HELP_STRING([--with-ldap-binddn=DN], [dn to use for retrieving user information via ldap (default cn=admin, cn=config)]),
|
||||||
|
ldap_binddn=$withval,
|
||||||
|
ldap_binddn=["cn=Manager, ou=icinga, ou=org"]
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_bindpass],
|
||||||
|
AS_HELP_STRING([--with-ldap-bindpass=PASS], [password to use for retrieving user information via ldap (default admin)]),
|
||||||
|
ldap_bindpass=$withval,
|
||||||
|
ldap_bindpass=["secret"]
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_rootdn],
|
||||||
|
AS_HELP_STRING([--with-ldap-rootdn=LDAP_ATTRIBUTE], [root dn to use for user lookup (default ou=people, dc=icinga, dc=org)]),
|
||||||
|
ldap_rootdn=$withval,
|
||||||
|
ldap_rootdn=["ou=people, dc=icinga, dc=org"]
|
||||||
|
)
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
>>>>>>> Add Autoconf based installation with most parameters
|
||||||
|
AC_ARG_WITH([ldap_user_objectclass],
|
||||||
|
AS_HELP_STRING([--with-ldap-user-objectclass=LDAP_OBJECT_CLASS], [ldap object class to use for user authentication (default: inetOrgPerson)]),
|
||||||
|
ldap_user_objectclass=$withval,
|
||||||
|
ldap_user_objectclass="inetOrgPerson"
|
||||||
|
<<<<<<< HEAD
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_attribute_username],
|
||||||
|
AS_HELP_STRING([--with-ldap-attribute-username=LDAP_ATTRIBUTE], [user attribute to use for the username (default: uid)]),
|
||||||
|
=======
|
||||||
|
AC_ARG_WITH([ldap_user_class],
|
||||||
|
AS_HELP_STRING([--with-ldap-attribute-username=LDAP_ATTRIBUTE], [user object type to use for the authentication (defaults inetOrgPerson)]),
|
||||||
|
ldap_user_class=$withval,
|
||||||
|
ldap_user_class="inetOrgPerson"
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_attribute_username],
|
||||||
|
AS_HELP_STRING([--with-ldap-attribute-username=LDAP_ATTRIBUTE], [user attribute to use for the username (defaults uid)]),
|
||||||
|
>>>>>>> ws-jmosshammer:icinga2-web moja$ git commit
|
||||||
|
=======
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_attribute_username],
|
||||||
|
AS_HELP_STRING([--with-ldap-attribute-username=LDAP_ATTRIBUTE], [user attribute to use for the username (default: uid)]),
|
||||||
|
>>>>>>> Add Autoconf based installation with most parameters
|
||||||
|
ldap_attribute_username=$withval,
|
||||||
|
ldap_attribute_username="uid"
|
||||||
|
)
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
>>>>>>> Add Autoconf based installation with most parameters
|
||||||
|
AC_ARG_WITH([ldap_attribute_password],
|
||||||
|
AS_HELP_STRING([--with-ldap-attribute-password=LDAP_ATTRIBUTE], [user attribute to use for the password (default: password)]),
|
||||||
|
ldap_attribute_password=$withval,
|
||||||
|
ldap_attribute_password="password"
|
||||||
|
<<<<<<< HEAD
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_group_objectclass],
|
||||||
|
AS_HELP_STRING([--with-ldap-group-objectclass=LDAP_ATTRIBUTE], [ldap object type to use for group authentication (default: inetOrgPerson)]),
|
||||||
|
ldap_group_objectclass=$withval,
|
||||||
|
ldap_group_objectclass="group"
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_attribute_groupname],
|
||||||
|
AS_HELP_STRING([--with-ldap-attribute-groupname=LDAP_OBJECT_CLASS], [user object type to use for the authentication (default: inetOrgPerson)]),
|
||||||
|
ldap_attribute_groupname=$withval,
|
||||||
|
ldap_attribute_groupname="guid"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Icinga backend selection
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([icinga_backend],
|
||||||
|
AS_HELP_STRING([--with-icinga-backend=(ido, statusdat, livestatus)], [backend to use for rb (default: statusdat)]),
|
||||||
|
icinga_backend=$withval,
|
||||||
|
icinga_backend="statusdat"
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Ido settings
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_db_type],
|
||||||
|
AS_HELP_STRING([--with-ido-db-type=(mysql, pgsql)], [database engine to use for retrieving data from the ido db (default: mysql)]),
|
||||||
|
ido_db_type=$withval,
|
||||||
|
ido_db_type="statusdat"
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_host],
|
||||||
|
AS_HELP_STRING([--with-ido-host=HOST], [host to use for retrieving data from the ido db (default: localhost)]),
|
||||||
|
ido_host=$withval,
|
||||||
|
ido_host="localhost"
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_port],
|
||||||
|
AS_HELP_STRING([--with-ido-port=PORT], [backend to use for retrieving data from the ido db (default: 3306 for mysql. 5432 for pgsql)]),
|
||||||
|
ido_port=$withval,
|
||||||
|
ido_port=db_default_port
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_database],
|
||||||
|
AS_HELP_STRING([--with-ido-database=DATABASE], [database name to use for retrieving data from the ido db (default: icinga)]),
|
||||||
|
ido_database=$withval,
|
||||||
|
ido_database="icinga"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_user],
|
||||||
|
AS_HELP_STRING([--with-ido-host=USER], [user to use for retrieving data from the ido db (default: icinga)]),
|
||||||
|
ido_user=$withval,
|
||||||
|
ido_user="icinga"
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_password],
|
||||||
|
AS_HELP_STRING([--with-ido-password=PASSWORD], [password to use for retrieving data from the ido db (default: icinga)]),
|
||||||
|
ido_password=$withval,
|
||||||
|
ido_password="icinga"
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Statusdat file location
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([statusdat_file],
|
||||||
|
AS_HELP_STRING([--with-statusdat-file=FILE], [location of the status.dat file when retrieving data from status.dat (default: /usr/local/icinga/var/status.dat)]),
|
||||||
|
statusdat_file=$withval,
|
||||||
|
statusdat_file="/usr/local/icinga/var/status.dat"
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([objects_cache_file],
|
||||||
|
AS_HELP_STRING([--with-objects-file=FILE], [location of the objects.cache file when retrieving data from status.dat (default: /usr/local/icinga/var/objects.cache)]),
|
||||||
|
objects_cache_file=$withval,
|
||||||
|
objects_cache_file="/usr/local/icinga/var/objects.cache"
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Livestatus connection
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([livestatus_socket],
|
||||||
|
AS_HELP_STRING([--with-livestatus-socket=FILE], [location of the livestatus socket (default: /usr/local/icinga/var/rw/live)]),
|
||||||
|
livestatus_socket=$withval,
|
||||||
|
livestatus_socket="/usr/local/icinga/var/rw/live"
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Icinga commandpipe
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([icinga_commandpipe],
|
||||||
|
AS_HELP_STRING([--with-icinga-commandpipe=FILE], [location of the command pipe used for sending commands (default: /usr/local/icinga/var/rw/icinga.cmd)]),
|
||||||
|
icinga_commandpipe=$withval,
|
||||||
|
icinga_commandpipe="/usr/local/icinga/var/rw/icinga.cmd"
|
||||||
|
)
|
||||||
|
=======
|
||||||
|
AC_ARG_WITH([ldap_attribute_firstname],
|
||||||
|
AS_HELP_STRING([--with-ldap-attribute-firstname=LDAP_ATTRIBUTE], [user attribute to use for the firstname (defaults firstname)]),
|
||||||
|
ldap_attribute_firstname=$withval,
|
||||||
|
ldap_attribute_firstname="firstname"
|
||||||
|
=======
|
||||||
|
>>>>>>> Add Autoconf based installation with most parameters
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_group_objectclass],
|
||||||
|
AS_HELP_STRING([--with-ldap-group-objectclass=LDAP_ATTRIBUTE], [ldap object type to use for group authentication (default: inetOrgPerson)]),
|
||||||
|
ldap_group_objectclass=$withval,
|
||||||
|
ldap_group_objectclass="group"
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ldap_attribute_groupname],
|
||||||
|
AS_HELP_STRING([--with-ldap-attribute-groupname=LDAP_OBJECT_CLASS], [user object type to use for the authentication (default: inetOrgPerson)]),
|
||||||
|
ldap_attribute_groupname=$withval,
|
||||||
|
ldap_attribute_groupname="guid"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Icinga backend selection
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([icinga_backend],
|
||||||
|
AS_HELP_STRING([--with-icinga-backend=(ido, statusdat, livestatus)], [backend to use for rb (default: statusdat)]),
|
||||||
|
icinga_backend=$withval,
|
||||||
|
icinga_backend="statusdat"
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Ido settings
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_db_type],
|
||||||
|
AS_HELP_STRING([--with-ido-db-type=(mysql, pgsql)], [database engine to use for retrieving data from the ido db (default: mysql)]),
|
||||||
|
ido_db_type=$withval,
|
||||||
|
ido_db_type="statusdat"
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_host],
|
||||||
|
AS_HELP_STRING([--with-ido-host=HOST], [host to use for retrieving data from the ido db (default: localhost)]),
|
||||||
|
ido_host=$withval,
|
||||||
|
ido_host="localhost"
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_port],
|
||||||
|
AS_HELP_STRING([--with-ido-port=PORT], [backend to use for retrieving data from the ido db (default: 3306 for mysql. 5432 for pgsql)]),
|
||||||
|
ido_port=$withval,
|
||||||
|
ido_port=db_default_port
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_database],
|
||||||
|
AS_HELP_STRING([--with-ido-database=DATABASE], [database name to use for retrieving data from the ido db (default: icinga)]),
|
||||||
|
ido_database=$withval,
|
||||||
|
ido_database="icinga"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_user],
|
||||||
|
AS_HELP_STRING([--with-ido-host=USER], [user to use for retrieving data from the ido db (default: icinga)]),
|
||||||
|
ido_user=$withval,
|
||||||
|
ido_user="icinga"
|
||||||
|
)
|
||||||
|
|
||||||
|
AC_ARG_WITH([ido_password],
|
||||||
|
AS_HELP_STRING([--with-ido-password=PASSWORD], [password to use for retrieving data from the ido db (default: icinga)]),
|
||||||
|
ido_password=$withval,
|
||||||
|
ido_password="icinga"
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Statusdat file location
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([statusdat_file],
|
||||||
|
AS_HELP_STRING([--with-statusdat-file=FILE], [location of the status.dat file when retrieving data from status.dat (default: /usr/local/icinga/var/status.dat)]),
|
||||||
|
statusdat_file=$withval,
|
||||||
|
statusdat_file="/usr/local/icinga/var/status.dat"
|
||||||
|
)
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
>>>>>>> ws-jmosshammer:icinga2-web moja$ git commit
|
||||||
|
=======
|
||||||
|
AC_ARG_WITH([objects_cache_file],
|
||||||
|
AS_HELP_STRING([--with-objects-file=FILE], [location of the objects.cache file when retrieving data from status.dat (default: /usr/local/icinga/var/objects.cache)]),
|
||||||
|
objects_cache_file=$withval,
|
||||||
|
objects_cache_file="/usr/local/icinga/var/objects.cache"
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Livestatus connection
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([livestatus_socket],
|
||||||
|
AS_HELP_STRING([--with-livestatus-socket=FILE], [location of the livestatus socket (default: /usr/local/icinga/var/rw/live)]),
|
||||||
|
livestatus_socket=$withval,
|
||||||
|
livestatus_socket="/usr/local/icinga/var/rw/live"
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Icinga commandpipe
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_ARG_WITH([icinga_commandpipe],
|
||||||
|
AS_HELP_STRING([--with-icinga-commandpipe=FILE], [location of the command pipe used for sending commands (default: /usr/local/icinga/var/rw/icinga.cmd)]),
|
||||||
|
icinga_commandpipe=$withval,
|
||||||
|
icinga_commandpipe="/usr/local/icinga/var/rw/icinga.cmd"
|
||||||
|
)
|
||||||
|
>>>>>>> Add Autoconf based installation with most parameters
|
||||||
|
|
||||||
# Installation options
|
# Installation options
|
||||||
INSTALL_OPTS="-o $bin_user -g $bin_group"
|
INSTALL_OPTS="-o $bin_user -g $bin_group"
|
||||||
INSTALL_OPTS_WEB="-o $web_user -g $web_group"
|
INSTALL_OPTS_WEB="-o $web_user -g $web_group"
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
>>>>>>> Add Autoconf based installation with most parameters
|
||||||
|
AS_IF([test "x$internal_db_type" = xmysql], [
|
||||||
|
AC_CHECK_PHP_INCLUDE([Zend/Db/Adapter/Pdo/Mysql.php],[Zend Framework - MySQL PDO Adapter])
|
||||||
|
AC_CHECK_PHP_MODULE([mysql])
|
||||||
|
AS_IF([test "x$internal_db_port" == xdb_default_port], [internal_db_port=3306])
|
||||||
|
])
|
||||||
|
|
||||||
|
AS_IF([test "x$ido_db_type" = xmysql], [
|
||||||
|
AC_CHECK_PHP_INCLUDE([Zend/Db/Adapter/Pdo/Mysql.php],[Zend Framework - MySQL PDO Adapter])
|
||||||
|
AC_CHECK_PHP_MODULE([mysql])
|
||||||
|
AS_IF([test "x$ido_port" = xdb_default_port], [ido_port=3306])
|
||||||
|
])
|
||||||
|
|
||||||
|
AS_IF([test "x$internal_db_type" = xpgsql], [
|
||||||
|
AC_CHECK_PHP_INCLUDE([Zend/Db/Adapter/Pdo/Pgsql.php],[Zend Framework - PostgreSQL PDO Adapter])
|
||||||
|
AC_CHECK_PHP_MODULE([pgsql])
|
||||||
|
AS_IF([test "x$internal_db_port" = xdb_default_port], [internal_db_port=5432])
|
||||||
|
])
|
||||||
|
|
||||||
|
AS_IF([test "x$ido_db_type" = xpgsql], [
|
||||||
|
AC_CHECK_PHP_INCLUDE([Zend/Db/Adapter/Pdo/Pgsql.php],[Zend Framework - PostgreSQL PDO Adapter])
|
||||||
|
AC_CHECK_PHP_MODULE([pgsql])
|
||||||
|
AS_IF([test "x$ido_port" = xdb_default_port], [ido_port=5432])
|
||||||
|
])
|
||||||
|
|
||||||
|
# comment out the disabled backends per default
|
||||||
|
ido_enabled="disable=1"
|
||||||
|
statusdat_enabled="disable=1"
|
||||||
|
livestatus_enabled="disable=1"
|
||||||
|
ldap_enabled="disable=1"
|
||||||
|
|
||||||
|
AS_CASE([$icinga_backend],
|
||||||
|
["ido"], [ido_enabled=""],
|
||||||
|
["statusdat"], [statusdat_enabled=""],
|
||||||
|
["livestatus"], [livestatus_enabled=""],
|
||||||
|
[statusdat_enabled=""])
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
AS_IF([test "x$ldap_authentication" != xno],
|
||||||
|
AC_CHECK_PHP_MODULE([ldap])
|
||||||
|
ldap_enabled=""
|
||||||
|
)
|
||||||
|
=======
|
||||||
|
=======
|
||||||
|
>>>>>>> Add Autoconf based installation with most parameters
|
||||||
|
|
||||||
|
AS_IF([test "x$ldap_authentication" != xno],
|
||||||
|
<<<<<<< HEAD
|
||||||
|
AC_CHECK_PHP_MODULE([ldap]))
|
||||||
|
>>>>>>> ws-jmosshammer:icinga2-web moja$ git commit
|
||||||
|
=======
|
||||||
|
AC_CHECK_PHP_MODULE([ldap])
|
||||||
|
ldap_enabled=""
|
||||||
|
)
|
||||||
|
>>>>>>> Add Autoconf based installation with most parameters
|
||||||
|
|
||||||
|
# Installation directives
|
||||||
AC_SUBST(app_name)
|
AC_SUBST(app_name)
|
||||||
AC_SUBST(web_user)
|
AC_SUBST(web_user)
|
||||||
AC_SUBST(web_group)
|
AC_SUBST(web_group)
|
||||||
@ -79,6 +502,112 @@ AC_SUBST(web_path)
|
|||||||
AC_SUBST(www_conf_path)
|
AC_SUBST(www_conf_path)
|
||||||
AC_SUBST(bin_user)
|
AC_SUBST(bin_user)
|
||||||
AC_SUBST(bin_group)
|
AC_SUBST(bin_group)
|
||||||
|
AC_SUBST(icinga2web_config_path)
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
# Internal db setup
|
||||||
|
AC_SUBST(internal_db_type)
|
||||||
|
AC_SUBST(internal_db_name)
|
||||||
|
AC_SUBST(internal_db_host)
|
||||||
|
AC_SUBST(internal_db_port)
|
||||||
|
AC_SUBST(internal_db_user)
|
||||||
|
AC_SUBST(internal_db_pass)
|
||||||
|
|
||||||
|
# ldap setup
|
||||||
|
AC_SUBST(ldap_host)
|
||||||
|
AC_SUBST(ldap_port)
|
||||||
|
AC_SUBST(ldap_rootdn)
|
||||||
|
AC_SUBST(ldap_binddn)
|
||||||
|
AC_SUBST(ldap_bindpass)
|
||||||
|
AC_SUBST(ldap_user_objectclass)
|
||||||
|
AC_SUBST(ldap_attribute_basedn)
|
||||||
|
AC_SUBST(ldap_attribute_username)
|
||||||
|
AC_SUBST(ldap_attribute_password)
|
||||||
|
AC_SUBST(ldap_group_objectclass)
|
||||||
|
AC_SUBST(ldap_attribute_groupname)
|
||||||
|
|
||||||
|
# backend setup
|
||||||
|
AC_SUBST(icinga_backend)
|
||||||
|
|
||||||
|
# ido backend variables
|
||||||
|
AC_SUBST(ido_db_type)
|
||||||
|
AC_SUBST(ido_host)
|
||||||
|
AC_SUBST(ido_port)
|
||||||
|
AC_SUBST(ido_database)
|
||||||
|
AC_SUBST(ido_user)
|
||||||
|
AC_SUBST(ido_password)
|
||||||
|
|
||||||
|
# status.dat backend
|
||||||
|
AC_SUBST(statusdat_file)
|
||||||
|
AC_SUBST(objects_cache_file)
|
||||||
|
|
||||||
|
# livestatus backend
|
||||||
|
AC_SUBST(livestatus_socket)
|
||||||
|
|
||||||
|
# command pipe
|
||||||
|
AC_SUBST(icinga_commandpipe)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Comment placeholders for toggling backends
|
||||||
|
#
|
||||||
|
AC_SUBST(livestatus_enabled)
|
||||||
|
AC_SUBST(statusdat_enabled)
|
||||||
|
AC_SUBST(ido_enabled)
|
||||||
|
AC_SUBST(ldap_enabled)
|
||||||
|
=======
|
||||||
|
>>>>>>> Add Autoconf based installation with most parameters
|
||||||
|
|
||||||
|
# Internal db setup
|
||||||
|
AC_SUBST(internal_db_type)
|
||||||
|
AC_SUBST(internal_db_name)
|
||||||
|
AC_SUBST(internal_db_host)
|
||||||
|
AC_SUBST(internal_db_port)
|
||||||
|
AC_SUBST(internal_db_user)
|
||||||
|
AC_SUBST(internal_db_pass)
|
||||||
|
|
||||||
|
# ldap setup
|
||||||
|
AC_SUBST(ldap_host)
|
||||||
|
AC_SUBST(ldap_port)
|
||||||
|
AC_SUBST(ldap_rootdn)
|
||||||
|
AC_SUBST(ldap_binddn)
|
||||||
|
AC_SUBST(ldap_bindpass)
|
||||||
|
AC_SUBST(ldap_user_objectclass)
|
||||||
|
AC_SUBST(ldap_attribute_basedn)
|
||||||
|
AC_SUBST(ldap_attribute_username)
|
||||||
|
AC_SUBST(ldap_attribute_password)
|
||||||
|
AC_SUBST(ldap_group_objectclass)
|
||||||
|
AC_SUBST(ldap_attribute_groupname)
|
||||||
|
|
||||||
|
# backend setup
|
||||||
|
AC_SUBST(icinga_backend)
|
||||||
|
|
||||||
|
# ido backend variables
|
||||||
|
AC_SUBST(ido_db_type)
|
||||||
|
AC_SUBST(ido_host)
|
||||||
|
AC_SUBST(ido_port)
|
||||||
|
AC_SUBST(ido_database)
|
||||||
|
AC_SUBST(ido_user)
|
||||||
|
AC_SUBST(ido_password)
|
||||||
|
|
||||||
|
# status.dat backend
|
||||||
|
AC_SUBST(statusdat_file)
|
||||||
|
AC_SUBST(objects_cache_file)
|
||||||
|
|
||||||
|
# livestatus backend
|
||||||
|
AC_SUBST(livestatus_socket)
|
||||||
|
|
||||||
|
# command pipe
|
||||||
|
AC_SUBST(icinga_commandpipe)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Comment placeholders for toggling backends
|
||||||
|
#
|
||||||
|
AC_SUBST(livestatus_enabled)
|
||||||
|
AC_SUBST(statusdat_enabled)
|
||||||
|
AC_SUBST(ido_enabled)
|
||||||
|
AC_SUBST(ldap_enabled)
|
||||||
|
|
||||||
AC_SUBST(PHP)
|
AC_SUBST(PHP)
|
||||||
AC_SUBST(INSTALL_OPTS)
|
AC_SUBST(INSTALL_OPTS)
|
||||||
@ -86,7 +615,9 @@ AC_SUBST(INSTALL_OPTS_WEB)
|
|||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
etc/apache/cranberry.conf
|
config/authentication.ini
|
||||||
|
config/backends.ini
|
||||||
|
public/index.php
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
46
doc/installation.md
Normal file
46
doc/installation.md
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
## configure && make
|
||||||
|
|
||||||
|
### Basic installation
|
||||||
|
|
||||||
|
If you like to configurea and install icinga2-web from the command line or
|
||||||
|
if you want to create packages, configure and make is the best choice for installation.
|
||||||
|
|
||||||
|
|
||||||
|
`
|
||||||
|
./configure && make install && make install-apache2-config
|
||||||
|
`
|
||||||
|
will install the application to the default target (/usr/local/icinga2-web). Also
|
||||||
|
an apache configuration entry is added to your apache server, so you should restart
|
||||||
|
your web server according to your systems configuration.
|
||||||
|
|
||||||
|
### Installation directory
|
||||||
|
|
||||||
|
If you want to install the application to a different directory, use the --prefix flag in your
|
||||||
|
configure call:
|
||||||
|
`
|
||||||
|
./configure --prefix=/my/target/directory
|
||||||
|
`
|
||||||
|
|
||||||
|
### Authentication
|
||||||
|
|
||||||
|
By default, icinga2-web will be installed to authenticate againts its internal database,
|
||||||
|
but you can configure it to use ldap-authentication by adding the `--with-ldap-authentication`
|
||||||
|
flag. You must provide the authentication details for your ldap server by using the --with-ldap-* flags.
|
||||||
|
To see a full list of the flags, call `./configure --help`
|
||||||
|
|
||||||
|
### Icinga backend
|
||||||
|
|
||||||
|
The default option for icinga2web is to configure all icinga backends with the default settings (for example
|
||||||
|
/usr/local/icinga/ as the icinga directory) but only enable statusdat. To use a different backend,
|
||||||
|
call `--with-icinga-backend=` and provide ido, livestatus or statusdat as an option. To further configure
|
||||||
|
your backend, take a look at the various options described in `./configure --help`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Quick and Dirty
|
||||||
|
----------------
|
||||||
|
|
||||||
|
tdb.
|
520
install-sh
Executable file
520
install-sh
Executable file
@ -0,0 +1,520 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# install - install a program, script, or datafile
|
||||||
|
|
||||||
|
scriptversion=2009-04-28.21; # UTC
|
||||||
|
|
||||||
|
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||||
|
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||||
|
# following copyright and license.
|
||||||
|
#
|
||||||
|
# Copyright (C) 1994 X Consortium
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to
|
||||||
|
# deal in the Software without restriction, including without limitation the
|
||||||
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
# sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in
|
||||||
|
# all copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||||
|
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||||
|
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
# Except as contained in this notice, the name of the X Consortium shall not
|
||||||
|
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||||
|
# ings in this Software without prior written authorization from the X Consor-
|
||||||
|
# tium.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# FSF changes to this file are in the public domain.
|
||||||
|
#
|
||||||
|
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||||
|
# `make' implicit rules from creating a file called install from it
|
||||||
|
# when there is no Makefile.
|
||||||
|
#
|
||||||
|
# This script is compatible with the BSD install script, but was written
|
||||||
|
# from scratch.
|
||||||
|
|
||||||
|
nl='
|
||||||
|
'
|
||||||
|
IFS=" "" $nl"
|
||||||
|
|
||||||
|
# set DOITPROG to echo to test this script
|
||||||
|
|
||||||
|
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||||
|
doit=${DOITPROG-}
|
||||||
|
if test -z "$doit"; then
|
||||||
|
doit_exec=exec
|
||||||
|
else
|
||||||
|
doit_exec=$doit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Put in absolute file names if you don't have them in your path;
|
||||||
|
# or use environment vars.
|
||||||
|
|
||||||
|
chgrpprog=${CHGRPPROG-chgrp}
|
||||||
|
chmodprog=${CHMODPROG-chmod}
|
||||||
|
chownprog=${CHOWNPROG-chown}
|
||||||
|
cmpprog=${CMPPROG-cmp}
|
||||||
|
cpprog=${CPPROG-cp}
|
||||||
|
mkdirprog=${MKDIRPROG-mkdir}
|
||||||
|
mvprog=${MVPROG-mv}
|
||||||
|
rmprog=${RMPROG-rm}
|
||||||
|
stripprog=${STRIPPROG-strip}
|
||||||
|
|
||||||
|
posix_glob='?'
|
||||||
|
initialize_posix_glob='
|
||||||
|
test "$posix_glob" != "?" || {
|
||||||
|
if (set -f) 2>/dev/null; then
|
||||||
|
posix_glob=
|
||||||
|
else
|
||||||
|
posix_glob=:
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
'
|
||||||
|
|
||||||
|
posix_mkdir=
|
||||||
|
|
||||||
|
# Desired mode of installed file.
|
||||||
|
mode=0755
|
||||||
|
|
||||||
|
chgrpcmd=
|
||||||
|
chmodcmd=$chmodprog
|
||||||
|
chowncmd=
|
||||||
|
mvcmd=$mvprog
|
||||||
|
rmcmd="$rmprog -f"
|
||||||
|
stripcmd=
|
||||||
|
|
||||||
|
src=
|
||||||
|
dst=
|
||||||
|
dir_arg=
|
||||||
|
dst_arg=
|
||||||
|
|
||||||
|
copy_on_change=false
|
||||||
|
no_target_directory=
|
||||||
|
|
||||||
|
usage="\
|
||||||
|
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||||
|
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||||
|
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||||
|
or: $0 [OPTION]... -d DIRECTORIES...
|
||||||
|
|
||||||
|
In the 1st form, copy SRCFILE to DSTFILE.
|
||||||
|
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||||
|
In the 4th, create DIRECTORIES.
|
||||||
|
|
||||||
|
Options:
|
||||||
|
--help display this help and exit.
|
||||||
|
--version display version info and exit.
|
||||||
|
|
||||||
|
-c (ignored)
|
||||||
|
-C install only if different (preserve the last data modification time)
|
||||||
|
-d create directories instead of installing files.
|
||||||
|
-g GROUP $chgrpprog installed files to GROUP.
|
||||||
|
-m MODE $chmodprog installed files to MODE.
|
||||||
|
-o USER $chownprog installed files to USER.
|
||||||
|
-s $stripprog installed files.
|
||||||
|
-t DIRECTORY install into DIRECTORY.
|
||||||
|
-T report an error if DSTFILE is a directory.
|
||||||
|
|
||||||
|
Environment variables override the default commands:
|
||||||
|
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||||
|
RMPROG STRIPPROG
|
||||||
|
"
|
||||||
|
|
||||||
|
while test $# -ne 0; do
|
||||||
|
case $1 in
|
||||||
|
-c) ;;
|
||||||
|
|
||||||
|
-C) copy_on_change=true;;
|
||||||
|
|
||||||
|
-d) dir_arg=true;;
|
||||||
|
|
||||||
|
-g) chgrpcmd="$chgrpprog $2"
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
--help) echo "$usage"; exit $?;;
|
||||||
|
|
||||||
|
-m) mode=$2
|
||||||
|
case $mode in
|
||||||
|
*' '* | *' '* | *'
|
||||||
|
'* | *'*'* | *'?'* | *'['*)
|
||||||
|
echo "$0: invalid mode: $mode" >&2
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
-o) chowncmd="$chownprog $2"
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
-s) stripcmd=$stripprog;;
|
||||||
|
|
||||||
|
-t) dst_arg=$2
|
||||||
|
shift;;
|
||||||
|
|
||||||
|
-T) no_target_directory=true;;
|
||||||
|
|
||||||
|
--version) echo "$0 $scriptversion"; exit $?;;
|
||||||
|
|
||||||
|
--) shift
|
||||||
|
break;;
|
||||||
|
|
||||||
|
-*) echo "$0: invalid option: $1" >&2
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
*) break;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||||
|
# When -d is used, all remaining arguments are directories to create.
|
||||||
|
# When -t is used, the destination is already specified.
|
||||||
|
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||||
|
for arg
|
||||||
|
do
|
||||||
|
if test -n "$dst_arg"; then
|
||||||
|
# $@ is not empty: it contains at least $arg.
|
||||||
|
set fnord "$@" "$dst_arg"
|
||||||
|
shift # fnord
|
||||||
|
fi
|
||||||
|
shift # arg
|
||||||
|
dst_arg=$arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test $# -eq 0; then
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
echo "$0: no input file specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# It's OK to call `install-sh -d' without argument.
|
||||||
|
# This can happen when creating conditional directories.
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dir_arg"; then
|
||||||
|
trap '(exit $?); exit' 1 2 13 15
|
||||||
|
|
||||||
|
# Set umask so as not to create temps with too-generous modes.
|
||||||
|
# However, 'strip' requires both read and write access to temps.
|
||||||
|
case $mode in
|
||||||
|
# Optimize common cases.
|
||||||
|
*644) cp_umask=133;;
|
||||||
|
*755) cp_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw='% 200'
|
||||||
|
fi
|
||||||
|
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||||
|
*)
|
||||||
|
if test -z "$stripcmd"; then
|
||||||
|
u_plus_rw=
|
||||||
|
else
|
||||||
|
u_plus_rw=,u+rw
|
||||||
|
fi
|
||||||
|
cp_umask=$mode$u_plus_rw;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
for src
|
||||||
|
do
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $src in
|
||||||
|
-*) src=./$src;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
dst=$src
|
||||||
|
dstdir=$dst
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
else
|
||||||
|
|
||||||
|
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||||
|
# might cause directories to be created, which would be especially bad
|
||||||
|
# if $src (and thus $dsttmp) contains '*'.
|
||||||
|
if test ! -f "$src" && test ! -d "$src"; then
|
||||||
|
echo "$0: $src does not exist." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -z "$dst_arg"; then
|
||||||
|
echo "$0: no destination specified." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
dst=$dst_arg
|
||||||
|
# Protect names starting with `-'.
|
||||||
|
case $dst in
|
||||||
|
-*) dst=./$dst;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# If destination is a directory, append the input filename; won't work
|
||||||
|
# if double slashes aren't ignored.
|
||||||
|
if test -d "$dst"; then
|
||||||
|
if test -n "$no_target_directory"; then
|
||||||
|
echo "$0: $dst_arg: Is a directory" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
dstdir=$dst
|
||||||
|
dst=$dstdir/`basename "$src"`
|
||||||
|
dstdir_status=0
|
||||||
|
else
|
||||||
|
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||||
|
dstdir=`
|
||||||
|
(dirname "$dst") 2>/dev/null ||
|
||||||
|
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||||
|
X"$dst" : 'X\(//\)[^/]' \| \
|
||||||
|
X"$dst" : 'X\(//\)$' \| \
|
||||||
|
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||||
|
echo X"$dst" |
|
||||||
|
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)[^/].*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\/\)$/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
/^X\(\/\).*/{
|
||||||
|
s//\1/
|
||||||
|
q
|
||||||
|
}
|
||||||
|
s/.*/./; q'
|
||||||
|
`
|
||||||
|
|
||||||
|
test -d "$dstdir"
|
||||||
|
dstdir_status=$?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
obsolete_mkdir_used=false
|
||||||
|
|
||||||
|
if test $dstdir_status != 0; then
|
||||||
|
case $posix_mkdir in
|
||||||
|
'')
|
||||||
|
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||||
|
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||||
|
umask=`umask`
|
||||||
|
case $stripcmd.$umask in
|
||||||
|
# Optimize common cases.
|
||||||
|
*[2367][2367]) mkdir_umask=$umask;;
|
||||||
|
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||||
|
|
||||||
|
*[0-7])
|
||||||
|
mkdir_umask=`expr $umask + 22 \
|
||||||
|
- $umask % 100 % 40 + $umask % 20 \
|
||||||
|
- $umask % 10 % 4 + $umask % 2
|
||||||
|
`;;
|
||||||
|
*) mkdir_umask=$umask,go-w;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# With -d, create the new directory with the user-specified mode.
|
||||||
|
# Otherwise, rely on $mkdir_umask.
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
mkdir_mode=-m$mode
|
||||||
|
else
|
||||||
|
mkdir_mode=
|
||||||
|
fi
|
||||||
|
|
||||||
|
posix_mkdir=false
|
||||||
|
case $umask in
|
||||||
|
*[123567][0-7][0-7])
|
||||||
|
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||||
|
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||||
|
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||||
|
|
||||||
|
if (umask $mkdir_umask &&
|
||||||
|
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
if test -z "$dir_arg" || {
|
||||||
|
# Check for POSIX incompatibilities with -m.
|
||||||
|
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||||
|
# other-writeable bit of parent directory when it shouldn't.
|
||||||
|
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||||
|
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||||
|
case $ls_ld_tmpdir in
|
||||||
|
d????-?r-*) different_mode=700;;
|
||||||
|
d????-?--*) different_mode=755;;
|
||||||
|
*) false;;
|
||||||
|
esac &&
|
||||||
|
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||||
|
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||||
|
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
then posix_mkdir=:
|
||||||
|
fi
|
||||||
|
rmdir "$tmpdir/d" "$tmpdir"
|
||||||
|
else
|
||||||
|
# Remove any dirs left behind by ancient mkdir implementations.
|
||||||
|
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||||
|
fi
|
||||||
|
trap '' 0;;
|
||||||
|
esac;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if
|
||||||
|
$posix_mkdir && (
|
||||||
|
umask $mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||||
|
)
|
||||||
|
then :
|
||||||
|
else
|
||||||
|
|
||||||
|
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||||
|
# or it failed possibly due to a race condition. Create the
|
||||||
|
# directory the slow way, step by step, checking for races as we go.
|
||||||
|
|
||||||
|
case $dstdir in
|
||||||
|
/*) prefix='/';;
|
||||||
|
-*) prefix='./';;
|
||||||
|
*) prefix='';;
|
||||||
|
esac
|
||||||
|
|
||||||
|
eval "$initialize_posix_glob"
|
||||||
|
|
||||||
|
oIFS=$IFS
|
||||||
|
IFS=/
|
||||||
|
$posix_glob set -f
|
||||||
|
set fnord $dstdir
|
||||||
|
shift
|
||||||
|
$posix_glob set +f
|
||||||
|
IFS=$oIFS
|
||||||
|
|
||||||
|
prefixes=
|
||||||
|
|
||||||
|
for d
|
||||||
|
do
|
||||||
|
test -z "$d" && continue
|
||||||
|
|
||||||
|
prefix=$prefix$d
|
||||||
|
if test -d "$prefix"; then
|
||||||
|
prefixes=
|
||||||
|
else
|
||||||
|
if $posix_mkdir; then
|
||||||
|
(umask=$mkdir_umask &&
|
||||||
|
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
test -d "$prefix" || exit 1
|
||||||
|
else
|
||||||
|
case $prefix in
|
||||||
|
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||||
|
*) qprefix=$prefix;;
|
||||||
|
esac
|
||||||
|
prefixes="$prefixes '$qprefix'"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
prefix=$prefix/
|
||||||
|
done
|
||||||
|
|
||||||
|
if test -n "$prefixes"; then
|
||||||
|
# Don't fail if two instances are running concurrently.
|
||||||
|
(umask $mkdir_umask &&
|
||||||
|
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||||
|
test -d "$dstdir" || exit 1
|
||||||
|
obsolete_mkdir_used=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -n "$dir_arg"; then
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||||
|
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||||
|
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||||
|
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||||
|
else
|
||||||
|
|
||||||
|
# Make a couple of temp file names in the proper directory.
|
||||||
|
dsttmp=$dstdir/_inst.$$_
|
||||||
|
rmtmp=$dstdir/_rm.$$_
|
||||||
|
|
||||||
|
# Trap to clean up those temp files at exit.
|
||||||
|
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||||
|
|
||||||
|
# Copy the file name to the temp name.
|
||||||
|
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||||
|
|
||||||
|
# and set any options; do chmod last to preserve setuid bits.
|
||||||
|
#
|
||||||
|
# If any of these fail, we abort the whole thing. If we want to
|
||||||
|
# ignore errors from any of these, just make sure not to ignore
|
||||||
|
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||||
|
#
|
||||||
|
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||||
|
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||||
|
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||||
|
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||||
|
|
||||||
|
# If -C, don't bother to copy if it wouldn't change the file.
|
||||||
|
if $copy_on_change &&
|
||||||
|
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||||
|
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||||
|
|
||||||
|
eval "$initialize_posix_glob" &&
|
||||||
|
$posix_glob set -f &&
|
||||||
|
set X $old && old=:$2:$4:$5:$6 &&
|
||||||
|
set X $new && new=:$2:$4:$5:$6 &&
|
||||||
|
$posix_glob set +f &&
|
||||||
|
|
||||||
|
test "$old" = "$new" &&
|
||||||
|
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
rm -f "$dsttmp"
|
||||||
|
else
|
||||||
|
# Rename the file to the real destination.
|
||||||
|
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||||
|
|
||||||
|
# The rename failed, perhaps because mv can't rename something else
|
||||||
|
# to itself, or perhaps because mv is so ancient that it does not
|
||||||
|
# support -f.
|
||||||
|
{
|
||||||
|
# Now remove or move aside any old file at destination location.
|
||||||
|
# We try this two ways since rm can't unlink itself on some
|
||||||
|
# systems and the destination file might be busy for other
|
||||||
|
# reasons. In this case, the final cleanup might fail but the new
|
||||||
|
# file should still install successfully.
|
||||||
|
{
|
||||||
|
test ! -f "$dst" ||
|
||||||
|
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||||
|
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||||
|
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||||
|
} ||
|
||||||
|
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||||
|
(exit 1); exit 1
|
||||||
|
}
|
||||||
|
} &&
|
||||||
|
|
||||||
|
# Now rename the file to the real destination.
|
||||||
|
$doit $mvcmd "$dsttmp" "$dst"
|
||||||
|
}
|
||||||
|
fi || exit 1
|
||||||
|
|
||||||
|
trap '' 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
|
# time-stamp-start: "scriptversion="
|
||||||
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
|
# time-stamp-time-zone: "UTC"
|
||||||
|
# time-stamp-end: "; # UTC"
|
||||||
|
# End:
|
10
public/index.php.in
Normal file
10
public/index.php.in
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
|
require_once dirname(__FILE__). '/../library/Icinga/Application/ApplicationBootstrap.php';
|
||||||
|
require_once dirname(__FILE__). '/../library/Icinga/Application/Web.php';
|
||||||
|
|
||||||
|
use Icinga\Application\Web;
|
||||||
|
|
||||||
|
Web::start(@icinga2web_config_path@)->dispatch();
|
Loading…
x
Reference in New Issue
Block a user