propellor

propellor config for hosts.
git clone git://git.ricketyspace.net/propellor.git
Log | Files | Refs | LICENSE

commit fc36ddd38d3e23de4787807f3c39e923e7c5cba4
parent be2930b23c057c5336d1cf3fae57955915101aa5
Author: rsiddharth <s@ricketyspace.net>
Date:   Tue, 19 Dec 2017 03:48:43 +0000

propellor spin

Diffstat:
config.hs | 43+++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+), 0 deletions(-)

diff --git a/config.hs b/config.hs @@ -47,9 +47,11 @@ import qualified Propellor.Property.Docker as Docker import qualified Propellor.Property.File as File import qualified Propellor.Property.Nginx as Nginx import qualified Propellor.Property.Ssh as Ssh +import qualified Propellor.Property.Sudo as Sudo import qualified Propellor.Property.User as User + main :: IO () main = defaultMain hosts @@ -582,5 +584,46 @@ ara = host "ara.ricketyspace.net" $props & Apt.stdSourcesList & Apt.unattendedUpgrades & Apt.safeUpgrade + & Apt.installed ["nginx-full", + "git", "etckeeper", + "htop", "sudo" + ] + -- nginx + & Nginx.siteEnabled "ara.ricketyspace.net" araNginx + & File.dirExists "/home/w/pub" + & File.hasContent "/home/w/pub/robots.txt" araWebRobotsTxt + & File.hasContent "/home/w/pub/index.html" araWebIndex -- root config & Ssh.authorizedKey (User "root") sCanonicalSshPubKey + -- w config + & User.accountFor (User "w") + & User.hasLoginShell (User "w") "/usr/bin/zsh" + & Ssh.authorizedKey (User "w") sCanonicalSshPubKey + -- s config + & User.accountFor(User "s") + & User.hasPassword (User "s") + & User.hasLoginShell (User "s") "/usr/bin/zsh" + & Sudo.enabledFor (User "s") + & Ssh.authorizedKey (User "s") sCanonicalSshPubKey + +araNginx :: [String] +araNginx = [ + "server {" + , " listen 80;" + , " listen [::]:80;" + , " server_name ara.ricketyspace.net;" + , " root /home/w/pub;" + , " error_page 404 /404.html;" + , " error_page 403 /403.html;" + , " default_type text/plain;" + , "}" + ] + +araWebRobotsTxt :: [File.Line] +araWebRobotsTxt = [ + "User-agent: *" + , "Disallow: /" + ] + +araWebIndex :: [File.Line] +araWebIndex = [""]