dokku / dokku-redirect

A plugin for dokku that gives the ability to set simple redirects for an application
MIT License
107 stars 9 forks source link

dokku-redirect appears to not be compatible with dokku 0.31.0 #37

Closed gamedevsam closed 1 year ago

gamedevsam commented 1 year ago

If you're using Dokku - especially for commercial purposes - consider donating to project development via OpenCollective or Patreon. Funds go to general development, support, and infrastructure costs.

If you'd like to sponsor specific functionality, see the project's Sponsoring document.

If you need support for a version of Dokku that is more than a year old, your issue may be closed without an answer. Please upgrade to a recent version before filing an issue.

Description of problem

After I upgraded to Dokku 0.31.0 this plugin stopped working for me, I get the following error:

root@ubuntu-2gb-ash-1:~# dokku redirect:set app dataconnectorpro.com dataconnector-pro.com
-----> Setting redirect for app...
-----> Ensuring network configuration is in sync for app
-----> Configuring dataconnector.pro...(using built-in template)
-----> Configuring dataconnector-pro.com...(using built-in template)
-----> Configuring dataconnectorpro.com...(using built-in template)
-----> Creating https nginx.conf
       Enabling HSTS
-----> Configuring redirect for dataconnectorpro.com to dataconnector-pro.com via HTTP 301...
template: nginx.conf.sigil:4:19: executing "nginx.conf.sigil" at <index $port_map_list 1>: error calling index: reflect: slice index out of range

How reproducible

Install Dokku 0.31.0, create an app, attempt to setup a redirect.

Steps to Reproduce

  1. Install Dokku 0.31.0
  2. Create an app and deploy a simple server to it
  3. Attempt to setup a redirect.

Actual Results

An error occurs.

Expected Results

No error occurs.

Environment Information

I don't believe this is relevant for this issue.

gamedevsam commented 1 year ago

@josegonzalez FYI.

This is not a big deal for me since I can just handle redirects on my application. Just posting this here so others know to avoid using it until it is fixed. I also think you should consider deprecating this plugin. I'm sure it's a maintenance burden on you, and I'm not sure many people use it since it's trivial to do redirects on the application layer.

alexisrobert commented 1 year ago

If you need a temporary fix, you can just set the DOKKU_PROXY_PORT_MAP environment variable manually, and the redirect plugin should work. It's a bit hacky, but in the meantime it does the job :)

dokku config:set app DOKKU_PROXY_PORT_MAP=http:80:5000

josegonzalez commented 1 year ago

Fixed and released in 0.9.1. Please upgrade the plugin.