Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard Domain/SSL Not Working #298

Closed
atwoodjw opened this issue Feb 3, 2023 · 7 comments · Fixed by #311
Closed

Wildcard Domain/SSL Not Working #298

atwoodjw opened this issue Feb 3, 2023 · 7 comments · Fixed by #311
Labels

Comments

@atwoodjw
Copy link

atwoodjw commented Feb 3, 2023

Description of problem

I can't get a wildcard domain working with a fresh install of Dokku and ruby-getting-started. Conversation started in #295.

How reproducible

Reproducible

Steps to Reproduce

dokku domains:set-global mydomain.com

dokku apps:create ruby-getting-started
dokku postgres:create railsdatabase
dokku postgres:link railsdatabase ruby-getting-started

DEPLOY APP

dokku letsencrypt:set --global dns-provider route53
dokku letsencrypt:set --global dns-provider-AWS_ACCESS_KEY_ID XXX
dokku letsencrypt:set --global dns-provider-AWS_SECRET_ACCESS_KEY XXX

dokku domains:add ruby-getting-started *.mydomain.com
dokku domains:remove ruby-getting-started ruby-getting-started.mydomain.com

dokku letsencrypt:enable ruby-getting-started
=====> Enabling letsencrypt for ruby-getting-started
-----> Enabling ACME proxy for ruby-getting-started...
-----> Getting letsencrypt certificate for ruby-getting-started via DNS-01
        - Domain '*.mydomain.com'
2023/02/03 03:41:11 [INFO] [*.mydomain.com] acme: Obtaining bundled SAN certificate
2023/02/03 03:41:11 [INFO] [*.mydomain.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/5213993073
2023/02/03 03:41:11 [INFO] [*.mydomain.com] acme: authorization already valid; skipping challenge
2023/02/03 03:41:11 [INFO] [*.mydomain.com] acme: Validations succeeded; requesting certificates
2023/02/03 03:41:12 [INFO] [*.mydomain.com] Server responded with a certificate.
-----> Certificate retrieved successfully.
-----> Installing let's encrypt certificates
 !     CRT file specified not found, please check file paths
cp: cannot stat '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.crt': No such file or directory
cp: cannot stat '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.crt': No such file or directory
-----> Ensuring network configuration is in sync for ruby-getting-started
-----> Configuring *.mydomain.com...(using built-in template)
-----> Creating http nginx.conf
       Reloading nginx
-----> Disabling ACME proxy for ruby-getting-started...
-----> Done

Actual Results

Error copying .crt file during "Installing lets encrypt certificates" step. The issue seems to be the * in the filename (*.mydomain.com.crt). The actual file name is _.mydomain.com.crt.

cd /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/
ls -al

drwx------ 2 dokku dokku 4096 Feb  2 22:29 .
drwxrwxr-x 4 dokku dokku 4096 Feb  2 22:41 ..
-rw------- 1 dokku dokku 4179 Feb  2 22:41 _.mydomain.com.crt
-rw------- 1 dokku dokku 2772 Feb  2 22:41 _.mydomain.com.issuer.crt
-rw------- 1 dokku dokku  251 Feb  2 22:41 _.mydomain.com.json
-rw------- 1 dokku dokku  227 Feb  2 22:41 _.mydomain.com.key
-rw------- 1 dokku dokku 4406 Feb  2 22:41 _.mydomain.com.pem

Expected Results

File copies successfully.

@josegonzalez
Copy link
Member

Can you post the output of dokku report ruby-getting-started? Also, is this running in a dokku container or on the host?

@atwoodjw
Copy link
Author

atwoodjw commented Feb 3, 2023

I'm running Dokku on Ubuntu 22.04 VM (via Proxmox 7.3-4).

dokku report ruby-getting-started

-----> uname: Linux dokku.mydomain.com 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
-----> memory:
                      total        used        free      shared  buff/cache   available
       Mem:            3923         550         272          12        3100        3069
       Swap:           3110           0        3110
-----> docker version:
       Client: Docker Engine - Community
        Version:           20.10.23
        API version:       1.41
        Go version:        go1.18.10
        Git commit:        7155243
        Built:             Thu Jan 19 17:45:08 2023
        OS/Arch:           linux/amd64
        Context:           default
        Experimental:      true

       Server: Docker Engine - Community
        Engine:
         Version:          20.10.23
         API version:      1.41 (minimum version 1.12)
         Go version:       go1.18.10
         Git commit:       6051f14
         Built:            Thu Jan 19 17:42:57 2023
         OS/Arch:          linux/amd64
         Experimental:     false
        containerd:
         Version:          1.6.16
         GitCommit:        31aa4358a36870b21a992d3ad2bef29e1d693bec
        runc:
         Version:          1.1.4
         GitCommit:        v1.1.4-0-g5fd4c4d
        docker-init:
         Version:          0.19.0
         GitCommit:        de40ad0
-----> docker daemon info:
       Client:
        Context:    default
        Debug Mode: true
        Plugins:
         app: Docker App (Docker Inc., v0.9.1-beta3)
         buildx: Docker Buildx (Docker Inc., v0.10.0-docker)
         compose: Docker Compose (Docker Inc., v2.15.1)
         scan: Docker Scan (Docker Inc., v0.23.0)

       Server:
        Containers: 2
         Running: 2
         Paused: 0
         Stopped: 0
        Images: 28
        Server Version: 20.10.23
        Storage Driver: overlay2
         Backing Filesystem: extfs
         Supports d_type: true
         Native Overlay Diff: true
         userxattr: false
        Logging Driver: json-file
        Cgroup Driver: systemd
        Cgroup Version: 2
        Plugins:
         Volume: local
         Network: bridge host ipvlan macvlan null overlay
         Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
        Swarm: inactive
        Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
        Default Runtime: runc
        Init Binary: docker-init
        containerd version: 31aa4358a36870b21a992d3ad2bef29e1d693bec
        runc version: v1.1.4-0-g5fd4c4d
        init version: de40ad0
        Security Options:
         apparmor
         seccomp
          Profile: default
         cgroupns
        Kernel Version: 5.15.0-58-generic
        Operating System: Ubuntu 22.04.1 LTS
        OSType: linux
        Architecture: x86_64
        CPUs: 2
        Total Memory: 3.832GiB
        Name: dokku.mydomain.com
        ID: QHFV:7JTZ:5ZJ7:33OZ:DCEE:WFHC:X53R:DBJJ:FL6F:3Y6B:5MQO:W3VD
        Docker Root Dir: /var/lib/docker
        Debug Mode: false
        Registry: https://index.docker.io/v1/
        Labels:
        Experimental: false
        Insecure Registries:
         127.0.0.0/8
        Live Restore Enabled: false

-----> git version: git version 2.34.1
-----> sigil version: 0.9.0build+bc921b7
-----> herokuish version:
       herokuish: v0.5.40
       buildpacks:
         heroku-buildpack-multi     v1.2.0
         heroku-buildpack-ruby      v244
         heroku-buildpack-nodejs    v202
         heroku-buildpack-clojure   v90
         heroku-buildpack-python    v223
         heroku-buildpack-java      v72
         heroku-buildpack-gradle    v38
         heroku-buildpack-scala     v96
         heroku-buildpack-play      v26
         heroku-buildpack-php       v227
         heroku-buildpack-go        v169
         heroku-buildpack-nginx     v22
         buildpack-null             v3
-----> dokku version: dokku version 0.29.4
-----> plugn version: plugn: 0.12.0build+3a27594
-----> dokku plugins:
         00_dokku-standard    0.29.4 enabled    dokku core standard plugin
         20_events            0.29.4 enabled    dokku core events logging plugin
         app-json             0.29.4 enabled    dokku core app-json plugin
         apps                 0.29.4 enabled    dokku core apps plugin
         builder              0.29.4 enabled    dokku core builder plugin
         builder-dockerfile   0.29.4 enabled    dokku core builder-dockerfile plugin
         builder-herokuish    0.29.4 enabled    dokku core builder-herokuish plugin
         builder-lambda       0.29.4 enabled    dokku core builder-lambda plugin
         builder-null         0.29.4 enabled    dokku core builder-null plugin
         builder-pack         0.29.4 enabled    dokku core builder-pack plugin
         buildpacks           0.29.4 enabled    dokku core buildpacks plugin
         caddy-vhosts         0.29.4 enabled    dokku core caddy-vhosts plugin
         certs                0.29.4 enabled    dokku core certificate management plugin
         checks               0.29.4 enabled    dokku core checks plugin
         common               0.29.4 enabled    dokku core common plugin
         config               0.29.4 enabled    dokku core config plugin
         cron                 0.29.4 enabled    dokku core cron plugin
         docker-options       0.29.4 enabled    dokku core docker-options plugin
         domains              0.29.4 enabled    dokku core domains plugin
         enter                0.29.4 enabled    dokku core enter plugin
         git                  0.29.4 enabled    dokku core git plugin
         letsencrypt          0.20.0 enabled    Automated installation of let's encrypt TLS certificates
         logs                 0.29.4 enabled    dokku core logs plugin
         network              0.29.4 enabled    dokku core network plugin
         nginx-vhosts         0.29.4 enabled    dokku core nginx-vhosts plugin
         plugin               0.29.4 enabled    dokku core plugin plugin
         postgres             1.26.1 enabled    dokku postgres service plugin
         proxy                0.29.4 enabled    dokku core proxy plugin
         ps                   0.29.4 enabled    dokku core ps plugin
         registry             0.29.4 enabled    dokku core registry plugin
         repo                 0.29.4 enabled    dokku core repo plugin
         resource             0.29.4 enabled    dokku core resource plugin
         run                  0.29.4 enabled    dokku core run plugin
         scheduler            0.29.4 enabled    dokku core scheduler plugin
         scheduler-docker-local 0.29.4 enabled    dokku core scheduler-docker-local plugin
         scheduler-null       0.29.4 enabled    dokku core scheduler-null plugin
         shell                0.29.4 enabled    dokku core shell plugin
         ssh-keys             0.29.4 enabled    dokku core ssh-keys plugin
         storage              0.29.4 enabled    dokku core storage plugin
         trace                0.29.4 enabled    dokku core trace plugin
         traefik-vhosts       0.29.4 enabled    dokku core traefik-vhosts plugin
=====> ruby-getting-started app-json information
       App json computed selected:    app.json
       App json global selected:      app.json
       App json selected:
=====> ruby-getting-started app information
       App created at:                1675389268
       App deploy source:             ruby-getting-started
       App deploy source metadata:    ruby-getting-started
       App dir:                       /home/dokku/ruby-getting-started
       App locked:                    false
=====> ruby-getting-started builder information
       Builder build dir:
       Builder computed build dir:
       Builder computed selected:
       Builder global build dir:
       Builder global selected:
       Builder selected:
=====> ruby-getting-started builder-dockerfile information
       Builder dockerfile computed dockerfile path: Dockerfile
       Builder dockerfile global dockerfile path: Dockerfile
       Builder dockerfile dockerfile path:
=====> ruby-getting-started builder-lambda information
       Builder lambda computed lambdayml path: lambda.yml
       Builder lambda global lambdayml path: lambda.yml
       Builder lambda lambdayml path:
=====> ruby-getting-started builder-pack information
       Builder pack computed projecttoml path: project.toml
       Builder pack global projecttoml path: project.toml
       Builder pack projecttoml path:
=====> ruby-getting-started buildpacks information
       Buildpacks computed stack:     gliderlabs/herokuish:latest-20
       Buildpacks global stack:
       Buildpacks list:
       Buildpacks stack:
=====> ruby-getting-started ssl information
       Ssl dir:                       /home/dokku/ruby-getting-started/tls
       Ssl enabled:                   false
       Ssl hostnames:
       Ssl expires at:
       Ssl issuer:
       Ssl starts at:
       Ssl subject:
       Ssl verified:
=====> ruby-getting-started checks information
       Checks disabled list:          none
       Checks skipped list:           none
       Checks computed wait to retire: 60
       Checks global wait to retire:  60
       Checks wait to retire:
=====> ruby-getting-started cron information
       Cron task count:               0
=====> ruby-getting-started docker options information
       Docker options build:          --link dokku.postgres.railsdatabase:dokku-postgres-railsdatabase
       Docker options deploy:         --link dokku.postgres.railsdatabase:dokku-postgres-railsdatabase --restart=on-failure:10
       Docker options run:            --link dokku.postgres.railsdatabase:dokku-postgres-railsdatabase
=====> ruby-getting-started domains information
       Domains app enabled:           true
       Domains app vhosts:            *.mydomain.com
       Domains global enabled:        true
       Domains global vhosts:         mydomain.com
=====> ruby-getting-started git information
       Git deploy branch:             master
       Git global deploy branch:      master
       Git keep git dir:              false
       Git rev env var:               GIT_REV
       Git sha:                       e806e44
       Git source image:
       Git last updated at:           1675389450
Could not open file or uri for loading certificate from /home/dokku/ruby-getting-started/tls/server.crt
404723D1FD7E0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
404723D1FD7E0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/home/dokku/ruby-getting-started/tls/server.crt)
Unable to load certificate
=====> ruby-getting-started letsencrypt information
       Letsencrypt active:            false
       Letsencrypt autorenew:         false
       Letsencrypt computed dns provider: route53
       Letsencrypt global dns provider: route53
       Letsencrypt dns provider:
       Letsencrypt computed email:    [email protected]
       Letsencrypt global email:      [email protected]
       Letsencrypt email:
       Letsencrypt expiration:        1675382400
       Letsencrypt computed graceperiod: 2592000
       Letsencrypt global graceperiod:
       Letsencrypt graceperiod:
       Letsencrypt computed lego docker args:
       Letsencrypt global lego docker args:
       Letsencrypt lego docker args:
       Letsencrypt computed server:   https://acme-staging-v02.api.letsencrypt.org/directory
       Letsencrypt global server:     staging
       Letsencrypt server:
