From f5674a8b57fe48d470fae283ac3d3c259f8aa9c7 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Wed, 7 Jul 2010 14:27:11 -0700 Subject: Apache integration. --- usr/src/libpiny/lib/Piny/Repo.pm | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'usr/src/libpiny/lib') diff --git a/usr/src/libpiny/lib/Piny/Repo.pm b/usr/src/libpiny/lib/Piny/Repo.pm index 55e8007..5ad7007 100644 --- a/usr/src/libpiny/lib/Piny/Repo.pm +++ b/usr/src/libpiny/lib/Piny/Repo.pm @@ -143,6 +143,20 @@ has 'ikiwiki_cgipath' => , init_arg => undef ); +has 'secure_path' => + ( is => 'ro' + , isa => 'Str' + , lazy_build => 1 + , init_arg => undef + ); + +has 'apache_config' => + ( is => 'ro' + , isa => 'Str' + , lazy_build => 1 + , init_arg => undef + ); + # Public methods sub add_access { @@ -185,6 +199,8 @@ sub _rename_repo { $s->clear_ikiwiki_cgiurl; $s->clear_ikiwiki_historyurl; $s->clear_ikiwiki_cgipath; + $s->clear_secure_path; + $s->clear_apache_config; }; sub _set_description { @@ -362,10 +378,16 @@ sub _build_ikiwiki_cgiurl { return "https://secure.piny.be/repos/" . $s->name . "/ikiwiki.cgi"; }; +sub _build_secure_path { + my ( $s ) = @_; + + return "/srv/www/secure.piny.be/repos/" . $s->name; +}; + sub _build_ikiwiki_cgipath { my ( $s ) = @_; - return "/srv/www/secure.piny.be/repos/" . $s->name . "/ikiwiki.cgi"; + return $s->secure_path . "/ikiwiki.cgi"; }; sub _build_ikiwiki_historyurl { @@ -380,6 +402,12 @@ sub _build_ikiwiki_diffurl { return "https://secure.piny.be/cgit/" . $s->name . "/diff/?id=[[sha1_commit]]"; }; +sub _build_apache_config { + my ( $s ) = @_; + + return "secure_path . ">\n AuthPAM_Enabled on\n AuthGROUP_Enabled on\n AuthPAM_FallThrough off\n AuthBasicAuthoritative off\n AuthType Basic\n AuthName \"User access to " . $s->name . " repository needed.\"\n Require group " . $s->group->name . "\n\n"; +}; + # Moose boilerplate __PACKAGE__->meta->make_immutable; -- cgit v1.2.3