-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ec5e75d
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.
Jamie, I discovered another bug in regards of SSL chained feature - if you install Ghost (when Nginx config is changed), it adds proxy pass correctly, however SSL records are getting dropped, i.e.:
.. from the end of the config ..
Also, if you later go to Edit Virtual Server and try to enable Nginx SSL feature, save but nothing gets enabled. Nginx SSL is set as Default? in Features and Plugins page.
ec5e75d
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.
That's odd - installing Ghost shouldn't enable or disable SSL features at all!
ec5e75d
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 seems as related, and hopefully helps to fix it:
ec5e75d
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.
That looks like a bug! Was an SSL Nginx website enabled for this domain before running the
disable-feature
command?ec5e75d
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.
Yes, it was enabled.
ec5e75d
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.
This should fix it : f21f1fa
ec5e75d
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.
Thanks. I see now. The actual fix is virtualmin/virtualmin-gpl@222770b. It means we won't be able to release new Virtualmin Nginx until Virtualmin 7.6 goes out.
ec5e75d
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.
Wait, no! Actually we can make a new Nginx plugins releases, because it works with this simple patch already, as we test for
if (defined($c)){}
in current Virtualmin release!But, for the love of God, this is very damn odd and bug-prone that Perl internally returns an empty string from a sub without
return
and wants explicitreturn undef
. This is bananas! I wonder if this is some kind of a burden of the past, a very first Perl versions?ec5e75d
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.
Either one of those patches will fix it, but we can release a new Nginx SSL plugin ASAP (and I tagged a new version already).
ec5e75d
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.
Yes, I realize that either of those patches fixes it. Although my question was rather different.
By the way, I have just tagged Nginx plugin, as we need to do a new release of it too. @swelljoe Joe, you can go with both Virtualmin Nginx and Virtualmin Nginx SS releases.
ec5e75d
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.
Yeah I don't like that Perl returns work that way! Best we can do is just avoid it ...
ec5e75d
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.
Yeah, and what's worse, it returns different results in scalar and list context! 🤯 But also, if I remember correctly Joe once mentioned that
return undef
is not welcomed by Perl::Critic either. I personally consider returningreturn undef
is a safest alternative.ec5e75d
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.
Really? I use
return undef
all the time..ec5e75d
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.
Yeah, but
return undef
makes sense and must be the default behaviour in Perl, as return different results depending on the context is prone to hard to debug bugs.ec5e75d
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 wonder is there a way we can detect missing return statements?
ec5e75d
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.
What do you mean by "detect"? Detect for which purposes?
ec5e75d
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 mean, some kind of linter that can analyze the code and report potential bugs like this.
ec5e75d
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 it will be pretty difficult considering that a function can have multiple returns. Also, I am not sure if linter will help a lot here because I don't think a linter could properly detect the context.
We just need to make sure, when writing the code, that function always return something..
ec5e75d
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.
In some languages like Go this kind of static analysis is possible, but Perl is dynamic enough that it might not be..