more uses for hostContext

This commit is contained in:
Joey Hess 2014-12-07 15:21:55 -04:00
parent 3b0b6f44dd
commit 2fe0b28982
3 changed files with 6 additions and 6 deletions

View File

@ -209,7 +209,7 @@ diatom = standardSystem "diatom.kitenet.net" (Stable "wheezy") "amd64"
& ipv4 "107.170.31.195" & ipv4 "107.170.31.195"
& DigitalOcean.distroKernel & DigitalOcean.distroKernel
& Ssh.hostKeys (Context "diatom.kitenet.net") & Ssh.hostKeys hostContext
& Apt.unattendedUpgrades & Apt.unattendedUpgrades
& Apt.serviceInstalledRunning "ntp" & Apt.serviceInstalledRunning "ntp"
& Postfix.satellite & Postfix.satellite
@ -273,9 +273,9 @@ elephant = standardSystem "elephant.kitenet.net" Unstable "amd64"
& Apt.unattendedUpgrades & Apt.unattendedUpgrades
& Systemd.installed & Systemd.installed
& Systemd.persistentJournal & Systemd.persistentJournal
& Ssh.hostKeys ctx & Ssh.hostKeys hostContext
& sshPubKey "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAJkoPRhUGT8EId6m37uBdYEtq42VNwslKnc9mmO+89ody066q6seHKeFY6ImfwjcyIjM30RTzEwftuVNQnbEB0=" & sshPubKey "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAJkoPRhUGT8EId6m37uBdYEtq42VNwslKnc9mmO+89ody066q6seHKeFY6ImfwjcyIjM30RTzEwftuVNQnbEB0="
& Ssh.keyImported SshRsa "joey" ctx & Ssh.keyImported SshRsa "joey" hostContext
& Apt.serviceInstalledRunning "swapspace" & Apt.serviceInstalledRunning "swapspace"
& alias "eubackup.kitenet.net" & alias "eubackup.kitenet.net"
@ -315,8 +315,6 @@ elephant = standardSystem "elephant.kitenet.net" Unstable "amd64"
-- that port for ssh, for traveling on bad networks that -- that port for ssh, for traveling on bad networks that
-- block 22. -- block 22.
& Ssh.listenPort 80 & Ssh.listenPort 80
where
ctx = Context "elephant.kitenet.net"
--' __|II| ,. --' __|II| ,.

View File

@ -80,7 +80,7 @@ randomHostKeys = flagFile prop "/etc/ssh/.unique_host_keys"
[ "DPKG_MAINTSCRIPT_NAME=postinst DPKG_MAINTSCRIPT_PACKAGE=openssh-server /var/lib/dpkg/info/openssh-server.postinst configure" ] [ "DPKG_MAINTSCRIPT_NAME=postinst DPKG_MAINTSCRIPT_PACKAGE=openssh-server /var/lib/dpkg/info/openssh-server.postinst configure" ]
-- | Sets all types of ssh host keys from the privdata. -- | Sets all types of ssh host keys from the privdata.
hostKeys :: Context -> Property hostKeys :: IsContext c => c -> Property
hostKeys ctx = propertyList "known ssh host keys" hostKeys ctx = propertyList "known ssh host keys"
[ hostKey SshDsa ctx [ hostKey SshDsa ctx
, hostKey SshRsa ctx , hostKey SshRsa ctx

View File

@ -21,6 +21,8 @@ data PrivDataField
-- Context "www.example.com" could be used for the SSL cert -- Context "www.example.com" could be used for the SSL cert
-- for the web server serving that domain. Multiple hosts might -- for the web server serving that domain. Multiple hosts might
-- use that privdata. -- use that privdata.
--
-- This appears in serlialized privdata files.
newtype Context = Context String newtype Context = Context String
deriving (Read, Show, Ord, Eq) deriving (Read, Show, Ord, Eq)