2022-02-17 06:39:22 +01:00
|
|
|
# portal_user configuration
|
|
|
|
|
|
|
|
server notls {
|
2022-02-17 07:14:05 +01:00
|
|
|
bind 127.0.0.1 8888
|
2022-02-17 06:39:22 +01:00
|
|
|
tls no
|
|
|
|
}
|
|
|
|
|
2022-02-17 07:30:50 +01:00
|
|
|
load ./portal_user.so init
|
2022-02-17 06:39:22 +01:00
|
|
|
|
|
|
|
http_body_max 1024000000
|
|
|
|
http_body_disk_offload 1024000
|
|
|
|
|
|
|
|
workers 1
|
|
|
|
|
|
|
|
|
|
|
|
validator v_login regex ^[-_.a-zA-Z0-9]*$
|
|
|
|
validator v_password function v_password_func
|
2022-02-17 07:14:05 +01:00
|
|
|
validator v_session function v_session_validate
|
|
|
|
|
2022-02-17 06:39:22 +01:00
|
|
|
pledge wpath cpath flock
|
2022-02-17 07:14:05 +01:00
|
|
|
|
|
|
|
authentication auth_example {
|
|
|
|
authentication_type cookie
|
|
|
|
authentication_value session_id
|
|
|
|
authentication_validator v_session
|
|
|
|
authentication_uri /
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-04-09 23:17:01 +02:00
|
|
|
|
2022-02-17 06:39:22 +01:00
|
|
|
domain * {
|
|
|
|
attach notls
|
|
|
|
|
|
|
|
|
|
|
|
accesslog kore_access.log
|
|
|
|
|
|
|
|
|
2023-04-09 23:17:01 +02:00
|
|
|
route / {
|
|
|
|
handler portal_user_load
|
|
|
|
methods post get
|
|
|
|
validate post login v_login
|
|
|
|
validate post password v_password
|
|
|
|
}
|
2022-05-30 01:52:07 +02:00
|
|
|
|
2023-04-09 23:17:01 +02:00
|
|
|
route /css/style.css {
|
|
|
|
handler asset_serve_style_css
|
|
|
|
}
|
|
|
|
|
|
|
|
route /js/theme-switcher.js {
|
|
|
|
handler asset_serve_theme_switcher_js
|
|
|
|
}
|
|
|
|
|
|
|
|
route /signup {
|
|
|
|
handler create_user
|
2023-04-11 21:17:47 +02:00
|
|
|
methods get post
|
2023-04-09 23:17:01 +02:00
|
|
|
validate post login v_login
|
|
|
|
validate post password v_password
|
|
|
|
}
|
|
|
|
|
|
|
|
route /portal/bienvenue {
|
|
|
|
handler private_portal
|
|
|
|
authenticate auth_example
|
|
|
|
}
|
|
|
|
|
|
|
|
route /logout {
|
|
|
|
handler v_session_remove
|
2023-04-11 21:17:47 +02:00
|
|
|
authenticate auth_example
|
2023-04-09 23:17:01 +02:00
|
|
|
}
|
|
|
|
|
2022-02-17 06:39:22 +01:00
|
|
|
|
|
|
|
}
|
2023-04-11 21:17:47 +02:00
|
|
|
|