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

Link alias appends "_URL" to my chosen environment variable #238

Closed
hades200082 opened this issue Feb 26, 2024 · 1 comment
Closed

Link alias appends "_URL" to my chosen environment variable #238

hades200082 opened this issue Feb 26, 2024 · 1 comment

Comments

@hades200082
Copy link

Description of problem

When I use the command sudo dokku mongo:link my-mongo my-app -a "DATABASE_URI" I end up with the environment DATABASE_URI_URL which is not what my application is expecting.

My use-case is that I'm using Payload CMS and it expects an environment variable named DATABASE_URI. Many apps that use environment variables will have them dictated like this and appending the "_URL" suffix makes the link unusable.

How reproducible

100%

Steps to Reproduce

  1. Create a dokku app
  2. Install the mongo plugin
  3. Create a link between mongo and the app using the -a or --alias flag to define a custom environment variable name.

Actual Results

My chosen alias is suffixed with "_URL"

Expected Results

My chosen alias should be used exactly as provided, with nothing added to it.

Environment Information

dokku report APP_NAME output

-----> uname: Linux wildkatz 5.15.0-94-generic dokku/dokku-mongo#104-Ubuntu SMP Tue Jan 9 15:25:40 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
-----> memory:
                      total        used        free      shared  buff/cache   available
       Mem:           32092         846       19663           2       11582       30768
       Swap:           8191           0        8191
-----> docker version:
       Client: Docker Engine - Community
        Version:           25.0.3
        API version:       1.44
        Go version:        go1.21.6
        Git commit:        4debf41
        Built:             Tue Feb  6 21:13:09 2024
        OS/Arch:           linux/amd64
        Context:           default

       Server: Docker Engine - Community
        Engine:
         Version:          25.0.3
         API version:      1.44 (minimum version 1.24)
         Go version:       go1.21.6
         Git commit:       f417435
         Built:            Tue Feb  6 21:13:09 2024
         OS/Arch:          linux/amd64
         Experimental:     false
        containerd:
         Version:          1.6.28
         GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
        runc:
         Version:          1.1.12
         GitCommit:        v1.1.12-0-g51d5e94
        docker-init:
         Version:          0.19.0
         GitCommit:        de40ad0
-----> docker daemon info:
       Client: Docker Engine - Community
        Version:    25.0.3
        Context:    default
        Debug Mode: true
        Plugins:
         buildx: Docker Buildx (Docker Inc.)
           Version:  v0.12.1
           Path:     /usr/libexec/docker/cli-plugins/docker-buildx
         compose: Docker Compose (Docker Inc.)
           Version:  v2.24.5
           Path:     /usr/libexec/docker/cli-plugins/docker-compose

       Server:
        Containers: 1
         Running: 1
         Paused: 0
         Stopped: 0
        Images: 11
        Server Version: 25.0.3
        Storage Driver: overlay2
         Backing Filesystem: extfs
         Supports d_type: true
         Using metacopy: false
         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 splunk syslog
        Swarm: inactive
        Runtimes: io.containerd.runc.v2 runc
        Default Runtime: runc
        Init Binary: docker-init
        containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
        runc version: v1.1.12-0-g51d5e94
        init version: de40ad0
        Security Options:
         apparmor
         seccomp
          Profile: builtin
         cgroupns
        Kernel Version: 5.15.0-94-generic
        Operating System: Ubuntu 22.04.4 LTS
        OSType: linux
        Architecture: x86_64
        CPUs: 32
        Total Memory: 31.34GiB
        Name: wildkatz
        ID: 7a28f82b-86c1-4df6-8a63-f21d8b84d713
        Docker Root Dir: /var/lib/docker
        Debug Mode: false
         File Descriptors: 29
         Goroutines: 50
         System Time: 2024-02-26T15:47:27.539703096Z
         EventsListeners: 0
        Experimental: false
        Insecure Registries:
         127.0.0.0/8
        Live Restore Enabled: false

