17 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
1cb586b2e7 refactor: standardize command naming
This standardization makes it somewhat easier to read stacktraces as the command names are all uniform, so it will be slightly easier to scan trace output.
2020-02-09 22:41:39 -05:00
Jose Diaz-Gonzalez
3ca6245b00 fix: use 6 X to support running under busybox
mktemp from busybox requires that all templates end with XXXXXX.
2019-08-12 18:16:16 -04:00
Jose Diaz-Gonzalez
925c6c4c28 feat: inject the dokku PID into temporary files/directories
This will allow background processes to cleanup these files if they were unable to be cleaned up during a run of the dokku binary, as is the case for files copied by the docker binary when running in docker.
2019-08-12 17:56:17 -04:00
Jose Diaz-Gonzalez
699719b600 fix: handle case where there are empty newlines in the authorized_keys file
Previously, an empty line would result in a failing ssh-keys:list call, or a failure to verify the file. Newlines should be ignored.
2019-07-05 10:00:52 -04:00
Jose Diaz-Gonzalez
1b92f4a97e chore: standardize how temporary files are named 2019-05-20 18:01:17 -07:00
Jose Diaz-Gonzalez
da4361583b fix: reverse quotes for variable expansion
Without reversing quotes, the variables are sometimes improperly expanded, resulting in files not being removed.
2019-05-20 17:56:50 -07:00
Jose Diaz-Gonzalez
8551dfb297 refactor: switch to temporary file for key verification 2019-05-12 19:04:50 -04:00
Jose Diaz-Gonzalez
86795ddacc tests: run mvdan/shfmt on test runs
While I do not agree with _every_ style change, this will force Dokku to have consistent formatting across all shell scripts, which is arguably a Good Thing™.

The command used to reprocess everything is:

```shell
shfmt -l -bn -ci -i 2 -w .
```
2019-01-07 01:25:55 -05:00
Jose Diaz-Gonzalez
e2bbdc968d SC2162: read without -r mangle backslashes 2017-03-26 04:59:10 -06:00
Jose Diaz-Gonzalez
ab93fefd5b Merge pull request #2508 from OmarShehata/master
Add default functions for all commands
2017-01-13 22:37:29 -07:00
Omar Shehata
f2a4f61920 Added ssh-keys plugin default to list 2016-12-03 19:36:11 +00:00
Omar Shehata
010c89e810 Revert "Added ssh-keys default help function"
This reverts commit 74db5b9d3b.
2016-12-03 19:08:02 +00:00
Omar Shehata
74db5b9d3b Added ssh-keys default help function 2016-11-28 02:59:32 +00:00
Jose Diaz-Gonzalez
4e25639de4 Create the user's authorized_keys file if it does not exist
Closes #2469
2016-11-21 19:08:33 -07:00
Flavio Poletti
a2bacd8096 Patch GH #2446 "Adding a file with two ssh-key..."
This is a proposed change for addressing GH #2446 "Adding a file with
two ssh-keys can result in an error" (see
https://github.com/dokku/dokku/issues/2446).

The following checks are performed:

- validity of key contents when read from a file
- key contents only contains one single line/key
- authorized_keys file is ultimately valid

The last test is an extension over the previous implementation in that
all lines in the file are checked.

The commit also includes extensions to the relevant test file to
excercise the new checks. It also takes care to save and then restore
the authorized_keys file.
2016-10-16 16:32:16 +02:00
Justin Clark
2d0374ec52 ssh-keys updates based on feedback 2016-07-05 17:16:19 -07:00
Justin Clark
283ed52520 Add ssh-keys core plugin 2016-07-05 17:16:19 -07:00