dokku / dokku-redirect

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

Validate the redirect does not have a protocol #26

Open Loschcode opened 5 years ago

Loschcode commented 5 years ago

I tried to insert a redirection with dokku-redirect and I wrongfully added the protocol with it. It did overwrite my Nginx configuration in Dokku and now I can't rollback or push my new changes to the app because the Nginx output the file as being with errors in it; here's part of the file it outputs and the rejection:

server {
  listen      [::]:443 ssl http2;
  listen      443 ssl http2;
  server_name https;
  access_log  off;

  ssl_certificate     /home/dokku/askalfred-to/tls/server.crt;
  ssl_certificate_key /home/dokku/askalfred-to/tls/server.key;

  return https  $scheme:////www.mydomain.to$request_uri;
}

[...]

To ***
 ! [remote rejected] master -> master (pre-receive hook declined)

What to do in this kind of situation ? How can I restore the previous Nginx configuration ?

Loschcode commented 5 years ago

I had to edit my dokku/my-app/nginx.conf myself and had to partially rebuild my apps and reboot my server entirely. If anyone gets this problem because of a bad input, edit it away manually 👍

josegonzalez commented 5 years ago

Reopening as this is a bug that we should handle (input verification).