on master help sign in
ob deploy: Copy ssh key into deploy dir and set permissions
commit0efcae237273cfff21234f069c54165e2c249dff authorLuigy Leon <luigy@outlook.com> dateMon 14 May 2018, 18:03 (8 years ago) parentb468831
1 file changed+3−3
lib/command/src/Obelisk/Command/Deploy.hs+3−3
lib/command/src/Obelisk/Command/Deploy.hs+3−3
@@ -15,7 +15,6 @@ import qualified Data.Text.IO as T
1515import System.Directory
1616import System.Exit (ExitCode(..))
1717import System.FilePath
18−import System.Posix.Files
1918import System.Process
2019
2120import Obelisk.Command.Nix
@@ -35,8 +34,9 @@ deployInit thunkPtr configDir deployDir sshKeyPath hostnames = do
3534 ]
3635 keyExists <- doesFileExist sshKeyPath
3736 when keyExists $ do
38− target <- makeAbsolute sshKeyPath
39− createSymbolicLink target (deployDir </> "ssh_key")
37+ let localKey = deployDir </> "ssh_key"
38+ cp [sshKeyPath, localKey]
39+ setPermissions localKey $ setOwnerWritable True $ setOwnerReadable True emptyPermissions
4040 createThunk (deployDir </> "src") thunkPtr
4141 writeFile (deployDir </> "backend_hosts") $ unlines hostnames
4242 initGit deployDir