Update aftok.cfg.example and revise INSTALL instructions

[?]
Jun 8, 2015, 4:36 PM
PGZJ736CG2E4HXIRYTZTGOMJRX2CHPIFG6H45PPO57EONOWJJ74QC

Dependencies

  • [2] 4U7F3CPI THE GREAT RENAMING OF THINGS!
  • [3] DLZRD7VB Add a preliminary, probably somewhat broken set of setup instructions.
  • [4] QO4NFWIY Added sample config file.
  • [5] IZEVQF62 Work in progress replacing sqlite with postgres.
  • [6] NZGH6W6V add cabal install cpphs step to docs to avoid thyme install failure
  • [7] TNR3TEHK Switch to Postgres + snaplet arch compiles.
  • [8] Z3M53KTL Adrift.
  • [9] EPOYLP7O A little .gitignore cleanup.
  • [10] NVOCQVAS Initial failing tests.
  • [11] EQXRXRZD Changed to use tasty instead of test-framework
  • [12] ADMKQQGC Initial empty Snap project.
  • [13] PBD7LZYQ Postgres & auth are beginning to function.
  • [14] OBFPJS2G Project successfully builds and tests under nix.

Change contents

  • edit in .gitignore at line 1
    [4.135]
    [4.140]
    shell.nix
  • edit in .gitignore at line 3
    [4.161]
    [4.1]
    .cabal-sandbox
    Setup
  • edit in .gitignore at line 7
    [4.7][4.1:7]()
    *.cfg
  • edit in .gitignore at line 8
    [4.17][4.23:29]()
    Setup
  • replacement in .gitignore at line 9
    [4.9][4.9:24]()
    .cabal-sandbox
    [4.9]
    [4.24]
    conf/*.cfg
    conf/*.pem
    conf/site_key.txt
  • edit in .gitignore at line 15
    [4.33][4.33:36](),[4.36][4.1:14](),[4.29][4.1:14]()
    db
    local
    stable
  • edit in .gitignore at line 16
    [4.36][4.36:49](),[4.49][4.37:47]()
    site_key.txt
    shell.nix
  • replacement in INSTALL.md at line 27
    [3.828][3.828:1326]()
    used for encryption of cookies and so forth:
    mkdir local
    cd local
    openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodes
    cd <project_root>
    echo 'sslCert = "local/cert.pem"' > aftok.cfg
    echo 'siteKey = "local/key.pem"' >> aftok.cfg
    If you want to run on a port other than 8000, you can set 'port = 12345' in that
    aftok.cfg file.
    Next, we'll want to run the server in order to autogenerate the files that need
    to be edited to configure postgres:
    cabal run aftok-server
    [3.828]
    [3.1326]
    used 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
    [3.1327][3.1327:1493]()
    I can't remember whether this will succeed or fail to start, but in any case
    once it has run you should be able to find the file
    snaplets/postgresql-simple/devel.cfg
    [3.1327]
    [3.1493]
    openssl req -x509 -newkey rsa:2048 -keyout conf/key.pem -out conf/cert.pem -days 365 -nodes
  • replacement in INSTALL.md at line 32
    [3.1494][3.1494:1553]()
    Edit this file to set the database connection information:
    [3.1494]
    [3.1553]
    Next, copy the example config file into place and edit it to provide the port you want
    the service to run on, and your postgres database connection information.
  • replacement in INSTALL.md at line 35
    [3.1554][3.1554:1626]()
    host = "localhost"
    port = 5432
    user = "aftok"
    pass = "???"
    db = "aftok"
    [3.1554]
    [3.1626]
    cp conf/aftok.cfg.example conf/aftok.cfg
    vi conf/aftok.cfg
  • edit in INSTALL.md at line 47
    [3.2202][3.2202:2204]()
  • replacement in conf/aftok.cfg.example at line 1
    [4.19][2.653:677](),[2.677][4.47:59](),[4.47][4.47:59]()
    db = "db/aftok-test.db"
    port = 8080
    [4.19]
    port = 8000
    sslCert = "conf/cert.pem"
    siteKey = "conf/key.pem"
    db {
    host = "localhost"
    port = 5432
    user = "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
    [4.8195][2.3269:3302]()
    cfg <- loadQConfig "aftok.cfg"
    [4.8195]
    [4.8231]
    cfg <- loadQConfig "conf/aftok.cfg"