Fossil SCM

Add --https and --nossl options to the 'server' command.

mistachkin 2016-02-01 20:38 trunk merge
Commit b8c7af5bd9b503f4af70160cb8b4d6a6d2a241e8
2 files changed +9 -1 +9 -1
+9 -1
--- src/main.c
+++ src/main.c
@@ -2435,11 +2435,13 @@
24352435
** --create Create a new REPOSITORY if it does not already exist
24362436
** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
24372437
** --files GLOBLIST Comma-separated list of glob patterns for static files
24382438
** --localauth enable automatic login for requests from localhost
24392439
** --localhost listen on 127.0.0.1 only (always true for "ui")
2440
+** --https signal a request coming in via https
24402441
** --nojail Drop root privileges but do not enter the chroot jail
2442
+** --nossl signal that no SSL connections are available
24412443
** --notfound URL Redirect
24422444
** -P|--port TCPPORT listen to request on port TCPPORT
24432445
** --th-trace trace TH1 execution (for debugging purposes)
24442446
** --repolist If REPOSITORY is dir, URL "/" lists repos.
24452447
** --scgi Accept SCGI rather than HTTP
@@ -2496,10 +2498,17 @@
24962498
zAltBase = find_option("baseurl", 0, 1);
24972499
fCreate = find_option("create",0,0)!=0;
24982500
if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
24992501
if( zAltBase ){
25002502
set_base_url(zAltBase);
2503
+ }
2504
+ g.sslNotAvailable = find_option("nossl", 0, 0)!=0;
2505
+ if( find_option("https",0,0)!=0 ){
2506
+ cgi_replace_parameter("HTTPS","on");
2507
+ }else{
2508
+ /* without --https, defaults to not available. */
2509
+ g.sslNotAvailable = 1;
25012510
}
25022511
if( find_option("localhost", 0, 0)!=0 ){
25032512
flags |= HTTP_SERVER_LOCALHOST;
25042513
}
25052514
@@ -2557,11 +2566,10 @@
25572566
if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
25582567
db_close(1);
25592568
if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
25602569
fossil_fatal("unable to listen on TCP socket %d", iPort);
25612570
}
2562
- g.sslNotAvailable = 1;
25632571
g.httpIn = stdin;
25642572
g.httpOut = stdout;
25652573
if( g.fHttpTrace || g.fSqlTrace ){
25662574
fprintf(stderr, "====== SERVER pid %d =======\n", getpid());
25672575
}
25682576
--- src/main.c
+++ src/main.c
@@ -2435,11 +2435,13 @@
2435 ** --create Create a new REPOSITORY if it does not already exist
2436 ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
2437 ** --files GLOBLIST Comma-separated list of glob patterns for static files
2438 ** --localauth enable automatic login for requests from localhost
2439 ** --localhost listen on 127.0.0.1 only (always true for "ui")
 
2440 ** --nojail Drop root privileges but do not enter the chroot jail
 
