aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-08-09 22:13:40 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-08-09 22:13:40 +0100
commit1960585357bafc0cd872afe61df04e6d9055fc8e (patch)
tree356af6a343dc28f9c097084730a4bb8ede7a0fff
parent030ff273473f0a5620ba276a370e5119f57179df (diff)
Document sqlite
-rw-r--r--README.md6
-rw-r--r--cmd/dbinit/dbinit.go2
2 files changed, 5 insertions, 3 deletions
diff --git a/README.md b/README.md
index 6077556..5a987b5 100644
--- a/README.md
+++ b/README.md
@@ -87,11 +87,12 @@ Configuration is divided into different sections: `server`, `auth`, `ssh`, and `
#### Datastore
Datastores contain a record of issued certificates for audit and revocation purposes. The connection string is of the form `engine:username:password:host[:port]`.
-Supported database providers: `mysql`, `mongo` and `mem`.
+Supported database providers: `mysql`, `mongo`, `sqlite` and `mem`.
`mem` is an in-memory database intended for testing and takes no additional config options.
`mysql` is the MySQL database and accepts `username`, `password` and `host` arguments. Only `username` and `host` arguments are required. `port` is assumed to be 3306 unless otherwise specified.
`mongo` is MongoDB and accepts `username`, `password` and `host` arguments. All arguments are optional and multiple hosts can be specified using comma-separated values: `mongo:dbuser:dbpasswd:host1,host2`.
+`sqlite` is the SQLite database and accepts a `path` argument.
If no datastore is specified the `mem` store is used.
@@ -104,10 +105,11 @@ server {
datastore = "mysql:cashier:PaSsWoRd:mydbprovider.example.com:5150" # mysql running on a remote host on port 5150
datastore = "mongo:cashier:PaSsWoRd:mydbprovider.example.com:27018" # mongo running on a remote host on port 27018
datastore = "mongo:cashier:PaSsWoRd:server1.example.com:27018,server2.example.com:27018" # mongo running on multiple servers on port 27018
+ datastore = "sqlite:/data/certs.db"
}
```
-Prior to using MySQL or MongoDB datastores you need to create the database and tables using the [dbinit tool](cmd/dbinit/dbinit.go).
+Prior to using MySQL, MongoDB or SQLite datastores you need to create the database and tables using the [dbinit tool](cmd/dbinit/dbinit.go).
Note that dbinit has no support for replica sets.
### auth
diff --git a/cmd/dbinit/dbinit.go b/cmd/dbinit/dbinit.go
index 1183452..4cf0834 100644
--- a/cmd/dbinit/dbinit.go
+++ b/cmd/dbinit/dbinit.go
@@ -20,7 +20,7 @@ var (
dbUser = flag.String("db_user", "user", "Database user")
dbPasswd = flag.String("db_password", "passwd", "Admin password")
dbType = flag.String("db_type", "mysql", "Database engine (\"mysql\", \"sqlite\" or \"mongo\")")
- sqliteDB = flag.String("db_path", "cashier.db", "Path to SQLite database")
+ sqliteDB = flag.String("db_path", "certs.db", "Path to SQLite database")
authDB = flag.String("authdb", "admin", "Admin database (mongo)")
certsDB = "certs"