summaryrefslogtreecommitdiff
path: root/usr/src/libpiny
diff options
context:
space:
mode:
authorJulian Blake Kongslie <jblake@omgwallhack.org>2010-07-07 14:27:11 -0700
committerJulian Blake Kongslie <jblake@omgwallhack.org>2010-07-07 14:27:11 -0700
commitf5674a8b57fe48d470fae283ac3d3c259f8aa9c7 (patch)
tree2891a7f2e697c4ba4d99a2e38c116a6e25962419 /usr/src/libpiny
parentd21b1c4b1b2f8725cab456041d31f57baf94be89 (diff)
downloadpiny-code-f5674a8b57fe48d470fae283ac3d3c259f8aa9c7.tar.gz
piny-code-f5674a8b57fe48d470fae283ac3d3c259f8aa9c7.zip
Apache integration.
Diffstat (limited to 'usr/src/libpiny')
-rw-r--r--usr/src/libpiny/debian/changelog6
-rw-r--r--usr/src/libpiny/lib/Piny/Repo.pm30
2 files changed, 35 insertions, 1 deletions
diff --git a/usr/src/libpiny/debian/changelog b/usr/src/libpiny/debian/changelog
index cc6a89b..01b3a02 100644
--- a/usr/src/libpiny/debian/changelog
+++ b/usr/src/libpiny/debian/changelog
@@ -1,3 +1,9 @@
+libpiny-perl (0.8) unstable; urgency=low
+
+ * Added apache config stuff.
+
+ -- Julian Blake Kongslie <jblake@omgwallhack.org> Wed, 07 Jul 2010 14:26:38 -0700
+
libpiny-perl (0.7) unstable; urgency=low
* Lots more ikiwiki integration.
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 "<Directory " . $s->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</Directory>\n";
+};
+
# Moose boilerplate
__PACKAGE__->meta->make_immutable;