Fossil SCM

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

mistachkin 2016-02-01 04:34 UTC trunk
Commit 2bf596c9d518549416313950277e8f627ad4431f
1 file changed +9 -1
+9 -1
--- src/main.c
+++ src/main.c
@@ -2429,11 +2429,13 @@
24292429
** --create Create a new REPOSITORY if it does not already exist
24302430
** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
24312431
** --files GLOBLIST Comma-separated list of glob patterns for static files
24322432
** --localauth enable automatic login for requests from localhost
24332433
** --localhost listen on 127.0.0.1 only (always true for "ui")
2434
+** --https signal a request coming in via https
24342435
** --nojail Drop root privileges but do not enter the chroot jail
2436
+** --nossl signal that no SSL connections are available
24352437
** --notfound URL Redirect
24362438
** -P|--port TCPPORT listen to request on port TCPPORT
24372439
** --th-trace trace TH1 execution (for debugging purposes)
24382440
** --repolist If REPOSITORY is dir, URL "/" lists repos.
24392441
** --scgi Accept SCGI rather than HTTP
@@ -2490,10 +2492,17 @@
24902492
zAltBase = find_option("baseurl", 0, 1);
24912493
fCreate = find_option("create",0,0)!=0;
24922494
if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
24932495
if( zAltBase ){
24942496
set_base_url(zAltBase);
2497
+ }
2498
+ g.sslNotAvailable = find_option("nossl", 0, 0)!=0;
2499
+ if( find_option("https",0,0)!=0 ){
2500
+ cgi_replace_parameter("HTTPS","on");
2501
+ }else{
2502
+ /* without --https, defaults to not available. */
2503
+ g.sslNotAvailable = 1;
24952504
}
24962505
if( find_option("localhost", 0, 0)!=0 ){
24972506
flags |= HTTP_SERVER_LOCALHOST;
24982507
}
24992508
@@ -2551,11 +2560,10 @@
25512560
if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
25522561
db_close(1);
25532562
if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
25542563
fossil_fatal("unable to listen on TCP socket %d", iPort);
25552564
}
2556
- g.sslNotAvailable = 1;
25572565
g.httpIn = stdin;
25582566
g.httpOut = stdout;
25592567
if( g.fHttpTrace || g.fSqlTrace ){
25602568
fprintf(stderr, "====== SERVER pid %d =======\n", getpid());
25612569
}
25622570
--- src/main.c
+++ src/main.c
@@ -2429,11 +2429,13 @@
2429 ** --create Create a new REPOSITORY if it does not already exist
2430 ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
2431 ** --files GLOBLIST Comma-separated list of glob patterns for static files
2432 ** --localauth enable automatic login for requests from localhost
2433 ** --localhost listen on 127.0.0.1 only (always true for "ui")
 
2434 ** --nojail Drop root privileges but do not enter the chroot jail
 
2435 ** --notfound URL Redirect
2436 ** -P|--port TCPPORT listen to request on port TCPPORT
2437 ** --th-trace trace TH1 execution (for debugging purposes)
2438 ** --repolist If REPOSITORY is dir, URL "/" lists repos.
2439 ** --scgi Accept SCGI rather than HTTP
@@ -2490,10 +2492,17 @@
2490 zAltBase = find_option("baseurl", 0, 1);
2491 fCreate = find_option("create",0,0)!=0;
2492 if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
2493 if( zAltBase ){
2494 set_base_url(zAltBase);
 
 
 
 
 
 
 
2495 }
2496 if( find_option("localhost", 0, 0)!=0 ){
2497 flags |= HTTP_SERVER_LOCALHOST;
2498 }
2499
@@ -2551,11 +2560,10 @@
2551 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2552 db_close(1);
2553 if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2554 fossil_fatal("unable to listen on TCP socket %d", iPort);
2555 }
2556 g.sslNotAvailable = 1;
2557 g.httpIn = stdin;
2558 g.httpOut = stdout;
2559 if( g.fHttpTrace || g.fSqlTrace ){
2560 fprintf(stderr, "====== SERVER pid %d =======\n", getpid());
2561 }
2562
--- src/main.c
+++ src/main.c
@@ -2429,11 +2429,13 @@
2429 ** --create Create a new REPOSITORY if it does not already exist
2430 ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
2431 ** --files GLOBLIST Comma-separated list of glob patterns for static files
2432 ** --localauth enable automatic login for requests from localhost
2433 ** --localhost listen on 127.0.0.1 only (always true for "ui")
2434 ** --https signal a request coming in via https
2435 ** --nojail Drop root privileges but do not enter the chroot jail
2436 ** --nossl signal that no SSL connections are available
2437 ** --notfound URL Redirect
2438 ** -P|--port TCPPORT listen to request on port TCPPORT
2439 ** --th-trace trace TH1 execution (for debugging purposes)
2440 ** --repolist If REPOSITORY is dir, URL "/" lists repos.
2441 ** --scgi Accept SCGI rather than HTTP
@@ -2490,10 +2492,17 @@
2492 zAltBase = find_option("baseurl", 0, 1);
2493 fCreate = find_option("create",0,0)!=0;
2494 if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI;
2495 if( zAltBase ){
2496 set_base_url(zAltBase);
2497 }
2498 g.sslNotAvailable = find_option("nossl", 0, 0)!=0;
2499 if( find_option("https",0,0)!=0 ){
2500 cgi_replace_parameter("HTTPS","on");
2501 }else{
2502 /* without --https, defaults to not available. */
2503 g.sslNotAvailable = 1;
2504 }
2505 if( find_option("localhost", 0, 0)!=0 ){
2506 flags |= HTTP_SERVER_LOCALHOST;
2507 }
2508
@@ -2551,11 +2560,10 @@
2560 if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT;
2561 db_close(1);
2562 if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){
2563 fossil_fatal("unable to listen on TCP socket %d", iPort);
2564 }
 
2565 g.httpIn = stdin;
2566 g.httpOut = stdout;
2567 if( g.fHttpTrace || g.fSqlTrace ){
2568 fprintf(stderr, "====== SERVER pid %d =======\n", getpid());
2569 }
2570

Keyboard Shortcuts

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