diff options
Diffstat (limited to 'config-joey.hs')
| -rw-r--r-- | config-joey.hs | 73 |
1 files changed, 22 insertions, 51 deletions
diff --git a/config-joey.hs b/config-joey.hs index a240cd12..9aa6413f 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -3,7 +3,6 @@ module Main where import Propellor -import Propellor.CmdLine import Propellor.Property.Scheduled import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt @@ -17,9 +16,9 @@ import qualified Propellor.Property.Hostname as Hostname import qualified Propellor.Property.Tor as Tor import qualified Propellor.Property.Dns as Dns import qualified Propellor.Property.OpenId as OpenId -import qualified Propellor.Property.Docker as Docker import qualified Propellor.Property.Git as Git import qualified Propellor.Property.Postfix as Postfix +import qualified Propellor.Property.Apache as Apache import qualified Propellor.Property.Grub as Grub import qualified Propellor.Property.Obnam as Obnam import qualified Propellor.Property.Gpg as Gpg @@ -322,14 +321,10 @@ elephant = standardSystem "elephant.kitenet.net" Unstable "amd64" & alias "ns3.kitenet.net" & myDnsSecondary - & Docker.configured - & Docker.docked openidProvider - `requires` Apt.serviceInstalledRunning "ntp" - & Docker.docked ancientKitenet - & Docker.docked jerryPlay - & Docker.garbageCollected `period` (Weekly (Just 1)) - & Systemd.nspawned oldusenetShellBox + & Systemd.nspawned ancientKitenet + & Systemd.nspawned openidProvider + `requires` Apt.serviceInstalledRunning "ntp" & JoeySites.scrollBox & alias "scroll.joeyh.name" @@ -424,40 +419,36 @@ iabak = host "iabak.archiveteam.org" webserver :: Systemd.Container webserver = standardStableContainer "webserver" & Systemd.bind "/var/www" - & Apt.serviceInstalledRunning "apache2" + & Apache.installed -- My own openid provider. Uses php, so containerized for security -- and administrative sanity. -openidProvider :: Docker.Container -openidProvider = standardStableDockerContainer "openid-provider" - & alias "openid.kitenet.net" - & Docker.publish "8081:80" - & OpenId.providerFor [User "joey", User "liw"] - "openid.kitenet.net:8081" +openidProvider :: Systemd.Container +openidProvider = standardStableContainer "openid-provider" + & alias hn + & OpenId.providerFor [User "joey", User "liw"] hn (Just (Port 8081)) + where + hn = "openid.kitenet.net" --- Exhibit: kite's 90's website. -ancientKitenet :: Docker.Container -ancientKitenet = standardStableDockerContainer "ancient-kitenet" - & alias "ancient.kitenet.net" - & Docker.publish "1994:80" - & Apt.serviceInstalledRunning "apache2" +-- Exhibit: kite's 90's website on port 1994. +ancientKitenet :: Systemd.Container +ancientKitenet = standardStableContainer "ancient-kitenet" + & alias hn & Git.cloned (User "root") "git://kitenet-net.branchable.com/" "/var/www/html" (Just "remotes/origin/old-kitenet.net") + & Apache.installed + & Apache.listenPorts [p] + & Apache.virtualHost hn p "/var/www/html" + & Apache.siteDisabled "000-default" + where + p = Port 1994 + hn = "ancient.kitenet.net" oldusenetShellBox :: Systemd.Container oldusenetShellBox = standardStableContainer "oldusenet-shellbox" & alias "shell.olduse.net" & JoeySites.oldUseNetShellBox -jerryPlay :: Docker.Container -jerryPlay = standardDockerContainer "jerryplay" Unstable "amd64" - & alias "jerryplay.kitenet.net" - & Docker.publish "2202:22" - & Docker.publish "8001:80" - & Apt.installed ["ssh"] - & User.hasPassword (User "root") - & Ssh.permitRootLogin (Ssh.RootLogin True) - kiteShellBox :: Systemd.Container kiteShellBox = standardStableContainer "kiteshellbox" & JoeySites.kiteShellBox @@ -505,26 +496,6 @@ standardContainer name suite arch = Systemd.container name chroot standardStableContainer :: Systemd.MachineName -> Systemd.Container standardStableContainer name = standardContainer name (Stable "jessie") "amd64" -standardStableDockerContainer :: Docker.ContainerName -> Docker.Container -standardStableDockerContainer name = standardDockerContainer name (Stable "jessie") "amd64" - -standardDockerContainer :: Docker.ContainerName -> DebianSuite -> Architecture -> Docker.Container -standardDockerContainer name suite arch = Docker.container name (dockerImage system) - & os system - & Apt.stdSourcesList `onChange` Apt.upgrade - & Apt.unattendedUpgrades - & Apt.cacheCleaned - & Docker.tweaked - where - system = System (Debian suite) arch - --- Docker images I prefer to use. -dockerImage :: System -> Docker.Image -dockerImage (System (Debian Unstable) arch) = Docker.latestImage ("joeyh/debian-unstable-" ++ arch) -dockerImage (System (Debian Testing) arch) = Docker.latestImage ("joeyh/debian-unstable-" ++ arch) -dockerImage (System (Debian (Stable _)) arch) = Docker.latestImage ("joeyh/debian-stable-" ++ arch) -dockerImage _ = Docker.latestImage "debian-stable-official" -- does not currently exist! - myDnsSecondary :: Property HasInfo myDnsSecondary = propertyList "dns secondary for all my domains" $ props & Dns.secondary hosts "kitenet.net" |