-----> herokuish version:
       herokuish: v0.7.3
       buildpacks:
         heroku-buildpack-multi     v1.2.0
         heroku-buildpack-ruby      v265
         heroku-buildpack-nodejs    v235
         heroku-buildpack-clojure   v91
         heroku-buildpack-python    v242
         heroku-buildpack-java      v73
         heroku-buildpack-gradle    v39
         heroku-buildpack-scala     v96
         heroku-buildpack-play      v26
         heroku-buildpack-php       v244
         heroku-buildpack-go        v184
         heroku-buildpack-nginx     v25
         buildpack-null             v3
-----> dokku version: dokku version 0.33.6
-----> dokku-event-listener version: 0.15.0build+5268732
-----> dokku-update version: dokku-update 0.7.2
-----> docker-container-healthchecker version: 0.9.0

-----> docker-image-labeler version: 0.6.1build+c6e15a9
-----> git version: git version 2.34.1
-----> lambda-builder version:        0.6.0
-----> netrc version: 0.8.0build+0751c1b
 !     pack binary is not available
-----> plugn version: plugn: 0.13.0build+fd5297a
-----> sigil version: 0.10.1build+e443be0
-----> sshcommand version: sshcommand 0.17.1
-----> dokku plugins:
         00_dokku-standard    0.33.6 enabled    dokku core standard plugin
         20_events            0.33.6 enabled    dokku core events logging plugin
         app-json             0.33.6 enabled    dokku core app-json plugin
         apps                 0.33.6 enabled    dokku core apps plugin
         builder              0.33.6 enabled    dokku core builder plugin
         builder-dockerfile   0.33.6 enabled    dokku core builder-dockerfile plugin
         builder-herokuish    0.33.6 enabled    dokku core builder-herokuish plugin
         builder-lambda       0.33.6 enabled    dokku core builder-lambda plugin
         builder-nixpacks     0.33.6 enabled    dokku core builder-nixpacks plugin
         builder-null         0.33.6 enabled    dokku core builder-null plugin
         builder-pack         0.33.6 enabled    dokku core builder-pack plugin
         buildpacks           0.33.6 enabled    dokku core buildpacks plugin
         caddy-vhosts         0.33.6 enabled    dokku core caddy-vhosts plugin
         certs                0.33.6 enabled    dokku core certificate management plugin
         checks               0.33.6 enabled    dokku core checks plugin
         common               0.33.6 enabled    dokku core common plugin
         config               0.33.6 enabled    dokku core config plugin
         cron                 0.33.6 enabled    dokku core cron plugin
         docker-options       0.33.6 enabled    dokku core docker-options plugin
         domains              0.33.6 enabled    dokku core domains plugin
         elasticsearch        1.35.3 enabled    dokku elasticsearch service plugin
         enter                0.33.6 enabled    dokku core enter plugin
         git                  0.33.6 enabled    dokku core git plugin
         haproxy-vhosts       0.33.6 enabled    dokku core haproxy-vhosts plugin
         letsencrypt          0.20.3 enabled    Automated installation of let's encrypt TLS certificates
         logs                 0.33.6 enabled    dokku core logs plugin
         mariadb              1.38.3 enabled    dokku mariadb service plugin
         mongo                1.36.6 enabled    dokku mongo service plugin
         network              0.33.6 enabled    dokku core network plugin
         nginx-vhosts         0.33.6 enabled    dokku core nginx-vhosts plugin
         openresty-vhosts     0.33.6 enabled    dokku core openresty-vhosts plugin
         plugin               0.33.6 enabled    dokku core plugin plugin
         ports                0.33.6 enabled    dokku core ports plugin
         proxy                0.33.6 enabled    dokku core proxy plugin
         ps                   0.33.6 enabled    dokku core ps plugin
         rabbitmq             1.36.8 enabled    dokku rabbitmq service plugin
         registry             0.33.6 enabled    dokku core registry plugin
         repo                 0.33.6 enabled    dokku core repo plugin
         resource             0.33.6 enabled    dokku core resource plugin
         run                  0.33.6 enabled    dokku core run plugin
         scheduler            0.33.6 enabled    dokku core scheduler plugin
         scheduler-docker-local 0.33.6 enabled    dokku core scheduler-docker-local plugin
         scheduler-k3s        0.33.6 enabled    dokku core scheduler-k3s plugin
         scheduler-null       0.33.6 enabled    dokku core scheduler-null plugin
         shell                0.33.6 enabled    dokku core shell plugin
         ssh-keys             0.33.6 enabled    dokku core ssh-keys plugin
         storage              0.33.6 enabled    dokku core storage plugin
         trace                0.33.6 enabled    dokku core trace plugin
         traefik-vhosts       0.33.6 enabled    dokku core traefik-vhosts plugin
