Commit Graph
17 Commits
Author SHA1 Message Date
Jose Diaz-Gonzalez e67b96780d refactor: unify command declaration across codebase 2020-02-10 01:40:30 -05:00
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
Tom Parker-Shemilt a848d92823 Allow SSH keys with no ending newline (fixes #3590) 2019-06-12 22:16:02 +01: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 dee0144c7c fix: add missing awk to get number of lines in key file 2019-05-12 19:08:55 -04:00
Jose Diaz-Gonzalez 6ca4813247 fix: invert check 2019-05-12 19:04:50 -04:00
Jose Diaz-Gonzalez a717cb99a3 fix: correct shfmt and update error message 2019-05-12 19:04:50 -04:00
Jose Diaz-Gonzalez 6a5bbd63a3 refactor: always use a temp file for interacting with ssh keys
Rather than have stdin open everywhere, try to coerce input into a temporary file for later use.
2019-05-12 19:04:50 -04:00
Jose Diaz-Gonzalez ca0b2937b9 refactor: fetch ssh key via argument before stdin
This allows the ssh-keys:add command to work in environments where there is no stdin/tty available, such as via server automation.
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 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