=====> ruby-getting-started logs information
       Logs computed max size:        10m
       Logs global max size:          10m
       Logs global vector sink:
       Logs max size:
       Logs vector sink:
=====> ruby-getting-started network information
       Network attach post create:
       Network attach post deploy:
       Network bind all interfaces:          false
       Network computed attach post create:
       Network computed attach post deploy:
       Network computed bind all interfaces: false
       Network computed initial network:
       Network computed tld:
       Network global attach post create:
       Network global attach post deploy:
       Network global bind all interfaces:   false
       Network global initial network:
       Network global tld:
       Network initial network:
       Network static web listener:
       Network tld:
       Network web listeners:                172.17.0.4:5000
=====> ruby-getting-started nginx information
       Nginx access log format:
       Nginx access log path:         /var/log/nginx/ruby-getting-started-access.log
       Nginx bind address ipv4:
       Nginx bind address ipv6:       ::
       Nginx client max body size:
       Nginx disable custom config:   false
       Nginx error log path:          /var/log/nginx/ruby-getting-started-error.log
       Nginx global hsts:             true
       Nginx computed hsts:           true
       Nginx hsts:
       Nginx hsts include subdomains: true
       Nginx hsts max age:            15724800
       Nginx hsts preload:            false
       Nginx computed nginx conf sigil path: nginx.conf.sigil
       Nginx global nginx conf sigil path: nginx.conf.sigil
       Nginx nginx conf sigil path:
       Nginx proxy buffer size:       4096
       Nginx proxy buffering:         on
       Nginx proxy buffers:           8 4096
       Nginx proxy busy buffers size: 8192
       Nginx proxy read timeout:      60s
       Nginx last visited at:         1675396349
       Nginx x forwarded for value:   $remote_addr
       Nginx x forwarded port value:  $server_port
       Nginx x forwarded proto value: $scheme
       Nginx x forwarded ssl:
=====> ruby-getting-started proxy information
       Proxy enabled:                 true
       Proxy port map:                http:80:5000
       Proxy type:                    nginx
=====> ruby-getting-started ps information
       Deployed:                      true
       Processes:                     1
       Ps can scale:                  true
       Ps computed procfile path:     Procfile
       Ps global procfile path:       Procfile
       Ps procfile path:
       Ps restart policy:             on-failure:10
       Restore:                       true
       Running:                       true
       Status web 1:                  running (CID: 0e75cbbd76a)
=====> ruby-getting-started registry information
       Registry computed image repo:      dokku/ruby-getting-started
       Registry computed push on release: false
       Registry computed server:
       Registry global push on release:
       Registry global server:
       Registry image repo:
       Registry push on release:
       Registry server:
       Registry tag version:
=====> ruby-getting-started resource information
=====> ruby-getting-started scheduler information
       Scheduler computed selected:   docker-local
       Scheduler global selected:     docker-local
       Scheduler selected:
=====> ruby-getting-started scheduler-docker-local information
       Scheduler docker local disable chown:
       Scheduler docker local init process: true
       Scheduler docker local parallel schedule count:
=====> ruby-getting-started storage information
       Storage build mounts:
       Storage deploy mounts:
       Storage run mounts:

@josegonzalez
Copy link
Member

Alright cool I'll test this on a VM this weekend - it worked for me last weekend and I had the sponsor confirm things work for them, but I wonder if there is something odd about that * character being misinterpreted somewhere.

Can you run the letsencrypt:enable command but with --trace?

dokku --trace letsencrypt:enable ruby-getting-started

@atwoodjw
Copy link
Author

atwoodjw commented Feb 3, 2023

Awesome, thanks. Certainly seems like the * is causing issues with the cp command.

dokku --trace letsencrypt:enable ruby-getting-started

