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
|
2021-01-04 03:48:29 +01:00
|
|
|
|
2022-06-27 01:09:28 +02:00
|
|
|
privsep worker {
|
|
|
|
runas <{get chuser }>
|
|
|
|
|
|
|
|
root <{get kore_chroot }>
|
|
|
|
|
|
|
|
}
|
|
|
|
privsep keymgr {
|
|
|
|
runas <{get chuser }>
|
|
|
|
|
|
|
|
root .
|
|
|
|
}
|
2021-01-04 03:48:29 +01:00
|
|
|
|
2022-06-27 01:09:28 +02:00
|
|
|
load ./smr.so
|
2021-01-04 03:48:29 +01:00
|
|
|
|
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
|
|
|
|
2022-06-27 01:09:28 +02:00
|
|
|
route / {
|
|
|
|
handler home
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_css/style.css {
|
|
|
|
handler asset_serve_style_css
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_css/suggest_tags.css {
|
|
|
|
handler asset_serve_style_css
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_css/milligram.css {
|
|
|
|
handler asset_serve_milligram_css
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_css/milligram.min.css.map {
|
|
|
|
handler asset_serve_milligram_min_css_map
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_faq {
|
|
|
|
handler asset_serve_faq_html
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_js/suggest_tags.js {
|
|
|
|
handler asset_serve_suggest_tags_js
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_js/bookmark.js {
|
|
|
|
handler asset_serve_bookmark_js
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_js/intervine_deletion.js {
|
|
|
|
handler asset_serve_intervine_deletion_js
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route /favicon.ico {
|
|
|
|
handler asset_serve_favicon_ico
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_paste {
|
|
|
|
handler post_story
|
|
|
|
methods get post
|
|
|
|
|
|
|
|
validate post title v_any
|
|
|
|
validate post text v_any
|
|
|
|
validate post pasteas v_subdomain
|
|
|
|
validate post markup v_markup
|
|
|
|
validate post tags v_any
|
|
|
|
validate post unlisted v_checkbox
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_edit {
|
|
|
|
handler edit_story
|
|
|
|
methods get post
|
|
|
|
|
|
|
|
validate qs:get story v_storyid
|
|
|
|
|
|
|
|
validate post title v_any
|
|
|
|
validate post story v_storyid
|
|
|
|
validate post text v_any
|
|
|
|
validate post pasteas v_subdomain
|
|
|
|
validate post markup v_markup
|
|
|
|
validate post tags v_any
|
|
|
|
validate post unlisted v_checkbox
|
|
|
|
}
|
2022-09-03 01:22:47 +02:00
|
|
|
|
2022-06-27 01:09:28 +02:00
|
|
|
route /_bio {
|
|
|
|
handler edit_bio
|
2022-09-03 01:22:47 +02:00
|
|
|
methods get post
|
|
|
|
|
|
|
|
validate post text v_any
|
2022-11-21 01:32:49 +01:00
|
|
|
validate post author v_subdomain
|
2022-06-27 01:09:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
route /_login {
|
|
|
|
handler login
|
|
|
|
methods get post
|
|
|
|
|
2022-09-03 01:22:47 +02:00
|
|
|
validate post user v_subdomain
|
|
|
|
validate post pass v_any
|
2022-06-27 01:09:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
route /_logout {
|
|
|
|
handler logout
|
|
|
|
methods get
|
|
|
|
}
|
|
|
|
|
|
|
|
route ^/_claim {
|
|
|
|
handler claim
|
|
|
|
methods get post
|
|
|
|
|
|
|
|
validate post user v_subdomain
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_download {
|
|
|
|
handler download
|
|
|
|
methods get
|
|
|
|
|
|
|
|
validate qs:get story v_storyid
|
|
|
|
validate qs:get pwd v_hex_128
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_preview {
|
|
|
|
handler preview
|
|
|
|
methods post
|
|
|
|
|
|
|
|
validate post title v_any
|
|
|
|
validate post text v_any
|
|
|
|
validate post pasteas v_subdomain
|
|
|
|
validate post markup v_markup
|
|
|
|
validate post tags v_any
|
|
|
|
validate post unlisted v_checkbox
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_search {
|
|
|
|
handler search
|
|
|
|
methods get
|
|
|
|
|
|
|
|
validate qs:get q v_any
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_archive {
|
|
|
|
handler archive
|
|
|
|
methods get
|
|
|
|
|
|
|
|
validate qs:get t v_time
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_api {
|
|
|
|
handler api
|
|
|
|
methods get
|
|
|
|
|
|
|
|
validate qs:get call v_any
|
|
|
|
validate qs:get data v_any
|
|
|
|
}
|
|
|
|
|
|
|
|
route /_delete {
|
|
|
|
handler delete
|
|
|
|
methods post
|
|
|
|
|
|
|
|
validate post story v_storyid
|
|
|
|
}
|
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 '/'
|
2022-06-27 01:09:28 +02:00
|
|
|
route ^/[^_].* {
|
|
|
|
handler read_story
|
|
|
|
methods get post
|
|
|
|
|
|
|
|
validate qs:get comments v_bool
|
|
|
|
validate qs:get pwd v_hex_128
|
|
|
|
|
|
|
|
validate post text v_any
|
|
|
|
validate post postas v_subdomain
|
|
|
|
validate post pwd v_hex_128
|
2021-10-11 02:59:50 +02:00
|
|
|
}
|
2020-05-16 01:10:11 +02:00
|
|
|
}
|