Fossil SCM
Add --https and --nossl options to the 'server' command.
Commit
b8c7af5bd9b503f4af70160cb8b4d6a6d2a241e8
Parent
4110f5229720559…
2 files changed
+9
-1
+9
-1
+9
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2435,11 +2435,13 @@ | ||
| 2435 | 2435 | ** --create Create a new REPOSITORY if it does not already exist |
| 2436 | 2436 | ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci" |
| 2437 | 2437 | ** --files GLOBLIST Comma-separated list of glob patterns for static files |
| 2438 | 2438 | ** --localauth enable automatic login for requests from localhost |
| 2439 | 2439 | ** --localhost listen on 127.0.0.1 only (always true for "ui") |
| 2440 | +** --https signal a request coming in via https | |
| 2440 | 2441 | ** --nojail Drop root privileges but do not enter the chroot jail |
| 2442 | +** --nossl signal that no SSL connections are available | |
| 2441 | 2443 | ** --notfound URL Redirect |
| 2442 | 2444 | ** -P|--port TCPPORT listen to request on port TCPPORT |
| 2443 | 2445 | ** --th-trace trace TH1 execution (for debugging purposes) |
| 2444 | 2446 | ** --repolist If REPOSITORY is dir, URL "/" lists repos. |
| 2445 | 2447 | ** --scgi Accept SCGI rather than HTTP |
| @@ -2496,10 +2498,17 @@ | ||
| 2496 | 2498 | zAltBase = find_option("baseurl", 0, 1); |
| 2497 | 2499 | fCreate = find_option("create",0,0)!=0; |
| 2498 | 2500 | if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI; |
| 2499 | 2501 | if( zAltBase ){ |
| 2500 | 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; | |
| 2501 | 2510 | } |
| 2502 | 2511 | if( find_option("localhost", 0, 0)!=0 ){ |
| 2503 | 2512 | flags |= HTTP_SERVER_LOCALHOST; |
| 2504 | 2513 | } |
| 2505 | 2514 | |
| @@ -2557,11 +2566,10 @@ | ||
| 2557 | 2566 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2558 | 2567 | db_close(1); |
| 2559 | 2568 | if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){ |
| 2560 | 2569 | fossil_fatal("unable to listen on TCP socket %d", iPort); |
| 2561 | 2570 | } |
| 2562 | - g.sslNotAvailable = 1; | |
| 2563 | 2571 | g.httpIn = stdin; |
| 2564 | 2572 | g.httpOut = stdout; |
| 2565 | 2573 | if( g.fHttpTrace || g.fSqlTrace ){ |
| 2566 | 2574 | fprintf(stderr, "====== SERVER pid %d =======\n", getpid()); |
| 2567 | 2575 | } |
| 2568 | 2576 |
| --- 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 @@ | ||
| 2435 | 2435 | ** --create Create a new REPOSITORY if it does not already exist |
| 2436 | 2436 | ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci" |
| 2437 | 2437 | ** --files GLOBLIST Comma-separated list of glob patterns for static files |
| 2438 | 2438 | ** --localauth enable automatic login for requests from localhost |
| 2439 | 2439 | ** --localhost listen on 127.0.0.1 only (always true for "ui") |
| 2440 | +** --https signal a request coming in via https | |
| 2440 | 2441 | ** --nojail Drop root privileges but do not enter the chroot jail |
| 2442 | +** --nossl signal that no SSL connections are available | |
| 2441 | 2443 | ** --notfound URL Redirect |
| 2442 | 2444 | ** -P|--port TCPPORT listen to request on port TCPPORT |
| 2443 | 2445 | ** --th-trace trace TH1 execution (for debugging purposes) |
| 2444 | 2446 | ** --repolist If REPOSITORY is dir, URL "/" lists repos. |
| 2445 | 2447 | ** --scgi Accept SCGI rather than HTTP |
| @@ -2496,10 +2498,17 @@ | ||
| 2496 | 2498 | zAltBase = find_option("baseurl", 0, 1); |
| 2497 | 2499 | fCreate = find_option("create",0,0)!=0; |
| 2498 | 2500 | if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI; |
| 2499 | 2501 | if( zAltBase ){ |
| 2500 | 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; | |
| 2501 | 2510 | } |
| 2502 | 2511 | if( find_option("localhost", 0, 0)!=0 ){ |
| 2503 | 2512 | flags |= HTTP_SERVER_LOCALHOST; |
| 2504 | 2513 | } |
| 2505 | 2514 | |
| @@ -2557,11 +2566,10 @@ | ||
| 2557 | 2566 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2558 | 2567 | db_close(1); |
| 2559 | 2568 | if( cgi_http_server(iPort, mxPort, zBrowserCmd, zIpAddr, flags) ){ |
| 2560 | 2569 | fossil_fatal("unable to listen on TCP socket %d", iPort); |
| 2561 | 2570 | } |
| 2562 | - g.sslNotAvailable = 1; | |
| 2563 | 2571 | g.httpIn = stdin; |
| 2564 | 2572 | g.httpOut = stdout; |
| 2565 | 2573 | if( g.fHttpTrace || g.fSqlTrace ){ |
| 2566 | 2574 | fprintf(stderr, "====== SERVER pid %d =======\n", getpid()); |
| 2567 | 2575 | } |
| 2568 | 2576 |
| --- 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 |