extract secrets to env, use docker compose
This commit is contained in:
parent
14ba148284
commit
c8300f5978
16 changed files with 186 additions and 133 deletions
|
|
@ -18,10 +18,14 @@ import web/components/control
|
|||
import web/router
|
||||
import wisp
|
||||
import wisp/wisp_mist
|
||||
import envoy
|
||||
|
||||
pub fn main() {
|
||||
wisp.configure_logger()
|
||||
|
||||
let assert Ok(sha_api_key) = envoy.get("SHAED_API_KEY")
|
||||
let assert Ok(secret) = envoy.get("QTERM_SECRET")
|
||||
|
||||
let assert Ok(state_handler) = statehandler.initialize()
|
||||
let assert Ok(room_handler) = roomhandler.initialize(state_handler)
|
||||
|
||||
|
|
@ -48,7 +52,7 @@ pub fn main() {
|
|||
room_handler,
|
||||
)
|
||||
["socket", "single", id, pin] ->
|
||||
sockethandler.serve_slow(
|
||||
sockethandler.serve_single(
|
||||
req,
|
||||
answerlist.component(),
|
||||
id,
|
||||
|
|
@ -58,8 +62,8 @@ pub fn main() {
|
|||
)
|
||||
_ ->
|
||||
wisp_mist.handler(
|
||||
router.handle_request(room_handler, state_handler, _),
|
||||
"very_secret",
|
||||
router.handle_request(sha_api_key, room_handler, state_handler, _),
|
||||
secret,
|
||||
)(req)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue