This PR adds a "Redirect all requests" option to the server block and location URL Re-Writing pages in the Nginx Webserver module, backed by the Nginx return directive with a choice of 301, 302, 303, 307 or 308.
The existing rewrite table only offers the redirect and permanent flags, which map to 302 and 301. The other codes requested on the forum are not supported by rewrite at all, so they can only be provided through return.
The new option only manages return directives that are redirects. A bare URL form such as return https://example.com/; is shown as a 302, while non-redirect uses like return 404; are hidden from the page and never modified or removed.
Example of the resulting config for a server block:
return 308 "https://example.com$request_uri";
Fixes https://forum.virtualmin.com/t/137940
ⓘ Values with a # were written unquoted, so on the next read the module took the # as the start of a comment and lost the rest of the line.
For example, a redirect saved as return 301 https://example.com/docs#install; then showed as no redirect on the page, and re-saving it added a duplicate rewrite_log directive that Nginx rejected.
So, before the fix, saving a redirect to https://example.com/docs#install wrote:
return 301 https://example.com/docs#install;
rewrite_log off;
On the next read the module dropped everything after the #, so it saw one merged line:
return 301 https://example.com/docs rewrite_log off;
The redirect disappeared from the page, and saving again appended a second rewrite_log off;, which Nginx rejects as a duplicate.
After the fix the same save writes:
return 301 "https://example.com/docs#install";
rewrite_log off;
Nginx treats the quoted and unquoted forms identically, and the module reads it back correctly.
ⓘ Decode octal-escaped spaces when reading /etc/mtab, as is already done for /etc/fstab, so dashboard disk usage no longer runs df on non-existent paths and fills the error log.
Also quote the path passed to df -i, and parse df output from the numeric columns so a device name containing a space, such as a ZFS dataset, no longer shifts the values.
Fixes https://github.com/webmin/webmin/issues/2833
ⓘ Run cp and mv through backquote_logged and capture their stderr, so the actual command error is shown instead of an unrelated $! value.
https://github.com/webmin/webmin/issues/2834
The file was regenerated when master added acl/forgot_sudouser, and the
regeneration dropped the trailing newline. All 481 files in this branch
now end with one.
Both issues were raised in review.
webmin/upgrade_desc had <a href="webmin.com">, which a browser resolves
against the Webmin server rather than the public site. lang/en has
<a href=https://webmin.com>; the Turkish now matches. This was the only
relative href in any Turkish file.
proc uses __norefs=1, so the four $stime values were displayed
literally instead of expanding. lang/en spells the word out in all four
places rather than referencing stime, so the Turkish now does the same.
A scan for the same class of defect across every module found one more
case that had not been reported: useradmin/uedit_dothers was
$udel_dothers, and useradmin also sets __norefs=1. lang/en spells that
one out too, so it is fixed the same way.
The scan also found heartbeat/conf_auto_on and conf_auto_off, which are
${conf_enabled} and ${conf_disabled} in lang/en itself - so English is
affected as well, and conf_auto_ references ${default}, a key that does
not exist in the file. That is an upstream bug rather than a
translation one, so it is left alone here and reported on the PR.
#2829 landed on master and touched 173 of the same keys this branch
rewrites, which is where the conflicts came from.
Resolved by rule rather than by hand: for any key #2829 already fixed
and merged, master's value wins (54 keys); everything else keeps this
branch's version. That keeps the diff against master limited to what is
genuinely new here, and avoids re-editing work that is already upstream.
It also avoids a regression. This branch was cut before #2829, so it
still carried the old double-encoded UTF-8 in nine mailboxes strings
(confirm_warnallf, left_autoreply, left_folders, left_forward,
left_pass, left_sig, mail_fromfilter, mail_selread, mail_subfilter).
Taking master's value for those keeps them fixed. A mojibake scan over
the whole tree after the merge reports 0 remaining lines.
master also added acl/forgot_sudouser, which is translated here, so
lang/tr is still complete at 31,523 of 31,523 keys.
Every module now has a reviewed desc_tr and longdesc_tr in
module.info.tr - 245 strings across 125 modules. Previously 37 were
reviewed, 194 came from module.info.tr.auto and 14 were missing
entirely (grub2, hardware-info, kea-dhcp, logviewer, nftables, systemd,
xterm), so those modules showed English titles in the Webmin menu.
The reviewed strings are removed from module.info.tr.auto, which now
holds only name_tr - the same split the de and ca translations use.
Thirty-six of those files became empty and are deleted.
Some of the machine text this replaces was wrong rather than just
clumsy:
sarg "Squid Report Generator" had become "Kalamar Rapor
Oluşturucu" - the fish, not the proxy
heartbeat the product name was translated as "Kalp Atışı"
cluster-cron "Cron Jobs" had become "Cron İş İlanları" (job ads)
proc "renice" was translated as "rename"
samba "file and print shares" was split into "create a samba
file" and "print the shares"
exports, hpuxexports, sgiexports, inetd, init, mount, net
each repeated the file path mid-sentence
firewall, the "(iptables)" and "(ip6tables)" qualifiers that
firewall6 distinguish the two modules were dropped
Turkish capitalisation of English words was also wrong throughout
("İptables", "İnetd", "İscsitarget", "İnternet"), and three previously
reviewed strings were stored as double-encoded UTF-8 (cron/desc_tr,
mailboxes/desc_tr, mailboxes/longdesc_tr).
cluster-cron and ldap-server carried a stray desc_de_tr key - a German
key that had leaked into the Turkish file. It is removed.
A consistency check of every lang/tr against its lang/en turned up 58
lines that were wrong independently of the missing translations. All of
them are fixed here:
Missing or wrong $N placeholders (the value silently disappears from
the message at runtime, or the wrong value is shown):
acl/cert_eca, acl/hide_desc, adsl-client/index_stopdesc,
apache/reconfig_ever, apache/log_files, apache/log_files_l,
bind8/log_manual, dhcpd/listl_lfnotcont, fdisk/mkfs_desc1,
fdisk/fsck_desc1, fdisk/tunefs_desc, hpuxexports/save_ehost,
inittab/log_rename, mysql/index_ever, mysql/index_version,
mysql/log_perm_create, mysql/log_perm_delete, mysql/log_perm_modify,
sendmail/index_epath, sendmail/index_startmsg, sendmail/asave_ematch,
sendmail/mailers_efile, sendmail/generics_efile,
webalizer/index_ewebalizer, webalizer/index_econf
cron/env_ename carried a $1 that lang/en does not have, and its text
described a different error than the key means.
adsl-client/index_stopdesc and inittab/log_rename each repeated $1
where $2 was meant, so both values printed the same string.
HTML markup that did not match lang/en:
bind8/mass_desc, dhcpd/index_dhcpdnotfound, firewall/index_existing,
inetd/index_applymsg, mysql/index_nomod, mysql/index_nomods,
samba/esync_msg, samba/viewu_list, sendmail/trusts_desc,
sendmail/mailers_desc2, sendmail/domains_desc, squid/clear_msgclear,
status/proc_thresh
Several of these were also truncated mid-sentence, dropping a whole
sentence of the original text; those are now translated in full.
Encoding:
mailboxes/confirm_warnf was stored as double-encoded UTF-8 and
displayed as mojibake. It also used $1 twice instead of $1 and $2.
Trailing whitespace:
proc/kill_term, kill_hup, kill_stop, kill_cont
Untranslated strings:
fdisk/select_* device descriptions, mount/irix_mode0, irix_mode0cd,
shorewall/tunnels_ipsec:noah
bind8/mass_desc previously translated the literal configuration
keywords master, slave, stub and forward into Turkish; they are now
left in English, since they are values the user has to type.
With this change every module has a complete lang/tr and no lang/tr.auto
files are left in the tree:
mount 92 new strings - Linux/FreeBSD/IRIX mount options
bandwidth 83 strings - bandwidth monitoring and reports
mailboxes 78 new strings - attachments, iCal, HTML composer
firewall 76 new strings - IPset, physdev, chain rename and move
gray-theme 72 strings - theme layout and system information page
fdisk 72 new strings - parted, NVME, partition table format
servers 71 new strings - automatic server discovery
stunnel 69 strings - SSL tunnels via inetd/xinetd
cron 68 new strings - crond control and manual editing
custom 63 new strings - SQL commands and output formats
cluster-copy 62 strings - scheduled file copies across servers
firewall/move_chain reads "Current change" in lang/en where "Current
chain" is clearly meant; it is translated by intent as "Mevcut zincir".
Command and format names that appear verbatim in configuration files
(parted, fdisk, hdparm, SMART, GPT, MS-DOS, NVME, tmpfs, CIFS, NFSv4,
inetd, xinetd, crond, IPset, physdev, TCP-wrappers) stay in English.
Finishes the Turkish translation of six modules and removes their
machine-generated lang/tr.auto files:
useradmin 110 new strings - SSH keys, group batch files, export
quota 111 new strings - Btrfs subvolume quotas, mass updates
heartbeat 98 strings - Heartbeat cluster monitor
ppp-client 98 strings - WvDial dialup client
webminlog 96 new strings - action search, rollback, notification
ldap-useradmin 94 new strings - LDAP users, Samba and IMAP options
Also fixes five defects in the existing Turkish files:
quota/gfilesys_all was missing its $1 placeholder
quota/lusers_noquota was missing $1 and the <tt> tags
quota/lusers_info was missing $1
useradmin/batch_emove was missing $2
useradmin/export_eopen had a literal $! where $1 was meant
Adds complete lang/tr files for five more previously untranslated
modules and removes their machine-generated lang/tr.auto files:
procmail 122 strings - procmail recipes, conditions and variables
cpan 121 strings - Perl module installation from CPAN
logrotate 117 strings - log file rotation and scheduling
pptp-client 106 strings - PPTP VPN tunnels and MPPE options
iscsi-tgtd 99 strings - iSCSI TGTd targets
iscsi-tgtd reuses 73 strings from iscsi-target and iscsi-server, taken
only where the English source text is identical.
Procmail flag semantics, Makefile.PL, endscript/endrotate, MPPE
directive names and MH/maildir folder types are kept in English, since
they appear verbatim in the configuration files being edited.
Completes the Turkish translation of six more modules and removes their
machine-generated lang/tr.auto files:
cluster-useradmin 154 strings - users and groups across servers
net 146 new strings - IPv6, bridges, bonding, VLANs
pptp-server 141 strings - PoPToP PPTP VPN server
format 141 strings - Solaris disk partitioning
filter 131 strings - Usermin mail filtering and autoreply
fetchmail 130 strings - Fetchmail mail retrieval
net already had a partial lang/tr; the 196 existing strings were kept
and only the untranslated remainder was added.
Interface and driver terminology that appears verbatim in configuration
files (Netplan, dhcpcd, Network Manager, miimon, updelay, downdelay,
balance-tlb, balance-alb, VLAN, PPP, PAP, CHAP, MS-CHAP, MPPE, PTY,
UFS, INBOX, procmail) is kept in English.
Adds complete lang/tr files for four more previously untranslated
modules and removes their machine-generated lang/tr.auto files:
iscsi-client 176 strings - iSCSI initiator, interfaces and connections
iscsi-target 170 strings - iSCSI target export and access control
raid 161 strings - Linux MD RAID arrays
pap 154 strings - PPP dial-in accounts and Mgetty ports
iscsi-client and iscsi-target reuse a few strings from iscsi-server,
taken only where the English source text is identical.
Command names and option flags (mdadm, mkraid, raidstart, raidstop,
--grow, --manage, LVM VG/LV, UUID, RAID0..RAID10, baud) are kept in
English, matching the rest of the Turkish translation.
Adds complete lang/tr files for four more previously untranslated
modules and removes their machine-generated lang/tr.auto files:
iscsi-server 177 strings - iSCSI extents, devices and targets
sarg 171 strings - Squid report generator
firewalld 169 strings - FirewallD zones, ports and rules
cluster-software 167 strings - package management across servers
cluster-software shares 69 strings with the software module, which were
reused verbatim after checking that the English source text matches.
Also fixes software/install_ezip, which was missing its $1 placeholder;
the same defect had been inherited by cluster-software.
Adds complete lang/tr files for four more previously untranslated
modules and removes their machine-generated lang/tr.auto files:
ldap-client 226 strings - NSS/PAM LDAP client setup and NSS switch
dovecot 188 strings - Dovecot IMAP/POP3 server configuration
filemin 185 strings - file manager UI
package-updates 176 strings - package update checking and repositories
Product names are deliberately left untranslated where Turkish has no
established equivalent: "Novell Directory Services", "Active Directory",
"System Security Services", "Hesiod", "XFN", "VPOPMail", "Blastwave".
Protocol, format and command names (IMAP, POP3, LMTP, SASL, Maildir,
mbox, dbox, chmod, chown, chattr, setfacl, umask, tar.gz) also stay in
English, matching the rest of the Turkish translation.