Fossil SCM
Checkpoint after a first pass through every call to ...getenv() in src/*.c to list environment variables mentioned. Every variable has a very rough draft description. Every global command option is listed, but not all have even a rough draft description yet.
Commit
3b5ff98cf04e1e64297144832560783c6c376f24
Parent
4e89aee8f299678…
1 file changed
+91
-5
+91
-5
| --- www/env-opts.md | ||
| +++ www/env-opts.md | ||
| @@ -20,14 +20,20 @@ | ||
| 20 | 20 | argument unless it starts with '-' and contains a space, in which case |
| 21 | 21 | it is assumed to be another flag and is treated as such. `--args |
| 22 | 22 | FILENAME` may be used in conjunction with any other flags. |
| 23 | 23 | |
| 24 | 24 | `--case-sensitive BOOL`: Override the `case-sensitive` setting, which |
| 25 | -can override the native preferences of the platform: insensitive on | |
| 26 | -WIndows, sensitive on Unix. | |
| 25 | +can override the native preferences of the platform for case sensitive | |
| 26 | +file names: insensitive on Windows, sensitive on Unix. There are | |
| 27 | +probably odd interactions possible if you mix case sensitive and case | |
| 28 | +insensitive file systems on any single platform. This option or the | |
| 29 | +global setting should be used to force the case sensitivity to the | |
| 30 | +most sensible condition. | |
| 27 | 31 | |
| 28 | -`--chdir DIRECTORY`: | |
| 32 | +`--chdir DIRECTORY`: | |
| 33 | + | |
| 34 | + | |
| 29 | 35 | |
| 30 | 36 | `--comfmtflags NUMBER`: |
| 31 | 37 | |
| 32 | 38 | |
| 33 | 39 | `--errorlog ERRLOG`: |
| @@ -76,10 +82,23 @@ | ||
| 76 | 82 | used as the location of the `~/.fossil` file. |
| 77 | 83 | |
| 78 | 84 | `EDITOR`: Name the editor to use for check-in and stash comments. |
| 79 | 85 | Overridden by the local or global `editor` setting or the `VISUAL` |
| 80 | 86 | environment variable. |
| 87 | + | |
| 88 | +`FOSSIL_FORCE_TICKET_MODERATION`: If set, *ALL* changes for tickets | |
| 89 | +will be required to go through moderation (even those performed by the | |
| 90 | +local interactive user via the command line). This can be useful for | |
| 91 | +local (or remote) testing of the moderation subsystem and its impact | |
| 92 | +on the contents and status of tickets. | |
| 93 | + | |
| 94 | +`FOSSIL_FORCE_WIKI_MODERATION`: If set, *ALL* changes for wiki pages | |
| 95 | +will be required to go through moderation (even those performed by the | |
| 96 | +local interactive user via the command line). This can be useful for | |
| 97 | +local (or remote) testing of the moderation subsystem and its impact | |
| 98 | +on the contents and status of wiki pages. | |
| 99 | + | |
| 81 | 100 | |
| 82 | 101 | `FOSSIL_HOME`: Location of the `~/.fossil` file. The first environment |
| 83 | 102 | variable found in the environment from the list `FOSSIL_HOME`, |
| 84 | 103 | `LOCALAPPDATA` (Windows), `APPDATA` (Windows), `HOMEDRIVE` and |
| 85 | 104 | `HOMEPATH` (Windows, used together), and `HOME` is used as the |
| @@ -88,10 +107,14 @@ | ||
| 88 | 107 | `FOSSIL_USER`: Name of the default user account if the local or global |
| 89 | 108 | `default-user` setting is not present. The first environment variable |
| 90 | 109 | found in the environment from the list `FOSSIL_USER`, `USERNAME` |
| 91 | 110 | (Windows), `USER`, and `LOGNAME` is the user name. If none of those |
| 92 | 111 | are set, then the default user name is "root". |
| 112 | + | |
| 113 | +`FOSSIL_TCL_PATH`: When Tcl stubs support is configured, point to a | |
| 114 | +specific folder containing the version of Tcl to load at run time. | |
| 115 | + | |
| 93 | 116 | |
| 94 | 117 | `FOSSIL_VFS`: Name a VFS to load into SQLite. |
| 95 | 118 | |
| 96 | 119 | `GATEWAY_INTERFACE`: If present and the `--nocgi` option is not, assume |
| 97 | 120 | fossil is invoked from a web server as a CGI command, and act |
| @@ -108,10 +131,14 @@ | ||
| 108 | 131 | `FOSSIL_HOME`, `LOCALAPPDATA` (Windows), `APPDATA` (Windows), |
| 109 | 132 | `HOMEDRIVE` and `HOMEPATH` (Windows, used together), and `HOME` is |
| 110 | 133 | used as the location of the `~/.fossil` file. |
| 111 | 134 | |
| 112 | 135 | `HTTP_HOST`: If defined, included in error log messages. |
| 136 | + | |
| 137 | +`http_proxy`: If the global or local settings `proxy` is not set, this | |
| 138 | +is used as the default value for the `proxy` setting. | |
| 139 | + | |
| 113 | 140 | |
| 114 | 141 | `HTTP_USER_AGENT`: If defined, included in error log messages. |
| 115 | 142 | |
| 116 | 143 | |
| 117 | 144 | `LOCALAPPDATA`: (Windows) Location of the `~/.fossil` file. The first |
| @@ -143,11 +170,18 @@ | ||
| 143 | 170 | |
| 144 | 171 | `REQUEST_URI`: If defined, included in error log messages. |
| 145 | 172 | |
| 146 | 173 | `SCRIPT_NAME`: If defined, included in error log messages. |
| 147 | 174 | |
| 148 | -`SSH_CONNECTION`: | |
| 175 | +`SSH_CONNECTION`: Informs CGI processing if the remote client is SSH. | |
| 176 | + | |
| 177 | +`SQLITE_FORCE_PROXY_LOCKING`: From `sqlite3.c`, 1 means force always | |
| 178 | +use proxy, 0 means never use proxy, and undefined means use proxy for | |
| 179 | +non-local files only. | |
| 180 | + | |
| 181 | +`SQLITE_TMPDIR`: Names the temporary file location to SQLite. | |
| 182 | + | |
| 149 | 183 | |
| 150 | 184 | `SYSTEMROOT`: (Windows) Used to locate `notepad.exe` as a |
| 151 | 185 | fall back comment editor. |
| 152 | 186 | |
| 153 | 187 | `TEMP`: On Windows, the location of temporary files. The first |
| @@ -168,16 +202,26 @@ | ||
| 168 | 202 | released all of its allocated memory, when exiting fossil. This is not |
| 169 | 203 | strictly necessary, but makes debugging memory leaks easier. See |
| 170 | 204 | [main.c near line 386](/artifact/e75796be5338a81c?ln=386,391) for the |
| 171 | 205 | code. |
| 172 | 206 | |
| 207 | +`TH1_ENABLE_DOCS`: Override the local or global setting `tcl-docs` | |
| 208 | +to enable TH1 documents in fossil. | |
| 209 | + | |
| 210 | +`TH1_ENABLE_HOOKS`: Override the local or global setting `tcl-hooks` | |
| 211 | +to enable TH1 hooks in fossil. | |
| 212 | + | |
| 213 | +`TH1_ENABLE_TCL`: Override the local or global setting `tcl` to enable | |
| 214 | +TCL in fossil. | |
| 173 | 215 | |
| 174 | 216 | `TMP`: On Windows, the location of temporary files. The first |
| 175 | 217 | environment variable found in the environment that names an existing |
| 176 | 218 | directory from the list `TMP`, `TEMP`, `USERPROFILE`, the Windows |
| 177 | 219 | directory (usually `C:\WINDOWS`), `TEMP`, `TMP`, and the current |
| 178 | 220 | directory (aka `.`) is the temporary folder. |
| 221 | + | |
| 222 | +`TMPDIR`: Names the temporary file location to SQLite. | |
| 179 | 223 | |
| 180 | 224 | |
| 181 | 225 | `USER`: Name of the default user account if the local or global |
| 182 | 226 | `default-user` setting is not present. The first environment variable |
| 183 | 227 | found in the environment from the list `FOSSIL_USER`, `USERNAME` |
| @@ -238,10 +282,12 @@ | ||
| 238 | 282 | displayed on stdout, and stdin is read until a single line containing |
| 239 | 283 | only a dot is seen. |
| 240 | 284 | |
| 241 | 285 | |
| 242 | 286 | ### Default Username |
| 287 | + | |
| 288 | + | |
| 243 | 289 | |
| 244 | 290 | When creating a new repository, fossil wants to guess a sensible user |
| 245 | 291 | name to make the default user granted the "s" permission. |
| 246 | 292 | |
| 247 | 293 | Fossil will use the setting `default-user` if set. Normally, a local |
| @@ -256,10 +302,37 @@ | ||
| 256 | 302 | |
| 257 | 303 | If `default-user` is not set, then the first found environment |
| 258 | 304 | variable from the list `FOSSIL_USER`, `USERNAME` (Windows), `USER`, |
| 259 | 305 | and `LOGNAME` is the user name. If none of those are set, then the |
| 260 | 306 | default user name is "root". |
| 307 | + | |
| 308 | + | |
| 309 | +**TODO** Compare `db_create_default_users()` in `db.c` to | |
| 310 | +`user_select()` in `user.c` which checks in a different order... | |
| 311 | + | |
| 312 | +Figure out what user is at the controls. | |
| 313 | + | |
| 314 | + 1. Use the --user and -U command-line options. | |
| 315 | + | |
| 316 | + 2. If the local database is open, check in VVAR. ??? | |
| 317 | + | |
| 318 | + 3. Check the default user in the repository (setting | |
| 319 | + `default-user`) | |
| 320 | + | |
| 321 | + 4. Try the `FOSSIL_USER` environment variable. | |
| 322 | + | |
| 323 | + 5. Try the `USER` environment variable. | |
| 324 | + | |
| 325 | + 6. Try the `LOGNAME` environment variable. | |
| 326 | + | |
| 327 | + 7. Try the `USERNAME` environment variable. | |
| 328 | + | |
| 329 | + 8. Check if the user can be extracted from the remote URL, if | |
| 330 | + there is a remote URL. | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 261 | 334 | |
| 262 | 335 | ### Error logging |
| 263 | 336 | |
| 264 | 337 | If logging errors to a file, fossil will include the values of the |
| 265 | 338 | following environment variables in the error log entry if they are |
| @@ -275,10 +348,18 @@ | ||
| 275 | 348 | |
| 276 | 349 | The user's home directory is specified by the first environment |
| 277 | 350 | variable found in the environment from the list `FOSSIL_HOME`, |
| 278 | 351 | `LOCALAPPDATA` (Windows), `APPDATA` (Windows), `HOMEDRIVE` and |
| 279 | 352 | `HOMEPATH` (Windows, used together), and `HOME`. |
| 353 | + | |
| 354 | +SQLite has its own notion of the user's home directory, which is only | |
| 355 | +exposed if the interactive SQL shell is run with the "fossil | |
| 356 | +sqlite3" command. Being a separate library, SQLite uses many of the | |
| 357 | +same variables to find the home directory, but uses them in a | |
| 358 | +different order, and does not use the `FOSSIL_HOME` variable at all. | |
| 359 | + | |
| 360 | + | |
| 280 | 361 | |
| 281 | 362 | ### SQLite VFS to use |
| 282 | 363 | |
| 283 | 364 | See [the SQLite documentation](http://www.sqlite.org/vfs.html) for an |
| 284 | 365 | explanation of what a VFS actually is and what it does. |
| @@ -296,11 +377,14 @@ | ||
| 296 | 377 | folder as the merge result. |
| 297 | 378 | |
| 298 | 379 | Other temporary files need a home. On Unix-like systems, the first |
| 299 | 380 | folder from the hard coded list `/var/tmp`, `/usr/tmp`, `/tmp`, |
| 300 | 381 | `/temp`, and `.` that is found to exist in the file system is used by |
| 301 | -fossil. | |
| 382 | +fossil. The SQLite library has its own code for finding a safe place for | |
| 383 | +temporary files. It checks the environment variables `SQLITE_TMPDIR` | |
| 384 | +and `TMPDIR` ahead of the hard coded list `/var/tmp`, `/usr/tmp`, | |
| 385 | +`/tmp`, and `.` for the first directory that exists. | |
| 302 | 386 | |
| 303 | 387 | On Windows, fossil calls [`GetTempPath`][gtp], and also queries the |
| 304 | 388 | environment variables `TEMP`, and `TMP`. If none of those three places |
| 305 | 389 | exist, then it uses `.`. Notice that `GetTempPath` itself used `TMP`, |
| 306 | 390 | `TEMP`, `USERPROFILE`, and the Windows folder (named in the variable |
| @@ -308,10 +392,12 @@ | ||
| 308 | 392 | versions of Windows is generally *not* writable by the logged in user, |
| 309 | 393 | not having `TEMP`, `TMP`, or `USERPROFILE` set is almost guaranteed to |
| 310 | 394 | cause trouble. |
| 311 | 395 | |
| 312 | 396 | [gtp]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa364992%28v=vs.85%29.aspx |
| 397 | + | |
| 398 | + | |
| 313 | 399 | |
| 314 | 400 | That said, it is not unusual for utilities on all platforms to assume |
| 315 | 401 | that `TEMP` or `TMP` point somewhere safe for temporary files. |
| 316 | 402 | |
| 317 | 403 | If the identified temporary folder is not writable, then weird things |
| 318 | 404 |
| --- www/env-opts.md | |
| +++ www/env-opts.md | |
| @@ -20,14 +20,20 @@ | |
| 20 | argument unless it starts with '-' and contains a space, in which case |
| 21 | it is assumed to be another flag and is treated as such. `--args |
| 22 | FILENAME` may be used in conjunction with any other flags. |
| 23 | |
| 24 | `--case-sensitive BOOL`: Override the `case-sensitive` setting, which |
| 25 | can override the native preferences of the platform: insensitive on |
| 26 | WIndows, sensitive on Unix. |
| 27 | |
| 28 | `--chdir DIRECTORY`: |
| 29 | |
| 30 | `--comfmtflags NUMBER`: |
| 31 | |
| 32 | |
| 33 | `--errorlog ERRLOG`: |
| @@ -76,10 +82,23 @@ | |
| 76 | used as the location of the `~/.fossil` file. |
| 77 | |
| 78 | `EDITOR`: Name the editor to use for check-in and stash comments. |
| 79 | Overridden by the local or global `editor` setting or the `VISUAL` |
| 80 | environment variable. |
| 81 | |
| 82 | `FOSSIL_HOME`: Location of the `~/.fossil` file. The first environment |
| 83 | variable found in the environment from the list `FOSSIL_HOME`, |
| 84 | `LOCALAPPDATA` (Windows), `APPDATA` (Windows), `HOMEDRIVE` and |
| 85 | `HOMEPATH` (Windows, used together), and `HOME` is used as the |
| @@ -88,10 +107,14 @@ | |
| 88 | `FOSSIL_USER`: Name of the default user account if the local or global |
| 89 | `default-user` setting is not present. The first environment variable |
| 90 | found in the environment from the list `FOSSIL_USER`, `USERNAME` |
| 91 | (Windows), `USER`, and `LOGNAME` is the user name. If none of those |
| 92 | are set, then the default user name is "root". |
| 93 | |
| 94 | `FOSSIL_VFS`: Name a VFS to load into SQLite. |
| 95 | |
| 96 | `GATEWAY_INTERFACE`: If present and the `--nocgi` option is not, assume |
| 97 | fossil is invoked from a web server as a CGI command, and act |
| @@ -108,10 +131,14 @@ | |
| 108 | `FOSSIL_HOME`, `LOCALAPPDATA` (Windows), `APPDATA` (Windows), |
| 109 | `HOMEDRIVE` and `HOMEPATH` (Windows, used together), and `HOME` is |
| 110 | used as the location of the `~/.fossil` file. |
| 111 | |
| 112 | `HTTP_HOST`: If defined, included in error log messages. |
| 113 | |
| 114 | `HTTP_USER_AGENT`: If defined, included in error log messages. |
| 115 | |
| 116 | |
| 117 | `LOCALAPPDATA`: (Windows) Location of the `~/.fossil` file. The first |
| @@ -143,11 +170,18 @@ | |
| 143 | |
| 144 | `REQUEST_URI`: If defined, included in error log messages. |
| 145 | |
| 146 | `SCRIPT_NAME`: If defined, included in error log messages. |
| 147 | |
| 148 | `SSH_CONNECTION`: |
| 149 | |
| 150 | `SYSTEMROOT`: (Windows) Used to locate `notepad.exe` as a |
| 151 | fall back comment editor. |
| 152 | |
| 153 | `TEMP`: On Windows, the location of temporary files. The first |
| @@ -168,16 +202,26 @@ | |
| 168 | released all of its allocated memory, when exiting fossil. This is not |
| 169 | strictly necessary, but makes debugging memory leaks easier. See |
| 170 | [main.c near line 386](/artifact/e75796be5338a81c?ln=386,391) for the |
| 171 | code. |
| 172 | |
| 173 | |
| 174 | `TMP`: On Windows, the location of temporary files. The first |
| 175 | environment variable found in the environment that names an existing |
| 176 | directory from the list `TMP`, `TEMP`, `USERPROFILE`, the Windows |
| 177 | directory (usually `C:\WINDOWS`), `TEMP`, `TMP`, and the current |
| 178 | directory (aka `.`) is the temporary folder. |
| 179 | |
| 180 | |
| 181 | `USER`: Name of the default user account if the local or global |
| 182 | `default-user` setting is not present. The first environment variable |
| 183 | found in the environment from the list `FOSSIL_USER`, `USERNAME` |
| @@ -238,10 +282,12 @@ | |
| 238 | displayed on stdout, and stdin is read until a single line containing |
| 239 | only a dot is seen. |
| 240 | |
| 241 | |
| 242 | ### Default Username |
| 243 | |
| 244 | When creating a new repository, fossil wants to guess a sensible user |
| 245 | name to make the default user granted the "s" permission. |
| 246 | |
| 247 | Fossil will use the setting `default-user` if set. Normally, a local |
| @@ -256,10 +302,37 @@ | |
| 256 | |
| 257 | If `default-user` is not set, then the first found environment |
| 258 | variable from the list `FOSSIL_USER`, `USERNAME` (Windows), `USER`, |
| 259 | and `LOGNAME` is the user name. If none of those are set, then the |
| 260 | default user name is "root". |
| 261 | |
| 262 | ### Error logging |
| 263 | |
| 264 | If logging errors to a file, fossil will include the values of the |
| 265 | following environment variables in the error log entry if they are |
| @@ -275,10 +348,18 @@ | |
| 275 | |
| 276 | The user's home directory is specified by the first environment |
| 277 | variable found in the environment from the list `FOSSIL_HOME`, |
| 278 | `LOCALAPPDATA` (Windows), `APPDATA` (Windows), `HOMEDRIVE` and |
| 279 | `HOMEPATH` (Windows, used together), and `HOME`. |
| 280 | |
| 281 | ### SQLite VFS to use |
| 282 | |
| 283 | See [the SQLite documentation](http://www.sqlite.org/vfs.html) for an |
| 284 | explanation of what a VFS actually is and what it does. |
| @@ -296,11 +377,14 @@ | |
| 296 | folder as the merge result. |
| 297 | |
| 298 | Other temporary files need a home. On Unix-like systems, the first |
| 299 | folder from the hard coded list `/var/tmp`, `/usr/tmp`, `/tmp`, |
| 300 | `/temp`, and `.` that is found to exist in the file system is used by |
| 301 | fossil. |
| 302 | |
| 303 | On Windows, fossil calls [`GetTempPath`][gtp], and also queries the |
| 304 | environment variables `TEMP`, and `TMP`. If none of those three places |
| 305 | exist, then it uses `.`. Notice that `GetTempPath` itself used `TMP`, |
| 306 | `TEMP`, `USERPROFILE`, and the Windows folder (named in the variable |
| @@ -308,10 +392,12 @@ | |
| 308 | versions of Windows is generally *not* writable by the logged in user, |
| 309 | not having `TEMP`, `TMP`, or `USERPROFILE` set is almost guaranteed to |
| 310 | cause trouble. |
| 311 | |
| 312 | [gtp]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa364992%28v=vs.85%29.aspx |
| 313 | |
| 314 | That said, it is not unusual for utilities on all platforms to assume |
| 315 | that `TEMP` or `TMP` point somewhere safe for temporary files. |
| 316 | |
| 317 | If the identified temporary folder is not writable, then weird things |
| 318 |
| --- www/env-opts.md | |
| +++ www/env-opts.md | |
| @@ -20,14 +20,20 @@ | |
| 20 | argument unless it starts with '-' and contains a space, in which case |
| 21 | it is assumed to be another flag and is treated as such. `--args |
| 22 | FILENAME` may be used in conjunction with any other flags. |
| 23 | |
| 24 | `--case-sensitive BOOL`: Override the `case-sensitive` setting, which |
| 25 | can override the native preferences of the platform for case sensitive |
| 26 | file names: insensitive on Windows, sensitive on Unix. There are |
| 27 | probably odd interactions possible if you mix case sensitive and case |
| 28 | insensitive file systems on any single platform. This option or the |
| 29 | global setting should be used to force the case sensitivity to the |
| 30 | most sensible condition. |
| 31 | |
| 32 | `--chdir DIRECTORY`: |
| 33 | |
| 34 | |
| 35 | |
| 36 | `--comfmtflags NUMBER`: |
| 37 | |
| 38 | |
| 39 | `--errorlog ERRLOG`: |
| @@ -76,10 +82,23 @@ | |
| 82 | used as the location of the `~/.fossil` file. |
| 83 | |
| 84 | `EDITOR`: Name the editor to use for check-in and stash comments. |
| 85 | Overridden by the local or global `editor` setting or the `VISUAL` |
| 86 | environment variable. |
| 87 | |
| 88 | `FOSSIL_FORCE_TICKET_MODERATION`: If set, *ALL* changes for tickets |
| 89 | will be required to go through moderation (even those performed by the |
| 90 | local interactive user via the command line). This can be useful for |
| 91 | local (or remote) testing of the moderation subsystem and its impact |
| 92 | on the contents and status of tickets. |
| 93 | |
| 94 | `FOSSIL_FORCE_WIKI_MODERATION`: If set, *ALL* changes for wiki pages |
| 95 | will be required to go through moderation (even those performed by the |
| 96 | local interactive user via the command line). This can be useful for |
| 97 | local (or remote) testing of the moderation subsystem and its impact |
| 98 | on the contents and status of wiki pages. |
| 99 | |
| 100 | |
| 101 | `FOSSIL_HOME`: Location of the `~/.fossil` file. The first environment |
| 102 | variable found in the environment from the list `FOSSIL_HOME`, |
| 103 | `LOCALAPPDATA` (Windows), `APPDATA` (Windows), `HOMEDRIVE` and |
| 104 | `HOMEPATH` (Windows, used together), and `HOME` is used as the |
| @@ -88,10 +107,14 @@ | |
| 107 | `FOSSIL_USER`: Name of the default user account if the local or global |
| 108 | `default-user` setting is not present. The first environment variable |
| 109 | found in the environment from the list `FOSSIL_USER`, `USERNAME` |
| 110 | (Windows), `USER`, and `LOGNAME` is the user name. If none of those |
| 111 | are set, then the default user name is "root". |
| 112 | |
| 113 | `FOSSIL_TCL_PATH`: When Tcl stubs support is configured, point to a |
| 114 | specific folder containing the version of Tcl to load at run time. |
| 115 | |
| 116 | |
| 117 | `FOSSIL_VFS`: Name a VFS to load into SQLite. |
| 118 | |
| 119 | `GATEWAY_INTERFACE`: If present and the `--nocgi` option is not, assume |
| 120 | fossil is invoked from a web server as a CGI command, and act |
| @@ -108,10 +131,14 @@ | |
| 131 | `FOSSIL_HOME`, `LOCALAPPDATA` (Windows), `APPDATA` (Windows), |
| 132 | `HOMEDRIVE` and `HOMEPATH` (Windows, used together), and `HOME` is |
| 133 | used as the location of the `~/.fossil` file. |
| 134 | |
| 135 | `HTTP_HOST`: If defined, included in error log messages. |
| 136 | |
| 137 | `http_proxy`: If the global or local settings `proxy` is not set, this |
| 138 | is used as the default value for the `proxy` setting. |
| 139 | |
| 140 | |
| 141 | `HTTP_USER_AGENT`: If defined, included in error log messages. |
| 142 | |
| 143 | |
| 144 | `LOCALAPPDATA`: (Windows) Location of the `~/.fossil` file. The first |
| @@ -143,11 +170,18 @@ | |
| 170 | |
| 171 | `REQUEST_URI`: If defined, included in error log messages. |
| 172 | |
| 173 | `SCRIPT_NAME`: If defined, included in error log messages. |
| 174 | |
| 175 | `SSH_CONNECTION`: Informs CGI processing if the remote client is SSH. |
| 176 | |
| 177 | `SQLITE_FORCE_PROXY_LOCKING`: From `sqlite3.c`, 1 means force always |
| 178 | use proxy, 0 means never use proxy, and undefined means use proxy for |
| 179 | non-local files only. |
| 180 | |
| 181 | `SQLITE_TMPDIR`: Names the temporary file location to SQLite. |
| 182 | |
| 183 | |
| 184 | `SYSTEMROOT`: (Windows) Used to locate `notepad.exe` as a |
| 185 | fall back comment editor. |
| 186 | |
| 187 | `TEMP`: On Windows, the location of temporary files. The first |
| @@ -168,16 +202,26 @@ | |
| 202 | released all of its allocated memory, when exiting fossil. This is not |
| 203 | strictly necessary, but makes debugging memory leaks easier. See |
| 204 | [main.c near line 386](/artifact/e75796be5338a81c?ln=386,391) for the |
| 205 | code. |
| 206 | |
| 207 | `TH1_ENABLE_DOCS`: Override the local or global setting `tcl-docs` |
| 208 | to enable TH1 documents in fossil. |
| 209 | |
| 210 | `TH1_ENABLE_HOOKS`: Override the local or global setting `tcl-hooks` |
| 211 | to enable TH1 hooks in fossil. |
| 212 | |
| 213 | `TH1_ENABLE_TCL`: Override the local or global setting `tcl` to enable |
| 214 | TCL in fossil. |
| 215 | |
| 216 | `TMP`: On Windows, the location of temporary files. The first |
| 217 | environment variable found in the environment that names an existing |
| 218 | directory from the list `TMP`, `TEMP`, `USERPROFILE`, the Windows |
| 219 | directory (usually `C:\WINDOWS`), `TEMP`, `TMP`, and the current |
| 220 | directory (aka `.`) is the temporary folder. |
| 221 | |
| 222 | `TMPDIR`: Names the temporary file location to SQLite. |
| 223 | |
| 224 | |
| 225 | `USER`: Name of the default user account if the local or global |
| 226 | `default-user` setting is not present. The first environment variable |
| 227 | found in the environment from the list `FOSSIL_USER`, `USERNAME` |
| @@ -238,10 +282,12 @@ | |
| 282 | displayed on stdout, and stdin is read until a single line containing |
| 283 | only a dot is seen. |
| 284 | |
| 285 | |
| 286 | ### Default Username |
| 287 | |
| 288 | |
| 289 | |
| 290 | When creating a new repository, fossil wants to guess a sensible user |
| 291 | name to make the default user granted the "s" permission. |
| 292 | |
| 293 | Fossil will use the setting `default-user` if set. Normally, a local |
| @@ -256,10 +302,37 @@ | |
| 302 | |
| 303 | If `default-user` is not set, then the first found environment |
| 304 | variable from the list `FOSSIL_USER`, `USERNAME` (Windows), `USER`, |
| 305 | and `LOGNAME` is the user name. If none of those are set, then the |
| 306 | default user name is "root". |
| 307 | |
| 308 | |
| 309 | **TODO** Compare `db_create_default_users()` in `db.c` to |
| 310 | `user_select()` in `user.c` which checks in a different order... |
| 311 | |
| 312 | Figure out what user is at the controls. |
| 313 | |
| 314 | 1. Use the --user and -U command-line options. |
| 315 | |
| 316 | 2. If the local database is open, check in VVAR. ??? |
| 317 | |
| 318 | 3. Check the default user in the repository (setting |
| 319 | `default-user`) |
| 320 | |
| 321 | 4. Try the `FOSSIL_USER` environment variable. |
| 322 | |
| 323 | 5. Try the `USER` environment variable. |
| 324 | |
| 325 | 6. Try the `LOGNAME` environment variable. |
| 326 | |
| 327 | 7. Try the `USERNAME` environment variable. |
| 328 | |
| 329 | 8. Check if the user can be extracted from the remote URL, if |
| 330 | there is a remote URL. |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | ### Error logging |
| 336 | |
| 337 | If logging errors to a file, fossil will include the values of the |
| 338 | following environment variables in the error log entry if they are |
| @@ -275,10 +348,18 @@ | |
| 348 | |
| 349 | The user's home directory is specified by the first environment |
| 350 | variable found in the environment from the list `FOSSIL_HOME`, |
| 351 | `LOCALAPPDATA` (Windows), `APPDATA` (Windows), `HOMEDRIVE` and |
| 352 | `HOMEPATH` (Windows, used together), and `HOME`. |
| 353 | |
| 354 | SQLite has its own notion of the user's home directory, which is only |
| 355 | exposed if the interactive SQL shell is run with the "fossil |
| 356 | sqlite3" command. Being a separate library, SQLite uses many of the |
| 357 | same variables to find the home directory, but uses them in a |
| 358 | different order, and does not use the `FOSSIL_HOME` variable at all. |
| 359 | |
| 360 | |
| 361 | |
| 362 | ### SQLite VFS to use |
| 363 | |
| 364 | See [the SQLite documentation](http://www.sqlite.org/vfs.html) for an |
| 365 | explanation of what a VFS actually is and what it does. |
| @@ -296,11 +377,14 @@ | |
| 377 | folder as the merge result. |
| 378 | |
| 379 | Other temporary files need a home. On Unix-like systems, the first |
| 380 | folder from the hard coded list `/var/tmp`, `/usr/tmp`, `/tmp`, |
| 381 | `/temp`, and `.` that is found to exist in the file system is used by |
| 382 | fossil. The SQLite library has its own code for finding a safe place for |
| 383 | temporary files. It checks the environment variables `SQLITE_TMPDIR` |
| 384 | and `TMPDIR` ahead of the hard coded list `/var/tmp`, `/usr/tmp`, |
| 385 | `/tmp`, and `.` for the first directory that exists. |
| 386 | |
| 387 | On Windows, fossil calls [`GetTempPath`][gtp], and also queries the |
| 388 | environment variables `TEMP`, and `TMP`. If none of those three places |
| 389 | exist, then it uses `.`. Notice that `GetTempPath` itself used `TMP`, |
| 390 | `TEMP`, `USERPROFILE`, and the Windows folder (named in the variable |
| @@ -308,10 +392,12 @@ | |
| 392 | versions of Windows is generally *not* writable by the logged in user, |
| 393 | not having `TEMP`, `TMP`, or `USERPROFILE` set is almost guaranteed to |
| 394 | cause trouble. |
| 395 | |
| 396 | [gtp]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa364992%28v=vs.85%29.aspx |
| 397 | |
| 398 | |
| 399 | |
| 400 | That said, it is not unusual for utilities on all platforms to assume |
| 401 | that `TEMP` or `TMP` point somewhere safe for temporary files. |
| 402 | |
| 403 | If the identified temporary folder is not writable, then weird things |
| 404 |