2020-05-16 01:10:11 +02:00
|
|
|
# smr configuration
|
|
|
|
|
|
|
|
server tls {
|
2021-01-04 03:48:29 +01:00
|
|
|
bind 0.0.0.0 <{get port}>
|
|
|
|
|
2020-05-16 01:10:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
seccomp_tracing yes
|
|
|
|
load ./smr.so
|
2021-01-04 03:48:29 +01:00
|
|
|
root <{get kore_chroot}>
|
|
|
|
|
|
|
|
runas <{get chuser }>
|
|
|
|
|
|
|
|
keymgr_runas <{get chuser }>
|
|
|
|
|
2020-08-13 19:59:33 +02:00
|
|
|
keymgr_root .
|
2020-05-16 01:10:11 +02:00
|
|
|
workers 1
|
|
|
|
|
|
|
|
http_body_max 8388608
|
|
|
|
|
|
|
|
tls_dhparam dh2048.pem
|
|
|
|
|
2020-12-23 07:07:00 +01:00
|
|
|
validator v_any regex [\s\S]*
|
2020-12-24 05:09:38 +01:00
|
|
|
validator v_storyid regex [a-zA-Z0-9$+!*'(),-]+
|
2020-05-16 01:10:11 +02:00
|
|
|
validator v_subdomain regex [a-z0-9]{1,30}
|
|
|
|
validator v_markup regex (plain|imageboard)
|
2020-08-13 19:59:33 +02:00
|
|
|
validator v_bool regex (0|1)
|
2021-01-10 22:34:13 +01:00
|
|
|
validator v_checkbox regex (|on)
|
|
|
|
validator v_hex_128 regex [0-9a-f]{128}
|
2021-02-03 04:41:22 +01:00
|
|
|
validator v_time regex [0-9]+
|
2020-05-16 01:10:11 +02:00
|
|
|
|
|
|
|
domain * {
|
|
|
|
attach tls
|
|
|
|
|
2020-08-13 19:59:33 +02:00
|
|
|
certfile cert/server.pem
|
|
|
|
certkey cert/key.pem
|
2020-05-16 01:10:11 +02:00
|
|
|
|
|
|
|
#I run kore behind a lighttpd reverse proxy, so this is a bit useless to me
|
2020-05-17 18:05:00 +02:00
|
|
|
accesslog /dev/null
|
2020-05-16 01:10:11 +02:00
|
|
|
|
|
|
|
route / home
|
|
|
|
route /_css/style.css asset_serve_style_css
|
2021-02-22 07:59:51 +01:00
|
|
|
route /_css/suggest_tags.css asset_serve_suggest_tags_css
|
2020-05-16 01:10:11 +02:00
|
|
|
route /_css/milligram.css asset_serve_milligram_css
|
|
|
|
route /_css/milligram.min.css.map asset_serve_milligram_min_css_map
|
2020-12-28 05:01:07 +01:00
|
|
|
route /_faq asset_serve_faq_html
|
2021-02-14 08:30:20 +01:00
|
|
|
route /_js/suggest_tags.js asset_serve_suggest_tags_js
|
2020-05-16 01:10:11 +02:00
|
|
|
route /favicon.ico asset_serve_favicon_ico
|
|
|
|
route /_paste post_story
|
|
|
|
route /_edit edit_story
|
|
|
|
route /_bio edit_bio
|
|
|
|
route /_login login
|
2021-01-11 04:34:22 +01:00
|
|
|
route /_logout logout
|
2020-12-23 07:07:00 +01:00
|
|
|
route ^/_claim claim
|
2020-08-13 19:59:33 +02:00
|
|
|
route /_download download
|
2020-08-24 23:38:24 +02:00
|
|
|
route /_preview preview
|
2020-10-11 01:28:39 +02:00
|
|
|
route /_search search
|
2021-02-03 04:41:22 +01:00
|
|
|
route /_archive archive
|
2021-02-14 08:30:20 +01:00
|
|
|
route /_api api
|
2020-05-16 01:10:11 +02:00
|
|
|
# Leading ^ is needed for dynamic routes, kore says the route is dynamic if it does not start with '/'
|
|
|
|
route ^/[^_].* read_story
|
|
|
|
|
|
|
|
params get /_edit {
|
|
|
|
validate story v_storyid
|
|
|
|
}
|
2020-08-13 19:59:33 +02:00
|
|
|
params get /_download {
|
|
|
|
validate story v_storyid
|
2021-01-11 04:34:22 +01:00
|
|
|
validate pwd v_hex_128
|
2020-08-13 19:59:33 +02:00
|
|
|
}
|
2020-05-16 01:10:11 +02:00
|
|
|
params post /_edit {
|
|
|
|
validate title v_any
|
|
|
|
validate story v_storyid
|
|
|
|
validate text v_any
|
|
|
|
validate pasteas v_subdomain
|
|
|
|
validate markup v_markup
|
2020-10-11 01:28:39 +02:00
|
|
|
validate tags v_any
|
2021-01-10 22:34:13 +01:00
|
|
|
validate unlisted v_checkbox
|
2020-05-16 01:10:11 +02:00
|
|
|
}
|
|
|
|
params post /_paste {
|
|
|
|
validate title v_any
|
|
|
|
validate text v_any
|
|
|
|
validate pasteas v_subdomain
|
|
|
|
validate markup v_markup
|
2020-10-11 01:28:39 +02:00
|
|
|
validate tags v_any
|
2021-01-10 22:34:13 +01:00
|
|
|
validate unlisted v_checkbox
|
2020-05-16 01:10:11 +02:00
|
|
|
}
|
2020-08-24 23:38:24 +02:00
|
|
|
params post /_preview {
|
|
|
|
validate title v_any
|
|
|
|
validate text v_any
|
|
|
|
validate pasteas v_subdomain
|
|
|
|
validate markup v_markup
|
2020-10-11 01:28:39 +02:00
|
|
|
validate tags v_any
|
2021-01-10 22:34:13 +01:00
|
|
|
validate unlisted v_checkbox
|
2020-10-11 01:28:39 +02:00
|
|
|
}
|
|
|
|
params get /_search {
|
2020-12-28 05:01:07 +01:00
|
|
|
validate q v_any
|
2020-08-24 23:38:24 +02:00
|
|
|
}
|
2021-02-03 04:41:22 +01:00
|
|
|
params get /_archive {
|
|
|
|
validate t v_time
|
|
|
|
}
|
2020-08-13 19:59:33 +02:00
|
|
|
params get ^/[^_].* {
|
|
|
|
validate comments v_bool
|
2021-01-10 22:34:13 +01:00
|
|
|
validate pwd v_hex_128
|
2020-08-13 19:59:33 +02:00
|
|
|
}
|
|
|
|
params post ^/[^_].* {
|
|
|
|
validate text v_any
|
|
|
|
validate postas v_subdomain
|
2021-01-11 04:34:22 +01:00
|
|
|
validate pwd v_hex_128
|
2020-08-13 19:59:33 +02:00
|
|
|
}
|
2020-05-16 01:10:11 +02:00
|
|
|
params post /_login {
|
|
|
|
validate user v_subdomain
|
|
|
|
validate pass v_any
|
|
|
|
}
|
2020-12-23 07:07:00 +01:00
|
|
|
params post ^/_claim {
|
2020-08-13 21:29:18 +02:00
|
|
|
validate user v_subdomain
|
2020-05-16 01:10:11 +02:00
|
|
|
}
|
2021-02-14 08:30:20 +01:00
|
|
|
params get /_api {
|
|
|
|
validate call v_any
|
|
|
|
validate data v_any
|
|
|
|
}
|
2020-05-16 01:10:11 +02:00
|
|
|
}
|