From 005e6985dca760bced6e6f2af5df4a0a5cadb0e3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 8 Mar 2017 14:02:31 -0400 Subject: added Apache.confEnabled --- src/Propellor/Property/Apache.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/Propellor/Property/Apache.hs b/src/Propellor/Property/Apache.hs index d912acc1..554a5837 100644 --- a/src/Propellor/Property/Apache.hs +++ b/src/Propellor/Property/Apache.hs @@ -64,6 +64,24 @@ modEnabled modname = enable disable `onChange` reloaded isenabled = boolSystem "a2query" [Param "-q", Param "-m", Param modname] +-- | Control whether an apache configuration file is enabled. +-- +-- The String is the base name of the configuration, eg "charset" or "gitweb". +confEnabled :: String -> RevertableProperty DebianLike DebianLike +confEnabled confname = enable disable + where + enable = check (not <$> isenabled) + (cmdProperty "a2enconf" ["--quiet", confname]) + `describe` ("apache configuration enabled " ++ confname) + `requires` installed + `onChange` reloaded + disable = check isenabled + (cmdProperty "a2disconf" ["--quiet", confname]) + `describe` ("apache configuration disabled " ++ confname) + `requires` installed + `onChange` reloaded + isenabled = boolSystem "a2query" [Param "-q", Param "-c", Param confname] + -- | Make apache listen on the specified ports. -- -- Note that ports are also specified inside a site's config file, -- cgit v1.2.3 From a50b512564cf4a586106a649cb28f66180bb5564 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 8 Mar 2017 14:07:34 -0400 Subject: propellor spin --- debian/changelog | 6 +++++ src/Propellor/Property/SiteSpecific/JoeySites.hs | 28 ++++++++++++++---------- 2 files changed, 23 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/debian/changelog b/debian/changelog index 485cb9d9..9f0d46b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +propellor (3.4.2) UNRELEASED; urgency=medium + + * Added Apache.confEnabled. + + -- Joey Hess Wed, 08 Mar 2017 14:02:10 -0400 + propellor (3.4.1) unstable; urgency=medium * Fixed https url to propellor git repository. diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index c4f0e352..c84644cb 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -228,23 +228,29 @@ gitServer hosts = propertyList "git.kitenet.net setup" $ props `requires` Ssh.knownHost hosts "usw-s002.rsync.net" (User "root") `requires` Ssh.authorizedKeys (User "family") (Context "git.kitenet.net") `requires` User.accountFor (User "family") - & Apt.installed ["git", "rsync", "gitweb"] + & Apt.installed ["git", "rsync", "cgit"] & Apt.installed ["git-annex"] & Apt.installed ["kgb-client"] & File.hasPrivContentExposed "/etc/kgb-bot/kgb-client.conf" anyContext `requires` File.dirExists "/etc/kgb-bot/" & Git.daemonRunning "/srv/git" - & "/etc/gitweb.conf" `File.containsLines` - [ "$projectroot = '/srv/git';" - , "@git_base_url_list = ('https://git.joeyh.name/git', 'git://git.joeyh.name', 'ssh://git.joeyh.name/srv/git');" - , "# disable snapshot download; overloads server" - , "$feature{'snapshot'}{'default'} = [];" + & "/etc/cgitrc" `File.hasContent` + [ "clone-url=https://git.joeyh.name/git/$CGIT_REPO_URL git://git.joeyh.name/$CGIT_REPO_URL" + , "css=/cgit-css/cgit.css" + , "logo=/cgit-css/cgit.png" + , "enable-http-clone=1" + , "root-title=Joey's git repositories" + , "root-desc=" + , "enable-index-owner=0" + , "snapshots=tar.gz" + , "enable-git-config=1" + , "scan-path=/srv/git" ] - `describe` "gitweb configured" - -- Repos push on to github. - & Ssh.knownHost hosts "github.com" (User "joey") - -- I keep the website used for gitweb checked into git.. + `describe` "cgit configured" + -- I keep the website used for git.kitenet.net/git.joeyh.name checked into git.. & Git.cloned (User "root") "/srv/git/joey/git.kitenet.net.git" "/srv/web/git.kitenet.net" Nothing + -- Don't need global apache configuration for cgit. + ! Apache.confEnabled "cgit" & website "git.kitenet.net" & website "git.joeyh.name" & Apache.modEnabled "cgi" @@ -256,7 +262,7 @@ gitServer hosts = propertyList "git.kitenet.net setup" $ props , " Options Indexes ExecCGI FollowSymlinks" , " AllowOverride None" , " AddHandler cgi-script .cgi" - , " DirectoryIndex index.cgi" + , " DirectoryIndex cgit.cgi" , Apache.allowAll , " " , "" -- cgit v1.2.3 From 75d47168dc4e0cbe67d1a2f0223a43f2a45da06d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 8 Mar 2017 14:14:48 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index c84644cb..28246dfe 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -262,7 +262,7 @@ gitServer hosts = propertyList "git.kitenet.net setup" $ props , " Options Indexes ExecCGI FollowSymlinks" , " AllowOverride None" , " AddHandler cgi-script .cgi" - , " DirectoryIndex cgit.cgi" + , " DirectoryIndex index.cgi" , Apache.allowAll , " " , "" -- cgit v1.2.3