devnomads-cli 0.15.0__tar.gz → 0.16.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/PKG-INFO +26 -9
  2. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/README.md +25 -8
  3. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/devnomads_cli.egg-info/PKG-INFO +26 -9
  4. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/devnomads_cli.egg-info/SOURCES.txt +1 -0
  5. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/dncli.py +494 -39
  6. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/pyproject.toml +1 -1
  7. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_agent_features.py +19 -0
  8. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_generate.py +15 -0
  9. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_generated_cli.py +5 -1
  10. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_sites_publish.py +8 -0
  11. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_sites_ssh.py +38 -0
  12. devnomads_cli-0.16.1/tests/test_ssh_keys.py +309 -0
  13. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/LICENSE +0 -0
  14. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/devnomads_cli.egg-info/dependency_links.txt +0 -0
  15. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/devnomads_cli.egg-info/entry_points.txt +0 -0
  16. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/devnomads_cli.egg-info/requires.txt +0 -0
  17. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/devnomads_cli.egg-info/top_level.txt +0 -0
  18. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/setup.cfg +0 -0
  19. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_cert.py +0 -0
  20. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_cli.py +0 -0
  21. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_config.py +0 -0
  22. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_helpers.py +0 -0
  23. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_hook.py +0 -0
  24. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_transfer.py +0 -0
  25. {devnomads_cli-0.15.0 → devnomads_cli-0.16.1}/tests/test_versions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devnomads-cli
3
- Version: 0.15.0
3
+ Version: 0.16.1
4
4
  Summary: Manage your DevNomads services from the command line
5
5
  Author-email: DevNomads <support@devnomads.nl>
6
6
  License: MIT
@@ -111,7 +111,8 @@ the full detail for one group, for scripts and AI agents.
111
111
  ## Logging in to a site
112
112
 
113
113
  `dncli sites ssh` opens an SSH session as the site's system user,
114
- `site<service_id>`, so you don't need to know that name:
114
+ `site` + the service id padded to five digits (service 2467 is
115
+ `site02467`), so you don't need to know that name:
115
116
 
116
117
  ```sh
117
118
  dncli sites ssh example.com
@@ -124,10 +125,25 @@ on several hosts (an HA cluster) asks which one; pick it with `--host`
124
125
  to skip the question, for example in a script. Anything after `--`
125
126
  goes to ssh: extra options (`-- -p 2222`) or a remote command.
126
127
 
127
- ssh logs in with your SSH key when the site has it (`dncli sites keys
128
- attach`); otherwise ssh itself asks for the site's password. dncli never
129
- sees or stores that password. Scripts and other runs without a terminal
130
- cannot answer a password prompt, so they need key login.
128
+ ssh logs in with your SSH key when the site has it; otherwise ssh itself
129
+ asks for the site's password. dncli never sees or stores that password.
130
+ Scripts and other runs without a terminal cannot answer a password
131
+ prompt, so they need key login.
132
+
133
+ dncli helps with the key. Before it connects, it compares the public
134
+ keys you have here (the ssh agent's, and the `~/.ssh/id_*` files ssh
135
+ would use) with the keys attached to the site. When none of yours is
136
+ attached, it offers to attach one, adding it to your DevNomads account
137
+ first if it isn't there yet. `--attach-key` does that without asking
138
+ (for scripts), `--no-attach-key` skips the check. Only public keys are
139
+ read and sent; your private key never leaves `~/.ssh`. You can also do
140
+ it on its own:
141
+
142
+ ```sh
143
+ dncli sites keys attach-local example.com # add to the account if needed, then attach
144
+ dncli keys add-local # only add it to your account
145
+ dncli keys add-local --key ~/.ssh/deploy.pub --name ci
146
+ ```
131
147
 
132
148
  ## Publishing a site
133
149
 
@@ -140,7 +156,7 @@ dncli sites publish example.com ./dist # new and changed files
140
156
  dncli sites publish example.com ./dist --delete # also remove files not in ./dist
141
157
  ```
142
158
 
143
- Files go to `/home/site<service_id>/domains/<domain>/public_html`. `.git/`
159
+ Files go to `/home/site<NNNNN>/domains/<domain>/public_html`. `.git/`
144
160
  is never uploaded; `--exclude` leaves out more (repeat it). You need