2441 ** --notfound URL Redirect
2442 ** -P|--port TCPPORT listen to request on port TCPPORT
2443 ** --th-trace trace TH1 execution (for debugging purposes)
2444 ** --repolist If REPOSITORY is dir, URL "/" lists repos.
2445 ** --scgi Accept SCGI rather than HTTP
@@ -2496,10 +2498,17 @@
2496 zAltBase = find_option("baseurl", 0, 1);
2497 fCreate = find_option("create",0,0)!=0;
2498 if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
2499 if( zAltBase ){
2500 set_base_url(zAltBase);
 
 
 
 
 
 
 
2501 }
2502 if( find_option("localhost", 0, 0)!=0 ){
2503 flags |= HTTP_SERVER_LOCALHOST;
2504 }
2505
@@ -2557,11 +2566,10 @@
2557 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2558 db_close(1);
2559 if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2560 fossil_fatal("unable to listen on TCP socket %d", iPort);
2561 }
2562 g.sslNotAvailable = 1;
2563 g.httpIn = stdin;
2564 g.httpOut = stdout;
2565 if( g.fHttpTrace || g.fSqlTrace ){
2566 fprintf(stderr, "====== SERVER pid %d =======\n", getpid());
2567 }
2568
--- src/main.c
+++ src/main.c
@@ -2435,11 +2435,13 @@
2435 ** --create Create a new REPOSITORY if it does not already exist
2436 ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
2437 ** --files GLOBLIST Comma-separated list of glob patterns for static files
2438 ** --localauth enable automatic login for requests from localhost
2439 ** --localhost listen on 127.0.0.1 only (always true for "ui")
2440 ** --https signal a request coming in via https
2441 ** --nojail Drop root privileges but do not enter the chroot jail
2442 ** --nossl signal that no SSL connections are available
2443 ** --notfound URL Redirect
2444 ** -P|--port TCPPORT listen to request on port TCPPORT
2445 ** --th-trace trace TH1 execution (for debugging purposes)
2446 ** --repolist If REPOSITORY is dir, URL "/" lists repos.
2447 ** --scgi Accept SCGI rather than HTTP
@@ -2496,10 +2498,17 @@
2498 zAltBase = find_option("baseurl", 0, 1);
2499 fCreate = find_option("create",0,0)!=0;
2500 if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
2501 if( zAltBase ){
2502 set_base_url(zAltBase);
2503 }
2504 g.sslNotAvailable = find_option("nossl", 0, 0)!=0;
2505 if( find_option("https",0,0)!=0 ){
2506 cgi_replace_parameter("HTTPS","on");
2507 }else{
2508 /* without --https, defaults to not available. */
2509 g.sslNotAvailable = 1;
2510 }
2511 if( find_option("localhost", 0, 0)!=0 ){
2512 flags |= HTTP_SERVER_LOCALHOST;
2513 }
2514
@@ -2557,11 +2566,10 @@
2566 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2567 db_close(1);
2568 if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2569 fossil_fatal("unable to listen on TCP socket %d", iPort);
2570 }
 
2571 g.httpIn = stdin;
2572 g.httpOut = stdout;
2573 if( g.fHttpTrace || g.fSqlTrace ){
2574 fprintf(stderr, "====== SERVER pid %d =======\n", getpid());
2575 }
2576
+9 -1
--- src/main.c
+++ src/main.c
@@ -2435,11 +2435,13 @@
24352435
** --create Create a new REPOSITORY if it does not already exist
24362436
** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
24372437
** --files GLOBLIST Comma-separated list of glob patterns for static files
24382438
** --localauth enable automatic login for requests from localhost
24392439
** --localhost listen on 127.0.0.1 only (always true for "ui")
2440
+** --https signal a request coming in via https
24402441
** --nojail Drop root privileges but do not enter the chroot jail
2442
+** --nossl signal that no SSL connections are available
24412443
** --notfound URL Redirect
24422444
** -P|--port TCPPORT listen to request on port TCPPORT
24432445
** --th-trace trace TH1 execution (for debugging purposes)
24442446
** --repolist If REPOSITORY is dir, URL "/" lists repos.
24452447
** --scgi Accept SCGI rather than HTTP
@@ -2496,10 +2498,17 @@
24962498
zAltBase = find_option("baseurl", 0, 1);
24972499
fCreate = find_option("create",0,0)!=0;
24982500
if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
24992501
if( zAltBase ){
25002502
set_base_url(zAltBase);
2503
+ }
2504
+ g.sslNotAvailable = find_option("nossl", 0, 0)!=0;
2505
+ if( find_option("https",0,0)!=0 ){
2506
+ cgi_replace_parameter("HTTPS","on");
2507
+ }else{
2508
+ /* without --https, defaults to not available. */
2509
+ g.sslNotAvailable = 1;
25012510
}
25022511
if( find_option("localhost", 0, 0)!=0 ){
25032512
flags |= HTTP_SERVER_LOCALHOST;
25042513
}
25052514
@@ -2557,11 +2566,10 @@
25572566
if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
25582567
db_close(1);
25592568
if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
25602569
fossil_fatal("unable to listen on TCP socket %d", iPort);
25612570
}
2562
- g.sslNotAvailable = 1;
25632571
g.httpIn = stdin;
25642572
g.httpOut = stdout;
25652573
if( g.fHttpTrace || g.fSqlTrace ){
25662574
fprintf(stderr, "====== SERVER pid %d =======\n", getpid());
25672575
}
25682576
--- src/main.c
+++ src/main.c
@@ -2435,11 +2435,13 @@
2435 ** --create Create a new REPOSITORY if it does not already exist
2436 ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
2437 ** --files GLOBLIST Comma-separated list of glob patterns for static files
2438 ** --localauth enable automatic login for requests from localhost
2439 ** --localhost listen on 127.0.0.1 only (always true for "ui")
 
