mirror of
https://github.com/m1k1o/neko.git
synced 2026-11-03 00:11:48 -06:00
cookie add domain & path, change expiration to duration from seconds.
This commit is contained in:
@@ -349,16 +349,21 @@ If you disable the cookies, the token will be sent to the client in the login re
|
||||
```yaml title="config.yaml"
|
||||
session:
|
||||
cookie:
|
||||
# Whether the cookies are enabled or not.
|
||||
enabled: true
|
||||
# Name of the cookie used to store the session.
|
||||
name: "NEKO_SESSION"
|
||||
# Expiration time of the cookie in seconds.
|
||||
expiration: 86400
|
||||
# Whether the cookie is secure (HTTPS only) or not.
|
||||
expiration: "24h"
|
||||
secure: true
|
||||
http_only: true
|
||||
domain: ""
|
||||
path: ""
|
||||
```
|
||||
|
||||
- `enabled` - Whether the cookies are enabled or not.
|
||||
- `name` - Name of the cookie used to store the session.
|
||||
- `expiration` - Expiration time of the cookie, use [go duration format](https://pkg.go.dev/time#ParseDuration) (e.g., `24h`, `1h30m`, `60m`).
|
||||
- `secure` and `http_only` - Ensures that the cookie is only sent over HTTPS and cannot be accessed by JavaScript, see [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#block_access_to_your_cookies) for more information.
|
||||
- `domain` and `path` - Define where the cookie is valid, see [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#define_where_cookies_are_sent) for more information.
|
||||
|
||||
:::info
|
||||
The `session.cookie.secure` is set to `true` by default, which means that the cookie is only sent over HTTPS. If you are using HTTP, you should really consider using HTTPS. Only for testing and development purposes should you consider setting it to `false`.
|
||||
The `secure` and `http_only` are set to `true` by default, which means that the cookie is only sent over HTTPS. If you are using HTTP, you should really consider using HTTPS. Only for testing and development purposes should you consider setting it to `false`.
|
||||
:::
|
||||
|
||||
@@ -486,6 +486,15 @@
|
||||
"defaultValue": "true",
|
||||
"description": "users can gain control only if at least one admin is in the room"
|
||||
},
|
||||
{
|
||||
"key": [
|
||||
"session",
|
||||
"cookie",
|
||||
"domain"
|
||||
],
|
||||
"type": "string",
|
||||
"description": "domain of the cookie"
|
||||
},
|
||||
{
|
||||
"key": [
|
||||
"session",
|
||||
@@ -502,9 +511,19 @@
|
||||
"cookie",
|
||||
"expiration"
|
||||
],
|
||||
"type": "int",
|
||||
"defaultValue": "8760",
|
||||
"description": "expiration of the cookie in hours"
|
||||
"type": "duration",
|
||||
"defaultValue": "24h0m0s",
|
||||
"description": "expiration of the cookie"
|
||||
},
|
||||
{
|
||||
"key": [
|
||||
"session",
|
||||
"cookie",
|
||||
"http_only"
|
||||
],
|
||||
"type": "boolean",
|
||||
"defaultValue": "true",
|
||||
"description": "use http only cookies"
|
||||
},
|
||||
{
|
||||
"key": [
|
||||
@@ -516,6 +535,15 @@
|
||||
"defaultValue": "NEKO_SESSION",
|
||||
"description": "name of the cookie that holds token"
|
||||
},
|
||||
{
|
||||
"key": [
|
||||
"session",
|
||||
"cookie",
|
||||
"path"
|
||||
],
|
||||
"type": "string",
|
||||
"description": "path of the cookie"
|
||||
},
|
||||
{
|
||||
"key": [
|
||||
"session",
|
||||
|
||||
@@ -50,9 +50,12 @@
|
||||
--server.static string path to neko client files to serve
|
||||
--session.api_token string API token for interacting with external services
|
||||
--session.control_protection users can gain control only if at least one admin is in the room
|
||||
--session.cookie.domain string domain of the cookie
|
||||
--session.cookie.enabled whether cookies authentication should be enabled (default true)
|
||||
--session.cookie.expiration int expiration of the cookie in hours (default 8760)
|
||||
--session.cookie.expiration duration expiration of the cookie (default 24h0m0s)
|
||||
--session.cookie.http_only use http only cookies (default true)
|
||||
--session.cookie.name string name of the cookie that holds token (default "NEKO_SESSION")
|
||||
--session.cookie.path string path of the cookie
|
||||
--session.cookie.secure use secure cookies (default true)
|
||||
--session.file string if sessions should be stored in a file, otherwise they will be stored only in memory
|
||||
--session.heartbeat_interval int interval in seconds for sending heartbeat messages (default 120)
|
||||
|
||||
Reference in New Issue
Block a user