README: add systemd instructions
This commit is contained in:
parent
6bf67dd013
commit
a6b3732cd3
1 changed files with 22 additions and 18 deletions
40
README.md
40
README.md
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
Streamline repetitive ssh config files with trait-style property inheritance!
|
Streamline repetitive ssh config files with trait-style property inheritance!
|
||||||
|
|
||||||
ssh_config+ is meant for users with very large and repetitive ssh configs. This
|
ssh_compose_pro is meant for users with very large and repetitive ssh configs.
|
||||||
includes templating, an inheretence-style way of copying fields, and for loops
|
This includes templating, an inheretence-style way of copying fields, and for
|
||||||
to reduce repetitive lines.
|
loops to reduce repetitive lines.
|
||||||
|
|
||||||
See the `example/` directory for an idea of capabilities, but here's a snippet:
|
See the `example/` directory for an idea of capabilities, but here's a snippet:
|
||||||
|
|
||||||
|
@ -39,26 +39,30 @@ coronation:
|
||||||
|
|
||||||
# Quick Start
|
# Quick Start
|
||||||
|
|
||||||
```bash
|
Convert your `~/.ssh/config` into an `~/.ssh/config.yaml` by following the rules
|
||||||
mv ~/.ssh/config ~/.ssh/config_og
|
below. Eventually we hope to have a conversion script, but not yet...
|
||||||
python3 src/ssh_config_to_yaml.py ~/.ssh/config_og --out ~/.ssh/config.yaml
|
|
||||||
# Do some edits on ~/.ssh/config.yaml. The migration script won't compress
|
|
||||||
# things with for-loops or templates. Then...
|
|
||||||
python3 ~/.ssh/config.yaml --out ~/.ssh/config
|
|
||||||
```
|
|
||||||
|
|
||||||
As a proof of concept, you can even chain the scripts! The order of hosts will
|
Run `src/main.py` on your `~/.ssh/config.yaml` to convert it!
|
||||||
change, but the config should function identically!
|
|
||||||
|
## Systemd Integration
|
||||||
|
|
||||||
|
You can have systemd automatically run ssh_compose_pro when your yaml file
|
||||||
|
changes!
|
||||||
|
|
||||||
|
Move the files under `systemd/` to `~/.config/systemd/user` and update the paths
|
||||||
|
to match your system. Next:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python3 src/main.py <(python3 src/ssh_config_to_yaml.py ~/.ssh/config)
|
systemctl --user enable --now ssh-compose-pro.path
|
||||||
|
journalctl --user -fu ssh-compose-pro.service
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Make a change to your yaml file, and you should see the output appear in the
|
||||||
|
terminal running `journalctl`. You can ^C the `journalctl` command, it'll still
|
||||||
|
update on change.
|
||||||
|
|
||||||
# Rules
|
# Rules
|
||||||
|
|
||||||
The `src/ssh_config_to_yaml.py` script will assist in quickly migrating your
|
|
||||||
existing config.
|
|
||||||
|
|
||||||
## SSH Properties
|
## SSH Properties
|
||||||
|
|
||||||
Standard SSH config properties go under the `ssh_props` heading for every host.
|
Standard SSH config properties go under the `ssh_props` heading for every host.
|
||||||
|
@ -130,7 +134,7 @@ Will generate:
|
||||||
Host ohaton:
|
Host ohaton:
|
||||||
ForwardX11 false
|
ForwardX11 false
|
||||||
Hostname ohaton.cs.ualberta.ca
|
Hostname ohaton.cs.ualberta.ca
|
||||||
IdentitiesOnly true
|
IdentitiesOnly yes
|
||||||
IdentityFile ~/.ssh/id_ed25519
|
IdentityFile ~/.ssh/id_ed25519
|
||||||
Port 22
|
Port 22
|
||||||
User emiliko
|
User emiliko
|
||||||
|
@ -138,7 +142,7 @@ Host ohaton:
|
||||||
Host coronation:
|
Host coronation:
|
||||||
ForwardX11 false
|
ForwardX11 false
|
||||||
Hostname coronation.cs.ualberta.ca
|
Hostname coronation.cs.ualberta.ca
|
||||||
IdentitiesOnly true
|
IdentitiesOnly yes
|
||||||
IdentityFile ~/.ssh/id_ed25519
|
IdentityFile ~/.ssh/id_ed25519
|
||||||
Port: 22
|
Port: 22
|
||||||
User emiliko
|
User emiliko
|
||||||
|
|
Loading…
Reference in a new issue