From 3e4b807fbb96c65d4007269203d0234ca96f3cde Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 20 May 2014 01:55:47 +0000 Subject: [PATCH] added the sample httpd/dav configuration file --- codepot/README | 18 ++++++++++++++-- codepot/codepot.spec.in | 1 + codepot/configure | 3 ++- codepot/configure.ac | 1 + codepot/etc/Makefile.am | 10 +++++++-- codepot/etc/Makefile.in | 40 ++++++++++++++++++++++++------------ codepot/etc/codepot.httpd.in | 24 ++++++++++++++++++++++ codepot/etc/codepot.ini.in | 8 ++++---- 8 files changed, 83 insertions(+), 22 deletions(-) create mode 100644 codepot/etc/codepot.httpd.in diff --git a/codepot/README b/codepot/README index c4f62293..b5ea3f60 100644 --- a/codepot/README +++ b/codepot/README @@ -5,9 +5,24 @@ CODEPOT subversion revision control system and wiki-based documentation, and supports authentication via LDAP. - INSTALLATION + An RPM package is provided for RedHat/CentOS Linux. The RPM package specifies + dependency which must met prior to or at the same time as the installation of + the rpm package. + + rpm -ivh codepot-X.X.X-X.noarch.rpm + + You can use the yum utility to be hassle-free instead. + + yum localinstall --nogpgcheck codepot-X.X.X-X.noarch.rpm + + You should perform the following tasks after the RPM installation. + + * Initialize the mysql database using /etc/codepot/codepot.mysql. + * Configure /etc/httpd/conf.d/codepot.conf + * Configure /etc/codepot/codepot.ini + Here is how to install Codepot into the standard locations under Ubuntu Linux. * Install required packages. @@ -29,7 +44,6 @@ INSTALLATION * Enable the apache server modules $ sudo a2enmod php5 $ sudo a2enmod authnz_ldap # enable ldap-based authentication - $ sudo a2enmod auth_mysql # enable mysql-based authentication $ sudo a2enmod dav_svn $ sudo a2enmod userdir # to enable $HOME/public_html $ sudo /etc/init.d/apache2 restart diff --git a/codepot/codepot.spec.in b/codepot/codepot.spec.in index 1e484884..836177a6 100644 --- a/codepot/codepot.spec.in +++ b/codepot/codepot.spec.in @@ -44,6 +44,7 @@ rm -rf $RPM_BUILD_ROOT /usr/sbin/codepot-user %config(noreplace) /etc/codepot/codepot.ini +%config(noreplace) /etc/httpd/conf.d/codepot.conf /etc/codepot/codepot.mysql /etc/codepot/codepot.a2ldap /etc/codepot/start-commit diff --git a/codepot/configure b/codepot/configure index ee545124..38c6e6de 100755 --- a/codepot/configure +++ b/codepot/configure @@ -2544,7 +2544,7 @@ cachedir=$cachedir - ac_config_files="$ac_config_files Makefile codepot.spec etc/Makefile etc/codepot.ini etc/codepot.a2ldap etc/start-commit etc/post-commit etc/pre-revprop-change etc/post-revprop-change sbin/Makefile sbin/codepot-user DEBIAN/Makefile DEBIAN/control DEBIAN/postinst DEBIAN/postrm src/config.php src/codepot/config/Makefile src/codepot/controllers/Makefile src/codepot/errors/Makefile src/codepot/helpers/Makefile src/codepot/hooks/Makefile src/codepot/language/english/Makefile src/codepot/language/indonesian/Makefile src/codepot/language/korean/Makefile src/codepot/language/Makefile src/codepot/libraries/Makefile src/codepot/models/Makefile src/codepot/views/Makefile src/codepot/Makefile src/css/images/Makefile src/css/Makefile src/js/prettify/Makefile src/js/Makefile src/system/cache/Makefile src/system/codeigniter/Makefile src/system/database/drivers/mssql/Makefile src/system/database/drivers/mysql/Makefile src/system/database/drivers/mysqli/Makefile src/system/database/drivers/oci8/Makefile src/system/database/drivers/odbc/Makefile src/system/database/drivers/postgre/Makefile src/system/database/drivers/sqlite/Makefile src/system/database/drivers/Makefile src/system/database/Makefile src/system/fonts/Makefile src/system/helpers/Makefile src/system/language/english/Makefile src/system/language/korean/Makefile src/system/language/Makefile src/system/libraries/Makefile src/system/logs/Makefile src/system/plugins/Makefile src/system/scaffolding/images/Makefile src/system/scaffolding/views/Makefile src/system/scaffolding/Makefile src/system/Makefile src/Makefile" + ac_config_files="$ac_config_files Makefile codepot.spec etc/Makefile etc/codepot.ini etc/codepot.a2ldap etc/codepot.httpd etc/start-commit etc/post-commit etc/pre-revprop-change etc/post-revprop-change sbin/Makefile sbin/codepot-user DEBIAN/Makefile DEBIAN/control DEBIAN/postinst DEBIAN/postrm src/config.php src/codepot/config/Makefile src/codepot/controllers/Makefile src/codepot/errors/Makefile src/codepot/helpers/Makefile src/codepot/hooks/Makefile src/codepot/language/english/Makefile src/codepot/language/indonesian/Makefile src/codepot/language/korean/Makefile src/codepot/language/Makefile src/codepot/libraries/Makefile src/codepot/models/Makefile src/codepot/views/Makefile src/codepot/Makefile src/css/images/Makefile src/css/Makefile src/js/prettify/Makefile src/js/Makefile src/system/cache/Makefile src/system/codeigniter/Makefile src/system/database/drivers/mssql/Makefile src/system/database/drivers/mysql/Makefile src/system/database/drivers/mysqli/Makefile src/system/database/drivers/oci8/Makefile src/system/database/drivers/odbc/Makefile src/system/database/drivers/postgre/Makefile src/system/database/drivers/sqlite/Makefile src/system/database/drivers/Makefile src/system/database/Makefile src/system/fonts/Makefile src/system/helpers/Makefile src/system/language/english/Makefile src/system/language/korean/Makefile src/system/language/Makefile src/system/libraries/Makefile src/system/logs/Makefile src/system/plugins/Makefile src/system/scaffolding/images/Makefile src/system/scaffolding/views/Makefile src/system/scaffolding/Makefile src/system/Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -3076,6 +3076,7 @@ do "etc/Makefile" ) CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "etc/codepot.ini" ) CONFIG_FILES="$CONFIG_FILES etc/codepot.ini" ;; "etc/codepot.a2ldap" ) CONFIG_FILES="$CONFIG_FILES etc/codepot.a2ldap" ;; + "etc/codepot.httpd" ) CONFIG_FILES="$CONFIG_FILES etc/codepot.httpd" ;; "etc/start-commit" ) CONFIG_FILES="$CONFIG_FILES etc/start-commit" ;; "etc/post-commit" ) CONFIG_FILES="$CONFIG_FILES etc/post-commit" ;; "etc/pre-revprop-change" ) CONFIG_FILES="$CONFIG_FILES etc/pre-revprop-change" ;; diff --git a/codepot/configure.ac b/codepot/configure.ac index 36aed3eb..ffd6116c 100644 --- a/codepot/configure.ac +++ b/codepot/configure.ac @@ -86,6 +86,7 @@ AC_CONFIG_FILES([ etc/Makefile etc/codepot.ini etc/codepot.a2ldap + etc/codepot.httpd etc/start-commit etc/post-commit etc/pre-revprop-change diff --git a/codepot/etc/Makefile.am b/codepot/etc/Makefile.am index 1c43fe99..64b15053 100644 --- a/codepot/etc/Makefile.am +++ b/codepot/etc/Makefile.am @@ -1,10 +1,16 @@ cfgdir=$(CFGDIR) -cfg_DATA = codepot.ini codepot.mysql codepot.a2ldap +cfg_DATA = codepot.ini codepot.mysql codepot.a2ldap cfg_SCRIPTS = start-commit pre-commit post-commit pre-revprop-change post-revprop-change perldir=$(CFGDIR)/perl/Codepot perl_SCRIPTS=perl/Codepot/AccessHandler.pm perl/Codepot/AuthenHandler.pm -EXTRA_DIST = $(cfg_DATA) $(cfg_SCRIPTS) $(perl_SCRIPTS) +EXTRA_DIST = $(cfg_DATA) $(cfg_SCRIPTS) $(perl_SCRIPTS) + +install-data-hook: + $(INSTALL) -D -m 0644 "@abs_top_builddir@/etc/codepot.httpd" "$(DESTDIR)@sysconfdir@/httpd/conf.d/codepot.conf" + +uninstall-hook: + $(RM) -f "$(DESTDIR)@sysconfdir@/httpd/conf.d/codepot.conf" diff --git a/codepot/etc/Makefile.in b/codepot/etc/Makefile.in index b7e3f9bf..c7887d12 100644 --- a/codepot/etc/Makefile.in +++ b/codepot/etc/Makefile.in @@ -37,8 +37,9 @@ PRE_UNINSTALL = : POST_UNINSTALL = : subdir = etc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/codepot.a2ldap.in $(srcdir)/codepot.ini.in \ - $(srcdir)/post-commit.in $(srcdir)/post-revprop-change.in \ + $(srcdir)/codepot.a2ldap.in $(srcdir)/codepot.httpd.in \ + $(srcdir)/codepot.ini.in $(srcdir)/post-commit.in \ + $(srcdir)/post-revprop-change.in \ $(srcdir)/pre-revprop-change.in $(srcdir)/start-commit.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/ac/m4/as-ac-expand.m4 \ @@ -47,8 +48,9 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/./config.h -CONFIG_CLEAN_FILES = codepot.ini codepot.a2ldap start-commit \ - post-commit pre-revprop-change post-revprop-change +CONFIG_CLEAN_FILES = codepot.ini codepot.a2ldap codepot.httpd \ + start-commit post-commit pre-revprop-change \ + post-revprop-change am__installdirs = "$(DESTDIR)$(cfgdir)" "$(DESTDIR)$(perldir)" \ "$(DESTDIR)$(cfgdir)" cfgSCRIPT_INSTALL = $(INSTALL_SCRIPT) @@ -148,11 +150,11 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ wwwdir = @wwwdir@ -cfg_DATA = codepot.ini codepot.mysql codepot.a2ldap +cfg_DATA = codepot.ini codepot.mysql codepot.a2ldap cfg_SCRIPTS = start-commit pre-commit post-commit pre-revprop-change post-revprop-change perldir = $(CFGDIR)/perl/Codepot perl_SCRIPTS = perl/Codepot/AccessHandler.pm perl/Codepot/AuthenHandler.pm -EXTRA_DIST = $(cfg_DATA) $(cfg_SCRIPTS) $(perl_SCRIPTS) +EXTRA_DIST = $(cfg_DATA) $(cfg_SCRIPTS) $(perl_SCRIPTS) all: all-am .SUFFIXES: @@ -189,6 +191,8 @@ codepot.ini: $(top_builddir)/config.status $(srcdir)/codepot.ini.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ codepot.a2ldap: $(top_builddir)/config.status $(srcdir)/codepot.a2ldap.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +codepot.httpd: $(top_builddir)/config.status $(srcdir)/codepot.httpd.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ start-commit: $(top_builddir)/config.status $(srcdir)/start-commit.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ post-commit: $(top_builddir)/config.status $(srcdir)/post-commit.in @@ -339,6 +343,8 @@ info-am: install-data-am: install-cfgDATA install-cfgSCRIPTS \ install-perlSCRIPTS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: @@ -366,18 +372,26 @@ ps-am: uninstall-am: uninstall-cfgDATA uninstall-cfgSCRIPTS uninstall-info-am \ uninstall-perlSCRIPTS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-cfgDATA install-cfgSCRIPTS \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-man install-perlSCRIPTS \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-cfgDATA uninstall-cfgSCRIPTS uninstall-info-am \ - uninstall-perlSCRIPTS + install-data install-data-am install-data-hook install-exec \ + install-exec-am install-info install-info-am install-man \ + install-perlSCRIPTS install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ + uninstall-am uninstall-cfgDATA uninstall-cfgSCRIPTS \ + uninstall-hook uninstall-info-am uninstall-perlSCRIPTS + +install-data-hook: + $(INSTALL) -D -m 0644 "@abs_top_builddir@/etc/codepot.httpd" "$(DESTDIR)@sysconfdir@/httpd/conf.d/codepot.conf" + +uninstall-hook: + $(RM) -f "$(DESTDIR)@sysconfdir@/httpd/conf.d/codepot.conf" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/codepot/etc/codepot.httpd.in b/codepot/etc/codepot.httpd.in new file mode 100644 index 00000000..e9155efe --- /dev/null +++ b/codepot/etc/codepot.httpd.in @@ -0,0 +1,24 @@ +# +# This file contains sample configuration to enable subversion +# webdav access. The actual configuration can be more complex +# than this file depending on your requirement. +# + + + DAV svn + SVNParentPath "@DEPOTDIR@/svnrepo" + #SVNListParentPath on + + PerlAccessHandler Codepot::AccessHandler + PerlAuthenHandler Codepot::AuthenHandler + PerlSetEnv CODEPOT_CONFIG_FILE /etc/codepot/codepot.ini + + # Uncomment SSLRequireSSL below to disallow non-SSL access. + # Note that SSL must be enabled site-wide to use it. + # SSLRequireSSL + + AuthType Basic + AuthName "@PACKAGE@" + require valid-user + + diff --git a/codepot/etc/codepot.ini.in b/codepot/etc/codepot.ini.in index 692c36cc..99f78514 100644 --- a/codepot/etc/codepot.ini.in +++ b/codepot/etc/codepot.ini.in @@ -37,7 +37,7 @@ database_prefix = "" ;------------------------------------------------------------------------------ ldap_server_uri = "ldap://127.0.0.1:389" ldap_server_protocol_version = "3" -ldap_auth_mode 1 +ldap_auth_mode = 2 ldap_userid_format = "cn=${userid},ou=users,dc=codepot,dc=org" ldap_password_format = "${password}" ldap_admin_binddn = "cn=admin,dc=codepot,dc=org" @@ -74,7 +74,7 @@ https_compulsory = "no" https_url = "https://${SERVER_NAME}${REQUEST_URI}" ;------------------------------------------------------------------------------ -; API base URL +; API base URL (Deprecated as of v0.1.2. Not useful anymore) ;------------------------------------------------------------------------------ api_base_url = "http://127.0.0.1" @@ -93,8 +93,8 @@ svn_base_url = "${REQUEST_PROTOCOL}://${SERVER_NAME}:${SERVER_PORT}/svn" ;------------------------------------------------------------------------------ ; Login model to use. ;------------------------------------------------------------------------------ -login_model = "LdapLoginModel" -#login_model = "DbLoginModel" +#login_model = "LdapLoginModel" +login_model = "DbLoginModel" ;------------------------------------------------------------------------------ ; Comma separated list of system administrator IDs