=====> leeconlin-cms app-json information
       App json computed selected:    app.json
       App json global selected:      app.json
       App json selected:
=====> leeconlin-cms app information
       App created at:                1708954276
       App deploy source:
       App deploy source metadata:
       App dir:                       /home/dokku/leeconlin-cms
       App locked:                    false
=====> leeconlin-cms builder information
       Builder build dir:
       Builder computed build dir:
       Builder computed selected:
       Builder global build dir:
       Builder global selected:
       Builder selected:
=====> leeconlin-cms builder-dockerfile information
       Builder dockerfile computed dockerfile path: leeconlin-co-uk-cms/Dockerfile
       Builder dockerfile global dockerfile path: Dockerfile
       Builder dockerfile dockerfile path: leeconlin-co-uk-cms/Dockerfile
=====> leeconlin-cms builder-herokuish information
       Builder herokuish computed allowed: true
       Builder herokuish global allowed: true
       Builder herokuish allowed:
=====> leeconlin-cms builder-lambda information
       Builder lambda computed lambdayml path: lambda.yml
       Builder lambda global lambdayml path: lambda.yml
       Builder lambda lambdayml path:
=====> leeconlin-cms builder-nixpacks information
       Builder nixpacks computed nixpackstoml path: nixpacks.toml
       Builder nixpacks global nixpackstoml path: nixpacks.toml
       Builder nixpacks nixpackstoml path:
       Builder nixpacks computed no cache: false
       Builder nixpacks global no cache: false
       Builder nixpacks no cache:
=====> leeconlin-cms builder-pack information
       Builder pack computed projecttoml path: project.toml
       Builder pack global projecttoml path: project.toml
       Builder pack projecttoml path:
=====> leeconlin-cms buildpacks information
       Buildpacks computed stack:     gliderlabs/herokuish:latest-22
       Buildpacks global stack:
       Buildpacks list:
       Buildpacks stack:
=====> leeconlin-cms caddy information
       Caddy image:                   lucaslorentz/caddy-docker-proxy:2.8
       Caddy letsencrypt email:
       Caddy letsencrypt server:      https://acme-v02.api.letsencrypt.org/directory
       Caddy log level:               ERROR
       Caddy polling interval:        5s
       Caddy tls internal:            false
=====> leeconlin-cms ssl information
       Ssl dir:                       /home/dokku/leeconlin-cms/tls
       Ssl enabled:                   false
       Ssl hostnames:
       Ssl expires at:
       Ssl issuer:
       Ssl starts at:
       Ssl subject:
       Ssl verified:
=====> leeconlin-cms 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:
=====> leeconlin-cms docker options information
       Docker options build:          --link dokku.mongo.leeconlin-mongo:dokku-mongo-leeconlin-mongo
       Docker options deploy:         --link dokku.mongo.leeconlin-mongo:dokku-mongo-leeconlin-mongo --restart=on-failure:10
       Docker options run:            --link dokku.mongo.leeconlin-mongo:dokku-mongo-leeconlin-mongo
=====> leeconlin-cms domains information
       Domains app enabled:           true
       Domains app vhosts:            leeconlin-cms.wildkatz.org
       Domains global enabled:        true
       Domains global vhosts:         wildkatz.org
=====> leeconlin-cms git information
       Git deploy branch:             main
       Git global deploy branch:      master
       Git keep git dir:              false
       Git rev env var:               GIT_REV
       Git sha:
       Git source image:
       Git last updated at:
=====> leeconlin-cms haproxy information
       Haproxy image:                 byjg/easy-haproxy:4.3.0
       Haproxy letsencrypt email:
       Haproxy letsencrypt server:    https://acme-v02.api.letsencrypt.org/directory
       Haproxy log level:             ERROR
