-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yml
More file actions
63 lines (52 loc) · 2.56 KB
/
Copy pathconfig.yml
File metadata and controls
63 lines (52 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# This is the main configuration file of your Dancer2 app
# env-related settings should go to environments/$env.yml
# all the settings in this file will be loaded at Dancer's startup.
# === Basic configuration ===
# Your application's name
appname: "HSSB::LockoutBoard"
# The default layout to use for your application (located in
# views/layouts/main.tt)
layout: "main"
# when the charset is set to UTF-8 Dancer2 will handle for you
# all the magic of encoding and decoding. You should not care
# about unicode within your app when this setting is set (recommended).
charset: "UTF-8"
# === Engines ===
#
# NOTE: All the engine configurations need to be under a single "engines:"
# key. If you uncomment engine configurations below, make sure to delete
# all "engines:" lines except the first. Otherwise, only the last
# "engines:" block will take effect.
# template engine
# simple: default and very basic template engine
# template_toolkit: TT
#template: "simple"
template: "template_toolkit"
session: "YAML"
engines:
template:
template_toolkit:
# Note: start_tag and end_tag are regexes
start_tag: '<%'
end_tag: '%>'
session:
YAML:
session_dir: "data/sessions"
cookie_duration: 86400
plugins:
Auth::Extensible:
login_without_redirect: 0
realms:
users:
provider: 'Database'
Database:
driver: SQLite
database: 'data/boards.sqlite'
on_connect_do:
- 'create table if not exists boards ( board varchar(32) primary key, name varchar(115), state varchar(15) not null )'
- 'create table if not exists boardobjectives ( board varchar(32) NOT NULL, objective_index integer not null, objective text not null, captured_by varchar(32), capture_utctime integer, primary key ( board, objective_index ))'
- 'create table if not exists teammembers ( board varchar(32) not null, team int not null, player varchar(32) not null, primary key (board, team, player) )'
- 'CREATE TABLE if not exists users ( id INTEGER PRIMARY KEY AUTOINCREMENT, username VARCHAR(32) NOT NULL UNIQUE, password VARCHAR(40) NOT NULL)'
- 'CREATE TABLE if not exists roles ( id INTEGER PRIMARY KEY AUTOINCREMENT, role VARCHAR(32) NOT NULL)'
- 'CREATE TABLE if not exists user_roles ( user_id INTEGER NOT NULL, role_id INTEGER NOT NULL, primary key (user_id, role_id))'
- 'create view if not exists scored_board as select b.board, b.objective_index, b.objective, b.captured_by, b.capture_utctime, t.team as captured_by_team from boardobjectives as b left join teammembers as t on b.board = t.board and b.captured_by = t.player'