imp:web: cleanups; use --allow on Sandstorm (#834)

This commit is contained in:
Simon Michael 2023-10-23 09:57:29 +01:00
parent 95d33f20f6
commit 795dbd97f8
3 changed files with 8 additions and 7 deletions

View File

@ -29,4 +29,4 @@ set -euo pipefail
mkdir -p /var/lib/hledger
touch /var/lib/hledger/Ledger
cd /var
hledger-web --capabilities-header=X-Sandstorm-Permissions --serve --base-url='' -f /var/lib/hledger/Ledger --port 8000
hledger-web --allow=sandstorm --serve --base-url='' -f /var/lib/hledger/Ledger --port 8000

View File

@ -45,6 +45,11 @@ webflags =
["serve-api"]
(setboolopt "serve-api")
"like --serve, but serve only the JSON web API, without the server-side web UI"
, flagReq
["allow"]
(\s opts -> Right $ setopt "allow" s opts)
"view|add|edit"
"set the user's access level for changing data (default: `add`). It also accepts `sandstorm` for use on that platform (reads permissions from the `X-Sandstorm-Permissions` request header)."
, flagReq
["cors"]
(\s opts -> Right $ setopt "cors" s opts)
@ -75,11 +80,6 @@ webflags =
(\s opts -> Right $ setopt "file-url" s opts)
"FILEURL"
"set the static files url (default: BASEURL/static)"
, flagReq
["allow"]
(\s opts -> Right $ setopt "allow" s opts)
"view|add|edit"
"set the user's access level for changing data (default: `add`). (There is also `sandstorm`, used when running on Sandstorm.)"
, flagNone
["test"]
(setboolopt "test")

View File

@ -96,7 +96,8 @@ serve them from another server for efficiency, you would set the url with this.
`--allow=view|add|edit`
: set the user's access level for changing data (default: `add`).
(There is also `sandstorm`, used when running on the Sandstorm app platform.)
It also accepts `sandstorm` for use on that platform (reads
permissions from the `X-Sandstorm-Permissions` request header).
`--test`
: run hledger-web's tests and exit. hspec test runner args may follow a --, eg: hledger-web --test -- --help