mirror of
https://github.com/gophernicus/gophernicus.git
synced 2024-10-13 05:03:40 -04:00
Selector /server-status can now be disabled and no longer leaks IP addresses by default
This commit is contained in:
parent
ff90756b80
commit
2b522069cd
3
README
3
README
@ -40,11 +40,12 @@ Command line options:
|
||||
-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
|
||||
|
||||
-d Debug to syslog (not for production use)
|
||||
-d Debug output in syslog and /server-status
|
||||
-v Display version number and build date
|
||||
-b Display the BSD license
|
||||
-? Display this help
|
||||
|
2
file.c
2
file.c
@ -204,6 +204,7 @@ void server_status(state *st, shm_state *shm, int shmid)
|
||||
if ((now - shm->session[i].req_atime) < st->session_timeout) {
|
||||
sessions++;
|
||||
|
||||
if (st->debug) {
|
||||
printf("Session: %-4i %-40s %-4li %-7li gopher%s://%s:%i/%c%s" CRLF,
|
||||
(int) (now - shm->session[i].req_atime),
|
||||
shm->session[i].req_remote_addr,
|
||||
@ -216,6 +217,7 @@ void server_status(state *st, shm_state *shm, int shmid)
|
||||
shm->session[i].req_selector);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
printf("Total Sessions: %i" CRLF, sessions);
|
||||
}
|
||||
|
@ -450,6 +450,7 @@ void init_state(state *st)
|
||||
st->opt_iconv = TRUE;
|
||||
st->opt_query = TRUE;
|
||||
st->opt_caps = TRUE;
|
||||
st->opt_status = TRUE;
|
||||
st->opt_shm = TRUE;
|
||||
st->opt_root = TRUE;
|
||||
st->opt_proxy = TRUE;
|
||||
@ -676,7 +677,7 @@ get_selector:
|
||||
|
||||
/* Handle /server-status requests */
|
||||
#ifdef HAVE_SHMEM
|
||||
if (sstrncmp(st.req_selector, SERVER_STATUS) == MATCH) {
|
||||
if (st.opt_status && sstrncmp(st.req_selector, SERVER_STATUS) == MATCH) {
|
||||
if (shm) server_status(&st, shm, shmid);
|
||||
return OK;
|
||||
}
|
||||
|
@ -348,6 +348,7 @@ typedef struct {
|
||||
char opt_vhost;
|
||||
char opt_query;
|
||||
char opt_caps;
|
||||
char opt_status;
|
||||
char opt_shm;
|
||||
char opt_root;
|
||||
char opt_proxy;
|
||||
|
@ -140,6 +140,7 @@ void parse_args(state *st, int argc, char *argv[])
|
||||
if (*optarg == 'q') { st->opt_query = FALSE; break; }
|
||||
if (*optarg == 's') { st->opt_syslog = FALSE; break; }
|
||||
if (*optarg == 'a') { st->opt_caps = FALSE; break; }
|
||||
if (*optarg == 't') { st->opt_status = FALSE; break; }
|
||||
if (*optarg == 'm') { st->opt_shm = FALSE; break; }
|
||||
if (*optarg == 'r') { st->opt_root = FALSE; break; }
|
||||
if (*optarg == 'p') { st->opt_proxy = FALSE; break; }
|
||||
|
Loading…
Reference in New Issue
Block a user