Skip to content

Commit

Permalink
Update README (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
kansi authored Sep 11, 2024
1 parent fc32d68 commit c9e9043
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ In order to use `control_node` you must ensure the following,
- [x] Native service monitoring/health check
- [x] Blue-Green deployment
- [x] Support failover via [heart](http://erlang.org/doc/man/heart.html)
- [ ] Support namespace environment variable configuration
- [ ] Rollback releases
- [x] Rollback releases
- [x] Support namespace environment variable configuration
- [ ] Support package registries other than local file system

## Quick example

Expand Down Expand Up @@ -137,15 +138,19 @@ l(:observer)

## Real world example

https://github.com/kansi/cnops
https://github.com/kansi/cnops (outdated)


## Can control node be used to deploy non Elixir/Erlang project?

YES!
Yes! The general idea would be to compile target project into a command and run
and monitor that command from an elixir service. This maybe more work but you
have the option of avoiding multiple deploy tools

https://github.com/kansi/cnops deploys a Golang service `hello_go`

NOTE: The above is old but still valid inspiration


## Under the hood

Expand Down Expand Up @@ -173,6 +178,28 @@ AllowTcpForwarding yes
...
```

## SSH key rotation

A general good security practice is to routinely rotate your SSH keys. Control
node expose APIs via `ControlNode.Host.SSH` module which can be leveraged to
perform this rotation. Below is an example,

``` elixir
host_spec = %ControlNode.Host.SSH{
host: "localhost",
port: 2222,
user: "linuxserver.io",
private_key_dir: "/path/to/ssh_dir"
}

authorized_keys = """
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDg+KMD7QAU+qtH3duwTHmBaJE/WUdiOwC87cqP5cL21 [email protected]
"""

host_state = ControlNode.Host.SSH.connect(host_spec)
ControlNode.Host.SSH.exec(host_state, "echo '#{authorized_key}' > /user/.ssh/authorized_keys")
```

## Limitations

- **SSH client only supports `ed25519` keys**. Other keys types are supported
Expand Down

0 comments on commit c9e9043

Please sign in to comment.