chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:12:17 +08:00
commit cf8edb9f21
44281 changed files with 1655134 additions and 0 deletions
+71
View File
@@ -0,0 +1,71 @@
use strict;
use warnings;
our (%text, %in);
do 'nginx-lib.pl';
# acl_security_form(&options)
# Output HTML for editing security options for the acl module
sub acl_security_form
{
my ($o) = @_;
# Allowed server blocks
print &ui_table_row($text{'acl_vhosts'},
&ui_radio("vhosts_def", $o->{'vhosts'} ? 0 : 1,
[ [ 1, $text{'acl_hosts1'} ],
[ 0, $text{'acl_hosts0'} ] ])."<br>\n".
&ui_textarea("vhosts",
join("\n", split(/\s+/, $o->{'vhosts'})), 5, 30), 3);
# Can edit server settings?
print &ui_table_row($text{'acl_edit'},
&ui_yesno_radio("edit", $o->{'edit'}));
# Can create server blocks?
print &ui_table_row($text{'acl_create'},
&ui_yesno_radio("create", !defined($o->{'create'}) || $o->{'create'}));
# Can stop and start Nginx?
print &ui_table_row($text{'acl_stop'},
&ui_yesno_radio("stop", $o->{'stop'}));
# Allowed directories for locations
print &ui_table_row($text{'acl_root'},
&ui_textarea("root", $o->{'root'}, 5), 3);
# Can edit global settings?
print &ui_table_row($text{'acl_global'},
&ui_yesno_radio("global", $o->{'global'}));
# Can manually edit configuration files?
print &ui_table_row($text{'acl_manual'},
&ui_yesno_radio("manual",
defined($o->{'manual'}) ? $o->{'manual'} : $o->{'global'}));
# Can edit log files?
print &ui_table_row($text{'acl_logs'},
&ui_yesno_radio("logs", $o->{'logs'}));
# Write password files as user
print &ui_table_row($text{'acl_user'},
&ui_user_textbox("user", $o->{'user'}));
}
# acl_security_save(&options)
# Parse the form for security options for the acl module
sub acl_security_save
{
my ($o) = @_;
$o->{'vhosts'} = $in{'vhosts_def'} ? ""
: join(" ", split(/\s+/, $in{'vhosts'}));
$o->{'edit'} = $in{'edit'};
$o->{'create'} = $in{'create'};
$o->{'root'} = $in{'root'};
$o->{'global'} = $in{'global'};
$o->{'manual'} = $in{'manual'};
$o->{'logs'} = $in{'logs'};
$o->{'user'} = $in{'user'};
$o->{'stop'} = $in{'stop'};
}
+45
View File
@@ -0,0 +1,45 @@
require 'nginx-lib.pl';
# backup_config_files()
# Returns files and directories that can be backed up
sub backup_config_files
{
local @rv;
push(@rv, &get_all_config_files());
return &unique(@rv);
}
# pre_backup(&files)
# Called before the files are actually read
sub pre_backup
{
return undef;
}
# post_backup(&files)
# Called after the files are actually read
sub post_backup
{
return undef;
}
# pre_restore(&files)
# Called before the files are restored from a backup
sub pre_restore
{
return undef;
}
# post_restore(&files)
# Called after the files are restored from a backup
sub post_restore
{
if (&is_nginx_running()) {
return &apply_nginx();
}
return undef;
}
1;
+5
View File
@@ -0,0 +1,5 @@
nginx_config=/usr/local/nginx/conf/nginx.conf
nginx_cmd=/usr/local/nginx/sbin/nginx
start_cmd=/usr/local/nginx/sbin/nginx >/dev/null 2>&1 </dev/null &
stop_cmd=killall nginx
apply_cmd=killall nginx ; sleep 1 ; /usr/local/nginx/sbin/nginx >/dev/null 2>&1 </dev/null &
+5
View File
@@ -0,0 +1,5 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=systemctl start nginx
stop_cmd=systemctl stop nginx
apply_cmd=systemctl reload nginx
+5
View File
@@ -0,0 +1,5 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=systemctl start nginx
stop_cmd=systemctl stop nginx
apply_cmd=systemctl reload nginx
+5
View File
@@ -0,0 +1,5 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=systemctl start nginx
stop_cmd=systemctl stop nginx
apply_cmd=systemctl reload nginx
+5
View File
@@ -0,0 +1,5 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=systemctl start nginx
stop_cmd=systemctl stop nginx
apply_cmd=systemctl reload nginx
@@ -0,0 +1,5 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=systemctl start nginx
stop_cmd=systemctl stop nginx
apply_cmd=systemctl reload nginx
+5
View File
@@ -0,0 +1,5 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=systemctl start nginx
stop_cmd=systemctl stop nginx
apply_cmd=systemctl reload nginx
+5
View File
@@ -0,0 +1,5 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=service nginx start
stop_cmd=service nginx stop
apply_cmd=service nginx restart
+7
View File
@@ -0,0 +1,7 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=systemctl start nginx
stop_cmd=systemctl stop nginx
apply_cmd=systemctl reload nginx
add_to=/etc/nginx/sites-available
add_link=/etc/nginx/sites-enabled
+7
View File
@@ -0,0 +1,7 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=systemctl start nginx
stop_cmd=systemctl stop nginx
apply_cmd=systemctl reload nginx
add_to=/etc/nginx/sites-available
add_link=/etc/nginx/sites-enabled
+5
View File
@@ -0,0 +1,5 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=systemctl start nginx
stop_cmd=systemctl stop nginx
apply_cmd=systemctl reload nginx
+5
View File
@@ -0,0 +1,5 @@
nginx_config=/etc/nginx/nginx.conf
nginx_cmd=/usr/sbin/nginx
start_cmd=systemctl start nginx
stop_cmd=systemctl stop nginx
apply_cmd=systemctl reload nginx
+8
View File
@@ -0,0 +1,8 @@
nginx_config=Full path to Nginx config file,0
add_to=File or directory for new server blocks,3,Add to main config file
add_link=Directory for links to new server block files,3,None
nginx_cmd=Full path to Nginx command,0
start_cmd=Command to start Nginx,0
stop_cmd=Command to stop Nginx,0
apply_cmd=Command to apply Nginx configuration,0
extra_dirs=Default extra directives for new server blocks,9,80,5,\t
+8
View File
@@ -0,0 +1,8 @@
nginx_config=Volledig pad naar de Nginx config file,0
add_to=File or directory for new server block files,3,Add to main config file
add_link=Directory for links to new server block files,3,Geen
nginx_cmd=Volledig pad naar de Nginx opdracht,0
start_cmd=Opdracht om Nginx te starten,0
stop_cmd=Opdracht om Nginx te stoppen,0
apply_cmd=Toe te voegen opdracht aan de Nginx configuratie,0
extra_dirs=Standaard extra richtlijnen voor nieuwe serverblokken,9,80,5,\t
+8
View File
@@ -0,0 +1,8 @@
vhosts=
root=/
global=1
user=root
edit=1
create=1
stop=1
logs=1
+140
View File
@@ -0,0 +1,140 @@
#!/usr/local/bin/perl
# Delete selected server blocks
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %config, %access);
&ReadParse();
my @items = split(/\0/, $in{'d'} || "");
my $file_action = $in{'toggle'} ? "toggle" :
$in{'enable'} ? "enable" :
$in{'disable'} ? "disable" : undef;
&error_setup($file_action ? $text{'enable_err'} : $text{'delete_err'});
$access{'edit'} || &error($text{'server_ecannotedit'});
if ($file_action) {
&can_manage_server_files() || &error($text{'enable_elinkdir'});
my %add_to = map { $_, 1 } &get_add_to_files();
my %files;
foreach my $item (@items) {
my $file;
if ($item =~ /^file\t([^\t]+)/) {
$file = $1;
}
else {
my $server = &find_server($item);
next if (!$server || !&can_edit_server($server));
$file = $server->{'file'};
}
my $rfile = $file ? &resolve_links($file) : undef;
$files{$rfile}++ if ($rfile && -f $rfile && $add_to{$rfile} &&
&can_manage_server_file($rfile));
}
my @files = keys %files;
@files || &error($text{'enable_enone'});
my %file_actions;
foreach my $file (@files) {
my $action = $file_action eq "toggle" ?
&server_file_toggle_action($file) : $file_action;
my $err = &virtualmin_server_file_state_error($file, $action);
$err && &error($err);
$file_actions{$file} = $action;
}
foreach my $file (@files) {
my $err = $file_actions{$file} eq "enable" ?
&enable_server_file($file) :
&disable_server_file($file);
$err && &error($err);
}
&webmin_log($file_action, "serverfile", scalar(@files));
&redirect("");
exit;
}
if (!$in{'delete'}) {
&error($text{'delete_eaction'});
}
my (@ids, %file_lines);
foreach my $item (@items) {
if ($item =~ /^file\t([^\t]+)\t(\d+)$/) {
push(@{$file_lines{$1}}, $2);
}
elsif ($item !~ /^file\t/) {
push(@ids, $item);
}
}
@ids || %file_lines || &error($text{'delete_enone'});
# Validate the selected server blocks before locking config files.
foreach my $id (@ids) {
my $server = &find_server($id);
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&is_default_server_block($server) && &error($text{'delete_edefault'});
}
my %add_to = map { $_, 1 } &get_add_to_files();
my %file_servers;
foreach my $file (keys %file_lines) {
my $rfile = &resolve_links($file);
next if (!$rfile || !-f $rfile || !$add_to{$rfile} ||
!&can_manage_server_file($rfile));
my @servers = &find_servers_in_file($rfile);
foreach my $line (@{$file_lines{$file}}) {
my ($server) = grep { $_->{'line'} == $line } @servers;
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&is_default_server_block($server) && &error($text{'delete_edefault'});
push(@{$file_servers{$rfile}}, $server);
}
}
@ids || %file_servers || &error($text{'delete_enone'});
my @servers;
if (@ids) {
&lock_all_config_files();
my $conf = &get_config();
my $http = &find("http", $conf);
if (!$http) {
&unlock_all_config_files();
&error(&text('index_ehttp', "<tt>$config{'nginx_config'}</tt>"));
}
foreach my $id (@ids) {
my $server = &find_server($id);
if (!$server) {
&unlock_all_config_files();
&error($text{'server_egone'});
}
if (!&can_edit_server($server)) {
&unlock_all_config_files();
&error($text{'server_ecannot'});
}
if (&is_default_server_block($server)) {
&unlock_all_config_files();
&error($text{'delete_edefault'});
}
push(@servers, $server);
}
foreach my $server (@servers) {
&save_directive($http, [ $server ], [ ]);
}
&flush_config_file_lines();
&unlock_all_config_files();
}
foreach my $server (@servers) {
&delete_server_link($server);
}
my %done_file;
foreach my $server (@servers) {
next if ($done_file{$server->{'file'}}++);
&delete_server_file_if_empty($server);
}
foreach my $file (keys %file_servers) {
&lock_file($file);
&delete_servers_from_file($file, @{$file_servers{$file}});
&unlock_file($file);
}
my $count = scalar(@servers) +
scalar(map { @$_ } values %file_servers);
&webmin_log("delete", "servers", $count);
&redirect("");
+27
View File
@@ -0,0 +1,27 @@
#!/usr/local/bin/perl
# Show document related options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %access);
my $parent = &get_config_parent();
my $http = &find("http", $parent);
$access{'global'} || &error($text{'index_eglobal'});
&ui_print_header(undef, $text{'docs_title'}, "");
print &ui_form_start("save_docs.cgi", "post");
print &ui_table_start($text{'docs_header'}, undef, 2);
print &nginx_opt_input("root", $http, 60, undef,
&file_chooser_button("root", 1));
print &nginx_opt_input("index", $http, 60, undef, undef, 1);
print &nginx_opt_input("default_type", $http, 20);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});
+34
View File
@@ -0,0 +1,34 @@
#!/usr/local/bin/perl
# Show server block FCGI options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&ui_print_header(&server_desc($server), $text{'fcgi_title'}, "");
print &ui_form_start("save_fcgi.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &nginx_submod_hidden();
print &ui_table_start($text{'fcgi_header'}, undef, 2);
# XXX should be in location section
#print &nginx_opt_input("fastcgi_pass", $server, 50, $text{'fcgi_hostport'});
print &nginx_opt_input("fastcgi_index", $server, 20, $text{'fcgi_index'});
print &nginx_param_input("fastcgi_param", $server);
print &nginx_opt_input("fastcgi_buffer_size", $server, 10,
$text{'fcgi_buffer'});
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+37
View File
@@ -0,0 +1,37 @@
#!/usr/local/bin/perl
# Show location access control options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
my $location = &find_location($server, $in{'path'});
$location || &error($text{'location_egone'});
&ui_print_header(&location_desc($server, $location), $text{'access_title'}, "");
print &ui_form_start("save_laccess.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("path", $in{'path'});
print &nginx_submod_hidden();
print &ui_table_start($text{'access_header'}, undef, 2);
print &nginx_access_input("allow", "deny", $location);
print &nginx_realm_input("auth_basic", $location);
print &nginx_passfile_input("auth_basic_user_file", $location,
$in{'id'}, $in{'path'});
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_location.cgi?id=".&urlize($in{'id'}).
"&path=".&urlize($in{'path'})),
$text{'location_return'},
&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+34
View File
@@ -0,0 +1,34 @@
#!/usr/local/bin/perl
# Show document related options for a location
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
my $location = &find_location($server, $in{'path'});
$location || &error($text{'location_egone'});
&ui_print_header(&location_desc($server, $location), $text{'ldocs_title'}, "");
print &ui_form_start("save_ldocs.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("path", $in{'path'});
print &nginx_submod_hidden();
print &ui_table_start($text{'docs_header'}, undef, 2);
print &nginx_opt_input("index", $location, 60);
print &nginx_opt_input("default_type", $location, 20);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_location.cgi?id=".&urlize($in{'id'}).
"&path=".&urlize($in{'path'})),
$text{'location_return'},
&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+39
View File
@@ -0,0 +1,39 @@
#!/usr/local/bin/perl
# Show location FCGI options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
my $location = &find_location($server, $in{'path'});
$location || &error($text{'location_egone'});
&ui_print_header(&location_desc($server, $location), $text{'fcgi_title'}, "");
print &ui_form_start("save_lfcgi.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("path", $in{'path'});
print &nginx_submod_hidden();
print &ui_table_start($text{'fcgi_header'}, undef, 2);
print &nginx_opt_input("fastcgi_pass", $location, 50, $text{'fcgi_hostport'});
print &nginx_opt_input("fastcgi_index", $location, 20, $text{'fcgi_index'});
print &nginx_param_input("fastcgi_param", $location);
print &nginx_opt_input("fastcgi_buffer_size", $location, 10,
$text{'fcgi_buffer'});
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_location.cgi?id=".&urlize($in{'id'}).
"&path=".&urlize($in{'path'})),
$text{'location_return'},
&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+39
View File
@@ -0,0 +1,39 @@
#!/usr/local/bin/perl
# Show location gzip options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
my $location = &find_location($server, $in{'path'});
$location || &error($text{'location_egone'});
&ui_print_header(&location_desc($server, $location), $text{'gzip_title'}, "");
print &ui_form_start("save_lgzip.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("path", $in{'path'});
print &nginx_submod_hidden();
print &ui_table_start($text{'gzip_header'}, undef, 2);
print &nginx_onoff_input("gzip", $location);
print &nginx_opt_input("gzip_disable", $location, 60, $text{'net_regexp'});
print &nginx_opt_input("gzip_comp_level", $location, 5,
$text{'gzip_level'});
print &nginx_opt_list_input("gzip_types", $location, 60, $text{'ssi_types'});
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_location.cgi?id=".&urlize($in{'id'}).
"&path=".&urlize($in{'path'})),
$text{'location_return'},
&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+79
View File
@@ -0,0 +1,79 @@
#!/usr/local/bin/perl
# Show the config for one location inside a server block
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
my $location;
if ($in{'new'}) {
&ui_print_header(&server_desc($server), $text{'location_create'}, "");
$location = { 'name' => 'location',
'words' => [ ],
'members' => [ ] };
}
else {
$location = &find_location($server, $in{'path'});
$location || &error($text{'location_egone'});
&ui_print_header(&location_desc($server, $location),
$text{'location_edit'}, "");
}
if ($in{'path'}) {
# Show icons for location types
print &ui_subheading($text{'location_settings'});
my @lpages = ( "ldocs", "lfcgi", "lssi", "lgzip", "lproxy",
"laccess", "lrewrite", );
&icons_table(
[ map { &nginx_submod_url("edit_".$_.".cgi?id=".
&urlize($in{'id'})."&path=".&urlize($in{'path'})) }
@lpages ],
[ map { $text{$_."_title"} } @lpages ],
[ map { "images/".$_.".gif" } @lpages ],
);
print &ui_hr();
}
# Show form to edit location path and root
if (!$in{'new'}) {
print &ui_subheading($text{'location_location'});
}
print &ui_form_start("save_location.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("new", $in{'new'});
print &ui_hidden("oldpath", $in{'path'});
print &nginx_submod_hidden();
print &ui_table_start($text{'location_header'}, "width=100%", 2);
# Location path
my @w = @{$location->{'words'}};
print &ui_table_row($text{'location_path'},
&ui_textbox("path", @w ? $w[$#w] : "", 60));
# Match type
print &ui_table_row($text{'location_match'},
&ui_select("match", @w > 1 ? $w[0] : "",
[ map { [ $_, &match_desc($_) ] } &list_match_types() ],
1, 0, 1));
# Root directory
print &nginx_text_input("root", $location, 60,
&file_chooser_button("root", 1));
print &ui_table_end();
if ($in{'new'}) {
print &ui_form_end([ [ undef, $text{'create'} ] ]);
}
else {
print &ui_form_end([ [ undef, $text{'save'} ],
[ 'delete', $text{'location_delete'} ] ]);
}
&ui_print_footer(&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+28
View File
@@ -0,0 +1,28 @@
#!/usr/local/bin/perl
# Show logging options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %access);
my $parent = &get_config_parent();
my $http = &find("http", $parent);
$access{'global'} || &error($text{'index_eglobal'});
&ui_print_header(undef, $text{'logs_title'}, "");
print &ui_form_start("save_logs.cgi", "post");
print &ui_table_start($text{'logs_header'}, undef, 2);
print &nginx_error_log_input("error_log", $parent);
print &nginx_access_log_input("access_log", $http);
print &nginx_logformat_input("log_format", $http);
print &nginx_opt_input("pid", $parent, 60, $text{'logs_file'});
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});
+45
View File
@@ -0,0 +1,45 @@
#!/usr/local/bin/perl
# Show location proxy options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
my $location = &find_location($server, $in{'path'});
$location || &error($text{'location_egone'});
&ui_print_header(&server_desc($server), $text{'proxy_title'}, "");
print &ui_form_start("save_lproxy.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("path", $in{'path'});
print &nginx_submod_hidden();
print &ui_table_start($text{'proxy_header'}, undef, 2);
print &nginx_opt_input("proxy_pass", $location, 50, $text{'proxy_url'});
print &nginx_opt_input("proxy_buffer_size", $location, 10,
$text{'fcgi_buffer'});
print &nginx_opt_input("proxy_bind", $location, 20,
$text{'proxy_ip'});
print &nginx_param_input("proxy_set_header", $location,
$text{'proxy_name'}, $text{'proxy_value'});
print &nginx_textarea_input("proxy_pass_header", $location, 60, 5);
print &nginx_textarea_input("proxy_hide_header", $location, 60, 5);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_location.cgi?id=".&urlize($in{'id'}).
"&path=".&urlize($in{'path'})),
$text{'location_return'},
&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+35
View File
@@ -0,0 +1,35 @@
#!/usr/local/bin/perl
# Show location URL rewrite options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %rewrite);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
my $location = &find_location($server, $in{'path'});
$location || &error($text{'location_egone'});
&ui_print_header(&location_desc($server, $location),
$text{'rewrite_title'}, "");
print &ui_form_start("save_lrewrite.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("path", $in{'path'});
print &nginx_submod_hidden();
print &ui_table_start($text{'rewrite_header'}, undef, 2);
print &nginx_rewrite_input("rewrite", $location);
print &nginx_onoff_input("rewrite_log", $location);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_location.cgi?id=".&urlize($in{'id'}).
"&path=".&urlize($in{'path'})),
$text{'location_return'},
&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+38
View File
@@ -0,0 +1,38 @@
#!/usr/local/bin/perl
# Show location server-side include options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
my $location = &find_location($server, $in{'path'});
$location || &error($text{'location_egone'});
&ui_print_header(&location_desc($server, $location), $text{'ssi_title'}, "");
print &ui_form_start("save_lssi.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("path", $in{'path'});
print &nginx_submod_hidden();
print &ui_table_start($text{'ssi_header'}, undef, 2);
print &nginx_onoff_input("ssi", $location);
print &nginx_onoff_input("ssi_silent_errors", $location);
print &nginx_opt_list_input("ssi_types", $location, 60, $text{'ssi_types'});
print &nginx_opt_input("ssi_value_length", $location, 10);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_location.cgi?id=".&urlize($in{'id'}).
"&path=".&urlize($in{'path'})),
$text{'location_return'},
&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+45
View File
@@ -0,0 +1,45 @@
#!/usr/local/bin/perl
# Show a form to edit all config files
use strict;
use warnings;
require './nginx-lib.pl';
&ReadParse();
our (%text, %in, %access);
&can_edit_manual_config() || &error($text{'manual_ecannot'});
&ui_print_header(undef, $text{'manual_title'}, "");
my @files = &get_manual_config_files();
$in{'file'} ||= $files[0];
$in{'file'} = &resolve_manual_config_file($in{'file'}, @files) ||
&error($text{'manual_efile'});
# Show file selector
print &ui_form_start("edit_manual.cgi");
print &nginx_submod_hidden();
print &ui_hidden("id", $in{'id'});
print "<b>$text{'manual_file'}</b>\n";
print &ui_select("file", $in{'file'}, \@files, 1, 0, 0, 0,
"onChange='form.submit()'");
print &ui_submit($text{'manual_ok'});
print &ui_form_end();
# Show current file
print &ui_form_start("save_manual.cgi", "form-data");
print &ui_hidden("file", $in{'file'});
print &ui_hidden("id", $in{'id'});
print &nginx_submod_hidden();
print &ui_table_start(undef, "width=100%", 2);
print &ui_table_row(undef,
&ui_textarea("data", &read_file_contents($in{'file'}), 25, 80,
undef, 0, "style='width:100%'"), 2);
print &ui_table_row(undef,
&ui_checkbox("test", 1, $text{'manual_test'}, 1));
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});
+86
View File
@@ -0,0 +1,86 @@
#!/usr/local/bin/perl
# Show a table of all MIME types, with links to edit
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $conf = &get_config();
my $http = &find("http", $conf);
my $types = &find("types", $http);
$access{'global'} || &error($text{'index_eglobal'});
&ui_print_header(undef, $text{'mime_title'}, "");
# Show search form
print &ui_form_start("edit_mime.cgi");
print "$text{'mime_search'}&nbsp;&nbsp; ",
&ui_textbox("search", $in{'search'}, 20)," ",
&ui_submit($text{'mime_ok'});
print &ui_form_end();
# Find types
my @types = $types ? @{$types->{'members'}} : ();
if ($in{'search'}) {
@types = grep { $_->{'name'} =~ /\Q$in{'search'}\E/i ||
&indexoflc($in{'search'}, @{$_->{'words'}}) >= 0 }
@types;
}
my @links;
push(@links, "<a href='edit_mime.cgi?new=1&search=".&urlize($in{'search'}).
"#new'>".$text{'mime_add'}."</a>") if (!$in{'new'});
if (@types) {
# Show in table
unshift(@links, &select_all_link("d", 1),
&select_invert_link("d", 1));
print &ui_form_start("save_mime.cgi", "post");
print &ui_hidden("new", $in{'new'});
print &ui_hidden("type", $in{'type'});
print &ui_hidden("search", $in{'search'});
print &ui_links_row(\@links);
print &ui_columns_start([ "", $text{'mime_type'}, $text{'mime_exts'} ],
100, 0, [ "width=5" ]);
foreach my $t (@types) {
if ($in{'type'} && $in{'type'} eq $t->{'name'}) {
# Editing this type
print "<a name=edit>";
print &ui_checked_columns_row(
[ &ui_textbox("name", $t->{'name'}, 30),
&ui_textbox("words",
join(" ", @{$t->{'words'}}), 50) ],
undef, "d", $t->{'name'}, 0, 1);
}
else {
# Just show, with link to edit
print &ui_checked_columns_row(
[ "<a href='edit_mime.cgi?type=".
&urlize($t->{'name'})."&search=".
&urlize($in{'search'})."#edit'>".
&html_escape($t->{'name'})."</a>",
&html_escape(join(" ", @{$t->{'words'}})) ],
undef, "d", $t->{'name'});
}
}
if ($in{'new'}) {
print &ui_checked_columns_row(
[ &ui_textbox("name", undef, 30),
&ui_textbox("words", undef, 50) ],
undef, "d", "xxx", 0, 1);
}
print &ui_columns_end();
print "<a name=new>\n";
print &ui_links_row(\@links);
print &ui_form_end([ $in{'type'} ? ( [ undef, $text{'save'} ] ) :
$in{'new'} ? ( [ undef, $text{'create'} ] ) : ( ),
[ 'delete', $text{'mime_delete'} ] ]);
}
else {
# None matching search
print "<b>",($in{'search'} ? $text{'mime_nomatch'}
: $text{'mime_none'}),"</b><p>\n";
print &ui_links_row(\@links);
}
&ui_print_footer("", $text{'index_return'});
+32
View File
@@ -0,0 +1,32 @@
#!/usr/local/bin/perl
# Show other random options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %access);
my $parent = &get_config_parent();
my $events = &find("events", $parent);
my $http = &find("http", $parent);
$access{'global'} || &error($text{'index_eglobal'});
&ui_print_header(undef, $text{'misc_title'}, "");
print &ui_form_start("save_misc.cgi", "post");
print &ui_table_start($text{'misc_header'}, undef, 2);
print &nginx_user_input("user", $parent);
print &nginx_opt_input("worker_processes", $parent, 5);
print &nginx_opt_input("worker_priority", $parent, 5, $text{'misc_pri'},
$text{'misc_prisuffix'});
print &nginx_opt_input("index", $http, 60);
print &nginx_opt_input("default_type", $http, 20);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});
+35
View File
@@ -0,0 +1,35 @@
#!/usr/local/bin/perl
# Show networking-related options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %access);
my $conf = &get_config();
my $http = &find("http", $conf);
$access{'global'} || &error($text{'index_eglobal'});
&ui_print_header(undef, $text{'net_title'}, "");
print &ui_form_start("save_net.cgi", "post");
print &ui_table_start($text{'net_header'}, undef, 2);
print &nginx_onoff_input("sendfile", $http);
print &nginx_onoff_input("gzip", $http);
print &nginx_opt_input("gzip_disable", $http, 60, $text{'net_regexp'});
print &nginx_onoff_input("tcp_nopush", $http);
print &nginx_onoff_input("tcp_nodelay", $http);
print &nginx_opt_input("keepalive_timeout", $http, 5, undef,
$text{'opt_secs'});
print &nginx_opt_input("keepalive_requests", $http, 5, undef);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});
+30
View File
@@ -0,0 +1,30 @@
#!/usr/local/bin/perl
# Show server block access control options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&ui_print_header(&server_desc($server), $text{'access_title'}, "");
print &ui_form_start("save_saccess.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &nginx_submod_hidden();
print &ui_table_start($text{'access_header'}, undef, 2);
print &nginx_access_input("allow", "deny", $server);
print &nginx_realm_input("auth_basic", $server);
print &nginx_passfile_input("auth_basic_user_file", $server, $in{'id'});
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+31
View File
@@ -0,0 +1,31 @@
#!/usr/local/bin/perl
# Show document related options for a server block
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&ui_print_header(&server_desc($server), $text{'sdocs_title'}, "");
print &ui_form_start("save_sdocs.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &nginx_submod_hidden();
print &ui_table_start($text{'docs_header'}, undef, 2);
print &nginx_opt_input("root", $server, 60, undef,
&file_chooser_button("root", 1));
print &nginx_opt_input("index", $server, 60, undef, undef, 1);
print &nginx_opt_input("default_type", $server, 20);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+196
View File
@@ -0,0 +1,196 @@
#!/usr/local/bin/perl
# Show the config for one HTTP server
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access, %config);
&ReadParse();
my $from_submod = defined($in{'nmod'});
my $action_links = -r $config{'nginx_config'} &&
&has_command($config{'nginx_cmd'}) ?
&nginx_action_links() : "";
my $server;
my $can_create = !defined($access{'create'}) || $access{'create'};
if ($in{'new'}) {
$can_create || &error($text{'server_ecannotcreate'});
&ui_print_header(undef, $text{'server_create'}, "", undef, undef,
undef, undef, $action_links);
$server = { 'name' => 'server',
'members' => [ ] };
}
else {
$server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&ui_print_header(&server_desc($server), $text{'server_edit'}, "",
undef, undef, undef, undef, $action_links);
}
if ($in{'id'}) {
# Show icons for server settings types
print &ui_subheading($text{'server_settings'});
my @spages = ( $access{'logs'} ? ( "slogs" ) : ( ),
"sdocs", "ssl", "fcgi", "sssi", "sgzip", "sproxy",
"saccess", "srewrite", );
my @slinks = map { &nginx_submod_url("edit_".$_.".cgi?id=".
&urlize($in{'id'})) } @spages;
my @stitles = map { $text{$_."_title"} } @spages;
my @sicons = map { "images/".$_.".gif" } @spages;
if (&can_edit_manual_config() && &can_edit_manual_file($server->{'file'})) {
push(@slinks, &nginx_submod_url("edit_manual.cgi?file=".
&urlize($server->{'file'}).
"&id=".&urlize($in{'id'})));
push(@stitles, $text{'manual_server'});
push(@sicons, "images/manual.gif");
}
&icons_table(
\@slinks,
\@stitles,
\@sicons,
);
# Show table for locations
print &ui_subheading($text{'server_locations'});
my @locations = &find("location", $server);
my @links = ( "<a href='".&nginx_submod_url("edit_location.cgi?id=".
&urlize($in{'id'})."&new=1").
"'>$text{'server_addloc'}</a>" );
if (@locations) {
print &ui_links_row(\@links);
print &ui_columns_start([ $text{'server_pathloc'},
$text{'server_matchtype'},
$text{'server_dirloc'},
$text{'server_indexloc'},
$text{'server_autoloc'} ]);
foreach my $l (@locations) {
my $rootdir = &find_value("root", $l);
my $pp = &find_value("proxy_pass", $l);
my @indexes = map { @{$_->{'words'}} }
&find("index", $l);
my $auto = &find_value("autoindex", $l);
my @w = @{$l->{'words'}};
print &ui_columns_row([
"<a href='".&nginx_submod_url("edit_location.cgi?id=".
&urlize($in{'id'})."&path=".
&urlize($w[$#w]))."'>".
&html_escape($w[$#w])."</a>",
&match_desc(@w > 1 ? $w[0] : ""),
$rootdir ? $rootdir :
$pp ? &text('server_pp', "<tt>$pp</tt>") :
"<i>$text{'index_noroot'}</i>",
join(" ", @indexes) ||
"<i>$text{'server_noindex'}</i>",
$auto =~ /on/i ? $text{'yes'} : $text{'no'},
]);
}
print &ui_columns_end();
}
else {
print "<b>$text{'server_noneloc'}</b><p>\n";
}
print &ui_links_row(\@links);
}
if ($access{'edit'} || ($in{'new'} && $can_create)) {
# Show form to edit name, IPs and root
if (!$in{'new'}) {
print &ui_hr();
print &ui_subheading($text{'server_server'});
}
print &ui_form_start("save_server.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &ui_hidden("new", $in{'new'});
print &nginx_submod_hidden();
print &ui_table_start($text{'server_header'}, "width=100%", 2);
# Server name
print &nginx_text_input("server_name", $server, 70, undef, 1);
# IP addresses / ports to listen on
my @listen;
if ($in{'new'}) {
@listen = ( &value_to_struct('listen', '80') );
}
else {
@listen = &find("listen", $server);
}
my $table = &ui_columns_start([ $text{'server_ip'},
$text{'server_port'},
$text{'server_default'},
$text{'server_ssl'},
$text{'server_http2'},
$text{'server_ipv6'} ], 100);
my $i = 0;
my @tds = ( "valign=top", "valign=top", "valign=top",
"valign=top", "valign=top" );
foreach my $l (@listen, { 'words' => [ ] }) {
my @w = @{$l->{'words'}};
my ($ip, $port) = @w ? &split_ip_port(shift(@w)) : ( );
my ($default, $ssl, $http2, $ipv6) = (0, 0, 0, "");
foreach my $w (@w) {
if ($w eq "default" || $w eq "default_server") {
$default = 1;
}
elsif ($w eq "ssl") {
$ssl = 1;
}
elsif ($w eq "http2") {
$http2 = 1;
}
elsif ($w =~ /^ipv6only=(\S+)/) {
$ipv6 = lc($1);
}
}
my $ipmode = !$ip && !$port ? 3 :
!$ip ? 1 : $ip eq "::" ? 2 : 0;
# XXX disable inputs when disabled
$table .= &ui_columns_row([
&ui_radio("ip_def_$i", $ipmode,
[ [ 3, $text{'server_none'}."<br>" ],
[ 1, $text{'server_ipany'}."<br>" ],
[ 2, $text{'server_ip6any'}."<br>" ],
[ 0, $text{'server_ipaddr'} ] ])." ".
&ui_textbox("ip_$i", $ipmode == 0 ? $ip : "", 30),
&ui_textbox("port_$i", $port, 6),
&ui_select("default_$i", $default,
[ [ 0, $text{'no'} ], [ 1, $text{'yes'} ] ]),
&ui_select("ssl_$i", $ssl,
[ [ 0, $text{'no'} ], [ 1, $text{'yes'} ] ]),
&ui_select("http2_$i", $http2,
[ [ 0, $text{'no'} ], [ 1, $text{'yes'} ] ]),
&ui_select("ipv6_$i", $ipv6,
[ [ "", $text{'server_auto'} ],
[ "off", $text{'no'} ], [ "on", $text{'yes'} ] ]),
], \@tds);
$i++;
}
$table .= &ui_columns_end();
print &ui_table_row($text{'server_listen'}, $table);
# Root directory (for new hosts)
if ($in{'new'}) {
print &ui_table_row($text{'server_rootdir'},
&ui_filebox("rootdir", undef, 50, 0, undef, undef, 1));
}
print &ui_table_end();
if ($in{'new'}) {
print &ui_form_end([ [ undef, $text{'create'} ] ]);
}
elsif ($from_submod) {
print &ui_form_end([ [ undef, $text{'save'} ] ]);
}
else {
print &ui_form_end([ [ undef, $text{'save'} ],
[ 'delete', $text{'server_delete'} ] ]);
}
}
if ($from_submod) {
&ui_print_footer();
}
else {
&ui_print_footer("", $text{'index_return'});
}
+33
View File
@@ -0,0 +1,33 @@
#!/usr/local/bin/perl
# Show server block gzip options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&ui_print_header(&server_desc($server), $text{'gzip_title'}, "");
print &ui_form_start("save_sgzip.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &nginx_submod_hidden();
print &ui_table_start($text{'gzip_header'}, undef, 2);
print &nginx_onoff_input("gzip", $server);
print &nginx_opt_input("gzip_disable", $server, 60, $text{'net_regexp'});
print &nginx_opt_input("gzip_comp_level", $server, 5,
$text{'gzip_level'});
print &nginx_opt_list_input("gzip_types", $server, 60, $text{'ssi_types'});
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+31
View File
@@ -0,0 +1,31 @@
#!/usr/local/bin/perl
# Show server block logging options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
$access{'logs'} || &error($text{'logs_ecannot'});
&ui_print_header(&server_desc($server), $text{'slogs_title'}, "");
print &ui_form_start("save_slogs.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &nginx_submod_hidden();
print &ui_table_start($text{'slogs_header'}, undef, 2);
print &nginx_error_log_input("error_log", $server);
print &nginx_access_log_input("access_log", $server);
print &nginx_logformat_input("log_format", $server);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+37
View File
@@ -0,0 +1,37 @@
#!/usr/local/bin/perl
# Show server block proxy options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&ui_print_header(&server_desc($server), $text{'proxy_title'}, "");
print &ui_form_start("save_sproxy.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &nginx_submod_hidden();
print &ui_table_start($text{'proxy_header'}, undef, 2);
print &nginx_opt_input("proxy_buffer_size", $server, 10,
$text{'fcgi_buffer'});
print &nginx_opt_input("proxy_bind", $server, 20,
$text{'proxy_ip'});
print &nginx_param_input("proxy_set_header", $server,
$text{'proxy_name'}, $text{'proxy_value'});
print &nginx_textarea_input("proxy_pass_header", $server, 60, 5);
print &nginx_textarea_input("proxy_hide_header", $server, 60, 5);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+28
View File
@@ -0,0 +1,28 @@
#!/usr/local/bin/perl
# Show server block URL re-write options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&ui_print_header(&server_desc($server), $text{'rewrite_title'}, "");
print &ui_form_start("save_srewrite.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &nginx_submod_hidden();
print &ui_table_start($text{'rewrite_header'}, undef, 2);
print &nginx_rewrite_input("rewrite", $server);
print &nginx_onoff_input("rewrite_log", $server);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+28
View File
@@ -0,0 +1,28 @@
#!/usr/local/bin/perl
# Show global server-side include options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %access);
my $parent = &get_config_parent();
my $http = &find("http", $parent);
$access{'global'} || &error($text{'index_eglobal'});
&ui_print_header(undef, $text{'ssi_title'}, "");
print &ui_form_start("save_ssi.cgi", "post");
print &ui_table_start($text{'ssi_header'}, undef, 2);
print &nginx_onoff_input("ssi", $http);
print &nginx_onoff_input("ssi_silent_errors", $http);
print &nginx_opt_list_input("ssi_types", $http, 60, $text{'ssi_types'});
print &nginx_opt_input("ssi_value_length", $http, 10);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});
+35
View File
@@ -0,0 +1,35 @@
#!/usr/local/bin/perl
# Show server block SSL options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&ui_print_header(&server_desc($server), $text{'ssl_title'}, "");
print &ui_form_start("save_ssl.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &nginx_submod_hidden();
print &ui_table_start($text{'ssl_header'}, undef, 2);
print &nginx_opt_input("ssl_certificate", $server, 50, $text{'ssl_file'},
&file_chooser_button("ssl_certificate"));
print &nginx_opt_input("ssl_certificate_key", $server, 50, $text{'ssl_file'},
&file_chooser_button("ssl_certificate_key"));
print &nginx_opt_input("ssl_ciphers", $server, 30, $text{'ssl_clist'});
print &nginx_multi_input("ssl_protocols", $server,
[ "SSLv2", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3" ]);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+32
View File
@@ -0,0 +1,32 @@
#!/usr/local/bin/perl
# Show server block server-side include options
use strict;
use warnings;
require './nginx-lib.pl';
our (%text, %in, %access);
&ReadParse();
my $server = &find_server($in{'id'});
$server || &error($text{'server_egone'});
&can_edit_server($server) || &error($text{'server_ecannot'});
&ui_print_header(&server_desc($server), $text{'ssi_title'}, "");
print &ui_form_start("save_sssi.cgi", "post");
print &ui_hidden("id", $in{'id'});
print &nginx_submod_hidden();
print &ui_table_start($text{'ssi_header'}, undef, 2);
print &nginx_onoff_input("ssi", $server);
print &nginx_onoff_input("ssi_silent_errors", $server);
print &nginx_opt_list_input("ssi_types", $server, 60, $text{'ssi_types'});
print &nginx_opt_input("ssi_value_length", $server, 10);
print &ui_table_end();
print &ui_form_end([ [ undef, $text{'save'} ] ]);
&ui_print_footer(&nginx_submod_url("edit_server.cgi?id=".&urlize($in{'id'})),
$text{'server_return'});
+66
View File
@@ -0,0 +1,66 @@
#!/usr/local/bin/perl
# Show form for creating or editing a user
use strict;
use warnings;
require './nginx-lib.pl';
&foreign_require("htaccess-htpasswd");
our (%text, %in, %access);
&ReadParse();
$in{'file'} || &error($text{'users_efile'});
&switch_write_user(1);
my $users = &htaccess_htpasswd::list_users($in{'file'});
&switch_write_user(0);
my $desc = "<tt>".&html_escape($in{'file'})."</tt>";
my $user;
if ($in{'new'}) {
&ui_print_header($desc, $text{'user_create'}, "");
$user = { 'enabled' => 1 };
}
else {
&ui_print_header($desc, $text{'user_edit'}, "");
($user) = grep { $_->{'user'} eq $in{'user'} } @$users;
$user || &error($text{'user_egone'});
}
print &ui_form_start("save_user.cgi", "post");
print &ui_hidden("new", $in{'new'});
print &ui_hidden("file", $in{'file'});
print &ui_hidden("old", $in{'user'});
print &ui_hidden("id", $in{'id'});
print &ui_hidden("path", $in{'path'});
print &nginx_submod_hidden();
print &ui_table_start($text{'user_header'}, undef, 2);
# Username
print &ui_table_row($text{'user_user'},
&ui_textbox("htuser", $user->{'user'}, 30));
# Password
if ($in{'new'}) {
print &ui_table_row($text{'user_pass'},
&ui_textbox("htpass", undef, 20));
}
else {
print &ui_table_row($text{'user_pass'},
&ui_opt_textbox("htpass", undef, 20,
$text{'user_passleave'}, $text{'user_passset'}));
}
# Enabled?
print &ui_table_row($text{'user_enabled'},
&ui_yesno_radio("enabled", $user->{'enabled'}));
print &ui_table_end();
if ($in{'new'}) {
print &ui_form_end([ [ undef, $text{'create'} ] ]);
}
else {
print &ui_form_end([ [ undef, $text{'save'} ],
[ 'delete', $text{'delete'} ] ]);
}
&ui_print_footer(&nginx_submod_url("list_users.cgi?file=".&urlize($in{'file'}).
"&id=".&urlize($in{'id'})."&path=".&urlize($in{'path'})),
$text{'users_return'});
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/perl
use strict;
use warnings;
my @mods;
my %donemod;
foreach my $l (&download("http://wiki.nginx.org/DirectiveIndex")) {
if ($l =~ /href="\/(Nginx([^"]*)Module)"/) {
my $page = $1;
my $mod = $2;
$mod =~ s/([A-Z])/_$1/g;
$mod =~ s/^_//;
$mod = lc($mod);
push(@mods, [ $page, $mod ]) if (!$donemod{$mod}++);
}
}
push(@mods, [ "CoreModule", "core" ]);
my @dirs;
foreach my $m (@mods) {
my ($page, $mod) = @$m;
my $dir;
foreach my $l (&download("http://wiki.nginx.org/$page")) {
if ($l =~ /<b>syntax:<\/b> (<i>)?([^< ]+)/i) {
$dir = { 'name' => $2,
'mod' => $mod };
push(@dirs, $dir);
}
elsif ($l =~ /<b>default:<\/b> <i>([^<]+)</i && $dir) {
$dir->{'default'} = $1;
$dir->{'default'} =~ s/^\Q$dir->{'name'}\E\s+//;
if ($dir->{'default'} eq 'compile-time option' ||
$dir->{'default'} eq 'system dependent' ||
$dir->{'default'} =~ /No value specified/) {
$dir->{'default'} = '';
}
$dir->{'default'} =~ s/;\s*$//;
}
elsif ($l =~ /<b>context:<\/b> <i>([^<]+)</i && $dir) {
$dir->{'context'} = $1;
$dir->{'context'} =~ s/\s//g;
$dir->{'context'} =~ s/\([^\)]+\)//g;
$dir = undef;
}
}
}
foreach my $dir (@dirs) {
print join("\t", $dir->{'mod'}, $dir->{'name'}, $dir->{'default'} || "-", $dir->{'context'} || "-"),"\n";
}
sub download
{
my ($url) = @_;
my @lines = `wget -O - -q $url 2>/dev/null`;
return @lines;
}
+7
View File
@@ -0,0 +1,7 @@
<header>كتل خادم Nginx</header>
تدير هذه الوحدة الإعدادات العامة لخادم الويب Nginx، وتكوين كتل
الخادم، ومواقع URL، وتسجيل السجلات، وSSL، وFastCGI، والوكيل،
والتحكم في الوصول، وقواعد إعادة الكتابة. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Сървърни блокове на Nginx</header>
Този модул управлява глобалните настройки на Nginx уеб сървъра,
конфигурацията на сървърните блокове, URL местоположенията,
регистрирането, SSL, FastCGI, проксито, контрола на достъпа и
правилата за пренаписване. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Blocs de servidor Nginx</header>
Aquest mòdul gestiona la configuració global del servidor web Nginx,
la configuració dels blocs de servidor, les ubicacions d'URL, el
registre, SSL, FastCGI, proxy, control d'accés i regles de
reescriptura. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Serverové bloky Nginx</header>
Tento modul spravuje globální nastavení webového serveru Nginx,
konfiguraci serverových bloků, umístění URL, protokolování, SSL,
FastCGI, proxy, řízení přístupu a pravidla přepisování. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Nginx-serverblokke</header>
Dette modul administrerer globale indstillinger for Nginx-webserveren,
serverblokkonfiguration, URL-placeringer, logning, SSL, FastCGI,
proxy, adgangskontrol og omskrivningsregler. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Nginx-Serverblöcke</header>
Dieses Modul verwaltet die globalen Einstellungen des
Nginx-Webservers, die Konfiguration der Serverblöcke, URL-Standorte,
Logging, SSL, FastCGI, Proxying, Zugriffskontrolle und
Rewrite-Regeln. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Μπλοκ διακομιστή Nginx</header>
Αυτή η μονάδα διαχειρίζεται τις γενικές ρυθμίσεις του διακομιστή ιστού
Nginx, τη διαμόρφωση μπλοκ διακομιστή, τις τοποθεσίες URL, την
καταγραφή, SSL, FastCGI, διακομιστή μεσολάβησης, έλεγχο πρόσβασης
και κανόνες επανεγγραφής. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Bloques de servidor Nginx</header>
Este módulo gestiona la configuración global del servidor web Nginx,
la configuración de los bloques de servidor, las ubicaciones de URL,
el registro, SSL, FastCGI, proxy, control de acceso y reglas de
reescritura. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Nginx zerbitzari-blokeak</header>
Modulu honek Nginx web zerbitzariaren ezarpen orokorrak, zerbitzari
blokeen konfigurazioa, URL kokapenak, erregistroa, SSL, FastCGI,
proxia, sarbide-kontrola eta berridazketa-arauak kudeatzen ditu. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>بلوک‌های سرور Nginx</header>
این ماژول تنظیمات سراسری وب‌سرور Nginx، پیکربندی بلوک سرور،
مکان‌های URL، گزارش‌گیری، SSL، FastCGI، پروکسی، کنترل دسترسی و
قوانین بازنویسی را مدیریت می‌کند. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Nginx-palvelinlohkot</header>
Tämä moduuli hallinnoi Nginx-verkkopalvelimen yleisiä asetuksia,
palvelinlohkojen konfiguraatiota, URL-sijainteja, lokitusta, SSL:ää,
FastCGI:tä, välityspalvelinta, käyttöoikeuksien hallintaa ja
uudelleenkirjoitussääntöjä. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Blocs serveur Nginx</header>
Ce module gère les paramètres globaux du serveur web Nginx, la
configuration des blocs serveur, les emplacements d'URL, la
journalisation, SSL, FastCGI, le proxy, le contrôle d'accès et les
règles de réécriture. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Nginx serverski blokovi</header>
Ovaj modul upravlja globalnim postavkama Nginx web poslužitelja,
konfiguracijom serverskih blokova, URL lokacijama, zapisivanjem,
SSL-om, FastCGI-jem, proxyjem, kontrolom pristupa i pravilima
prepisivanja. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Nginx server blocks</header>
This module manages global Nginx webserver settings, server block
configuration, URL locations, logging, SSL, FastCGI, proxying, access
control and rewrite rules. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Nginx szerverblokkok</header>
Ez a modul kezeli az Nginx webszerver globális beállításait, a
szerverblokkok konfigurációját, URL helyeket, naplózást, SSL-t,
FastCGI-t, proxyt, hozzáférés-vezérlést és újraírási szabályokat. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Blocchi server Nginx</header>
Questo modulo gestisce le impostazioni globali del server web Nginx,
la configurazione dei blocchi server, le posizioni URL, il logging,
SSL, FastCGI, il proxy, il controllo degli accessi e le regole di
riscrittura. <p>
<footer>
+6
View File
@@ -0,0 +1,6 @@
<header>Nginx サーバーブロック</header>
このモジュールは、Nginx ウェブサーバーのグローバル設定、サーバーブロックの構成、URL
の場所、ログ記録、SSL、FastCGI、プロキシ、アクセス制御、書き換えルールを管理します。 <p>
<footer>
+6
View File
@@ -0,0 +1,6 @@
<header>Nginx 서버 블록</header>
이 모듈은 Nginx 웹 서버의 전역 설정, 서버 블록 구성, URL 위치, 로깅, SSL, FastCGI,
프록시, 접근 제어 및 재작성 규칙을 관리합니다. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Blok pelayan Nginx</header>
Modul ini menguruskan tetapan global pelayan web Nginx, konfigurasi
blok pelayan, lokasi URL, pengelogan, SSL, FastCGI, proksi, kawalan
akses dan peraturan tulis semula. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Nginx serverblokken</header>
Deze module beheert globale Nginx-webserverinstellingen,
serverblokconfiguratie, URL-locaties, logging, SSL, FastCGI, proxy,
toegangscontrole en herschrijfregels. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Nginx serverblokker</header>
Denne modulen administrerer globale Nginx-webserverinnstillinger,
serverblokkonfigurasjon, URL-plasseringer, logging, SSL, FastCGI,
proxy, tilgangskontroll og omskrivningsregler. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Bloki serwera Nginx</header>
Ten moduł zarządza globalnymi ustawieniami serwera WWW Nginx,
konfiguracją bloków serwera, lokalizacjami URL, logowaniem, SSL,
FastCGI, proxy, kontrolą dostępu i regułami przepisywania. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Blocos de servidor Nginx</header>
Este módulo gere as configurações globais do servidor web Nginx, a
configuração de blocos de servidor, localizações de URL, registo,
SSL, FastCGI, proxy, controlo de acesso e regras de reescrita. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Blocos de servidor Nginx</header>
Este módulo gerencia as configurações globais do servidor web Nginx,
a configuração de blocos de servidor, locais de URL, registro, SSL,
FastCGI, proxy, controle de acesso e regras de reescrita. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Серверные блоки Nginx</header>
Этот модуль управляет глобальными настройками веб-сервера Nginx,
конфигурацией серверных блоков, расположениями URL, логированием,
SSL, FastCGI, проксированием, контролем доступа и правилами
перезаписи. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Serverové bloky Nginx</header>
Tento modul spravuje globálne nastavenia webového servera Nginx,
konfiguráciu serverových blokov, umiestnenia URL, logovanie, SSL,
FastCGI, proxy, riadenie prístupu a pravidlá prepisovania. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Nginx serverblock</header>
Denna modul hanterar globala Nginx-webbserverinställningar,
serverblockkonfiguration, URL-platser, loggning, SSL, FastCGI, proxy,
åtkomstkontroll och omskrivningsregler. <p>
<footer>
+8
View File
@@ -0,0 +1,8 @@
<header>Nginx sunucu blokları</header>
Bu modül, Nginx web sunucusunun genel ayarlarını, sunucu bloğu
yapılandırmasını, URL konumlarını, günlüğe kaydetmeyi, SSL'yi,
FastCGI'yı, proxy'i, erişim kontrolünü ve yeniden yazma kurallarını
yönetir. <p>
<footer>
+7
View File
@@ -0,0 +1,7 @@
<header>Серверні блоки Nginx</header>
Цей модуль керує глобальними налаштуваннями веб-сервера Nginx,
конфігурацією серверних блоків, розташуваннями URL, журналюванням,
SSL, FastCGI, проксі, контролем доступу та правилами перезапису. <p>
<footer>
+5
View File
@@ -0,0 +1,5 @@
<header>Nginx 服务器块</header>
此模块管理 Nginx Web 服务器的全局设置、服务器块配置、URL 位置、日志记录、SSL、FastCGI、代理、访问控制和重写规则。 <p>
<footer>
+5
View File
@@ -0,0 +1,5 @@
<header>Nginx 伺服器區塊</header>
此模組管理 Nginx 網頁伺服器的全域設定、伺服器區塊設定、URL 位置、日誌、SSL、FastCGI、代理、存取控制和重寫規則。 <p>
<footer>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Some files were not shown because too many files have changed in this diff Show More