Fossil SCM
Add the --page option to the "fossil ui" command.
Commit
f55f64e2d85557e88c51526cf47c23e28da3c0d8
Parent
d252cfd66d3c8f7…
1 file changed
+16
-6
+16
-6
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2381,10 +2381,11 @@ | ||
| 2381 | 2381 | ** by default. |
| 2382 | 2382 | ** |
| 2383 | 2383 | ** Options: |
| 2384 | 2384 | ** --baseurl URL Use URL as the base (useful for reverse proxies) |
| 2385 | 2385 | ** --create Create a new REPOSITORY if it does not already exist |
| 2386 | +** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci" | |
| 2386 | 2387 | ** --files GLOBLIST Comma-separated list of glob patterns for static files |
| 2387 | 2388 | ** --localauth enable automatic login for requests from localhost |
| 2388 | 2389 | ** --localhost listen on 127.0.0.1 only (always true for "ui") |
| 2389 | 2390 | ** --nojail Drop root privileges but do not enter the chroot jail |
| 2390 | 2391 | ** --notfound URL Redirect |
| @@ -2410,11 +2411,12 @@ | ||
| 2410 | 2411 | #endif |
| 2411 | 2412 | int allowRepoList; /* List repositories on URL "/" */ |
| 2412 | 2413 | const char *zAltBase; /* Argument to the --baseurl option */ |
| 2413 | 2414 | const char *zFileGlob; /* Static content must match this */ |
| 2414 | 2415 | char *zIpAddr = 0; /* Bind to this IP address */ |
| 2415 | - int fCreate = 0; | |
| 2416 | + int fCreate = 0; /* The --create flag */ | |
| 2417 | + char *zInitPage = 0; /* Start on this page. --page option */ | |
| 2416 | 2418 | |
| 2417 | 2419 | #if defined(_WIN32) |
| 2418 | 2420 | const char *zStopperFile; /* Name of file used to terminate server */ |
| 2419 | 2421 | zStopperFile = find_option("stopper", 0, 1); |
| 2420 | 2422 | #endif |
| @@ -2432,10 +2434,15 @@ | ||
| 2432 | 2434 | noJail = find_option("nojail",0,0)!=0; |
| 2433 | 2435 | #endif |
| 2434 | 2436 | g.useLocalauth = find_option("localauth", 0, 0)!=0; |
| 2435 | 2437 | Th_InitTraceLog(); |
| 2436 | 2438 | zPort = find_option("port", "P", 1); |
| 2439 | + isUiCmd = g.argv[1][0]=='u'; | |
| 2440 | + if( isUiCmd ){ | |
| 2441 | + zInitPage = find_option("page", 0, 1); | |
| 2442 | + } | |
| 2443 | + if( zInitPage==0 ) zInitPage = ""; | |
| 2437 | 2444 | zNotFound = find_option("notfound", 0, 1); |
| 2438 | 2445 | allowRepoList = find_option("repolist",0,0)!=0; |
| 2439 | 2446 | zAltBase = find_option("baseurl", 0, 1); |
| 2440 | 2447 | fCreate = find_option("create",0,0)!=0; |
| 2441 | 2448 | if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI; |
| @@ -2448,11 +2455,10 @@ | ||
| 2448 | 2455 | |
| 2449 | 2456 | /* We should be done with options.. */ |
| 2450 | 2457 | verify_all_options(); |
| 2451 | 2458 | |
| 2452 | 2459 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 2453 | - isUiCmd = g.argv[1][0]=='u'; | |
| 2454 | 2460 | if( isUiCmd ){ |
| 2455 | 2461 | flags |= HTTP_SERVER_LOCALHOST|HTTP_SERVER_REPOLIST; |
| 2456 | 2462 | g.useLocalauth = 1; |
| 2457 | 2463 | allowRepoList = 1; |
| 2458 | 2464 | } |
| @@ -2488,13 +2494,15 @@ | ||
| 2488 | 2494 | } |
| 2489 | 2495 | #else |
| 2490 | 2496 | zBrowser = db_get("web-browser", "open"); |
| 2491 | 2497 | #endif |
| 2492 | 2498 | if( zIpAddr ){ |
| 2493 | - zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr); | |
| 2499 | + zBrowserCmd = mprintf("%s http://%s:%%d/%s &", | |
| 2500 | + zBrowser, zIpAddr, zInitPage); | |
| 2494 | 2501 | }else{ |
| 2495 | - zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser); | |
| 2502 | + zBrowserCmd = mprintf("%s http://localhost:%%d/%s &", | |
| 2503 | + zBrowser, zInitPage); | |
| 2496 | 2504 | } |
| 2497 | 2505 | if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY; |
| 2498 | 2506 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2499 | 2507 | } |
| 2500 | 2508 | db_close(1); |
| @@ -2519,13 +2527,15 @@ | ||
| 2519 | 2527 | #else |
| 2520 | 2528 | /* Win32 implementation */ |
| 2521 | 2529 | if( isUiCmd ){ |
| 2522 | 2530 | zBrowser = db_get("web-browser", "start"); |
| 2523 | 2531 | if( zIpAddr ){ |
| 2524 | - zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr); | |
| 2532 | + zBrowserCmd = mprintf("%s http://%s:%%d/%s &", | |
| 2533 | + zBrowser, zIpAddr, zInitPage); | |
| 2525 | 2534 | }else{ |
| 2526 | - zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser); | |
| 2535 | + zBrowserCmd = mprintf("%s http://localhost:%%d/%s &", | |
| 2536 | + zBrowser, zInitPage); | |
| 2527 | 2537 | } |
| 2528 | 2538 | if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY; |
| 2529 | 2539 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2530 | 2540 | } |
| 2531 | 2541 | db_close(1); |
| 2532 | 2542 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2381,10 +2381,11 @@ | |
| 2381 | ** by default. |
| 2382 | ** |
| 2383 | ** Options: |
| 2384 | ** --baseurl URL Use URL as the base (useful for reverse proxies) |
| 2385 | ** --create Create a new REPOSITORY if it does not already exist |
| 2386 | ** --files GLOBLIST Comma-separated list of glob patterns for static files |
| 2387 | ** --localauth enable automatic login for requests from localhost |
| 2388 | ** --localhost listen on 127.0.0.1 only (always true for "ui") |
| 2389 | ** --nojail Drop root privileges but do not enter the chroot jail |
| 2390 | ** --notfound URL Redirect |
| @@ -2410,11 +2411,12 @@ | |
| 2410 | #endif |
| 2411 | int allowRepoList; /* List repositories on URL "/" */ |
| 2412 | const char *zAltBase; /* Argument to the --baseurl option */ |
| 2413 | const char *zFileGlob; /* Static content must match this */ |
| 2414 | char *zIpAddr = 0; /* Bind to this IP address */ |
| 2415 | int fCreate = 0; |
| 2416 | |
| 2417 | #if defined(_WIN32) |
| 2418 | const char *zStopperFile; /* Name of file used to terminate server */ |
| 2419 | zStopperFile = find_option("stopper", 0, 1); |
| 2420 | #endif |
| @@ -2432,10 +2434,15 @@ | |
| 2432 | noJail = find_option("nojail",0,0)!=0; |
| 2433 | #endif |
| 2434 | g.useLocalauth = find_option("localauth", 0, 0)!=0; |
| 2435 | Th_InitTraceLog(); |
| 2436 | zPort = find_option("port", "P", 1); |
| 2437 | zNotFound = find_option("notfound", 0, 1); |
| 2438 | allowRepoList = find_option("repolist",0,0)!=0; |
| 2439 | zAltBase = find_option("baseurl", 0, 1); |
| 2440 | fCreate = find_option("create",0,0)!=0; |
| 2441 | if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI; |
| @@ -2448,11 +2455,10 @@ | |
| 2448 | |
| 2449 | /* We should be done with options.. */ |
| 2450 | verify_all_options(); |
| 2451 | |
| 2452 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 2453 | isUiCmd = g.argv[1][0]=='u'; |
| 2454 | if( isUiCmd ){ |
| 2455 | flags |= HTTP_SERVER_LOCALHOST|HTTP_SERVER_REPOLIST; |
| 2456 | g.useLocalauth = 1; |
| 2457 | allowRepoList = 1; |
| 2458 | } |
| @@ -2488,13 +2494,15 @@ | |
| 2488 | } |
| 2489 | #else |
| 2490 | zBrowser = db_get("web-browser", "open"); |
| 2491 | #endif |
| 2492 | if( zIpAddr ){ |
| 2493 | zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr); |
| 2494 | }else{ |
| 2495 | zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser); |
| 2496 | } |
| 2497 | if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY; |
| 2498 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2499 | } |
| 2500 | db_close(1); |
| @@ -2519,13 +2527,15 @@ | |
| 2519 | #else |
| 2520 | /* Win32 implementation */ |
| 2521 | if( isUiCmd ){ |
| 2522 | zBrowser = db_get("web-browser", "start"); |
| 2523 | if( zIpAddr ){ |
| 2524 | zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr); |
| 2525 | }else{ |
| 2526 | zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser); |
| 2527 | } |
| 2528 | if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY; |
| 2529 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2530 | } |
| 2531 | db_close(1); |
| 2532 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2381,10 +2381,11 @@ | |
| 2381 | ** by default. |
| 2382 | ** |
| 2383 | ** Options: |
| 2384 | ** --baseurl URL Use URL as the base (useful for reverse proxies) |
| 2385 | ** --create Create a new REPOSITORY if it does not already exist |
| 2386 | ** --page PAGE Start "ui" on PAGE. ex: --page "timeline?y=ci" |
| 2387 | ** --files GLOBLIST Comma-separated list of glob patterns for static files |
| 2388 | ** --localauth enable automatic login for requests from localhost |
| 2389 | ** --localhost listen on 127.0.0.1 only (always true for "ui") |
| 2390 | ** --nojail Drop root privileges but do not enter the chroot jail |
| 2391 | ** --notfound URL Redirect |
| @@ -2410,11 +2411,12 @@ | |
| 2411 | #endif |
| 2412 | int allowRepoList; /* List repositories on URL "/" */ |
| 2413 | const char *zAltBase; /* Argument to the --baseurl option */ |
| 2414 | const char *zFileGlob; /* Static content must match this */ |
| 2415 | char *zIpAddr = 0; /* Bind to this IP address */ |
| 2416 | int fCreate = 0; /* The --create flag */ |
| 2417 | char *zInitPage = 0; /* Start on this page. --page option */ |
| 2418 | |
| 2419 | #if defined(_WIN32) |
| 2420 | const char *zStopperFile; /* Name of file used to terminate server */ |
| 2421 | zStopperFile = find_option("stopper", 0, 1); |
| 2422 | #endif |
| @@ -2432,10 +2434,15 @@ | |
| 2434 | noJail = find_option("nojail",0,0)!=0; |
| 2435 | #endif |
| 2436 | g.useLocalauth = find_option("localauth", 0, 0)!=0; |
| 2437 | Th_InitTraceLog(); |
| 2438 | zPort = find_option("port", "P", 1); |
| 2439 | isUiCmd = g.argv[1][0]=='u'; |
| 2440 | if( isUiCmd ){ |
| 2441 | zInitPage = find_option("page", 0, 1); |
| 2442 | } |
| 2443 | if( zInitPage==0 ) zInitPage = ""; |
| 2444 | zNotFound = find_option("notfound", 0, 1); |
| 2445 | allowRepoList = find_option("repolist",0,0)!=0; |
| 2446 | zAltBase = find_option("baseurl", 0, 1); |
| 2447 | fCreate = find_option("create",0,0)!=0; |
| 2448 | if( find_option("scgi", 0, 0)!=0 ) flags |= HTTP_SERVER_SCGI; |
| @@ -2448,11 +2455,10 @@ | |
| 2455 | |
| 2456 | /* We should be done with options.. */ |
| 2457 | verify_all_options(); |
| 2458 | |
| 2459 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 2460 | if( isUiCmd ){ |
| 2461 | flags |= HTTP_SERVER_LOCALHOST|HTTP_SERVER_REPOLIST; |
| 2462 | g.useLocalauth = 1; |
| 2463 | allowRepoList = 1; |
| 2464 | } |
| @@ -2488,13 +2494,15 @@ | |
| 2494 | } |
| 2495 | #else |
| 2496 | zBrowser = db_get("web-browser", "open"); |
| 2497 | #endif |
| 2498 | if( zIpAddr ){ |
| 2499 | zBrowserCmd = mprintf("%s http://%s:%%d/%s &", |
| 2500 | zBrowser, zIpAddr, zInitPage); |
| 2501 | }else{ |
| 2502 | zBrowserCmd = mprintf("%s http://localhost:%%d/%s &", |
| 2503 | zBrowser, zInitPage); |
| 2504 | } |
| 2505 | if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY; |
| 2506 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2507 | } |
| 2508 | db_close(1); |
| @@ -2519,13 +2527,15 @@ | |
| 2527 | #else |
| 2528 | /* Win32 implementation */ |
| 2529 | if( isUiCmd ){ |
| 2530 | zBrowser = db_get("web-browser", "start"); |
| 2531 | if( zIpAddr ){ |
| 2532 | zBrowserCmd = mprintf("%s http://%s:%%d/%s &", |
| 2533 | zBrowser, zIpAddr, zInitPage); |
| 2534 | }else{ |
| 2535 | zBrowserCmd = mprintf("%s http://localhost:%%d/%s &", |
| 2536 | zBrowser, zInitPage); |
| 2537 | } |
| 2538 | if( g.repositoryOpen ) flags |= HTTP_SERVER_HAD_REPOSITORY; |
| 2539 | if( g.localOpen ) flags |= HTTP_SERVER_HAD_CHECKOUT; |
| 2540 | } |
| 2541 | db_close(1); |
| 2542 |