mirror of
https://github.com/gophernicus/gophernicus.git
synced 2025-01-03 14:56:43 -05:00
Allow the disabling of the Gopher + menu
fixes #123 adds the `-ng` option to disable the generation of the default Gopher + menu so the exiting Gophermap file.
This commit is contained in:
parent
d5926c9d50
commit
7d4a234ce6
@ -70,6 +70,7 @@ are made.
|
||||
-np Disable HAproxy proxy protocol
|
||||
-nx Disable execution of gophermaps and scripts
|
||||
-nu Disable personal gopherspaces
|
||||
-ng Disable Gopher Plus default menu
|
||||
|
||||
-d Debug output in syslog and /server-status
|
||||
-v Display version number and build date
|
||||
|
79
README.options
Normal file
79
README.options
Normal file
@ -0,0 +1,79 @@
|
||||
# Gophernicus
|
||||
|
||||
This release: Version DEVEL
|
||||
NOTE: The master branch is rolling Development! DO NOT USE unless you want fiery dragons! (you probably want to `git checkout 3.1.1`)
|
||||
|
||||
*Copyright (c) 2009-2018 Kim Holviala*
|
||||
|
||||
*Copyright (c) 2019 Gophernicus Developers*
|
||||
|
||||
Gophernicus is a modern full-featured (and hopefully) secure gopher
|
||||
daemon. It is licensed under the BSD license.
|
||||
|
||||
(If you are looking for installation documentation, please see INSTALL.md).
|
||||
|
||||
## Support/Contact
|
||||
|
||||
Developers can be reached at gophernicus AT gophernicus DOT org.
|
||||
|
||||
Our IRC channel is on irc.libera.chat #gophernicus.
|
||||
|
||||
You most likely want to subscribe to the gophernicus mailing list at
|
||||
https://lists.tildeverse.org/postorius/lists/gophernicus.lists.tildeverse.org/,
|
||||
especially if you maintain a server. This is where all important announcements
|
||||
are made.
|
||||
|
||||
## Command line options
|
||||
|
||||
-h hostname Change server hostname (FQDN) [$HOSTNAME]
|
||||
-p port Change server port [70]
|
||||
-T port Change TLS/SSL port [0 = disabled]
|
||||
-r root Change gopher root [/var/gopher]
|
||||
-t type Change default gopher filetype [0]
|
||||
-g mapfile Change gophermap file [gophermap]
|
||||
-a tagfile Change gophertag file [gophertag]
|
||||
-c cgidir Change CGI script directory [/cgi-bin/]
|
||||
-u userdir Change users personal gopherspace [public_gopher]
|
||||
-l logfile Log to Apache-compatible combined format logfile
|
||||
|
||||
-w width Change default page width [67]
|
||||
-o charset Change default output charset [UTF-8]
|
||||
|
||||
-s seconds Session timeout in seconds [1800]
|
||||
-i hits Maximum hits until throttling [4096]
|
||||
-k kbytes Maximum transfer until throttling [4194304]
|
||||
|
||||
-f filterdir Specify directory for output filters
|
||||
-e ext=type Map file extension to gopher filetype
|
||||
-R old=new Rewrite the beginning of a selector
|
||||
|
||||
-D text|file Set or load server description for caps.txt
|
||||
-L text|file Set or load server location for caps.txt
|
||||
-A admin Set admin email for caps.txt
|
||||
|
||||
-U paths Specify a colon-separated list of extra unveil(2) paths
|
||||
(OpenBSD only).
|
||||
|
||||
-nv Disable virtual hosting
|
||||
-nl Disable parent directory links
|
||||
-nh Disable menu header (title)
|
||||
-nf Disable menu footer
|
||||
-nd Disable dates and filesizes in menus
|
||||
-nc Disable file content detection
|
||||
-no Disable charset conversion for output
|
||||
-nq Disable HTTP-style query strings (?query)
|
||||
-ns Disable logging to syslog
|
||||
-na Disable autogenerated caps.txt
|
||||
-nt Disable /server-status
|
||||
-nm Disable shared memory use (for debugging)
|
||||
-nr Disable root user checking (for debugging)
|
||||
-np Disable HAproxy proxy protocol
|
||||
-nx Disable execution of gophermaps and scripts
|
||||
-nu Disable personal gopherspaces
|
||||
-ng Disable Gopher Plus default menu
|
||||
|
||||
-d Debug output in syslog and /server-status
|
||||
-v Display version number and build date
|
||||
-b Display the BSD license
|
||||
-? Display this help
|
||||
|
@ -497,6 +497,7 @@ static void init_state(state *st)
|
||||
st->opt_exec = TRUE;
|
||||
st->opt_personal_spaces = TRUE;
|
||||
st->opt_http_requests = TRUE;
|
||||
st->opt_plus_menu = TRUE;
|
||||
st->debug = FALSE;
|
||||
|
||||
/* Load default suffix -> filetype mappings */
|
||||
@ -726,7 +727,7 @@ get_selector:
|
||||
}
|
||||
|
||||
/* Handle gopher+ root requests (UMN gopher client is seriously borken) */
|
||||
if (sstrncmp(selector, "\t$") == MATCH) {
|
||||
if (sstrncmp(selector, "\t$") == MATCH && st.opt_plus_menu == TRUE) {
|
||||
printf("+-1" CRLF);
|
||||
printf("+INFO: 1Main menu\t\t%s\t%i" CRLF,
|
||||
st.server_host,
|
||||
|
@ -63,7 +63,7 @@
|
||||
#undef HAVE_SENDFILE /* sendfile() in Linux & others */
|
||||
/* #undef HAVE_LIBWRAP autodetected, don't enable here */
|
||||
|
||||
#include "config.h"
|
||||
#include "../config.h"
|
||||
|
||||
/* Linux */
|
||||
#ifdef __linux
|
||||
@ -373,6 +373,7 @@ typedef struct {
|
||||
char opt_exec;
|
||||
char opt_personal_spaces;
|
||||
char opt_http_requests;
|
||||
char opt_plus_menu;
|
||||
char debug;
|
||||
} state;
|
||||
|
||||
|
@ -158,6 +158,7 @@ void parse_args(state *st, int argc, char *argv[])
|
||||
if (*optarg == 'x') { st->opt_exec = FALSE; break; }
|
||||
if (*optarg == 'u') { st->opt_personal_spaces = FALSE; break; }
|
||||
if (*optarg == 'H') { st->opt_http_requests = FALSE; break; }
|
||||
if (*optarg == 'g') { st->opt_plus_menu = FALSE; break; }
|
||||
break;
|
||||
|
||||
case 'd': st->debug = TRUE; break;
|
||||
|
Loading…
Reference in New Issue
Block a user