145
161
  rsync locally and on the server.
146
162
 
@@ -188,8 +204,9 @@ of them.
188
204
 
189
205
  **From a CI pipeline.** A pipeline has no terminal, so ssh cannot ask
190
206
  for a password or whether to trust a host it has not seen before. Give
191
- the pipeline an SSH key that is attached to the site (`dncli sites keys
192
- attach`), the hosts' keys in `known_hosts` and the API key in `DN_API_KEY`:
207
+ the pipeline an SSH key that is attached to the site (attach it once with
208
+ `dncli sites keys attach-local example.com --key deploy.pub`), the hosts'
209
+ keys in `known_hosts` and the API key in `DN_API_KEY`:
193
210
 
194
211
  ```sh
195
212
  mkdir -p ~/.ssh && ssh-keyscan web01.example.com >> ~/.ssh/known_hosts
@@ -95,7 +95,8 @@ the full detail for one group, for scripts and AI agents.
95
95
  ## Logging in to a site
96
96
 
97
97
  `dncli sites ssh` opens an SSH session as the site's system user,
98
- `site<service_id>`, so you don't need to know that name:
98
+ `site` + the service id padded to five digits (service 2467 is
99
+ `site02467`), so you don't need to know that name:
99
100
 
100
101
  ```sh
101
102
  dncli sites ssh example.com
@@ -108,10 +109,25 @@ on several hosts (an HA cluster) asks which one; pick it with `--host`
108
109
  to skip the question, for example in a script. Anything after `--`
109
110
  goes to ssh: extra options (`-- -p 2222`) or a remote command.
110
111
 
111
- ssh logs in with your SSH key when the site has it (`dncli sites keys
112
- attach`); otherwise ssh itself asks for the site's password. dncli never
113
- sees or stores that password. Scripts and other runs without a terminal
114
- cannot answer a password prompt, so they need key login.
112
+ ssh logs in with your SSH key when the site has it; otherwise ssh itself
113
+ asks for the site's password. dncli never sees or stores that password.
114
+ Scripts and other runs without a terminal cannot answer a password
115
+ prompt, so they need key login.
116
+
117
+ dncli helps with the key. Before it connects, it compares the public
118
+ keys you have here (the ssh agent's, and the `~/.ssh/id_*` files ssh
119
+ would use) with the keys attached to the site. When none of yours is
120
+ attached, it offers to attach one, adding it to your DevNomads account
121
+ first if it isn't there yet. `--attach-key` does that without asking
122
+ (for scripts), `--no-attach-key` skips the check. Only public keys are
123
+ read and sent; your private key never leaves `~/.ssh`. You can also do
124
+ it on its own:
125
+
126
+ ```sh
127
+ dncli sites keys attach-local example.com # add to the account if needed, then attach
128
+ dncli keys add-local # only add it to your account
129
+ dncli keys add-local --key ~/.ssh/deploy.pub --name ci
130
+ ```
115
131
 
116
132
  ## Publishing a site
117
133
 
@@ -124,7 +140,7 @@ dncli sites publish example.com ./dist # new and changed files
124
140
  dncli sites publish example.com ./dist --delete # also remove files not in ./dist
125
141
  ```
126
142
 
127
- Files go to `/home/site<service_id>/domains/<domain>/public_html`. `.git/`
143
+ Files go to `/home/site<NNNNN>/domains/<domain>/public_html`. `.git/`
128
144
  is never uploaded; `--exclude` leaves out more (repeat it). You need
129
145
  rsync locally and on the server.
130
146
 
@@ -172,8 +188,9 @@ of them.
172
188
 
173
189
  **From a CI pipeline.** A pipeline has no terminal, so ssh cannot ask
174
190
  for a password or whether to trust a host it has not seen before. Give
175
- the pipeline an SSH key that is attached to the site (`dncli sites keys
176
- attach`), the hosts' keys in `known_hosts` and the API key in `DN_API_KEY`:
191
+ the pipeline an SSH key that is attached to the site (attach it once with
192
+ `dncli sites keys attach-local example.com --key deploy.pub`), the hosts'
193
+ keys in `known_hosts` and the API key in `DN_API_KEY`:
177
194
 
178
195
  ```sh
