You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Portint`short:"p" long:"port" default:"3306" description:"Port where the server is going to listen"`
48
51
Userstring`short:"u" long:"user" default:"root" description:"User name used for connection"`
49
52
Passwordstring`short:"P" long:"password" default:"" description:"Password used for connection"`
53
+
UserFilestring`short:"U" long:"user-file" env:"GITBASE_USER_FILE" default:"" description:"JSON file with credentials list"`
50
54
ConnTimeoutint`short:"t" long:"timeout" env:"GITBASE_CONNECTION_TIMEOUT" description:"Timeout in seconds used for connections"`
51
55
IndexDirstring`short:"i" long:"index" default:"/var/lib/gitbase/index" description:"Directory where the gitbase indexes information will be persisted." env:"GITBASE_INDEX_DIR"`
52
56
CacheSize cache.FileSize`long:"cache" default:"512" description:"Object cache size in megabytes" env:"GITBASE_CACHESIZE_MB"`
53
57
Parallelismuint`long:"parallelism" description:"Maximum number of parallel threads per table. By default, it's the number of CPU cores. 0 means default, 1 means disabled."`
54
58
DisableSquashbool`long:"no-squash" description:"Disables the table squashing."`
ReadOnlybool`short:"r" long:"readonly" description:"Only allow read queries. This disables creating and deleting indexes as well." env:"GITBASE_READONLY"`
60
+
ReadOnlybool`short:"r" long:"readonly" description:"Only allow read queries. This disables creating and deleting indexes as well. Cannot be used with --user-file." env:"GITBASE_READONLY"`
57
61
SkipGitErrorsbool// SkipGitErrors disables failing when Git errors are found.
58
62
DisableGitbool`long:"no-git" description:"disable the load of git standard repositories."`
59
63
DisableSivabool`long:"no-siva" description:"disable the load of siva files."`
Copy file name to clipboardExpand all lines: docs/using-gitbase/configuration.md
+42-2Lines changed: 42 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@
15
15
|`GITBASE_UAST_CACHE_SIZE`| size of the cache for the `uast` and `uast_mode` UDFs. The size is the maximum number of elements kept in the cache, 10000 by default |
16
16
|`GITBASE_CACHESIZE_MB`| size of the cache for git objects specified as MB |
17
17
|`GITBASE_CONNECTION_TIMEOUT`| timeout in seconds used for client connections on write and reads. No timeout by default. |
18
+
|`GITBASE_USER_FILE`| JSON file with user credentials |
18
19
19
20
### Jaeger tracing variables
20
21
@@ -75,6 +76,7 @@ Help Options:
75
76
-p, --port= Port where the server is going to listen (default: 3306)
76
77
-u, --user= User name used for connection (default: root)
77
78
-P, --password= Password used for connection
79
+
-U, --user-file= JSON file with credentials list [$GITBASE_USER_FILE]
78
80
-t, --timeout= Timeout in seconds used for connections [$GITBASE_CONNECTION_TIMEOUT]
79
81
-i, --index= Directory where the gitbase indexes information will be persisted. (default:
80
82
/var/lib/gitbase/index) [$GITBASE_INDEX_DIR]
@@ -83,10 +85,48 @@ Help Options:
83
85
means default, 1 means disabled.
84
86
--no-squash Disables the table squashing.
85
87
--trace Enables jaeger tracing [$GITBASE_TRACE]
86
-
-r, --readonly Only allow read queries. This disables creating and deleting indexes as well.
87
-
[$GITBASE_READONLY]
88
+
-r, --readonly Only allow read queries. This disables creating and deleting indexes as well. Cannot be used
89
+
with --user-file. [$GITBASE_READONLY]
88
90
--no-git disable the load of git standard repositories.
89
91
--no-siva disable the load of siva files.
90
92
-v Activates the verbose mode
91
93
92
94
```
95
+
## User credentials
96
+
97
+
User credentials can be specified in the command line or using a user file. For single user this can be done with parameters `--user` and `--password`:
98
+
99
+
```
100
+
gitbase server --user root --password r00tp4ssword! -d /my/repositories/path
101
+
```
102
+
103
+
If you want to have more than one user or do not have the password in plain text you can use a user file with this format:
You can either specify a plain text password or hashed. Hashed version uses the same format as MySQL 5.x passwords. You can generate the native password with this command, remember to prefix the hash with `*`:
There are two permissions you can set to users, `read` and `write`. `read` only allows to execute queries. `write` is needed to create and delete indexes or lock tables. If no permissions are set for a user the default permission is `read`.
126
+
127
+
Then you can specify which user file to use with parameter `--user-file`:
128
+
129
+
```
130
+
gitbase server --user-file /path/to/user-file.json -d /my/repositories/path
0 commit comments