+ export DOKKU_HOST_ROOT=/home/dokku
+ DOKKU_HOST_ROOT=/home/dokku
+ export DOKKU_DISTRO
++ . /etc/os-release
++ echo ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOCKER_BIN=docker
+ DOCKER_BIN=docker
+ export DOKKU_IMAGE=gliderlabs/herokuish:latest-20
+ DOKKU_IMAGE=gliderlabs/herokuish:latest-20
+ export DOKKU_CNB_BUILDER=heroku/buildpacks
+ DOKKU_CNB_BUILDER=heroku/buildpacks
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ export DOKKU_SYSTEM_GROUP=dokku
+ DOKKU_SYSTEM_GROUP=dokku
+ export DOKKU_SYSTEM_USER=dokku
+ DOKKU_SYSTEM_USER=dokku
+ export DOKKU_API_VERSION=1
+ DOKKU_API_VERSION=1
+ export DOKKU_NOT_IMPLEMENTED_EXIT=10
+ DOKKU_NOT_IMPLEMENTED_EXIT=10
+ export DOKKU_VALID_EXIT=0
+ DOKKU_VALID_EXIT=0
+ export DOKKU_PID=295104
+ DOKKU_PID=295104
+ export DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ export DOKKU_LOGS_HOST_DIR=/var/log/dokku
+ DOKKU_LOGS_HOST_DIR=/var/log/dokku
+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ export DOKKU_CONTAINER_LABEL=dokku
+ DOKKU_CONTAINER_LABEL=dokku
+ export 'DOKKU_GLOBAL_BUILD_ARGS=--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ DOKKU_GLOBAL_BUILD_ARGS='--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ export 'DOKKU_GLOBAL_RUN_ARGS=--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ DOKKU_GLOBAL_RUN_ARGS='--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args letsencrypt:enable ruby-getting-started
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=('letsencrypt:enable' 'ruby-getting-started')
+ local args
+ local flags
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ letsencrypt:enable == \-\-\a\p\p ]]
+ [[ letsencrypt:enable =~ ^--.* ]]
+ next_index=2
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ ruby-getting-started == \-\-\a\p\p ]]
+ [[ ruby-getting-started =~ ^--.* ]]
+ next_index=3
+ [[ -z --trace ]]
+ return 0
+ args=("$@")
+ skip_arg=false
+ [[ letsencrypt:enable =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
+ [[ '' == \t\r\u\e ]]
++ LC_ALL=C
++ /usr/bin/tty
+ [[ /dev/pts/1 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
+ [[ letsencrypt:enable =~ ^plugin:.* ]]
+ [[ letsencrypt:enable == \s\s\h\-\k\e\y\s\:\a\d\d ]]
+ [[ letsencrypt:enable == \s\s\h\-\k\e\y\s\:\r\e\m\o\v\e ]]
+ [[ -n '' ]]
+ dokku_auth letsencrypt:enable ruby-getting-started
+ declare 'desc=calls user-auth plugin trigger'
+ export SSH_USER=user
+ SSH_USER=user
+ export SSH_NAME=default
+ SSH_NAME=default
+ export DOKKU_COMMAND=letsencrypt:enable
+ DOKKU_COMMAND=letsencrypt:enable
++ wc -l
++ find /var/lib/dokku/plugins/enabled/20_events/user-auth
+ local user_auth_count=1
+ [[ 1 == 0 ]]
+ [[ 1 == 1 ]]
+ [[ -f /var/lib/dokku/plugins/enabled/20_events/user-auth ]]
+ return 0
+ case "$1" in
+ execute_dokku_cmd letsencrypt:enable ruby-getting-started
+ declare 'desc=executes dokku sub-commands'
+ local PLUGIN_NAME=letsencrypt:enable
+ local PLUGIN_CMD=letsencrypt:enable
+ local implemented=0
+ local script
+ argv=('letsencrypt:enable' 'ruby-getting-started')
+ local argv
+ case "$PLUGIN_NAME" in
++ readlink -f /var/lib/dokku/plugins/enabled/letsencrypt
+ [[ /var/lib/dokku/plugins/available/letsencrypt == *core-plugins* ]]
+ [[ -x /var/lib/dokku/plugins/enabled/letsencrypt:enable/subcommands/default ]]
+ [[ -x /var/lib/dokku/plugins/enabled/letsencrypt:enable/subcommands/letsencrypt:enable ]]
+ [[ -x /var/lib/dokku/plugins/enabled/letsencrypt/subcommands/enable ]]
+ [[ -n enable ]]
+ /var/lib/dokku/plugins/enabled/letsencrypt/subcommands/enable letsencrypt:enable ruby-getting-started
++ source /var/lib/dokku/core-plugins/available/common/property-functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/letsencrypt/internal-functions
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+++ source /var/lib/dokku/core-plugins/available/certs/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++++ source /var/lib/dokku/core-plugins/available/common/functions
+++++ set -eo pipefail
+++++ [[ -n 1 ]]
+++++ set -x
+++ source /var/lib/dokku/core-plugins/available/domains/functions
++++ source /var/lib/dokku/core-plugins/available/common/functions
+++++ set -eo pipefail
+++++ [[ -n 1 ]]
+++++ set -x
++++ source /var/lib/dokku/plugins/available/config/functions
+++++ set -eo pipefail
+++++ [[ -n 1 ]]
+++++ set -x
+++++ source /var/lib/dokku/core-plugins/available/common/functions
++++++ set -eo pipefail
++++++ [[ -n 1 ]]
++++++ set -x
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+++ source /var/lib/dokku/core-plugins/available/nginx-vhosts/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++++ source /var/lib/dokku/core-plugins/available/common/functions
+++++ set -eo pipefail
+++++ [[ -n 1 ]]
+++++ set -x
++++ source /var/lib/dokku/plugins/available/certs/functions
+++++ set -eo pipefail
+++++ [[ -n 1 ]]
+++++ set -x
+++++ source /var/lib/dokku/core-plugins/available/common/functions
++++++ set -eo pipefail
++++++ [[ -n 1 ]]
++++++ set -x
++++ source /var/lib/dokku/plugins/available/config/functions
+++++ set -eo pipefail
+++++ [[ -n 1 ]]
+++++ set -x
+++++ source /var/lib/dokku/core-plugins/available/common/functions
++++++ set -eo pipefail
++++++ [[ -n 1 ]]
++++++ set -x
++++ source /var/lib/dokku/plugins/available/nginx-vhosts/internal-functions
+++++ set -eo pipefail
+++++ [[ -n 1 ]]
+++++ set -x
+++++ source /var/lib/dokku/core-plugins/available/common/functions
++++++ set -eo pipefail
++++++ [[ -n 1 ]]
++++++ set -x
+++++ source /var/lib/dokku/core-plugins/available/common/property-functions
++++++ set -eo pipefail
++++++ [[ -n 1 ]]
++++++ set -x
+++++ dirname /var/lib/dokku/plugins/available/letsencrypt/internal-functions
++++ cd /var/lib/dokku/plugins/available/letsencrypt
++++ pwd
+++ source /var/lib/dokku/plugins/available/letsencrypt/config
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++++ export LETSENCRYPT_IMAGE=goacme/lego
++++ LETSENCRYPT_IMAGE=goacme/lego
++++ export LETSENCRYPT_IMAGE_VERSION=v4.9.1
++++ LETSENCRYPT_IMAGE_VERSION=v4.9.1
++++ export PLUGIN_DISABLE_PULL=
++++ PLUGIN_DISABLE_PULL=
++++ export PLUGIN_DISABLE_PULL_VARIABLE=LETSENCRYPT_DISABLE_PULL
++++ PLUGIN_DISABLE_PULL_VARIABLE=LETSENCRYPT_DISABLE_PULL
++++ export PLUGIN_IMAGE=goacme/lego
++++ PLUGIN_IMAGE=goacme/lego
++++ export PLUGIN_IMAGE_VERSION=v4.9.1
++++ PLUGIN_IMAGE_VERSION=v4.9.1
++++ export LETSENCRYPT_CRON_CMD=/var/lib/dokku/plugins/available/letsencrypt/cron-job
++++ LETSENCRYPT_CRON_CMD=/var/lib/dokku/plugins/available/letsencrypt/cron-job
++++ export 'LETSENCRYPT_CRON_JOB=@daily /var/lib/dokku/plugins/available/letsencrypt/cron-job'
++++ LETSENCRYPT_CRON_JOB='@daily /var/lib/dokku/plugins/available/letsencrypt/cron-job'
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++++ dirname /var/lib/dokku/plugins/available/letsencrypt/command-functions
+++ cd /var/lib/dokku/plugins/available/letsencrypt
+++ pwd
++ source /var/lib/dokku/plugins/available/letsencrypt/config
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ export LETSENCRYPT_IMAGE=goacme/lego
+++ LETSENCRYPT_IMAGE=goacme/lego
+++ export LETSENCRYPT_IMAGE_VERSION=v4.9.1
+++ LETSENCRYPT_IMAGE_VERSION=v4.9.1
+++ export PLUGIN_DISABLE_PULL=
+++ PLUGIN_DISABLE_PULL=
+++ export PLUGIN_DISABLE_PULL_VARIABLE=LETSENCRYPT_DISABLE_PULL
+++ PLUGIN_DISABLE_PULL_VARIABLE=LETSENCRYPT_DISABLE_PULL
+++ export PLUGIN_IMAGE=goacme/lego
+++ PLUGIN_IMAGE=goacme/lego
+++ export PLUGIN_IMAGE_VERSION=v4.9.1
+++ PLUGIN_IMAGE_VERSION=v4.9.1
+++ export LETSENCRYPT_CRON_CMD=/var/lib/dokku/plugins/available/letsencrypt/cron-job
+++ LETSENCRYPT_CRON_CMD=/var/lib/dokku/plugins/available/letsencrypt/cron-job
+++ export 'LETSENCRYPT_CRON_JOB=@daily /var/lib/dokku/plugins/available/letsencrypt/cron-job'
+++ LETSENCRYPT_CRON_JOB='@daily /var/lib/dokku/plugins/available/letsencrypt/cron-job'
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ set -eo pipefail
+ [[ -n 1 ]]
+ set -x
+ cmd-letsencrypt-enable letsencrypt:enable ruby-getting-started
+ declare 'desc=Enable or renew letsencrypt for an app'
+ declare cmd=letsencrypt:enable
+ [[ letsencrypt:enable == \l\e\t\s\e\n\c\r\y\p\t\:\e\n\a\b\l\e ]]
+ shift 1
+ [[ -n '' ]]
+ declare APP=ruby-getting-started
+ [[ ruby-getting-started == \-\-\a\l\l ]]
+ fn-lentsencrypt-enable ruby-getting-started
+ declare APP=ruby-getting-started
+ local EXIT_CODE=0
+ local domain
+ verify_app_name ruby-getting-started
+ declare 'desc=verify app name format and app existence'
+ declare APP=ruby-getting-started
+ /var/lib/dokku/core-plugins/available/common/common --quiet verify-app-name ruby-getting-started
+ return 0
++ get_app_domains ruby-getting-started
++ declare 'desc=return app domains'
++ local APP=ruby-getting-started
++ local APP_VHOST_PATH=/home/dokku/ruby-getting-started/VHOST
++ awk '{print $1}'
+++ is_app_vhost_enabled ruby-getting-started
+++ declare 'desc=returns true or false if vhost support is enabled for a given application'
+++ local APP=ruby-getting-started
++++ config_get ruby-getting-started NO_VHOST
++++ declare 'desc=get value of given config var'
++++ config_sub get ruby-getting-started NO_VHOST
++++ declare 'desc=executes a config subcommand'
++++ local name=get
++++ shift
++++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started NO_VHOST
++ xargs
+++ local NO_VHOST=0
+++ local APP_VHOST_ENABLED=true
+++ [[ 0 == \1 ]]
+++ echo true
++ [[ true == \t\r\u\e ]]
++ [[ -f /home/dokku/ruby-getting-started/VHOST ]]
++ cat /home/dokku/ruby-getting-started/VHOST
+ domain='*.mydomain.com'
+ [[ -z *.mydomain.com ]]
+ dokku_log_info2 'Enabling letsencrypt for ruby-getting-started'
+ declare 'desc=log info2 formatter'
+ echo '=====> Enabling letsencrypt for ruby-getting-started'
=====> Enabling letsencrypt for ruby-getting-started
+ fn-letsencrypt-check-email ruby-getting-started
+ declare 'desc=Check if an e-mail address is provided globally or for the app'
+ declare APP=ruby-getting-started
++ fn-letsencrypt-computed-email ruby-getting-started
++ declare 'desc=get configured email address'
++ declare APP=ruby-getting-started
+++ fn-letsencrypt-email ruby-getting-started
+++ declare 'desc=get configured email address'
+++ declare APP=ruby-getting-started
+++ fn-plugin-property-get-default letsencrypt ruby-getting-started email ''
+++ declare 'desc=returns the value for a given property with a specified default value'
+++ declare PLUGIN=letsencrypt APP=ruby-getting-started KEY=email DEFAULT=
+++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt ruby-getting-started email ''
++ value=
++ [[ -z '' ]]
+++ fn-letsencrypt-global-email
+++ declare 'desc=get configured email address'
+++ fn-plugin-property-get-default letsencrypt --global email ''
+++ declare 'desc=returns the value for a given property with a specified default value'
+++ declare PLUGIN=letsencrypt APP=--global KEY=email DEFAULT=
+++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt --global email ''
++ [email protected]
++ echo [email protected]
+ [[ -z [email protected] ]]
+ fn-letsencrypt-acme-proxy-enable ruby-getting-started
+ declare 'desc=enable ACME proxy for an app'
+ local APP=ruby-getting-started
+ local app_root=/home/dokku/ruby-getting-started
+ local app_config_dir=/home/dokku/ruby-getting-started/nginx.conf.d
+ dokku_log_info1 'Enabling ACME proxy for ruby-getting-started...'
+ declare 'desc=log info1 formatter'
+ echo '-----> Enabling ACME proxy for ruby-getting-started...'
-----> Enabling ACME proxy for ruby-getting-started...
+ [[ -d /home/dokku/ruby-getting-started/nginx.conf.d ]]
+ sigil -f /var/lib/dokku/plugins/available/letsencrypt/templates/letsencrypt.conf.sigil APP=ruby-getting-started DOKKU_LIB_ROOT=/var/lib/dokku
+ restart_nginx
+ declare 'desc=restart nginx for given distros'
+ sed 's/^/       /'
++ plugn trigger proxy-is-enabled ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ local PROXY_ENABLED=true
++ plugn trigger proxy-type ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ local PROXY_TYPE=nginx
+ [[ true == \t\r\u\e ]]
+ [[ nginx == \n\g\i\n\x ]]
+ fn-nginx-vhosts-nginx-init-cmd reload
+ declare 'desc=start nginx for given distros'
+ declare CMD=reload
+ local NGINX_INIT_NAME
+ NGINX_INIT_NAME=nginx
+ fn-nginx-vhosts-uses-openresty
+ declare 'desc=returns whether openresty is in use or not'
+ [[ -x /usr/bin/openresty ]]
+ return 1
+ case "$DOKKU_DISTRO" in
+ [[ -x /usr/bin/sv ]]
+ [[ -x /usr/bin/systemctl ]]
+ sudo /usr/bin/systemctl reload nginx
+ fn-letsencrypt-acme-execute-challenge ruby-getting-started
+ declare 'desc=perform actual ACME validation procedure'
+ declare APP=ruby-getting-started
+ local FAKE_NGINX_CONF=false
+ local challenge_mode config_dir
+ [[ ! -f /home/dokku/ruby-getting-started/nginx.conf ]]
+ fn-letsencrypt-create-root ruby-getting-started
+ declare 'desc=Ensure the let'\''s encrypt root directory exists'
+ declare APP=ruby-getting-started
+ local app_root=/home/dokku/ruby-getting-started
+ local le_root=/home/dokku/ruby-getting-started/letsencrypt
+ mkdir -p /home/dokku/ruby-getting-started/letsencrypt
+ [[ ! -f /home/dokku/ruby-getting-started/nginx.conf ]]
+ challenge_mode=HTTP-01
++ fn-letsencrypt-computed-dns-provider ruby-getting-started
++ declare 'desc=get configured dns provider'
++ declare APP=ruby-getting-started
+++ fn-letsencrypt-dns-provider ruby-getting-started
+++ declare 'desc=get configured dns provider'
+++ declare APP=ruby-getting-started
+++ fn-plugin-property-get-default letsencrypt ruby-getting-started dns-provider ''
+++ declare 'desc=returns the value for a given property with a specified default value'
+++ declare PLUGIN=letsencrypt APP=ruby-getting-started KEY=dns-provider DEFAULT=
+++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt ruby-getting-started dns-provider ''
++ value=
++ [[ -z '' ]]
+++ fn-letsencrypt-global-dns-provider
+++ declare 'desc=get configured dns provider'
+++ fn-plugin-property-get-default letsencrypt --global dns-provider ''
+++ declare 'desc=returns the value for a given property with a specified default value'
+++ declare PLUGIN=letsencrypt APP=--global KEY=dns-provider DEFAULT=
+++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt --global dns-provider ''
++ value=route53
++ echo route53
+ dns_provider=route53
+ [[ -n route53 ]]
+ challenge_mode=DNS-01
+ dokku_log_info1 'Getting letsencrypt certificate for ruby-getting-started via DNS-01'
+ declare 'desc=log info1 formatter'
+ echo '-----> Getting letsencrypt certificate for ruby-getting-started via DNS-01'
-----> Getting letsencrypt certificate for ruby-getting-started via DNS-01
++ fn-letsencrypt-configure-and-get-dir ruby-getting-started
++ declare 'desc=assemble lego command line arguments and create a config hash directory for them'
++ declare APP=ruby-getting-started
++ local config config_dir config_hash dns_provider domain_args domains email extra_args graceperiod key server value
++ local app_root=/home/dokku/ruby-getting-started
++ local le_root=/home/dokku/ruby-getting-started/letsencrypt
++ mkdir -p /home/dokku/ruby-getting-started/letsencrypt/account
+++ fn-letsencrypt-computed-server ruby-getting-started
+++ declare 'desc=get configured server'
+++ declare APP=ruby-getting-started
++++ fn-letsencrypt-server ruby-getting-started
++++ declare 'desc=get configured server'
++++ declare APP=ruby-getting-started
++++ fn-plugin-property-get-default letsencrypt ruby-getting-started server ''
++++ declare 'desc=returns the value for a given property with a specified default value'
++++ declare PLUGIN=letsencrypt APP=ruby-getting-started KEY=server DEFAULT=
++++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt ruby-getting-started server ''
+++ value=
+++ [[ -z '' ]]
++++ fn-letsencrypt-global-server
++++ declare 'desc=get configured server'
++++ fn-plugin-property-get-default letsencrypt --global server ''
++++ declare 'desc=returns the value for a given property with a specified default value'
++++ declare PLUGIN=letsencrypt APP=--global KEY=server DEFAULT=
++++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt --global server ''
+++ value=staging
+++ [[ -z staging ]]
+++ [[ staging == \d\e\f\a\u\l\t ]]
+++ [[ staging == \s\t\a\g\i\n\g ]]
+++ value=https://acme-staging-v02.api.letsencrypt.org/directory
+++ echo https://acme-staging-v02.api.letsencrypt.org/directory
++ server=https://acme-staging-v02.api.letsencrypt.org/directory
+++ get_app_domains ruby-getting-started
+++ declare 'desc=return app domains'
+++ local APP=ruby-getting-started
+++ local APP_VHOST_PATH=/home/dokku/ruby-getting-started/VHOST
++++ is_app_vhost_enabled ruby-getting-started
++++ declare 'desc=returns true or false if vhost support is enabled for a given application'
++++ local APP=ruby-getting-started
+++++ config_get ruby-getting-started NO_VHOST
+++++ declare 'desc=get value of given config var'
+++++ config_sub get ruby-getting-started NO_VHOST
+++++ declare 'desc=executes a config subcommand'
+++++ local name=get
+++++ shift
+++++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started NO_VHOST
++++ local NO_VHOST=0
++++ local APP_VHOST_ENABLED=true
++++ [[ 0 == \1 ]]
++++ echo true
+++ [[ true == \t\r\u\e ]]
+++ [[ -f /home/dokku/ruby-getting-started/VHOST ]]
+++ cat /home/dokku/ruby-getting-started/VHOST
++ domains='*.mydomain.com'
++ domain_args=
++ for domain in $domains
++ dokku_log_verbose ' - Domain '\''*.mydomain.com'\'''
++ declare 'desc=log verbose formatter'
++ echo '        - Domain '\''*.mydomain.com'\'''
        - Domain '*.mydomain.com'
++ domain_args=' --domains *.mydomain.com'
+++ fn-letsencrypt-computed-graceperiod ruby-getting-started
+++ declare 'desc=get configured graceperiod'
+++ declare APP=ruby-getting-started
+++ local value
++++ fn-letsencrypt-graceperiod ruby-getting-started
++++ declare 'desc=get configured graceperiod'
++++ declare APP=ruby-getting-started
++++ fn-plugin-property-get-default letsencrypt ruby-getting-started graceperiod ''
++++ declare 'desc=returns the value for a given property with a specified default value'
++++ declare PLUGIN=letsencrypt APP=ruby-getting-started KEY=graceperiod DEFAULT=
++++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt ruby-getting-started graceperiod ''
+++ value=
+++ [[ -z '' ]]
++++ fn-letsencrypt-global-graceperiod
++++ declare 'desc=get configured graceperiod'
++++ fn-plugin-property-get-default letsencrypt --global graceperiod ''
++++ declare 'desc=returns the value for a given property with a specified default value'
++++ declare PLUGIN=letsencrypt APP=--global KEY=graceperiod DEFAULT=
++++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt --global graceperiod ''
+++ value=
+++ [[ -z '' ]]
+++ value=2592000
+++ echo 2592000
++ graceperiod=2592000
+++ fn-letsencrypt-computed-email ruby-getting-started
+++ declare 'desc=get configured email address'
+++ declare APP=ruby-getting-started
++++ fn-letsencrypt-email ruby-getting-started
++++ declare 'desc=get configured email address'
++++ declare APP=ruby-getting-started
++++ fn-plugin-property-get-default letsencrypt ruby-getting-started email ''
++++ declare 'desc=returns the value for a given property with a specified default value'
++++ declare PLUGIN=letsencrypt APP=ruby-getting-started KEY=email DEFAULT=
++++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt ruby-getting-started email ''
+++ value=
+++ [[ -z '' ]]
++++ fn-letsencrypt-global-email
++++ declare 'desc=get configured email address'
++++ fn-plugin-property-get-default letsencrypt --global email ''
++++ declare 'desc=returns the value for a given property with a specified default value'
++++ declare PLUGIN=letsencrypt APP=--global KEY=email DEFAULT=
++++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt --global email ''
+++ [email protected]
+++ echo [email protected]
++ [email protected]
+++ fn-letsencrypt-computed-lego-docker-args ruby-getting-started
+++ declare 'desc=get configured lego docker args'
+++ declare APP=ruby-getting-started
++++ fn-letsencrypt-lego-docker-args ruby-getting-started
++++ declare 'desc=get configured lego docker args'
++++ declare APP=ruby-getting-started
++++ fn-plugin-property-get-default letsencrypt ruby-getting-started lego-docker-args ''
++++ declare 'desc=returns the value for a given property with a specified default value'
++++ declare PLUGIN=letsencrypt APP=ruby-getting-started KEY=lego-docker-args DEFAULT=
++++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt ruby-getting-started lego-docker-args ''
+++ value=
+++ [[ -z '' ]]
++++ fn-letsencrypt-global-lego-docker-args
++++ declare 'desc=get configured lego docker args'
++++ fn-plugin-property-get-default letsencrypt --global lego-docker-args ''
++++ declare 'desc=returns the value for a given property with a specified default value'
++++ declare PLUGIN=letsencrypt APP=--global KEY=lego-docker-args DEFAULT=
++++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt --global lego-docker-args ''
+++ value=
+++ echo ''
++ extra_args=
++ config='--pem --accept-tos --cert.timeout 2592000 --path /certs --server https://acme-staging-v02.api.letsencrypt.org/directory --email [email protected]   --domains *.mydomain.com'
+++ fn-letsencrypt-computed-dns-provider ruby-getting-started
+++ declare 'desc=get configured dns provider'
+++ declare APP=ruby-getting-started
++++ fn-letsencrypt-dns-provider ruby-getting-started
++++ declare 'desc=get configured dns provider'
++++ declare APP=ruby-getting-started
++++ fn-plugin-property-get-default letsencrypt ruby-getting-started dns-provider ''
++++ declare 'desc=returns the value for a given property with a specified default value'
++++ declare PLUGIN=letsencrypt APP=ruby-getting-started KEY=dns-provider DEFAULT=
++++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt ruby-getting-started dns-provider ''
+++ value=
+++ [[ -z '' ]]
++++ fn-letsencrypt-global-dns-provider
++++ declare 'desc=get configured dns provider'
++++ fn-plugin-property-get-default letsencrypt --global dns-provider ''
++++ declare 'desc=returns the value for a given property with a specified default value'
++++ declare PLUGIN=letsencrypt APP=--global KEY=dns-provider DEFAULT=
++++ /var/lib/dokku/core-plugins/available/common/prop get-with-default letsencrypt --global dns-provider ''
+++ value=route53
+++ echo route53
++ dns_provider=route53
++ [[ -n route53 ]]
++ config='--dns route53 --pem --accept-tos --cert.timeout 2592000 --path /certs --server https://acme-staging-v02.api.letsencrypt.org/directory --email [email protected]   --domains *.mydomain.com'
+++ echo '--dns route53 --pem --accept-tos --cert.timeout 2592000 --path /certs --server https://acme-staging-v02.api.letsencrypt.org/directory --email [email protected]   --domains *.mydomain.com'
+++ awk '{print $1}'
+++ sha1sum
++ config_hash=5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
++ config_dir=/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
++ mkdir -p /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
++ rm -f /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/docker.env
++ touch /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/docker.env
++ [[ -n route53 ]]
++ fn-plugin-property-get-all letsencrypt --global
++ declare 'desc=returns a map of all properties for a given app'
++ declare PLUGIN=letsencrypt APP=--global
++ /var/lib/dokku/core-plugins/available/common/prop get-all letsencrypt --global
++ read -r line
++ [[ -n dns-provider route53 ]]
+++ cut '-d ' -f1
++ key=dns-provider
++ [[ dns-provider == dns-provider-* ]]
++ read -r line
++ [[ -n dns-provider-AWS_ACCESS_KEY_ID XXX ]]
+++ cut '-d ' -f1
++ key=dns-provider-AWS_ACCESS_KEY_ID
++ [[ dns-provider-AWS_ACCESS_KEY_ID == dns-provider-* ]]
+++ cut '-d ' -f2
++ value=XXX
++ echo AWS_ACCESS_KEY_ID=XXX
++ read -r line
++ [[ -n dns-provider-AWS_SECRET_ACCESS_KEY XXX ]]
+++ cut '-d ' -f1
++ key=dns-provider-AWS_SECRET_ACCESS_KEY
++ [[ dns-provider-AWS_SECRET_ACCESS_KEY == dns-provider-* ]]
+++ cut '-d ' -f2
++ value=XXX
++ echo AWS_SECRET_ACCESS_KEY=XXX
++ read -r line
++ [[ -n email [email protected] ]]
+++ cut '-d ' -f1
++ key=email
++ [[ email == dns-provider-* ]]
++ read -r line
++ [[ -n server staging ]]
+++ cut '-d ' -f1
++ key=server
++ [[ server == dns-provider-* ]]
++ read -r line
++ fn-plugin-property-get-all letsencrypt ruby-getting-started
++ declare 'desc=returns a map of all properties for a given app'
++ declare PLUGIN=letsencrypt APP=ruby-getting-started
++ /var/lib/dokku/core-plugins/available/common/prop get-all letsencrypt ruby-getting-started
++ read -r line
++ chmod 0755 /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/docker.env
++ echo '--dns route53 --pem --accept-tos --cert.timeout 2592000 --path /certs --server https://acme-staging-v02.api.letsencrypt.org/directory --email [email protected]   --domains *.mydomain.com'
++ echo /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3:/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
+ config_dirs=/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3:/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
++ echo /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3:/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
++ cut -d: -f1
+ host_config_dir=/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
++ echo /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3:/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
++ cut -d: -f2
+ container_config_dir=/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
+ read -r -a config
+ set +e
++ id -u
+ export DOKKU_UID=1001
+ DOKKU_UID=1001
++ id -g
+ export DOKKU_GID=1001
+ DOKKU_GID=1001
+ mkdir -p /var/lib/dokku/data/letsencrypt/ruby-getting-started
+ sed 's/^/       /'
+ docker run --rm --env-file /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/docker.env --user 1001:1001 -v /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3:/certs -v /var/lib/dokku/data/letsencrypt/ruby-getting-started:/webroot goacme/lego:v4.9.1 --dns route53 --pem --accept-tos --cert.timeout 2592000 --path /certs --server https://acme-staging-v02.api.letsencrypt.org/directory --email [email protected] --domains '*.mydomain.com' run
2023/02/03 04:29:52 [INFO] [*.mydomain.com] acme: Obtaining bundled SAN certificate
2023/02/03 04:29:52 [INFO] [*.mydomain.com] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/5213993073
2023/02/03 04:29:52 [INFO] [*.mydomain.com] acme: authorization already valid; skipping challenge
2023/02/03 04:29:52 [INFO] [*.mydomain.com] acme: Validations succeeded; requesting certificates
2023/02/03 04:29:53 [INFO] [*.mydomain.com] Server responded with a certificate.
+ local exit_code=0
+ set -e
+ [[ false == \t\r\u\e ]]
+ [[ 0 != 0 ]]
+ dokku_log_info1 'Certificate retrieved successfully.'
+ declare 'desc=log info1 formatter'
+ echo '-----> Certificate retrieved successfully.'
-----> Certificate retrieved successfully.
+ fn-letsencrypt-symlink-certs ruby-getting-started /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
+ declare 'desc=symlink let'\''s encrypt certificates so they can be found by dokku'
+ declare APP=ruby-getting-started config_dir=/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3
+ local app_root=/home/dokku/ruby-getting-started
+ local le_root=/home/dokku/ruby-getting-started/letsencrypt
+ local domain
+ dokku_log_info1 'Installing let'\''s encrypt certificates'
+ declare 'desc=log info1 formatter'
+ echo '-----> Installing let'\''s encrypt certificates'
-----> Installing let's encrypt certificates
+ ln -nsf /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3 /home/dokku/ruby-getting-started/letsencrypt/certs/current
+ unset DOKKU_APP_NAME
++ get_app_domains ruby-getting-started
++ declare 'desc=return app domains'
++ local APP=ruby-getting-started
++ local APP_VHOST_PATH=/home/dokku/ruby-getting-started/VHOST
++ xargs
++ awk '{print $1}'
+++ is_app_vhost_enabled ruby-getting-started
+++ declare 'desc=returns true or false if vhost support is enabled for a given application'
+++ local APP=ruby-getting-started
++++ config_get ruby-getting-started NO_VHOST
++++ declare 'desc=get value of given config var'
++++ config_sub get ruby-getting-started NO_VHOST
++++ declare 'desc=executes a config subcommand'
++++ local name=get
++++ shift
++++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started NO_VHOST
+++ local NO_VHOST=0
+++ local APP_VHOST_ENABLED=true
+++ [[ 0 == \1 ]]
+++ echo true
++ [[ true == \t\r\u\e ]]
++ [[ -f /home/dokku/ruby-getting-started/VHOST ]]
++ cat /home/dokku/ruby-getting-started/VHOST
+ domain='*.mydomain.com'
+ dokku certs:add ruby-getting-started '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key'
+ export DOKKU_HOST_ROOT=/home/dokku
+ DOKKU_HOST_ROOT=/home/dokku
+ export DOKKU_DISTRO
++ . /etc/os-release
++ echo ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOCKER_BIN=docker
+ DOCKER_BIN=docker
+ export DOKKU_IMAGE=gliderlabs/herokuish:latest-20
+ DOKKU_IMAGE=gliderlabs/herokuish:latest-20
+ export DOKKU_CNB_BUILDER=heroku/buildpacks
+ DOKKU_CNB_BUILDER=heroku/buildpacks
+ export DOKKU_LIB_ROOT=/var/lib/dokku
+ DOKKU_LIB_ROOT=/var/lib/dokku
+ export PLUGIN_PATH=/var/lib/dokku/plugins
+ PLUGIN_PATH=/var/lib/dokku/plugins
+ export PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ PLUGIN_AVAILABLE_PATH=/var/lib/dokku/plugins/available
+ export PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ PLUGIN_ENABLED_PATH=/var/lib/dokku/plugins/enabled
+ export PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ PLUGIN_CORE_PATH=/var/lib/dokku/core-plugins
+ export PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ PLUGIN_CORE_AVAILABLE_PATH=/var/lib/dokku/core-plugins/available
+ export PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ PLUGIN_CORE_ENABLED_PATH=/var/lib/dokku/core-plugins/enabled
+ export DOKKU_SYSTEM_GROUP=dokku
+ DOKKU_SYSTEM_GROUP=dokku
+ export DOKKU_SYSTEM_USER=dokku
+ DOKKU_SYSTEM_USER=dokku
+ export DOKKU_API_VERSION=1
+ DOKKU_API_VERSION=1
+ export DOKKU_NOT_IMPLEMENTED_EXIT=10
+ DOKKU_NOT_IMPLEMENTED_EXIT=10
+ export DOKKU_VALID_EXIT=0
+ DOKKU_VALID_EXIT=0
+ export DOKKU_PID=295632
+ DOKKU_PID=295632
+ export DOKKU_LOGS_DIR=/var/log/dokku
+ DOKKU_LOGS_DIR=/var/log/dokku
+ export DOKKU_LOGS_HOST_DIR=/var/log/dokku
+ DOKKU_LOGS_HOST_DIR=/var/log/dokku
+ export DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ DOKKU_EVENTS_LOGFILE=/var/log/dokku/events.log
+ export DOKKU_CONTAINER_LABEL=dokku
+ DOKKU_CONTAINER_LABEL=dokku
+ export 'DOKKU_GLOBAL_BUILD_ARGS=--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ DOKKU_GLOBAL_BUILD_ARGS='--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ export 'DOKKU_GLOBAL_RUN_ARGS=--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ DOKKU_GLOBAL_RUN_ARGS='--label=org.label-schema.schema-version=1.0 --label=org.label-schema.vendor=dokku --label=dokku'
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ parse_args certs:add ruby-getting-started '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key'
+ declare 'desc=top-level cli arg parser'
+ local next_index=1
+ local skip=false
+ args=('certs:add' 'ruby-getting-started' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key')
+ local args
+ local flags
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ certs:add == \-\-\a\p\p ]]
+ [[ certs:add =~ ^--.* ]]
+ next_index=2
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ ruby-getting-started == \-\-\a\p\p ]]
+ [[ ruby-getting-started =~ ^--.* ]]
+ next_index=3
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem == \-\-\a\p\p ]]
+ [[ /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem =~ ^--.* ]]
+ next_index=4
+ for arg in "$@"
+ [[ false == \t\r\u\e ]]
+ case "$arg" in
+ [[ false == \t\r\u\e ]]
+ [[ /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key == \-\-\a\p\p ]]
+ [[ /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key =~ ^--.* ]]
+ next_index=5
+ [[ -z --trace ]]
+ return 0
+ args=("$@")
+ skip_arg=false
+ [[ certs:add =~ ^--.* ]]
+ has_tty
+ declare 'desc=return 0 if we have a tty'
+ [[ '' == \t\r\u\e ]]
++ LC_ALL=C
++ /usr/bin/tty
+ [[ /dev/pts/1 == \n\o\t\ \a\ \t\t\y ]]
+ return 0
++ id -un
+ [[ dokku != \d\o\k\k\u ]]
+ [[ certs:add =~ ^plugin:.* ]]
+ [[ certs:add == \s\s\h\-\k\e\y\s\:\a\d\d ]]
+ [[ certs:add == \s\s\h\-\k\e\y\s\:\r\e\m\o\v\e ]]
+ [[ -n '' ]]
+ dokku_auth certs:add ruby-getting-started '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key'
+ declare 'desc=calls user-auth plugin trigger'
+ export SSH_USER=user
+ SSH_USER=user
+ export SSH_NAME=default
+ SSH_NAME=default
+ export DOKKU_COMMAND=certs:add
+ DOKKU_COMMAND=certs:add
++ wc -l
++ find /var/lib/dokku/plugins/enabled/20_events/user-auth
+ local user_auth_count=1
+ [[ 1 == 0 ]]
+ [[ 1 == 1 ]]
+ [[ -f /var/lib/dokku/plugins/enabled/20_events/user-auth ]]
+ return 0
+ case "$1" in
+ execute_dokku_cmd certs:add ruby-getting-started '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key'
+ declare 'desc=executes dokku sub-commands'
+ local PLUGIN_NAME=certs:add
+ local PLUGIN_CMD=certs:add
+ local implemented=0
+ local script
+ argv=('certs:add' 'ruby-getting-started' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key')
+ local argv
+ case "$PLUGIN_NAME" in
++ readlink -f /var/lib/dokku/plugins/enabled/certs
+ [[ /var/lib/dokku/core-plugins/available/certs == *core-plugins* ]]
+ [[ certs:add == \c\e\r\t\s\:\a\d\d ]]
+ shift 1
+ [[ -n '' ]]
+ set -- certs:add ruby-getting-started '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key'
+ [[ -x /var/lib/dokku/plugins/enabled/certs:add/subcommands/default ]]
+ [[ -x /var/lib/dokku/plugins/enabled/certs:add/subcommands/certs:add ]]
+ [[ -x /var/lib/dokku/plugins/enabled/certs/subcommands/add ]]
+ [[ -n add ]]
+ /var/lib/dokku/plugins/enabled/certs/subcommands/add certs:add ruby-getting-started '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key'
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/certs/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ cmd-certs-set certs:add ruby-getting-started '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key'
+ declare 'desc=imports an SSL cert/key combo either on STDIN via a tarball or from specified cert/key filenames'
+ declare cmd=certs:add
+ [[ certs:add == \c\e\r\t\s\:\a\d\d ]]
+ shift 1
+ declare APP=ruby-getting-started 'CRT_FILE=/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' 'KEY_FILE=/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key'
+ verify_app_name ruby-getting-started
+ declare 'desc=verify app name format and app existence'
+ declare APP=ruby-getting-started
+ /var/lib/dokku/core-plugins/available/common/common --quiet verify-app-name ruby-getting-started
+ return 0
+ local APP_SSL_PATH=/home/dokku/ruby-getting-started/tls
+ is_file_import '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem' '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key'
+ declare 'desc=determines if we have passed in a file and key path for a file import'
+ local 'CRT_FILE=/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem'
+ local 'KEY_FILE=/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key'
+ [[ -n /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem ]]
+ [[ -n /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.key ]]
+ [[ ! -r /home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.pem ]]
+ dokku_log_fail 'CRT file specified not found, please check file paths'
+ declare 'desc=log fail formatter'
+ echo ' !     CRT file specified not found, please check file paths'
 !     CRT file specified not found, please check file paths
+ exit 1
+ rm -f /home/dokku/ruby-getting-started/tls/server.letsencrypt.crt /home/dokku/ruby-getting-started/tls/server.crt
+ cp '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.crt' /home/dokku/ruby-getting-started/tls/server.letsencrypt.crt
cp: cannot stat '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.crt': No such file or directory
+ cp '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.crt' /home/dokku/ruby-getting-started/tls/server.crt
cp: cannot stat '/home/dokku/ruby-getting-started/letsencrypt/certs/5c0b57f16f858fe9b5d4f63accd5ac3dd75bfbe3/certificates/*.mydomain.com.crt': No such file or directory
+ plugn trigger proxy-build-config ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ source /var/lib/dokku/plugins/available/nginx-vhosts/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
++ source /var/lib/dokku/plugins/available/certs/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ source /var/lib/dokku/plugins/available/nginx-vhosts/internal-functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/property-functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
+ trigger-nginx-vhosts-proxy-build-config ruby-getting-started
+ declare 'desc=build nginx config to proxy app containers from command line'
+ declare trigger=proxy-build-config
+ declare APP=ruby-getting-started
+ local HAS_NETWORK_CONFIG
++ plugn trigger proxy-type ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ [[ nginx != \n\g\i\n\x ]]
++ plugn trigger network-config-exists ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ HAS_NETWORK_CONFIG=true
+ [[ true == \t\r\u\e ]]
+ plugn trigger network-build-config ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
 ?     plugn trigger ps-current-scale [ruby-getting-started]
 ?     plugn trigger ps-current-scale stderr: + source /var/lib/dokku/core-plugins/available/common/functions
 ?     plugn trigger ps-current-scale stderr: ++ set -eo pipefail
 ?     plugn trigger ps-current-scale stderr: ++ [[ -n 1 ]]
 ?     plugn trigger ps-current-scale stderr: ++ set -x
 ?     plugn trigger ps-current-scale stderr: + [[ ! -n '' ]]
 ?     plugn trigger ps-current-scale stderr:
 ?     plugn trigger ps-current-scale stdout: web=1
 ?     plugn trigger scheduler-detect [ruby-getting-started]
 ?     plugn trigger scheduler-detect [--global]
 ?     plugn trigger scheduler-detect stderr: + source /var/lib/dokku/core-plugins/available/common/functions
 ?     plugn trigger scheduler-detect stderr: ++ set -eo pipefail
 ?     plugn trigger scheduler-detect stderr: ++ [[ -n 1 ]]
 ?     plugn trigger scheduler-detect stderr: ++ set -x
 ?     plugn trigger scheduler-detect stderr: + [[ ! -n '' ]]
 ?     plugn trigger scheduler-detect stderr:
 ?     plugn trigger scheduler-detect stdout: docker-local
 ?     plugn trigger scheduler-detect stdout:
 ?     plugn trigger scheduler-detect stderr: + source /var/lib/dokku/core-plugins/available/common/functions
 ?     plugn trigger scheduler-detect stderr: ++ set -eo pipefail
 ?     plugn trigger scheduler-detect stderr: ++ [[ -n 1 ]]
 ?     plugn trigger scheduler-detect stderr: ++ set -x
 ?     plugn trigger scheduler-detect stderr: + [[ ! -n '' ]]
 ?     plugn trigger scheduler-detect stderr:
 ?     plugn trigger scheduler-detect stdout: docker-local
 ?     plugn trigger scheduler-detect stdout:
 ?     plugn trigger config-get [ruby-getting-started DOKKU_APP_USER]
 ?     plugn trigger config-get stderr: + source /var/lib/dokku/core-plugins/available/common/functions
 ?     plugn trigger config-get stderr: ++ set -eo pipefail
 ?     plugn trigger config-get stderr: ++ [[ -n 1 ]]
 ?     plugn trigger config-get stderr: ++ set -x
 ?     plugn trigger config-get stderr: + [[ ! -n '' ]]
 ?     plugn trigger config-get stderr:
 ?     plugn trigger config-get stdout:
-----> Ensuring network configuration is in sync for ruby-getting-started
 ?     plugn trigger network-write-ipaddr [ruby-getting-started web 1 172.17.0.4]
 ?     plugn trigger network-write-ipaddr stderr: + source /var/lib/dokku/core-plugins/available/common/functions
 ?     plugn trigger network-write-ipaddr stderr: ++ set -eo pipefail
 ?     plugn trigger network-write-ipaddr stderr: ++ [[ -n 1 ]]
 ?     plugn trigger network-write-ipaddr stderr: ++ set -x
 ?     plugn trigger network-write-ipaddr stderr: + [[ ! -n '' ]]
 ?     plugn trigger network-write-ipaddr stderr:
 ?     plugn trigger network-write-ipaddr stdout:
 ?     plugn trigger network-write-port [ruby-getting-started web 1 5000]
 ?     plugn trigger network-write-port stderr: + source /var/lib/dokku/core-plugins/available/common/functions
 ?     plugn trigger network-write-port stderr: ++ set -eo pipefail
 ?     plugn trigger network-write-port stderr: ++ [[ -n 1 ]]
 ?     plugn trigger network-write-port stderr: ++ set -x
 ?     plugn trigger network-write-port stderr: + [[ ! -n '' ]]
 ?     plugn trigger network-write-port stderr:
 ?     plugn trigger network-write-port stdout:
+ nginx_build_config ruby-getting-started
+ declare 'desc=build nginx config to proxy app containers using sigil'
+ declare APP=ruby-getting-started DOKKU_APP_LISTEN_PORT= DOKKU_APP_LISTEN_IP=
+ local VHOST_PATH=/home/dokku/ruby-getting-started/VHOST
+ local NGINX_TEMPLATE_NAME=nginx.conf.sigil
+ local NGINX_TEMPLATE=/var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil
+ local SCHEME=http
+ local NGINX_TEMPLATE_SOURCE=built-in
+ local APP_SSL_PATH=/home/dokku/ruby-getting-started/tls
++ get_app_raw_tcp_ports ruby-getting-started
++ declare 'desc=extracts raw tcp port numbers from DOCKERFILE_PORTS config variable'
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ local APP=ruby-getting-started
+++ config_get ruby-getting-started DOKKU_DOCKERFILE_PORTS
+++ declare 'desc=get value of given config var'
+++ config_sub get ruby-getting-started DOKKU_DOCKERFILE_PORTS
+++ declare 'desc=executes a config subcommand'
+++ local name=get
+++ shift
+++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started DOKKU_DOCKERFILE_PORTS
++ local DOCKERFILE_PORTS=
+++ echo ''
+++ xargs
++ local raw_tcp_ports=
++ echo ''
+ local RAW_TCP_PORTS=
+ local DOKKU_APP_LISTENERS
++ plugn trigger nginx-app-template-source ruby-getting-started app-config
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ CUSTOM_NGINX_TEMPLATE=
+ [[ -n '' ]]
+ local IS_APP_VHOST_ENABLED=true
+ plugn trigger domains-vhost-enabled ruby-getting-started
+ local IS_SSL_ENABLED=false
++ plugn trigger certs-exists ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ set -eo pipefail
+ [[ -n 1 ]]
+ set -x
+ trigger-certs-certs-exists ruby-getting-started
+ declare 'desc=checks if certs exist'
+ declare trigger=certs-exists
+ declare APP=ruby-getting-started
+ is_ssl_enabled ruby-getting-started
+ declare 'desc=returns 0 if ssl is enabled for given app'
+ local APP=ruby-getting-started
+ local APP_SSL_PATH=/home/dokku/ruby-getting-started/tls
+ [[ -e /home/dokku/ruby-getting-started/tls/server.crt ]]
+ return 1
+ echo false
+ [[ false == \t\r\u\e ]]
++ plugn trigger proxy-is-enabled ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ [[ true == \t\r\u\e ]]
+ [[ -z '' ]]
+ [[ -z '' ]]
++ plugn trigger network-get-listeners ruby-getting-started web
++ xargs
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ DOKKU_APP_LISTENERS=172.17.0.4:5000
+ plugn trigger proxy-configure-ports ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ source /var/lib/dokku/plugins/available/config/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ set -eo pipefail
+ [[ -n 1 ]]
+ set -x
+ trigger-proxy-proxy-configure-ports ruby-getting-started
+ declare 'desc=proxy proxy-configure-ports plugin trigger'
+ declare trigger=proxy-configure-ports
+ declare APP=ruby-getting-started
++ get_app_raw_tcp_ports ruby-getting-started
++ declare 'desc=extracts raw tcp port numbers from DOCKERFILE_PORTS config variable'
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ local APP=ruby-getting-started
+++ config_get ruby-getting-started DOKKU_DOCKERFILE_PORTS
+++ declare 'desc=get value of given config var'
+++ config_sub get ruby-getting-started DOKKU_DOCKERFILE_PORTS
+++ declare 'desc=executes a config subcommand'
+++ local name=get
+++ shift
+++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started DOKKU_DOCKERFILE_PORTS
++ local DOCKERFILE_PORTS=
+++ xargs
+++ echo ''
++ local raw_tcp_ports=
++ echo ''
+ local RAW_TCP_PORTS=
++ config_get ruby-getting-started DOKKU_PROXY_PORT
++ declare 'desc=get value of given config var'
++ config_sub get ruby-getting-started DOKKU_PROXY_PORT
++ declare 'desc=executes a config subcommand'
++ local name=get
++ shift
++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started DOKKU_PROXY_PORT
+ local DOKKU_PROXY_PORT=80
++ config_get ruby-getting-started DOKKU_PROXY_SSL_PORT
++ declare 'desc=get value of given config var'
++ config_sub get ruby-getting-started DOKKU_PROXY_SSL_PORT
++ declare 'desc=executes a config subcommand'
++ local name=get
++ shift
++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started DOKKU_PROXY_SSL_PORT
+ local DOKKU_PROXY_SSL_PORT=
++ config_get ruby-getting-started DOKKU_PROXY_PORT_MAP
++ declare 'desc=get value of given config var'
++ config_sub get ruby-getting-started DOKKU_PROXY_PORT_MAP
++ declare 'desc=executes a config subcommand'
++ local name=get
++ shift
++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started DOKKU_PROXY_PORT_MAP
+ local DOKKU_PROXY_PORT_MAP=http:80:5000
+ local IS_APP_VHOST_ENABLED=true
+ local UPSTREAM_PORT=5000
+ plugn trigger domains-vhost-enabled ruby-getting-started
+ [[ -z 80 ]]
+ [[ -z '' ]]
++ plugn trigger certs-exists ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
++ source /var/lib/dokku/core-plugins/available/common/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+ set -eo pipefail
+ [[ -n 1 ]]
+ set -x
+ trigger-certs-certs-exists ruby-getting-started
+ declare 'desc=checks if certs exist'
+ declare trigger=certs-exists
+ declare APP=ruby-getting-started
+ is_ssl_enabled ruby-getting-started
+ declare 'desc=returns 0 if ssl is enabled for given app'
+ local APP=ruby-getting-started
+ local APP_SSL_PATH=/home/dokku/ruby-getting-started/tls
+ [[ -e /home/dokku/ruby-getting-started/tls/server.crt ]]
+ return 1
+ echo false
+ [[ false == \t\r\u\e ]]
+ [[ -z http:80:5000 ]]
++ config_get ruby-getting-started DOKKU_PROXY_PORT
++ declare 'desc=get value of given config var'
++ config_sub get ruby-getting-started DOKKU_PROXY_PORT
++ declare 'desc=executes a config subcommand'
++ local name=get
++ shift
++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started DOKKU_PROXY_PORT
+ local PROXY_PORT=80
++ config_get ruby-getting-started DOKKU_PROXY_SSL_PORT
++ declare 'desc=get value of given config var'
++ config_sub get ruby-getting-started DOKKU_PROXY_SSL_PORT
++ declare 'desc=executes a config subcommand'
++ local name=get
++ shift
++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started DOKKU_PROXY_SSL_PORT
+ local PROXY_SSL_PORT=
++ config_get ruby-getting-started DOKKU_PROXY_PORT_MAP
++ declare 'desc=get value of given config var'
++ config_sub get ruby-getting-started DOKKU_PROXY_PORT_MAP
++ declare 'desc=executes a config subcommand'
++ local name=get
++ shift
++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started DOKKU_PROXY_PORT_MAP
+ local PROXY_PORT_MAP=http:80:5000
+ local PORT_MAP proxy_port_map
+ for PORT_MAP in $PROXY_PORT_MAP
++ awk -F : '{ print $1 }'
+ local PROXY_UPSTREAM_SCHEME=http
+ [[ http == \h\t\t\p\s ]]
+ proxy_port_map=' http:80:5000'
++ awk -F : '{ print $3 }'
+ local PROXY_UPSTREAM_PORT=5000
++ is_val_in_list 5000 '' ' '
++ declare 'desc=return true if value (5000) is in list () separated by delimiter ( ); delimiter defaults to comma'
++ local value=5000 list= 'delimiter= '
++ local 'IFS= ' val_in_list=false
++ echo false
+ [[ false == \f\a\l\s\e ]]
+ local 'PROXY_UPSTREAM_PORTS+=5000 '
+ PROXY_PORT_MAP=' http:80:5000'
++ echo '5000 '
++ xargs
+ local PROXY_UPSTREAM_PORTS=5000
+ local SSL_INUSE=
++ plugn trigger domains-list ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
++ source /var/lib/dokku/plugins/available/config/functions
+++ set -eo pipefail
+++ [[ -n 1 ]]
+++ set -x
+++ source /var/lib/dokku/core-plugins/available/common/functions
++++ set -eo pipefail
++++ [[ -n 1 ]]
++++ set -x
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ set -eo pipefail
+ [[ -n 1 ]]
+ set -x
+ trigger-domains-domains-list ruby-getting-started
+ declare 'desc=returns all domains for an app'
+ declare trigger=domains-list
+ declare APP=ruby-getting-started
+ get_app_domains ruby-getting-started
+ declare 'desc=return app domains'
+ local APP=ruby-getting-started
+ local APP_VHOST_PATH=/home/dokku/ruby-getting-started/VHOST
++ is_app_vhost_enabled ruby-getting-started
++ declare 'desc=returns true or false if vhost support is enabled for a given application'
++ local APP=ruby-getting-started
+++ config_get ruby-getting-started NO_VHOST
+++ declare 'desc=get value of given config var'
+++ config_sub get ruby-getting-started NO_VHOST
+++ declare 'desc=executes a config subcommand'
+++ local name=get
+++ shift
+++ /var/lib/dokku/plugins/available/config/config_sub get ruby-getting-started NO_VHOST
++ local NO_VHOST=0
++ local APP_VHOST_ENABLED=true
++ [[ 0 == \1 ]]
++ echo true
+ [[ true == \t\r\u\e ]]
+ [[ -f /home/dokku/ruby-getting-started/VHOST ]]
+ cat /home/dokku/ruby-getting-started/VHOST
+ local 'NONSSL_VHOSTS=*.mydomain.com'
++ echo '*.mydomain.com'
++ xargs
+ local 'NOSSL_SERVER_NAME=*.mydomain.com'
+ [[ false == \t\r\u\e ]]
+ local NGINX_LOCATION NGINX_VERSION SPDY_SUPPORTED TLS13_SUPPORTED HTTP2_SUPPORTED HTTP2_PUSH_SUPPORTED GRPC_SUPPORTED
++ get_nginx_location
++ declare 'desc=check that nginx is at the expected location and return it'
++ fn-nginx-vhosts-nginx-location
++ declare 'desc=check that nginx is at the expected location and return it'
++ local NGINX_LOCATION
+++ command -v nginx
++ NGINX_LOCATION=/usr/sbin/nginx
++ [[ -z /usr/sbin/nginx ]]
++ fn-nginx-vhosts-uses-openresty
++ declare 'desc=returns whether openresty is in use or not'
++ [[ -x /usr/bin/openresty ]]
++ return 1
++ [[ ! -x /usr/sbin/nginx ]]
++ echo /usr/sbin/nginx
+ NGINX_LOCATION=/usr/sbin/nginx
+ [[ -z /usr/sbin/nginx ]]
++ /usr/sbin/nginx -v
++ cut -d/ -f 2
+ NGINX_VERSION='1.18.0 (Ubuntu)'
++ is_spdy_enabled '1.18.0 (Ubuntu)'
++ declare 'desc=detects whether the installed nginx version has spdy support'
++ local 'NGINX_VERSION=1.18.0 (Ubuntu)'
++ local MAJOR_VERSION MINOR_VERSION PATCH_VERSION
++ local HAS_SUPPORT=true
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[1]}'
++ MAJOR_VERSION=1
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[2]}'
++ MINOR_VERSION=18
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[3]}'
++ PATCH_VERSION='0 (Ubuntu)'
++ [[ 1 -ge 2 ]]
++ [[ 1 -eq 1 ]]
++ [[ 18 -ge 10 ]]
++ HAS_SUPPORT=false
++ echo false
+ SPDY_SUPPORTED=false
++ is_tls13_available '1.18.0 (Ubuntu)'
++ declare 'desc=detects whether the installed nginx version has TLSv1.3 support'
++ local 'NGINX_VERSION=1.18.0 (Ubuntu)'
++ local MAJOR_VERSION MINOR_VERSION PATCH_VERSION
++ local HAS_SUPPORT=false
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[1]}'
++ MAJOR_VERSION=1
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[2]}'
++ MINOR_VERSION=18
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[3]}'
++ PATCH_VERSION='0 (Ubuntu)'
++ [[ 1 -ge 2 ]]
++ [[ 1 -eq 1 ]]
++ [[ 18 -ge 13 ]]
++ HAS_SUPPORT=true
++ echo true
+ TLS13_SUPPORTED=true
++ is_http2_enabled '1.18.0 (Ubuntu)'
++ declare 'desc=detects whether the installed nginx version has http2 support'
++ local 'NGINX_VERSION=1.18.0 (Ubuntu)'
++ local MAJOR_VERSION MINOR_VERSION PATCH_VERSION
++ local HAS_SUPPORT=false
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[1]}'
++ MAJOR_VERSION=1
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[2]}'
++ MINOR_VERSION=18
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[3]}'
++ PATCH_VERSION='0 (Ubuntu)'
++ [[ 1 -ge 2 ]]
++ [[ 1 -eq 1 ]]
++ [[ 18 -eq 11 ]]
++ [[ 18 -ge 12 ]]
++ HAS_SUPPORT=true
++ echo true
+ HTTP2_SUPPORTED=true
++ is_http2_push_enabled '1.18.0 (Ubuntu)'
++ declare 'desc=detects whether the installed nginx version has http2 push support'
++ local 'NGINX_VERSION=1.18.0 (Ubuntu)'
++ local MAJOR_VERSION MINOR_VERSION PATCH_VERSION
++ local HAS_SUPPORT=false
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[1]}'
++ MAJOR_VERSION=1
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[2]}'
++ MINOR_VERSION=18
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[3]}'
++ PATCH_VERSION='0 (Ubuntu)'
++ [[ 1 -ge 2 ]]
++ [[ 1 -eq 1 ]]
++ [[ 18 -eq 13 ]]
++ [[ 18 -ge 14 ]]
++ HAS_SUPPORT=true
++ echo true
+ HTTP2_PUSH_SUPPORTED=true
++ is_grpc_enabled '1.18.0 (Ubuntu)'
++ declare 'desc=detects whether the installed nginx version has grpc support'
++ local 'NGINX_VERSION=1.18.0 (Ubuntu)'
++ local MAJOR_VERSION MINOR_VERSION PATCH_VERSION
++ local HAS_SUPPORT=false
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[1]}'
++ MAJOR_VERSION=1
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[2]}'
++ MINOR_VERSION=18
+++ echo '1.18.0 (Ubuntu)'
+++ awk '{split($0,a,"."); print a[3]}'
++ PATCH_VERSION='0 (Ubuntu)'
++ [[ 1 -ge 2 ]]
++ [[ 1 -eq 1 ]]
++ [[ 18 -eq 13 ]]
++ [[ 18 -ge 14 ]]
++ HAS_SUPPORT=true
++ echo true
+ GRPC_SUPPORTED=true
++ echo ' http:80:5000'
++ xargs
+ PROXY_PORT_MAP=http:80:5000
++ fn-nginx-log-root
++ declare 'desc=get the nginx log root'
++ local NGINX_LOG_ROOT=/var/log/nginx
++ fn-nginx-vhosts-uses-openresty
++ declare 'desc=returns whether openresty is in use or not'
++ [[ -x /usr/bin/openresty ]]
++ return 1
++ echo /var/log/nginx
+ local NGINX_LOG_ROOT=/var/log/nginx
++ fn-nginx-access-log-format ruby-getting-started
++ declare 'desc=get the configured access log format'
++ declare APP=ruby-getting-started
++ fn-plugin-property-get-default nginx ruby-getting-started access-log-format ''
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=access-log-format DEFAULT=
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started access-log-format ''
+ local NGINX_ACCESS_LOG_FORMAT=
++ fn-nginx-access-log-path ruby-getting-started
++ declare 'desc=get the configured access log path'
++ declare APP=ruby-getting-started
+++ fn-nginx-log-root
+++ declare 'desc=get the nginx log root'
+++ local NGINX_LOG_ROOT=/var/log/nginx
+++ fn-nginx-vhosts-uses-openresty
+++ declare 'desc=returns whether openresty is in use or not'
+++ [[ -x /usr/bin/openresty ]]
+++ return 1
+++ echo /var/log/nginx
++ local NGINX_LOG_ROOT=/var/log/nginx
++ fn-plugin-property-get-default nginx ruby-getting-started access-log-path /var/log/nginx/ruby-getting-started-access.log
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=access-log-path DEFAULT=/var/log/nginx/ruby-getting-started-access.log
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started access-log-path /var/log/nginx/ruby-getting-started-access.log
+ local NGINX_ACCESS_LOG_PATH=/var/log/nginx/ruby-getting-started-access.log
++ fn-nginx-error-log-path ruby-getting-started
++ declare 'desc=get the configured access log path'
++ declare APP=ruby-getting-started
+++ fn-nginx-log-root
+++ declare 'desc=get the nginx log root'
+++ local NGINX_LOG_ROOT=/var/log/nginx
+++ fn-nginx-vhosts-uses-openresty
+++ declare 'desc=returns whether openresty is in use or not'
+++ [[ -x /usr/bin/openresty ]]
+++ return 1
+++ echo /var/log/nginx
++ local NGINX_LOG_ROOT=/var/log/nginx
++ fn-plugin-property-get-default nginx ruby-getting-started error-log-path /var/log/nginx/ruby-getting-started-error.log
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=error-log-path DEFAULT=/var/log/nginx/ruby-getting-started-error.log
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started error-log-path /var/log/nginx/ruby-getting-started-error.log
+ local NGINX_ERROR_LOG_PATH=/var/log/nginx/ruby-getting-started-error.log
++ fn-nginx-client-max-body-size ruby-getting-started
++ declare 'desc=get the configured client max body size'
++ declare APP=ruby-getting-started
++ fn-plugin-property-get-default nginx ruby-getting-started client-max-body-size ''
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=client-max-body-size DEFAULT=
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started client-max-body-size ''
+ local CLIENT_MAX_BODY_SIZE=
++ fn-nginx-proxy-read-timeout ruby-getting-started
++ declare 'desc=get the configured proxy read timeout'
++ declare APP=ruby-getting-started
++ fn-plugin-property-get-default nginx ruby-getting-started proxy-read-timeout 60s
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=proxy-read-timeout DEFAULT=60s
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started proxy-read-timeout 60s
+ local PROXY_READ_TIMEOUT=60s
++ fn-nginx-proxy-buffer-size ruby-getting-started
++ declare 'desc=get the configured proxy buffer size'
++ declare APP=ruby-getting-started
+++ fn-get-pagesize
+++ declare 'desc=return the underlying system'\''s memory page size'
+++ /var/lib/dokku/core-plugins/available/nginx-vhosts/pagesize
++ fn-plugin-property-get-default nginx ruby-getting-started proxy-buffer-size 4096
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=proxy-buffer-size DEFAULT=4096
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started proxy-buffer-size 4096
+ local PROXY_BUFFER_SIZE=4096
++ fn-nginx-proxy-buffering ruby-getting-started
++ declare 'desc=get the configured proxy buffering'
++ declare APP=ruby-getting-started
++ fn-plugin-property-get-default nginx ruby-getting-started proxy-buffering on
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=proxy-buffering DEFAULT=on
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started proxy-buffering on
+ local PROXY_BUFFERING=on
++ fn-nginx-proxy-buffers ruby-getting-started
++ declare 'desc=get the configured proxy buffers'
++ declare APP=ruby-getting-started
+++ fn-get-pagesize
+++ declare 'desc=return the underlying system'\''s memory page size'
+++ /var/lib/dokku/core-plugins/available/nginx-vhosts/pagesize
++ fn-plugin-property-get-default nginx ruby-getting-started proxy-buffers '8 4096'
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=proxy-buffers 'DEFAULT=8 4096'
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started proxy-buffers '8 4096'
+ local 'PROXY_BUFFERS=8 4096'
++ fn-nginx-proxy-busy-buffers-size ruby-getting-started
++ declare 'desc=get the configured proxy busy buffers size'
++ declare APP=ruby-getting-started
+++ fn-get-pagesize
+++ declare 'desc=return the underlying system'\''s memory page size'
+++ /var/lib/dokku/core-plugins/available/nginx-vhosts/pagesize
++ fn-plugin-property-get-default nginx ruby-getting-started proxy-busy-buffers-size 8192
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=proxy-busy-buffers-size DEFAULT=8192
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started proxy-busy-buffers-size 8192
+ local PROXY_BUSY_BUFFERS_SIZE=8192
+ [[ -z 172.17.0.4:5000 ]]
+ is_deployed ruby-getting-started
+ declare 'desc=return 0 if given app has a running container'
+ local APP=ruby-getting-started
+ /var/lib/dokku/core-plugins/available/common/common --quiet is-deployed ruby-getting-started
++ plugn trigger network-get-static-listeners ruby-getting-started web
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ [[ '' == '' ]]
++ get_running_image_tag ruby-getting-started
++ declare 'desc=retrieves current deployed image tag for a given app'
++ local APP=ruby-getting-started IMAGE_TAG=
+++ plugn trigger deployed-app-image-tag ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
++ local NEW_IMAGE_TAG=
++ [[ -n '' ]]
++ [[ -z '' ]]
++ IMAGE_TAG=latest
++ echo latest
+ local IMAGE_TAG=latest
++ get_deploying_app_image_name ruby-getting-started latest
+ local IMAGE=dokku/ruby-getting-started:latest
+ verify_image dokku/ruby-getting-started:latest
++ mktemp -d /tmp/dokku-295104-nginx_build_config.XXXXXX
+ local NGINX_BUILD_CONFIG_TMP_WORK_DIR=/tmp/dokku-295104-nginx_build_config.yL8Ztx
++ mktemp --tmpdir=/tmp/dokku-295104-nginx_build_config.yL8Ztx nginx.conf.XXXXXX
+ local NGINX_CONF=/tmp/dokku-295104-nginx_build_config.yL8Ztx/nginx.conf.DAb3GJ
+ local CUSTOM_NGINX_TEMPLATE=/tmp/dokku-295104-nginx_build_config.yL8Ztx/nginx.conf.sigil
+ trap 'rm -rf '\''/tmp/dokku-295104-nginx_build_config.yL8Ztx/nginx.conf.DAb3GJ'\'' '\''/tmp/dokku-295104-nginx_build_config.yL8Ztx'\'' >/dev/null' RETURN INT TERM EXIT
+ get_custom_nginx_template ruby-getting-started /tmp/dokku-295104-nginx_build_config.yL8Ztx/nginx.conf.sigil
+ [[ -f /tmp/dokku-295104-nginx_build_config.yL8Ztx/nginx.conf.sigil ]]
++ fn-plugin-property-get-default nginx ruby-getting-started bind-address-ipv4 ''
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=bind-address-ipv4 DEFAULT=
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started bind-address-ipv4 ''
+ local NGINX_BIND_ADDRESS_IP4=
++ fn-plugin-property-get-default nginx ruby-getting-started bind-address-ipv6 ::
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=bind-address-ipv6 DEFAULT=::
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started bind-address-ipv6 ::
+ local NGINX_BIND_ADDRESS_IP6=::
+ [[ -z :: ]]
++ fn-plugin-property-get-default nginx ruby-getting-started x-forwarded-for-value '$remote_addr'
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=x-forwarded-for-value 'DEFAULT=$remote_addr'
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started x-forwarded-for-value '$remote_addr'
+ local 'PROXY_X_FORWARDED_FOR=$remote_addr'
++ fn-plugin-property-get-default nginx ruby-getting-started x-forwarded-port-value '$server_port'
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=x-forwarded-port-value 'DEFAULT=$server_port'
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started x-forwarded-port-value '$server_port'
+ local 'PROXY_X_FORWARDED_PORT=$server_port'
++ fn-plugin-property-get-default nginx ruby-getting-started x-forwarded-proto-value '$scheme'
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=x-forwarded-proto-value 'DEFAULT=$scheme'
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started x-forwarded-proto-value '$scheme'
+ local 'PROXY_X_FORWARDED_PROTO=$scheme'
++ fn-plugin-property-get-default nginx ruby-getting-started x-forwarded-ssl ''
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=x-forwarded-ssl DEFAULT=
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started x-forwarded-ssl ''
+ local PROXY_X_FORWARDED_SSL=
++ config_export app ruby-getting-started
++ declare 'desc=returns export command for config variable of specified type (app/global)'
++ local CONFIG_TYPE=app
++ shift
++ local APP=ruby-getting-started
++ [[ app == \g\l\o\b\a\l ]]
++ shift
++ config_sub export ruby-getting-started
++ declare 'desc=executes a config subcommand'
++ local name=export
++ shift
++ /var/lib/dokku/plugins/available/config/config_sub export ruby-getting-started
++ return 0
+ eval 'export DATABASE_URL='\''postgres://postgres:c375216fe1e3b3d74663689f777ecc43@dokku-postgres-railsdatabase:5432/railsdatabase'\''
export DOKKU_APP_RESTORE='\''1'\''
export DOKKU_APP_TYPE='\''herokuish'\''
export DOKKU_PROXY_PORT='\''80'\''
export DOKKU_PROXY_PORT_MAP='\''http:80:5000'\''
export GIT_REV='\''e806e44fd81c115ee58a28e7d892873cb2f4ad37'\''
export NO_VHOST='\''0'\'''
++ export DATABASE_URL=postgres://postgres:c375216fe1e3b3d74663689f777ecc43@dokku-postgres-railsdatabase:5432/railsdatabase
++ DATABASE_URL=postgres://postgres:c375216fe1e3b3d74663689f777ecc43@dokku-postgres-railsdatabase:5432/railsdatabase
++ export DOKKU_APP_RESTORE=1
++ DOKKU_APP_RESTORE=1
++ export DOKKU_APP_TYPE=herokuish
++ DOKKU_APP_TYPE=herokuish
++ export DOKKU_PROXY_PORT=80
++ DOKKU_PROXY_PORT=80
++ export DOKKU_PROXY_PORT_MAP=http:80:5000
++ DOKKU_PROXY_PORT_MAP=http:80:5000
++ export GIT_REV=e806e44fd81c115ee58a28e7d892873cb2f4ad37
++ GIT_REV=e806e44fd81c115ee58a28e7d892873cb2f4ad37
++ export NO_VHOST=0
++ NO_VHOST=0
+ SIGIL_PARAMS=('-f' '/var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil' 'APP=ruby-getting-started' 'DOKKU_ROOT=/home/dokku' 'NOSSL_SERVER_NAME=*.mydomain.com' 'DOKKU_APP_LISTENERS=172.17.0.4:5000' 'DOKKU_LIB_ROOT=/var/lib/dokku' 'PASSED_LISTEN_IP_PORT=' 'SPDY_SUPPORTED=false' 'TLS13_SUPPORTED=true' 'HTTP2_SUPPORTED=true' 'NGINX_LOG_ROOT=/var/log/nginx' 'NGINX_ACCESS_LOG_FORMAT=' 'NGINX_ACCESS_LOG_PATH=/var/log/nginx/ruby-getting-started-access.log' 'NGINX_ERROR_LOG_PATH=/var/log/nginx/ruby-getting-started-error.log' 'NGINX_BIND_ADDRESS_IP4=' 'NGINX_BIND_ADDRESS_IP6=::' 'HTTP2_PUSH_SUPPORTED=true' 'GRPC_SUPPORTED=true' 'DOKKU_APP_LISTEN_PORT=' 'DOKKU_APP_LISTEN_IP=' 'APP_SSL_PATH=/home/dokku/ruby-getting-started/tls' 'SSL_INUSE=' 'SSL_SERVER_NAME=' 'CLIENT_MAX_BODY_SIZE=' 'PROXY_READ_TIMEOUT=60s' 'PROXY_BUFFER_SIZE=4096' 'PROXY_BUFFERING=on' 'PROXY_BUFFERS=8 4096' 'PROXY_BUSY_BUFFERS_SIZE=8192' 'NGINX_PORT=80' 'NGINX_SSL_PORT=' 'PROXY_PORT=80' 'PROXY_SSL_PORT=' 'RAW_TCP_PORTS=' 'PROXY_PORT_MAP=http:80:5000' 'PROXY_UPSTREAM_PORTS=5000' 'PROXY_X_FORWARDED_FOR=$remote_addr' 'PROXY_X_FORWARDED_PORT=$server_port' 'PROXY_X_FORWARDED_PROTO=$scheme' 'PROXY_X_FORWARDED_SSL=')
+ local SIGIL_PARAMS
+ read -r line
++ plugn trigger ps-current-scale ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ [[ -n web=1 ]]
+ PROC_TYPE=web
++ plugn trigger network-get-listeners ruby-getting-started web
++ xargs
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ LISTENERS=172.17.0.4:5000
+ UPP_PROC_TYPE=WEB
+ UPP_PROC_TYPE=WEB
+ SIGIL_PARAMS+=("DOKKU_APP_${UPP_PROC_TYPE}_LISTENERS=$LISTENERS")
+ read -r line
+ [[ -n '' ]]
+ grep DOKKU_APP_LISTENERS /var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil
+ grep NGINX_SSL_PORT /var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil
+ grep NGINX_PORT /var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil
+ xargs -i echo '-----> Configuring {}...(using built-in template)'
++ echo '' '*.mydomain.com'
++ sort -u
++ tr ' ' '\n'
-----> Configuring *.mydomain.com...(using built-in template)
+ cat -s
+ sigil -f /var/lib/dokku/plugins/available/nginx-vhosts/templates/nginx.conf.sigil APP=ruby-getting-started DOKKU_ROOT=/home/dokku 'NOSSL_SERVER_NAME=*.mydomain.com' DOKKU_APP_LISTENERS=172.17.0.4:5000 DOKKU_LIB_ROOT=/var/lib/dokku PASSED_LISTEN_IP_PORT= SPDY_SUPPORTED=false TLS13_SUPPORTED=true HTTP2_SUPPORTED=true NGINX_LOG_ROOT=/var/log/nginx NGINX_ACCESS_LOG_FORMAT= NGINX_ACCESS_LOG_PATH=/var/log/nginx/ruby-getting-started-access.log NGINX_ERROR_LOG_PATH=/var/log/nginx/ruby-getting-started-error.log NGINX_BIND_ADDRESS_IP4= NGINX_BIND_ADDRESS_IP6=:: HTTP2_PUSH_SUPPORTED=true GRPC_SUPPORTED=true DOKKU_APP_LISTEN_PORT= DOKKU_APP_LISTEN_IP= APP_SSL_PATH=/home/dokku/ruby-getting-started/tls SSL_INUSE= SSL_SERVER_NAME= CLIENT_MAX_BODY_SIZE= PROXY_READ_TIMEOUT=60s PROXY_BUFFER_SIZE=4096 PROXY_BUFFERING=on 'PROXY_BUFFERS=8 4096' PROXY_BUSY_BUFFERS_SIZE=8192 NGINX_PORT=80 NGINX_SSL_PORT= PROXY_PORT=80 PROXY_SSL_PORT= RAW_TCP_PORTS= PROXY_PORT_MAP=http:80:5000 PROXY_UPSTREAM_PORTS=5000 'PROXY_X_FORWARDED_FOR=$remote_addr' 'PROXY_X_FORWARDED_PORT=$server_port' 'PROXY_X_FORWARDED_PROTO=$scheme' PROXY_X_FORWARDED_SSL= DOKKU_APP_WEB_LISTENERS=172.17.0.4:5000
+ dokku_log_info1 'Creating http nginx.conf'
+ declare 'desc=log info1 formatter'
+ echo '-----> Creating http nginx.conf'
-----> Creating http nginx.conf
+ mv /tmp/dokku-295104-nginx_build_config.yL8Ztx/nginx.conf.DAb3GJ /home/dokku/ruby-getting-started/nginx.conf
+ fn-nginx-vhosts-manage-hsts ruby-getting-started ''
+ declare APP=ruby-getting-started SSL_ENABLED=
++ fn-nginx-hsts-is-enabled ruby-getting-started
++ declare APP=ruby-getting-started
+++ fn-plugin-property-get-default nginx ruby-getting-started hsts ''
+++ declare 'desc=returns the value for a given property with a specified default value'
+++ declare PLUGIN=nginx APP=ruby-getting-started KEY=hsts DEFAULT=
+++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started hsts ''
++ local hsts_is_enabled=
++ [[ '' == '' ]]
+++ fn-plugin-property-get-default nginx --global hsts true
+++ declare 'desc=returns the value for a given property with a specified default value'
+++ declare PLUGIN=nginx APP=--global KEY=hsts DEFAULT=true
+++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx --global hsts true
++ hsts_is_enabled=true
++ echo true
+ local HSTS=true
++ fn-plugin-property-get-default nginx ruby-getting-started hsts-include-subdomains true
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=hsts-include-subdomains DEFAULT=true
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started hsts-include-subdomains true
+ local HSTS_INCLUDE_SUBDOMAINS=true
++ fn-plugin-property-get-default nginx ruby-getting-started hsts-max-age 15724800
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=hsts-max-age DEFAULT=15724800
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started hsts-max-age 15724800
+ local HSTS_MAX_AGE=15724800
++ fn-plugin-property-get-default nginx ruby-getting-started hsts-preload false
++ declare 'desc=returns the value for a given property with a specified default value'
++ declare PLUGIN=nginx APP=ruby-getting-started KEY=hsts-preload DEFAULT=false
++ /var/lib/dokku/core-plugins/available/common/prop get-with-default nginx ruby-getting-started hsts-preload false
+ local HSTS_PRELOAD=false
+ local NGINX_HSTS_CONF=/home/dokku/ruby-getting-started/nginx.conf.d/hsts.conf
+ local HSTS_TEMPLATE=/var/lib/dokku/plugins/available/nginx-vhosts/templates/hsts.conf.sigil
++ plugn trigger nginx-app-template-source ruby-getting-started hsts-config
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ CUSTOM_HSTS_TEMPLATE=
+ [[ -n '' ]]
+ [[ true == \f\a\l\s\e ]]
+ [[ '' != \t\r\u\e ]]
+ rm -rf /home/dokku/ruby-getting-started/nginx.conf.d/hsts.conf
+ return
+ plugn trigger nginx-pre-reload ruby-getting-started '' ''
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ dokku_log_verbose 'Reloading nginx'
+ declare 'desc=log verbose formatter'
+ echo '       Reloading nginx'
       Reloading nginx
