Commit Graph

41 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
fd162f8895 feat: add verify_app_name calls to all shell subcommands
Without this, folks could potentially run commands against invalid applications.
2020-12-27 15:14:11 -05:00
Chris W Jones
112ee88fe9 Allow symbolic links for certificate and key files
This corrects an issue where if a symbolic link was given to the
`certs:add` command, an error would be thrown even though the file was
valid.

Issue: #4251
2020-12-17 15:35:52 -05:00
Aubrey Hewes
607b11ab6b fixed: when adding a cert remove previous cert before copying the new one
This fixes when a user (or plugin) has replaced the cert with a symlink; else the symlinked file would be overwritten.

This mainly is in the case of a global-cert (plugin) wildcard cert
2020-10-15 13:32:56 +02:00
Roland van Laar
be0ba28570 feat: Add show option to the certs plugin
The 'server.key' and 'server.crt' can printed to stdin.
The two options are:
    `dokku certs:show <app> key > server.key`
    `dokku certs:show <app> crt > server.crt`
This will create two files, `server.key` and `server.crt`.
Those files contain the private key and the certificate.

Includes tests.
2020-07-04 13:14:02 +02:00
Jose Diaz-Gonzalez
61a306664f refactor: move domain manipulation into triggers
This allows other plugins to avoid understanding the underlying details of how domains might be integrated with.
2020-05-06 00:16:51 -04:00
Jose Diaz-Gonzalez
848373def5 chore: remove all deprecated commands
This change removes all deprecated commands. In many cases, users have been warned for a number of releases before the commands have been removed. All commands that were removed have existing alternatives.
2020-02-12 02:03:03 -05:00
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
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
67ae374e60 lint: remove whitespaces before redirect 2019-02-02 13:49:24 -05: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
4aac1fd936 feat: add report trigger
This allows users to quickly show the state of any configured application, as well as the state of their server. In doing so, we make it easy for them to provide information necessary for debugging in a single command.
2018-04-07 04:49:21 -04:00
Kazuhiro NISHIYAMA
f476a12226 Remove unused password 2018-03-08 22:42:13 +09:00
Jose Diaz-Gonzalez
6d91a32f3d fix: use a longer password for self-signed certificates
Closes #3084
2018-03-03 14:58:33 -05:00
Jose Diaz-Gonzalez
15021d05c9 feat: allow quieter report output
Users should have the option of suppressing headers, which are not always useful when interacting with dokku in a programmatic fashion.
2017-04-21 00:53:35 -06:00
Jose Diaz-Gonzalez
97e35e796c fix: ensure we can call the report subcommand without an app while specifying flags
Closes #2628
2017-03-16 02:33:51 -06:00
raphaklaus
a3989aafaa add grep to find crt and key files 2017-03-02 16:38:25 -03:00
Raphael D. Pinheiro
8bc7cdaaeb Merge branch 'master' into master 2017-02-24 12:42:42 -03:00
Raphael D. Pinheiro
0c98a34094 enhance regex to allow multiple dots in file names
removed remaining *
2017-02-23 13:27:50 -03:00
Raphael D. Pinheiro
088b7f360e enhance regex to allow multiple dots in file names
things like mydomain.com.crt and mydomain.com.key will be better interpreted
2017-02-23 13:25:33 -03:00
Jose Diaz-Gonzalez
4026291572 SC2005: Useless echo? Instead of 'echo $(cmd)', just use 'cmd'. 2017-02-20 19:22:18 -07:00
Jose Diaz-Gonzalez
dcb88226b5 refactor: ensure that certs:default and certs:info are deprecated in favor of certs:report
Refs #2356
2017-02-20 16:47:14 -07:00
Jose Diaz-Gonzalez
51217521e3 feat: add certs:report
Refs #2356
2017-02-20 16:39:43 -07: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
Jose Diaz-Gonzalez
bcfa60ae98 feat: save the ssl certificate to the APP_SSL_PATH
This allows later retrieval of the csr in cases where the developer forgot to save it locally.
2017-01-08 19:36:17 -07:00
Jose Diaz-Gonzalez
82c11a2b2c fix: call post-certs-update on the application before updating domains
This ensures that we set the proper ssl ports.

Closes #2480
Closes #2528
2017-01-08 19:35:49 -07:00
Jose Diaz-Gonzalez
a967990be7 chore: remove unnecessary cd in certs:add
This was used before we started using `plugn` for triggering subshell calls to dokku.
2017-01-08 19:35:04 -07:00
Omar Shehata
1f47803324 Added certs plugin default to info 2016-12-03 19:27:49 +00:00
Omar Shehata
0062227c57 Revert "Added certs default help function"
This reverts commit d001fcc896.
2016-12-03 19:08:25 +00:00
Omar Shehata
d001fcc896 Added certs default help function 2016-11-28 02:53:46 +00:00
Jose Diaz-Gonzalez
0d4560177a Properly remap http port 80 mappings to https 443 when adding an ssl certificate
Rather than removing all port mappings, we simply remap port 80 mappings to 443. The previous behavior would remove custom port mappings for all applications and reset them on any certificate change, preventing automation from plugins such as letsencrypt. While this behavior doesn't matter for buildpack deploys - which only expose a single port on container port 5000 - Dockerfile deploys would frequently be affected by such a change, requiring a remapping of all custom ports.

This commit also standardizes on the method used to source the proxy functions
2016-07-23 16:04:13 -04:00
Stefan Seemayer
f0000a18ba Prefer file import in certs:add if files given
Fixes dokku/dokku-letsencrypt#67

Change the certs:add command to use a file import without trying to
detect a piped-in tarball if server.crt and server.key files were passed
in as arguments and those files exist.

Fixes hangs on certificate imports by filename when the check for a
STDIN pipe fails e.g. when running dokku remotely using a SSH command.
2016-06-27 16:09:05 +02:00
Michael Hobbs
ff18e0d6be cleanup external references to nginx-vhosts plugin 2016-06-16 16:04:44 -07:00
Michael Hobbs
6c1d6225f9 initial pass at implementing DOKKU_PROXY_PORT_MAP. closes #2239. 2016-06-16 16:04:44 -07:00
Michael Hobbs
9ce7470b87 remove deprecated mktemp args and name vars more clearly 2016-03-29 19:46:46 -07:00
Michael Hobbs
987c5cfb9c use declare for description variable 2016-03-08 15:30:34 -05:00
Michael Hobbs
aa2415eeb8 more style/function tweaks 2016-03-03 22:11:35 -08:00
Michael S. Hobbs
89f289b433 subcommand restructure and bashstyle refactor. closes #1579 2016-03-03 22:11:35 -08:00