Could not open file or uri for loading certificate from /home/dokku/leeconlin-cms/tls/server.crt
405735F41A7F0000:error:16000069:STORE routines:ossl_store_get0_loader_int:unregistered scheme:../crypto/store/store_register.c:237:scheme=file
405735F41A7F0000:error:80000002:system library:file_open:No such file or directory:../providers/implementations/storemgmt/file_store.c:267:calling stat(/home/dokku/leeconlin-cms/tls/server.crt)
Unable to load certificate
=====> leeconlin-cms letsencrypt information
       Letsencrypt active:            false
       Letsencrypt autorenew:         true
       Letsencrypt computed dns provider:
       Letsencrypt global dns provider:
       Letsencrypt dns provider:
       Letsencrypt computed email:    [email protected]
       Letsencrypt global email:      [email protected]
       Letsencrypt email:
       Letsencrypt expiration:        1708905600
       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-v02.api.letsencrypt.org/directory
       Letsencrypt global server:
       Letsencrypt server:
=====> leeconlin-cms logs information
       Logs computed max size:        10m
       Logs global max size:          10m
       Logs global vector sink:
       Logs max size:
       Logs vector global image:      timberio/vector:0.35.X-debian
       Logs vector sink:
=====> leeconlin-cms 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:
=====> leeconlin-cms nginx information
       Nginx access log format:
       Nginx computed access log format:
       Nginx global access log format:
       Nginx access log path:
       Nginx computed access log path: /var/log/nginx/leeconlin-cms-access.log
       Nginx global access log path:  /var/log/nginx/leeconlin-cms-access.log
       Nginx bind address ipv4:
       Nginx computed bind address ipv4:
       Nginx global bind address ipv4:
       Nginx bind address ipv6:
       Nginx computed bind address ipv6: ::
       Nginx global bind address ipv6: ::
       Nginx client max body size:
       Nginx computed client max body size: 1m
       Nginx global client max body size: 1m
       Nginx disable custom config:
       Nginx computed disable custom config: false
       Nginx global disable custom config: false
       Nginx error log path:
       Nginx computed error log path: /var/log/nginx/leeconlin-cms-error.log
       Nginx global error log path:   /var/log/nginx/leeconlin-cms-error.log
       Nginx hsts include subdomains:
       Nginx computed hsts include subdomains: true
       Nginx global hsts include subdomains: true
       Nginx hsts max age:
       Nginx computed hsts max age:   15724800
       Nginx global hsts max age:     15724800
       Nginx hsts preload:
       Nginx computed hsts preload:   false
       Nginx global hsts preload:     false
       Nginx hsts:
       Nginx computed hsts:           true
       Nginx global hsts:             true
       Nginx last visited at:
       Nginx nginx conf sigil path:
       Nginx computed nginx conf sigil path: nginx.conf.sigil
       Nginx global nginx conf sigil path: nginx.conf.sigil
       Nginx proxy buffer size:
       Nginx computed proxy buffer size: 4k
       Nginx global proxy buffer size: 4k
       Nginx proxy buffering:
       Nginx computed proxy buffering: on
       Nginx global proxy buffering:  on
       Nginx proxy buffers:
       Nginx computed proxy buffers:  8 4k
       Nginx global proxy buffers:    8 4k
       Nginx proxy busy buffers size:
       Nginx computed proxy busy buffers size: 8k
       Nginx global proxy busy buffers size: 8k
       Nginx proxy read timeout:
       Nginx computed proxy read timeout: 60s
       Nginx global proxy read timeout: 60s
       Nginx x forwarded for value:
       Nginx computed x forwarded for value: $remote_addr
       Nginx global x forwarded for value: $remote_addr
       Nginx x forwarded port value:
       Nginx computed x forwarded port value: $server_port
       Nginx global x forwarded port value: $server_port
       Nginx x forwarded proto value:
       Nginx computed x forwarded proto value: $scheme
       Nginx global x forwarded proto value: $scheme
       Nginx x forwarded ssl:
       Nginx computed x forwarded ssl:
       Nginx global x forwarded ssl:
