Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
srerickson committed Mar 12, 2024
1 parent 2d53c4f commit 865c746
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 24 deletions.
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,8 @@ and S3 backends are supported.

## Server

The server is distributed as a container image
([srerickson/chaparral](https://hub.docker.com/repository/docker/srerickson/chaparral/general)).
To run chaparral on :8080 using `hack/data` for persistence:

```sh
docker run --rm -v $(pwd)/hack/data:/data -p 8080:8080 srerickson/chaparral:latest
```

On first run, a new default OCFL storage root is initialized if one doesn't
exist. In addition, the server will create a new sqlite3 database for internal
state and an RSA key for signing auth tokens.

See [`config.yaml`](config.yaml) for configuration options.
The server is distributed as a container image: [srerickson/chaparral](https://hub.docker.com/repository/docker/srerickson/chaparral/general)).
See [`config.yaml`](config.yaml) for an example configuration

## API

Expand Down
25 changes: 16 additions & 9 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ uploads: "uploads"
# doesn't exist, it will be created using values in `init`. Additional storage
# roots can be added, but they need to include a unique, non-empty `id` value.
roots:
- id: "public"
path: "public"
init:
description: "public"
layout: "0003-hash-and-id-n-tuple-storage-layout"

- id: "main"
path: "ocfl-default" # path relative to backend (CHAPARRAL_BACKEND)
init:
Expand All @@ -54,13 +60,14 @@ roots:
#
# The "default" permission is used to set base permissions for all users,
# including un-authenticated requests.
# permissions:
# default: {} # no access by default
# roles:
# # members can read any object in the 'main' storage root
# chaparral_member:
# read_object: ["main::*"]
permissions:
default:
read_object: ["public::*"]
roles:
# members can read any object in the 'main' storage root
chaparral_member:
read_object: ["main::*"]

# # admins can do any action to any resource
# chaparral_admin:
# "*": ["*::*"]
# admins can do any action to any resource
chaparral_admin:
"*": ["*::*"]
2 changes: 1 addition & 1 deletion hack/start.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# start a local server
echo "starting server..."
CHAPARRAL_BACKEND=file://hack/data \
CHAPARRAL_PUBKEY_FILE='hack/data/pub.pem' \
CHAPARRAL_PUBKEY_FILE='hack/data/auth-pub.pem' \
CHAPARRAL_DB=hack/data/chaparral.sqlite3 \
CHAPARRAL_LISTEN=":8080" \
CHAPARRAL_DEBUG=true \
Expand Down
2 changes: 1 addition & 1 deletion hack/token.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PEM_FILE='hack/data/chaparral.pem' # will be created
PEM_FILE='hack/data/auth.pem'
USER_ID="1"
USER_EMAIL="[email protected]"
USER_NAME="test user"
Expand Down

0 comments on commit 865c746

Please sign in to comment.