go-bouquins/README.md

67 lines
1.7 KiB
Markdown
Raw Normal View History

2017-07-30 18:15:54 +00:00
# go-bouquins
2017-08-04 18:13:39 +00:00
Bouquins in Go
## TODO
* translations
* tests
* csrf
2017-09-09 15:12:37 +00:00
* userdb commands (init, migrate, add/remove user/email)
2017-09-09 16:03:59 +00:00
* error pages
2017-09-05 15:35:10 +00:00
2017-09-09 16:09:03 +00:00
## Minify
2017-09-05 15:35:10 +00:00
2017-09-09 16:09:03 +00:00
* JS: https://www.danstools.com/javascript-minify/
* CSS: curl -X POST -s --data-urlencode 'input@assets/css/bouquins.css' https://cssminifier.com/raw > assets/css/bouquins.min.css
2017-09-06 10:36:28 +00:00
## Deployment archive
tar czf ~/tmp/go-bouquins.tar.gz go-bouquins assets/ templates/
## Configuration
JSON config file: default ./bouquins.json, or binary argument
Example:
{
"calibre-path": "/usr/home/meutel/data/calibre",
"bind-address": ":8080",
2017-09-09 11:10:29 +00:00
"prod": true,
"cookie-secret": "random",
"external-url":"https://bouquins.meutel.net",
"providers": [
{
"name": "github",
"client-id": "ID client",
"client-secret": "SECRET"
},
{
"name": "google",
"client-id":"ID client",
"client-secret":"SECRET"
}
]
2017-09-06 10:36:28 +00:00
}
Options:
* calibre-path path to calibre data
* db-path path to calibre SQLite database (default <calibre-path>/metadata.db)
2017-09-09 15:12:37 +00:00
* user-db-path path to users SQLite database (default ./users.db)
2017-09-06 10:36:28 +00:00
* bind-address HTTP socket bind address
* prod (boolean) use minified javascript/CSS
2017-09-09 11:10:29 +00:00
* cookie-secret random string for cookie encryption
* external-url URL used by client browsers
* providers configuration for OAuth 2 providers
* name provider name
* client-id OAuth client ID
* client-secret OAuth secret
2017-09-09 15:12:37 +00:00
## Users SQL
CREATE TABLE accounts (id varchar(36) PRIMARY KEY NOT NULL, name varchar(255) NOT NULL);
CREATE TABLE authentifiers (id varchar(36) NOT NULL, authentifier varchar(320) PRIMARY KEY NOT NULL, FOREIGN KEY(id) REFERENCES account(id));