179
196
  mkdir -p ~/.ssh && ssh-keyscan web01.example.com >> ~/.ssh/known_hosts
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devnomads-cli
3
- Version: 0.15.0
3
+ Version: 0.16.1
4
4
  Summary: Manage your DevNomads services from the command line
5
5
  Author-email: DevNomads <support@devnomads.nl>
6
6
  License: MIT
@@ -111,7 +111,8 @@ the full detail for one group, for scripts and AI agents.
111
111
  ## Logging in to a site
112
112
 
113
113
  `dncli sites ssh` opens an SSH session as the site's system user,
114
- `site<service_id>`, so you don't need to know that name:
114
+ `site` + the service id padded to five digits (service 2467 is
115
+ `site02467`), so you don't need to know that name:
115
116
 
116
117
  ```sh
117
118
  dncli sites ssh example.com
@@ -124,10 +125,25 @@ on several hosts (an HA cluster) asks which one; pick it with `--host`
124
125
  to skip the question, for example in a script. Anything after `--`
125
126
  goes to ssh: extra options (`-- -p 2222`) or a remote command.
126
127
 
127
- ssh logs in with your SSH key when the site has it (`dncli sites keys
128
- attach`); otherwise ssh itself asks for the site's password. dncli never
129
- sees or stores that password. Scripts and other runs without a terminal
130
- cannot answer a password prompt, so they need key login.
128
+ ssh logs in with your SSH key when the site has it; otherwise ssh itself
129
+ asks for the site's password. dncli never sees or stores that password.
130
+ Scripts and other runs without a terminal cannot answer a password
131
+ prompt, so they need key login.
132
+
133
+ dncli helps with the key. Before it connects, it compares the public
134
+ keys you have here (the ssh agent's, and the `~/.ssh/id_*` files ssh
135
+ would use) with the keys attached to the site. When none of yours is
136
+ attached, it offers to attach one, adding it to your DevNomads account
137
+ first if it isn't there yet. `--attach-key` does that without asking
138
+ (for scripts), `--no-attach-key` skips the check. Only public keys are
139
+ read and sent; your private key never leaves `~/.ssh`. You can also do
140
+ it on its own:
141
+
142
+ ```sh
143
+ dncli sites keys attach-local example.com # add to the account if needed, then attach
144
+ dncli keys add-local # only add it to your account
145
+ dncli keys add-local --key ~/.ssh/deploy.pub --name ci
146
+ ```
131
147
 
132
148
  ## Publishing a site
133
149
 
@@ -140,7 +156,7 @@ dncli sites publish example.com ./dist # new and changed files
140
156
  dncli sites publish example.com ./dist --delete # also remove files not in ./dist
141
157
  ```
142
158
 
143
- Files go to `/home/site<service_id>/domains/<domain>/public_html`. `.git/`
159
+ Files go to `/home/site<NNNNN>/domains/<domain>/public_html`. `.git/`
144
160
  is never uploaded; `--exclude` leaves out more (repeat it). You need
145
161
  rsync locally and on the server.
146
162
 
@@ -188,8 +204,9 @@ of them.
188
204
 
189
205
  **From a CI pipeline.** A pipeline has no terminal, so ssh cannot ask
190
206
  for a password or whether to trust a host it has not seen before. Give
191
- the pipeline an SSH key that is attached to the site (`dncli sites keys
192
- attach`), the hosts' keys in `known_hosts` and the API key in `DN_API_KEY`:
207
+ the pipeline an SSH key that is attached to the site (attach it once with
208
+ `dncli sites keys attach-local example.com --key deploy.pub`), the hosts'
209
+ keys in `known_hosts` and the API key in `DN_API_KEY`:
193
210
 
194
211
  ```sh
195
212
  mkdir -p ~/.ssh && ssh-keyscan web01.example.com >> ~/.ssh/known_hosts
@@ -18,5 +18,6 @@ tests/test_helpers.py
18
18
  tests/test_hook.py
19
19
  tests/test_sites_publish.py
20
20
  tests/test_sites_ssh.py
21
+ tests/test_ssh_keys.py
21
22
  tests/test_transfer.py
22
23
  tests/test_versions.py