Skip to content

Commit

Permalink
Report on the nginx CGI status
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Sep 30, 2023
1 parent 8c1d883 commit 04e055a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion virtual_feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,25 @@ sub feature_hlink
# Checks if Nginx is actually installed, returns an error if not
sub feature_check
{
# Is nginx installed?
if (!-r $config{'nginx_config'}) {
return &text('feat_econfig', "<tt>$config{'nginx_config'}</tt>");
}
elsif (!&has_command($config{'nginx_cmd'})) {
return &text('feat_ecmd', "<tt>$config{'nginx_cmd'}</tt>");
}

# Show fcgiwrap status
if (&feature_web_supports_cgi()) {
&$virtual_server::second_print(

This comment has been minimized.

Copy link
@iliajie

iliajie Nov 1, 2023

Contributor

Hello, Jamie!

This doesn't seem to be working well with System Settings ⇾ Features and Plugins page and when the page is saved, it "crashes" with an error [01/Nov/2023:14:19:59 +0300] [10.211.55.2] /virtual-server/save_newfeatures.cgi : Bad Header, e.g.:

image

This comment has been minimized.

Copy link
@jcameron

jcameron Nov 2, 2023

Author Collaborator

This comment has been minimized.

Copy link
@iliajie

iliajie Nov 2, 2023

Contributor

Thanks, although this patch is incomplete. The final fix is here: virtualmin/virtualmin-gpl@a121290

This comment has been minimized.

Copy link
@jcameron

jcameron Nov 2, 2023

Author Collaborator

What does that patch fix though? push_all_print just saves the current *_print functions, it doesn't change anything..

This comment has been minimized.

Copy link
@iliajie

iliajie Nov 2, 2023

Contributor

It actually makes error set here returned by error() function. Otherwise it's just ignored.

This comment has been minimized.

Copy link
@jcameron

jcameron Nov 2, 2023

Author Collaborator

I don't understand .. can you describe what goes wrong with this CGI without this patch?

This comment has been minimized.

Copy link
@iliajie

iliajie Nov 2, 2023

Contributor

Yes — if $err = &plugin_call($p, "feature_check", \@neweverything); from save_newfeatures.cgi returns something from virtualmin_nginx::feature_check then without this patch it doesn't stop, i.e. &error(&text('newplugin_emod', $name, $err)); is not showing anything..

This comment has been minimized.

Copy link
@jcameron

jcameron Nov 2, 2023

Author Collaborator

Are you sure? I couldn't re-produce this, and also I can't see how that code change would effect what the error function does?

This comment has been minimized.

Copy link
@iliajie

iliajie Nov 2, 2023

Contributor

Indeed! Something must have gone wrong in my initial tests! I can also no longer repro this issue! Reverted! Sorry about that!

$virtual_server::text{'check_fcgiwrapok'});
}
else {
return undef;
&$virtual_server::second_print(
$virtual_server::text{'check_nocgiscript'});
}

return undef;
}

# feature_depends(&domain)
Expand Down

0 comments on commit 04e055a

Please sign in to comment.