Skip to content

Commit

Permalink
imp:web: cleanups; use --allow on Sandstorm (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Oct 24, 2023
1 parent 95d33f2 commit 795dbd9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .sandstorm/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions hledger-web/Hledger/Web/WebOptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion hledger-web/hledger-web.m4.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 795dbd9

Please sign in to comment.