| ︙ | | | ︙ | |
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#endif
#ifdef FOSSIL_ENABLE_JSON
# include "cson_amalgamation.h" /* JSON API. */
# include "json_detail.h"
#endif
/*
** Size of a UUID in characters
*/
#define UUID_SIZE 40
/*
** Maximum number of auxiliary parameters on reports
*/
#define MX_AUX 5
|
|
>
>
>
>
>
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#endif
#ifdef FOSSIL_ENABLE_JSON
# include "cson_amalgamation.h" /* JSON API. */
# include "json_detail.h"
#endif
/*
** Size of a UUID in characters. A UUID is a randomly generated
** lower-case hexadecimal number used to identify tickets.
**
** In Fossil 1.x, UUID also referred to a SHA1 artifact hash. But that
** usage is now obsolete. The term UUID should now mean only a very large
** random number used as a unique identifier for tickets or other objects.
*/
#define UUID_SIZE 40
/*
** Maximum number of auxiliary parameters on reports
*/
#define MX_AUX 5
|
| ︙ | | | ︙ | |
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
char *zRepositoryOption; /* Most recent cached repository option value */
char *zRepositoryName; /* Name of the repository database file */
char *zLocalDbName; /* Name of the local database file */
char *zOpenRevision; /* Check-in version to use during database open */
int localOpen; /* True if the local database is open */
char *zLocalRoot; /* The directory holding the local database */
int minPrefix; /* Number of digits needed for a distinct UUID */
int fNoDirSymlinks; /* True if --no-dir-symlinks flag is present */
int fSqlTrace; /* True if --sqltrace flag is present */
int fSqlStats; /* True if --sqltrace or --sqlstats are present */
int fSqlPrint; /* True if -sqlprint flag is present */
int fQuiet; /* True if -quiet flag is present */
int fJail; /* True if running with a chroot jail */
int fHttpTrace; /* Trace outbound HTTP requests */
int fAnyTrace; /* Any kind of tracing */
|
|
|
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
char *zRepositoryOption; /* Most recent cached repository option value */
char *zRepositoryName; /* Name of the repository database file */
char *zLocalDbName; /* Name of the local database file */
char *zOpenRevision; /* Check-in version to use during database open */
int localOpen; /* True if the local database is open */
char *zLocalRoot; /* The directory holding the local database */
int minPrefix; /* Number of digits needed for a distinct UUID */
int eHashPolicy; /* Current hash policy. One of HPOLICY_* */
int fSqlTrace; /* True if --sqltrace flag is present */
int fSqlStats; /* True if --sqltrace or --sqlstats are present */
int fSqlPrint; /* True if -sqlprint flag is present */
int fQuiet; /* True if -quiet flag is present */
int fJail; /* True if running with a chroot jail */
int fHttpTrace; /* Trace outbound HTTP requests */
int fAnyTrace; /* Any kind of tracing */
|
| ︙ | | | ︙ | |
545
546
547
548
549
550
551
552
553
554
555
556
557
558
|
#endif
int main(int argc, char **argv)
#endif
{
const char *zCmdName = "unknown";
const CmdOrPage *pCmd = 0;
int rc;
if( sqlite3_libversion_number()<3014000 ){
fossil_fatal("Unsuitable SQLite version %s, must be at least 3.14.0",
sqlite3_libversion());
}
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
memset(&g, 0, sizeof(g));
|
>
>
|
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
|
#endif
int main(int argc, char **argv)
#endif
{
const char *zCmdName = "unknown";
const CmdOrPage *pCmd = 0;
int rc;
fossil_limit_memory(1);
if( sqlite3_libversion_number()<3014000 ){
fossil_fatal("Unsuitable SQLite version %s, must be at least 3.14.0",
sqlite3_libversion());
}
sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
memset(&g, 0, sizeof(g));
|
| ︙ | | | ︙ | |
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
|
"another flag and is treated as such. --args FILENAME may be used\n"
"in conjunction with any other flags.\n");
fossil_exit(1);
}else{
const char *zChdir = find_option("chdir",0,1);
g.isHTTP = 0;
g.rcvid = 0;
g.fNoDirSymlinks = find_option("no-dir-symlinks", 0, 0)!=0;
g.fQuiet = find_option("quiet", 0, 0)!=0;
g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
g.fSshClient = 0;
g.zSshCmd = 0;
|
<
|
619
620
621
622
623
624
625
626
627
628
629
630
631
632
|
"another flag and is treated as such. --args FILENAME may be used\n"
"in conjunction with any other flags.\n");
fossil_exit(1);
}else{
const char *zChdir = find_option("chdir",0,1);
g.isHTTP = 0;
g.rcvid = 0;
g.fQuiet = find_option("quiet", 0, 0)!=0;
g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
g.fSshClient = 0;
g.zSshCmd = 0;
|
| ︙ | | | ︙ | |
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
|
** Verify that there are no unprocessed command-line options. If
** Any remaining command-line argument begins with "-" print
** an error message and quit.
*/
void verify_all_options(void){
int i;
for(i=1; i<g.argc; i++){
if( g.argv[i][0]=='-' ){
fossil_fatal(
"unrecognized command-line option, or missing argument: %s",
g.argv[i]);
}
}
}
|
|
|
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
|
** Verify that there are no unprocessed command-line options. If
** Any remaining command-line argument begins with "-" print
** an error message and quit.
*/
void verify_all_options(void){
int i;
for(i=1; i<g.argc; i++){
if( g.argv[i][0]=='-' && g.argv[i][1]!=0 ){
fossil_fatal(
"unrecognized command-line option, or missing argument: %s",
g.argv[i]);
}
}
}
|
| ︙ | | | ︙ | |
928
929
930
931
932
933
934
935
936
937
938
939
940
941
|
__DATE__, __TIME__, COMPILER_NAME, sizeof(void*)*8);
blob_appendf(pOut, "Schema version %s\n", AUX_SCHEMA_MAX);
#if defined(FOSSIL_ENABLE_MINIZ)
blob_appendf(pOut, "miniz %s, loaded %s\n", MZ_VERSION, mz_version());
#else
blob_appendf(pOut, "zlib %s, loaded %s\n", ZLIB_VERSION, zlibVersion());
#endif
#if defined(FOSSIL_ENABLE_SSL)
blob_appendf(pOut, "SSL (%s)\n", SSLeay_version(SSLEAY_VERSION));
#endif
#if defined(FOSSIL_HAVE_FUSEFS)
blob_appendf(pOut, "libfuse %s, loaded %s\n", fusefs_inc_version(),
fusefs_lib_version());
#endif
|
>
>
>
|
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
|
__DATE__, __TIME__, COMPILER_NAME, sizeof(void*)*8);
blob_appendf(pOut, "Schema version %s\n", AUX_SCHEMA_MAX);
#if defined(FOSSIL_ENABLE_MINIZ)
blob_appendf(pOut, "miniz %s, loaded %s\n", MZ_VERSION, mz_version());
#else
blob_appendf(pOut, "zlib %s, loaded %s\n", ZLIB_VERSION, zlibVersion());
#endif
#if FOSSIL_HARDENED_SHA1
blob_appendf(pOut, "hardened-SHA1 by Marc Stevens and Dan Shumow\n");
#endif
#if defined(FOSSIL_ENABLE_SSL)
blob_appendf(pOut, "SSL (%s)\n", SSLeay_version(SSLEAY_VERSION));
#endif
#if defined(FOSSIL_HAVE_FUSEFS)
blob_appendf(pOut, "libfuse %s, loaded %s\n", fusefs_inc_version(),
fusefs_lib_version());
#endif
|
| ︙ | | | ︙ | |
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
|
*/
void test_version_page(void){
Blob versionInfo;
int verboseFlag;
login_check_credentials();
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
verboseFlag = atoi(PD("verbose","0"));
style_header("Version Information");
style_submenu_element("Stat", "stat");
get_version_blob(&versionInfo, verboseFlag);
@ <pre>
@ %h(blob_str(&versionInfo))
@ </pre>
style_footer();
|
|
|
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
|
*/
void test_version_page(void){
Blob versionInfo;
int verboseFlag;
login_check_credentials();
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
verboseFlag = PD("verbose", 0) != 0;
style_header("Version Information");
style_submenu_element("Stat", "stat");
get_version_blob(&versionInfo, verboseFlag);
@ <pre>
@ %h(blob_str(&versionInfo))
@ </pre>
style_footer();
|
| ︙ | | | ︙ | |
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
|
** Open the repository to be served if it is known. If g.argv[arg] is
** a directory full of repositories, then set g.zRepositoryName to
** the name of that directory and the specific repository will be
** opened later by process_one_web_page() based on the content of
** the PATH_INFO variable.
**
** If the fCreate flag is set, then create the repository if it
** does not already exist.
*/
static void find_server_repository(int arg, int fCreate){
if( g.argc<=arg ){
db_must_be_within_tree();
}else{
const char *zRepo = g.argv[arg];
int isDir = file_isdir(zRepo);
if( isDir==1 ){
g.zRepositoryName = mprintf("%s", zRepo);
file_simplify_name(g.zRepositoryName, -1, 0);
}else{
if( isDir==0 && fCreate ){
const char *zPassword;
db_create_repository(zRepo);
db_open_repository(zRepo);
db_begin_transaction();
db_initial_setup(0, "now", g.zLogin);
db_end_transaction(0);
fossil_print("project-id: %s\n", db_get("project-code", 0));
fossil_print("server-id: %s\n", db_get("server-code", 0));
zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
fossil_print("admin-user: %s (initial password is \"%s\")\n",
g.zLogin, zPassword);
|
|
>
>
|
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
|
** Open the repository to be served if it is known. If g.argv[arg] is
** a directory full of repositories, then set g.zRepositoryName to
** the name of that directory and the specific repository will be
** opened later by process_one_web_page() based on the content of
** the PATH_INFO variable.
**
** If the fCreate flag is set, then create the repository if it
** does not already exist. Always use "auto" hash-policy in this case.
*/
static void find_server_repository(int arg, int fCreate){
if( g.argc<=arg ){
db_must_be_within_tree();
}else{
const char *zRepo = g.argv[arg];
int isDir = file_isdir(zRepo);
if( isDir==1 ){
g.zRepositoryName = mprintf("%s", zRepo);
file_simplify_name(g.zRepositoryName, -1, 0);
}else{
if( isDir==0 && fCreate ){
const char *zPassword;
db_create_repository(zRepo);
db_open_repository(zRepo);
db_begin_transaction();
g.eHashPolicy = HPOLICY_AUTO;
db_set_int("hash-policy", HPOLICY_AUTO, 0);
db_initial_setup(0, "now", g.zLogin);
db_end_transaction(0);
fossil_print("project-id: %s\n", db_get("project-code", 0));
fossil_print("server-id: %s\n", db_get("server-code", 0));
zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
fossil_print("admin-user: %s (initial password is \"%s\")\n",
g.zLogin, zPassword);
|
| ︙ | | | ︙ | |