Update aftok.cfg.example and revise INSTALL instructions
[?]
Jun 8, 2015, 4:36 PM
PGZJ736CG2E4HXIRYTZTGOMJRX2CHPIFG6H45PPO57EONOWJJ74QCDependencies
- [2]
4U7F3CPITHE GREAT RENAMING OF THINGS! - [3]
DLZRD7VBAdd a preliminary, probably somewhat broken set of setup instructions. - [4]
QO4NFWIYAdded sample config file. - [5]
IZEVQF62Work in progress replacing sqlite with postgres. - [6]
NZGH6W6Vadd cabal install cpphs step to docs to avoid thyme install failure - [7]
TNR3TEHKSwitch to Postgres + snaplet arch compiles. - [8]
Z3M53KTLAdrift. - [9]
EPOYLP7OA little .gitignore cleanup. - [10]
NVOCQVASInitial failing tests. - [11]
EQXRXRZDChanged to use tasty instead of test-framework - [12]
ADMKQQGCInitial empty Snap project. - [13]
PBD7LZYQPostgres & auth are beginning to function. - [14]
OBFPJS2GProject successfully builds and tests under nix.
Change contents
- edit in .gitignore at line 1
shell.nix - edit in .gitignore at line 3
.cabal-sandboxSetup - edit in .gitignore at line 7
*.cfg - edit in .gitignore at line 8
Setup - replacement in .gitignore at line 9
.cabal-sandboxconf/*.cfgconf/*.pemconf/site_key.txt - edit in .gitignore at line 15
dblocalstable - edit in .gitignore at line 16
site_key.txtshell.nix - replacement in INSTALL.md at line 27
used for encryption of cookies and so forth:mkdir localcd localopenssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodescd <project_root>echo 'sslCert = "local/cert.pem"' > aftok.cfgecho 'siteKey = "local/key.pem"' >> aftok.cfgIf you want to run on a port other than 8000, you can set 'port = 12345' in thataftok.cfg file.Next, we'll want to run the server in order to autogenerate the files that needto be edited to configure postgres:cabal run aftok-serverused for encryption of cookies. We're not currently taking advantage of this,since there's no browser-based UI, but without it the server will fail to start. - replacement in INSTALL.md at line 30
I can't remember whether this will succeed or fail to start, but in any caseonce it has run you should be able to find the filesnaplets/postgresql-simple/devel.cfgopenssl req -x509 -newkey rsa:2048 -keyout conf/key.pem -out conf/cert.pem -days 365 -nodes - replacement in INSTALL.md at line 32
Edit this file to set the database connection information:Next, copy the example config file into place and edit it to provide the port you wantthe service to run on, and your postgres database connection information. - replacement in INSTALL.md at line 35
host = "localhost"port = 5432user = "aftok"pass = "???"db = "aftok"cp conf/aftok.cfg.example conf/aftok.cfgvi conf/aftok.cfg - edit in INSTALL.md at line 47
- replacement in conf/aftok.cfg.example at line 1
db = "db/aftok-test.db"port = 8080[4.19]port = 8000sslCert = "conf/cert.pem"siteKey = "conf/key.pem"db {host = "localhost"port = 5432user = "postgres"pass = ""db = "testdb"# Nmuber of distinct connection pools to maintain. The smallest acceptable# value is 1.numStripes = 1# Number of seconds an unused resource is kept open. The smallest acceptable# value is 0.5 seconds.idleTime = 5# Maximum number of resources to keep open per stripe. The smallest# acceptable value is 1.maxResourcesPerStripe = 20} - replacement in server/Main.hs at line 25
cfg <- loadQConfig "aftok.cfg"cfg <- loadQConfig "conf/aftok.cfg"