diff options
Diffstat (limited to '')
| -rw-r--r-- | webd/src/session.rs | 7 | ||||
| -rw-r--r-- | webd/zagan-bet-webd.service | 20 |
2 files changed, 26 insertions, 1 deletions
diff --git a/webd/src/session.rs b/webd/src/session.rs index 8a20721..3b34f47 100644 --- a/webd/src/session.rs +++ b/webd/src/session.rs | |||
| @@ -575,7 +575,12 @@ mod tests { | |||
| 575 | let id = "a".repeat(64); | 575 | let id = "a".repeat(64); |
| 576 | assert_eq!( | 576 | assert_eq!( |
| 577 | cookie_id(&format!("other=1; {COOKIE_NAME}={id}; theme=dark")), | 577 | cookie_id(&format!("other=1; {COOKIE_NAME}={id}; theme=dark")), |
| 578 | Some(id) | 578 | Some(id.clone()) |
| 579 | ); | ||
| 580 | assert_eq!( | ||
| 581 | cookie_id(&format!("{HOST_COOKIE_NAME}={id}")), | ||
| 582 | Some(id), | ||
| 583 | "the secure __Host- name is accepted" | ||
| 579 | ); | 584 | ); |
| 580 | assert_eq!(cookie_id(&format!("{COOKIE_NAME}=short")), None); | 585 | assert_eq!(cookie_id(&format!("{COOKIE_NAME}=short")), None); |
| 581 | assert_eq!(cookie_id("other=1"), None); | 586 | assert_eq!(cookie_id("other=1"), None); |
diff --git a/webd/zagan-bet-webd.service b/webd/zagan-bet-webd.service new file mode 100644 index 0000000..58bec71 --- /dev/null +++ b/webd/zagan-bet-webd.service | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | [Unit] | ||
| 2 | Description=zagan-bet browser gateway | ||
| 3 | After=network-online.target | ||
| 4 | Wants=network-online.target | ||
| 5 | |||
| 6 | [Service] | ||
| 7 | Type=simple | ||
| 8 | User=zagan | ||
| 9 | Group=zagan | ||
| 10 | EnvironmentFile=/etc/zagan-bet-webd.env | ||
| 11 | ExecStart=/usr/local/bin/zagan-bet-webd | ||
| 12 | Restart=on-failure | ||
| 13 | RestartSec=2 | ||
| 14 | NoNewPrivileges=true | ||
| 15 | PrivateTmp=true | ||
| 16 | ProtectSystem=strict | ||
| 17 | ProtectHome=true | ||
| 18 | |||
| 19 | [Install] | ||
| 20 | WantedBy=multi-user.target | ||