2440 ** --nojail Drop root privileges but do not enter the chroot jail
 
2441 ** --notfound URL Redirect
2442 ** -P|--port TCPPORT listen to request on port TCPPORT
2443 ** --th-trace trace TH1 execution (for debugging purposes)
2444 ** --repolist If REPOSITORY is dir, URL "/" lists repos.
2445 ** --scgi Accept SCGI rather than HTTP
@@ -2496,10 +2498,17 @@
2496 zAltBase = find_option("baseurl", 0, 1);
2497 fCreate = find_option("create",0,0)!=0;
2498 if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
2499 if( zAltBase ){
2500 set_base_url(zAltBase);
 
 
 
 
 
 
 
2501 }
2502 if( find_option("localhost", 0, 0)!=0 ){
2503 flags |= HTTP_SERVER_LOCALHOST;
2504 }
2505
@@ -2557,11 +2566,10 @@
2557 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2558 db_close(1);
2559 if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2560 fossil_fatal("unable to listen on TCP socket %d", iPort);
2561 }
2562 g.sslNotAvailable = 1;
2563 g.httpIn = stdin;
2564 g.httpOut = stdout;
2565 if( g.fHttpTrace || g.fSqlTrace ){
2566 fprintf(stderr, "====== SERVER pid %d =======\n", getpid());
2567 }
2568
--- src/main.c
+++ src/main.c
@@ -2435,11 +2435,13 @@
2435 ** --create Create a new REPOSITORY if it does not already exist
2436 ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
2437 ** --files GLOBLIST Comma-separated list of glob patterns for static files
2438 ** --localauth enable automatic login for requests from localhost
2439 ** --localhost listen on 127.0.0.1 only (always true for "ui")
2440 ** --https signal a request coming in via https
2441 ** --nojail Drop root privileges but do not enter the chroot jail
2442 ** --nossl signal that no SSL connections are available
2443 ** --notfound URL Redirect
2444 ** -P|--port TCPPORT listen to request on port TCPPORT
2445 ** --th-trace trace TH1 execution (for debugging purposes)
2446 ** --repolist If REPOSITORY is dir, URL "/" lists repos.
2447 ** --scgi Accept SCGI rather than HTTP
@@ -2496,10 +2498,17 @@
2498 zAltBase = find_option("baseurl", 0, 1);
2499 fCreate = find_option("create",0,0)!=0;
2500 if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
2501 if( zAltBase ){
2502 set_base_url(zAltBase);
2503 }
2504 g.sslNotAvailable = find_option("nossl", 0, 0)!=0;
2505 if( find_option("https",0,0)!=0 ){
2506 cgi_replace_parameter("HTTPS","on");
2507 }else{
2508 /* without --https, defaults to not available. */
2509 g.sslNotAvailable = 1;
2510 }
2511 if( find_option("localhost", 0, 0)!=0 ){
2512 flags |= HTTP_SERVER_LOCALHOST;
2513 }
2514
@@ -2557,11 +2566,10 @@
2566 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2567 db_close(1);
2568 if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2569 fossil_fatal("unable to listen on TCP socket %d", iPort);
2570 }
 
2571 g.httpIn = stdin;
2572 g.httpOut = stdout;
2573 if( g.fHttpTrace || g.fSqlTrace ){
2574 fprintf(stderr, "====== SERVER pid %d =======\n", getpid());
2575 }
2576

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button