=====> leeconlin-cms openresty information
       Openresty access log format:
       Openresty access log path:     /var/log/nginx/leeconlin-cms-access.log
       Openresty bind address ipv4:
       Openresty bind address ipv6:   ::
       Openresty client max body size:
       Openresty error log path:      /var/log/nginx/leeconlin-cms-error.log
       Openresty global hsts:         true
       Openresty computed hsts:       true
       Openresty hsts:
       Openresty hsts include subdomains: true
       Openresty hsts max age:        15724800
       Openresty hsts preload:        false
       Openresty image:               dokku/openresty-docker-proxy:0.6.0
       Openresty letsencrypt email:
       Openresty letsencrypt server:  https://acme-v02.api.letsencrypt.org/directory
       Openresty proxy buffer size:   4k
       Openresty proxy buffering:     on
       Openresty proxy buffers:       8 4k
       Openresty proxy busy buffers size: 8k
       Openresty proxy read timeout:  60s
       Openresty x forwarded for value: $remote_addr
       Openresty x forwarded port value: $server_port
       Openresty x forwarded proto value: $scheme
       Openresty x forwarded ssl:
=====> leeconlin-cms ports information
       Ports map:
       Ports map detected:            http:3000:3000
=====> leeconlin-cms proxy information
       Proxy computed type:           nginx
       Proxy enabled:                 true
       Proxy global type:             nginx
       Proxy type:
=====> leeconlin-cms ps information
       Deployed:                      false
       Processes:                     0
       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:                       false
=====> leeconlin-cms registry information
       Registry computed image repo:        dokku/leeconlin-cms
       Registry computed push on release:   false
       Registry computed server:
       Registry global image repo template:
       Registry global push on release:
       Registry global server:
       Registry image repo:
       Registry push on release:
       Registry server:
       Registry tag version:
=====> leeconlin-cms resource information
=====> leeconlin-cms scheduler information
       Scheduler computed selected:   docker-local
       Scheduler global selected:     docker-local
       Scheduler selected:
=====> leeconlin-cms scheduler-docker-local information
       Scheduler docker local disable chown:
       Scheduler docker local init process: true
       Scheduler docker local parallel schedule count:
=====> leeconlin-cms scheduler-k3s information
       Scheduler k3s computed deploy timeout:       300s
       Scheduler k3s computed image pull secrets:
       Scheduler k3s computed letsencrypt server:   prod
       Scheduler k3s computed namespace:            default
       Scheduler k3s computed rollback on failure:  false
       Scheduler k3s deploy timeout:
       Scheduler k3s global deploy timeout:         300s
       Scheduler k3s global image pull secrets:
       Scheduler k3s global ingress class:          traefik
       Scheduler k3s global letsencrypt email prod:
       Scheduler k3s global letsencrypt email stag:
       Scheduler k3s global letsencrypt server:     prod
       Scheduler k3s global namespace:              default
       Scheduler k3s global network interface:      eth0
       Scheduler k3s global rollback on failure:    false
       Scheduler k3s image pull secrets:
       Scheduler k3s letsencrypt server:
       Scheduler k3s namespace:
       Scheduler k3s rollback on failure:
=====> leeconlin-cms storage information
       Storage build mounts:
       Storage deploy mounts:
       Storage run mounts:
=====> leeconlin-cms traefik information
       Traefik api enabled:           false
       Traefik api vhost:             traefik.dokku.me
       Traefik basic auth password:
       Traefik basic auth username:
       Traefik dashboard enabled:     false
       Traefik image:                 traefik:v2.10
       Traefik letsencrypt email:
       Traefik letsencrypt server:    https://acme-v02.api.letsencrypt.org/directory
       Traefik log level:             ERROR
       Traefik priority:

How (deb/make) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:

Dokku is installed on Ubuntu 22.04 on a physical, on-premise server.

Additional information

none.

@josegonzalez josegonzalez transferred this issue from dokku/dokku-mongo Mar 6, 2024
@josegonzalez
Copy link
Member

Thanks for filing this. It's come up in different venues across the years, and I've outlined a potential solution in #234 (also moved this from mongo to the redis plugin, where I track service-wide issues).

If you're interested in working on it, feel free to hit me up on slack/discord and I'd be happy to walk you through the work on your datastore of choice :)

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

No branches or pull requests

2 participants