-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Support static nginx port when deploying without an application VHOST #1476
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
Conversation
plugins/common/functions
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be a bit more professional here ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bahahahaha!
EDIT: You do read my code!!!!! ;P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't just click merge as soon as I see a green button :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lies!!!!!
1be6ebf to
f84c2bf
Compare
|
I'm not particularly happy with how this ended up. Any feedback on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add port as an option to nginx:enable so that users can modify the port to their preferred value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh? 🤷
just set the config var...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me :)
This reduces deploy output by moving `config:get` calls out of the main loop. Since the values are the same for each iteration, it does not make sense to re-retrieve them each time.
Because of how plugin commands are implemented, their output can be incredibly verbose. Rather than executing even the `set -eo pipefail` parts of a plugin, we immediately check if the command is implemented by a plugin. If it is not, then we continue on as normal. One side-effect of this change is that plugin commands need to be duplicated again: - once in the command array - once for the actual body of the command - once in the help output This is also quite hackish, and probably not the best way to decrease trace output. Note that we drop approximately 2k lines worth of logs with this change.
|
I'm working on some more refactoring |
plugins/config/functions
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was impossible to support transitions from NO_VHOST=1 to nothing and maintain a single function that told the truth about an app's vhost state. so we catch NO_VHOST in unset and set it to 0
7ad572f to
bf3cab7
Compare
|
I think this is a step in the right direction. Could definitely use some more time to breakdown |
bf3cab7 to
876173d
Compare
plugins/common/functions
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your if statement is missing the brackets to evaluate this and you have a continue in an if statement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it twerks:
$ get_open_port() {
> while true; do
> local port=$(shuf -i 80-81 -n 1)
> if ! nc -z 0.0.0.0 $port; then
> echo "open port: $port"
> return 0
> else
> echo "failed port: $port"
> continue
> fi
> done
> }
$ get_open_port
failed port: 80
failed port: 80
open port: 81
876173d to
3e18d9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ dpkg -S /usr/bin/shuf
coreutils: /usr/bin/shuf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just showing what provides shuf
08418db to
fd44635
Compare
|
yey passes |
nginx proxy without VHOST
closes #1123 #1474
example output with no
$DOKKU_ROOT/VHOSTand an IP in$DOKKU_ROOT/HOSTNAME(also can be accomplished by settingNO_VHOST=1)note: we always use the contents of
$DOKKU_ROOT/HOSTNAMEfor urls output in the aforementioned cases