+ validate_nginx
+ declare 'desc=validate entire nginx config'
+ declare APP= FLAG=
+ local NGINX_LOCATION EXIT_CODE
++ get_nginx_location
++ declare 'desc=check that nginx is at the expected location and return it'
++ fn-nginx-vhosts-nginx-location
++ declare 'desc=check that nginx is at the expected location and return it'
++ local NGINX_LOCATION
+++ command -v nginx
++ NGINX_LOCATION=/usr/sbin/nginx
++ [[ -z /usr/sbin/nginx ]]
++ fn-nginx-vhosts-uses-openresty
++ declare 'desc=returns whether openresty is in use or not'
++ [[ -x /usr/bin/openresty ]]
++ return 1
++ [[ ! -x /usr/sbin/nginx ]]
++ echo /usr/sbin/nginx
+ NGINX_LOCATION=/usr/sbin/nginx
+ [[ -z /usr/sbin/nginx ]]
+ [[ '' == \-\-\c\l\e\a\n ]]
+ set +e
+ sudo /usr/sbin/nginx -t
+ EXIT_CODE=0
+ set -e
+ [[ 0 -eq 0 ]]
+ return
+ restart_nginx
+ declare 'desc=restart nginx for given distros'
++ plugn trigger proxy-is-enabled ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ local PROXY_ENABLED=true
++ plugn trigger proxy-type ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ local PROXY_TYPE=nginx
+ [[ true == \t\r\u\e ]]
+ [[ nginx == \n\g\i\n\x ]]
+ fn-nginx-vhosts-nginx-init-cmd reload
+ declare 'desc=start nginx for given distros'
+ declare CMD=reload
+ local NGINX_INIT_NAME
+ NGINX_INIT_NAME=nginx
+ fn-nginx-vhosts-uses-openresty
+ declare 'desc=returns whether openresty is in use or not'
+ [[ -x /usr/bin/openresty ]]
+ return 1
+ case "$DOKKU_DISTRO" in
+ [[ -x /usr/bin/sv ]]
+ [[ -x /usr/bin/systemctl ]]
+ sudo /usr/bin/systemctl reload nginx
++ rm -rf /tmp/dokku-295104-nginx_build_config.yL8Ztx/nginx.conf.DAb3GJ /tmp/dokku-295104-nginx_build_config.yL8Ztx
+ [[ -f /var/lib/dokku/data/nginx-vhosts/app-ruby-getting-started/nginx.conf.sigil.295104 ]]
+ [[ -f /var/lib/dokku/data/nginx-vhosts/app-ruby-getting-started/nginx.conf.sigil.295104.missing ]]
++ rm -rf /tmp/dokku-295104-nginx_build_config.yL8Ztx/nginx.conf.DAb3GJ /tmp/dokku-295104-nginx_build_config.yL8Ztx
+ rm -rf /tmp/dokku-295104-nginx_build_config.yL8Ztx/nginx.conf.DAb3GJ /tmp/dokku-295104-nginx_build_config.yL8Ztx
+ fn-letsencrypt-acme-proxy-disable ruby-getting-started
+ declare 'desc=disable ACME proxy for an app'
+ local APP=ruby-getting-started
+ local app_root=/home/dokku/ruby-getting-started
+ local app_config_dir=/home/dokku/ruby-getting-started/nginx.conf.d
+ dokku_log_info1 'Disabling ACME proxy for ruby-getting-started...'
+ declare 'desc=log info1 formatter'
+ echo '-----> Disabling ACME proxy for ruby-getting-started...'
-----> Disabling ACME proxy for ruby-getting-started...
+ [[ -f /home/dokku/ruby-getting-started/nginx.conf.d/letsencrypt.conf ]]
+ rm /home/dokku/ruby-getting-started/nginx.conf.d/letsencrypt.conf
+ restart_nginx
+ declare 'desc=restart nginx for given distros'
+ sed 's/^/       /'
++ plugn trigger proxy-is-enabled ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ local PROXY_ENABLED=true
++ plugn trigger proxy-type ruby-getting-started
+ source /var/lib/dokku/core-plugins/available/common/functions
++ set -eo pipefail
++ [[ -n 1 ]]
++ set -x
+ [[ ! -n '' ]]
+ local PROXY_TYPE=nginx
+ [[ true == \t\r\u\e ]]
+ [[ nginx == \n\g\i\n\x ]]
+ fn-nginx-vhosts-nginx-init-cmd reload
+ declare 'desc=start nginx for given distros'
+ declare CMD=reload
+ local NGINX_INIT_NAME
+ NGINX_INIT_NAME=nginx
+ fn-nginx-vhosts-uses-openresty
+ declare 'desc=returns whether openresty is in use or not'
+ [[ -x /usr/bin/openresty ]]
+ return 1
+ case "$DOKKU_DISTRO" in
+ [[ -x /usr/bin/sv ]]
+ [[ -x /usr/bin/systemctl ]]
+ sudo /usr/bin/systemctl reload nginx
+ [[ 0 == 0 ]]
+ dokku_log_info1 Done
+ declare 'desc=log info1 formatter'
+ echo '-----> Done'
-----> Done
+ return
+ implemented=1
+ [[ 1 -eq 0 ]]
+ [[ 1 -eq 0 ]]

@EyMaddis
Copy link
Contributor

this is even documented in the lego docs:
https://go-acme.github.io/lego/usage/cli/obtain-a-certificate/

For wildcard certificates (*.example.com), the filenames will look like _.example.com.crt.

@josegonzalez
Copy link
Member

The problem is here:

dokku certs:add "$APP" "$config_dir/certificates/$domain.pem" "$config_dir/certificates/$domain.key"

This takes the literal domain name and uses it in the filename. If someone wants to make a PR that replaces * characters with _ characters before usage in certs:add, that should fix it.

EyMaddis added a commit to EyMaddis/dokku-letsencrypt that referenced this issue Jun 25, 2023
@EyMaddis
Copy link
Contributor

@josegonzalez Thanks for the pointer, I created a PR here: #311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants