| ︙ | | | ︙ | |
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
int wikiFlags; /* Wiki conversion flags applied to %W */
char isHTTP; /* True if server/CGI modes, else assume CLI. */
char javascriptHyperlink; /* If true, set href= using script, not HTML */
Blob httpHeader; /* Complete text of the HTTP request header */
UrlData url; /* Information about current URL */
const char *zLogin; /* Login name. NULL or "" if not logged in. */
const char *zCkoutAlias; /* doc/ uses this branch as an alias for "ckout" */
const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
** SSL client identity */
#if defined(_WIN32) && USE_SEE
const char *zPidKey; /* Saved value of the --usepidkey option. Only
* applicable when using SEE on Windows. */
#endif
int useLocalauth; /* No login required if from 127.0.0.1 */
|
>
|
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
int wikiFlags; /* Wiki conversion flags applied to %W */
char isHTTP; /* True if server/CGI modes, else assume CLI. */
char javascriptHyperlink; /* If true, set href= using script, not HTML */
Blob httpHeader; /* Complete text of the HTTP request header */
UrlData url; /* Information about current URL */
const char *zLogin; /* Login name. NULL or "" if not logged in. */
const char *zCkoutAlias; /* doc/ uses this branch as an alias for "ckout" */
const char *zMainMenuFile; /* --mainmenu FILE from server/ui/cgi */
const char *zSSLIdentity; /* Value of --ssl-identity option, filename of
** SSL client identity */
#if defined(_WIN32) && USE_SEE
const char *zPidKey; /* Saved value of the --usepidkey option. Only
* applicable when using SEE on Windows. */
#endif
int useLocalauth; /* No login required if from 127.0.0.1 */
|
| ︙ | | | ︙ | |
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
|
** can be multiple "redirect:" lines that are
** processed in order. If the REPO is "*", then
** an unconditional redirect to URL is taken.
**
** jsmode: VALUE Specifies the delivery mode for JavaScript
** files. See the help text for the --jsmode
** flag of the http command.
**
** Most CGI files contain only a "repository:" line. It is uncommon to
** use any other option.
**
** See also: [[http]], [[server]], [[winsrv]]
*/
void cmd_cgi(void){
|
>
>
>
|
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
|
** can be multiple "redirect:" lines that are
** processed in order. If the REPO is "*", then
** an unconditional redirect to URL is taken.
**
** jsmode: VALUE Specifies the delivery mode for JavaScript
** files. See the help text for the --jsmode
** flag of the http command.
**
** mainmenu: FILE Override the mainmenu config setting with the
** contents of the given file.
**
** Most CGI files contain only a "repository:" line. It is uncommon to
** use any other option.
**
** See also: [[http]], [[server]], [[winsrv]]
*/
void cmd_cgi(void){
|
| ︙ | | | ︙ | |
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
|
** auxiliary HTTP request. Noting, however, that "single" might
** actually mean more than one, depending on the script-timing
** requirements of any given page.
*/
builtin_set_js_delivery_mode(blob_str(&value),0);
blob_reset(&value);
continue;
}
if( blob_eq(&key, "cgi-debug:") && blob_token(&line, &value) ){
/* cgi-debug: FILENAME
**
** Causes output from cgi_debug() and CGIDEBUG(()) calls to go
** into FILENAME. Useful for debugging CGI configuration problems.
*/
|
>
>
>
>
>
>
>
>
>
>
>
|
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
|
** auxiliary HTTP request. Noting, however, that "single" might
** actually mean more than one, depending on the script-timing
** requirements of any given page.
*/
builtin_set_js_delivery_mode(blob_str(&value),0);
blob_reset(&value);
continue;
}
if( blob_eq(&key, "mainmenu:") && blob_token(&line, &value) ){
/* mainmenu: FILENAME
**
** Use the contents of FILENAME as the value of the site's
** "mainmenu" setting, overriding the contents (for this
** request) of the db-side setting or the hard-coded default.
*/
g.zMainMenuFile = mprintf("%s", blob_str(&value));
blob_reset(&value);
continue;
}
if( blob_eq(&key, "cgi-debug:") && blob_token(&line, &value) ){
/* cgi-debug: FILENAME
**
** Causes output from cgi_debug() and CGIDEBUG(()) calls to go
** into FILENAME. Useful for debugging CGI configuration problems.
*/
|
| ︙ | | | ︙ | |
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
|
** --nossl signal that no SSL connections are available
** --notfound URL use URL as "HTTP 404, object not found" page.
** --out FILE write results to FILE instead of to standard output
** --repolist If REPOSITORY is directory, URL "/" lists all repos
** --scgi Interpret input as SCGI rather than HTTP
** --skin LABEL Use override skin LABEL
** --th-trace trace TH1 execution (for debugging purposes)
** --usepidkey Use saved encryption key from parent process. This is
** only necessary when using SEE on Windows.
**
** See also: [[cgi]], [[server]], [[winsrv]]
*/
void cmd_http(void){
const char *zIpAddr = 0;
|
>
>
|
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
|
** --nossl signal that no SSL connections are available
** --notfound URL use URL as "HTTP 404, object not found" page.
** --out FILE write results to FILE instead of to standard output
** --repolist If REPOSITORY is directory, URL "/" lists all repos
** --scgi Interpret input as SCGI rather than HTTP
** --skin LABEL Use override skin LABEL
** --th-trace trace TH1 execution (for debugging purposes)
** --mainmenu FILE Override the mainmenu config setting with the contents
** of the given file.
** --usepidkey Use saved encryption key from parent process. This is
** only necessary when using SEE on Windows.
**
** See also: [[cgi]], [[server]], [[winsrv]]
*/
void cmd_http(void){
const char *zIpAddr = 0;
|
| ︙ | | | ︙ | |
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
|
if( zAltBase ) set_base_url(zAltBase);
if( find_option("https",0,0)!=0 ){
zIpAddr = fossil_getenv("REMOTE_HOST"); /* From stunnel */
cgi_replace_parameter("HTTPS","on");
}
zHost = find_option("host", 0, 1);
if( zHost ) cgi_replace_parameter("HTTP_HOST",zHost);
/* We should be done with options.. */
verify_all_options();
if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
g.cgiOutput = 1;
g.fullHttpReply = 1;
|
>
>
>
>
|
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
|
if( zAltBase ) set_base_url(zAltBase);
if( find_option("https",0,0)!=0 ){
zIpAddr = fossil_getenv("REMOTE_HOST"); /* From stunnel */
cgi_replace_parameter("HTTPS","on");
}
zHost = find_option("host", 0, 1);
if( zHost ) cgi_replace_parameter("HTTP_HOST",zHost);
g.zMainMenuFile = find_option("mainmenu",0,1);
if( g.zMainMenuFile!=0 && file_size(g.zMainMenuFile,ExtFILE)<0 ){
fossil_fatal("Cannot read --mainmenu file %s", g.zMainMenuFile);
}
/* We should be done with options.. */
verify_all_options();
if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
g.cgiOutput = 1;
g.fullHttpReply = 1;
|
| ︙ | | | ︙ | |
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
|
** --notfound URL Redirect
** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
** -P|--port TCPPORT listen to request on port TCPPORT
** --th-trace trace TH1 execution (for debugging purposes)
** --repolist If REPOSITORY is dir, URL "/" lists repos.
** --scgi Accept SCGI rather than HTTP
** --skin LABEL Use override skin LABEL
** --usepidkey Use saved encryption key from parent process. This is
** only necessary when using SEE on Windows.
**
** See also: [[cgi]], [[http]], [[winsrv]]
*/
void cmd_webserver(void){
int iPort, mxPort; /* Range of TCP ports allowed */
|
>
>
|
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
|
** --notfound URL Redirect
** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci"
** -P|--port TCPPORT listen to request on port TCPPORT
** --th-trace trace TH1 execution (for debugging purposes)
** --repolist If REPOSITORY is dir, URL "/" lists repos.
** --scgi Accept SCGI rather than HTTP
** --skin LABEL Use override skin LABEL
** --mainmenu FILE Override the mainmenu config setting with the contents
** of the given file.
** --usepidkey Use saved encryption key from parent process. This is
** only necessary when using SEE on Windows.
**
** See also: [[cgi]], [[http]], [[winsrv]]
*/
void cmd_webserver(void){
int iPort, mxPort; /* Range of TCP ports allowed */
|
| ︙ | | | ︙ | |
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
|
if( find_option("https",0,0)!=0 ){
cgi_replace_parameter("HTTPS","on");
}
if( find_option("localhost", 0, 0)!=0 ){
flags |= HTTP_SERVER_LOCALHOST;
}
g.zCkoutAlias = find_option("ckout-alias",0,1);
/* We should be done with options.. */
verify_all_options();
if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
if( isUiCmd ){
flags |= HTTP_SERVER_LOCALHOST|HTTP_SERVER_REPOLIST;
g.useLocalauth = 1;
|
>
>
>
|
|
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
|
if( find_option("https",0,0)!=0 ){
cgi_replace_parameter("HTTPS","on");
}
if( find_option("localhost", 0, 0)!=0 ){
flags |= HTTP_SERVER_LOCALHOST;
}
g.zCkoutAlias = find_option("ckout-alias",0,1);
g.zMainMenuFile = find_option("mainmenu",0,1);
if( g.zMainMenuFile!=0 && file_size(g.zMainMenuFile,ExtFILE)<0 ){
fossil_fatal("Cannot read --mainmenu file %s", g.zMainMenuFile);
}
/* We should be done with options.. */
verify_all_options();
if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
if( isUiCmd ){
flags |= HTTP_SERVER_LOCALHOST|HTTP_SERVER_REPOLIST;
g.useLocalauth = 1;
|
| ︙ | | | ︙ | |