update readme

This commit is contained in:
Your Name
2025-05-25 10:52:12 +12:00
parent 614ffc9019
commit 70ebbd64e6
2 changed files with 26 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ Write access is controlled by tokens.
Public read actions:
### Retrieve Object
- Objects are access via a label and tag, or via their hash. For example:
- `wget http://localhost:8123/object/squashkiwi:latest`
- `wget http://localhost:8123/object/4528400792837739857`
@@ -18,33 +19,51 @@ Public read actions:
- `curl http://localhost:8123/exists/squashkiwi:latest`
- `curl http://localhost:8123/exists/4528400792837739857`
### Retrieve Hash
- You can retrieve the hash for a given label and tag with, e.g.:
- `curl http://localhost:8123/hash/squashkiwi:latest`
### List Store Contents
- you can get a full list of {label:tag,hash} entries (one tag per entry) with:
- `curl http://localhost:8123/dir`
### Retrieve Metadata
- get all metadata for a tag:
- `curl http://localhost:8123/meta/squashkiwi:latest`
### Service Status Check
- quick status check:
- `curl http://localhost:8123/status`
Write actions:
- to upload a file (via http put)
- `curl -T object_file http://localhost:8123/upload?token="WRITE_TOKEN"\&labeltag="LABEL:TAG"\&filename="FILENAME"`
- the object_file is uploaded, hashed, added to the registry (if that hash doesn't already exist), and {label:tag,hash} is added to the directory index.
### Upload Object
- to upload a file (via http put)
```
curl -X PUT \
-H "Content-Type: application/json" \
-d '{
"label": "example",
"filename": "example.txt",
"description": "Example file",
"tags": ["test", "example"],
"custom_field": "custom value"
}' \
"http://localhost:8123/upload?token=YOUR_TOKEN"
```
- the object_file is uploaded, hashed, added to the registry (if that hash doesn't already exist), and {label:tag,hash} entries are added to the directory index.
- matching tags on older versions are removed.
### Delete Tag
- to delete a label/tag (object remains):
- `curl http://localhost:8123/deletetag?token="WRITE_TOKEN"\&labeltag="LABEL:TAG"`
### Delete Object
- to delete an object (and all tags on that object):
- `curl http://localhost:8123/deleteobject?token="WRITE_TOKEN"\&hash="HASH"`
- add a tag to an existing object:
- `curl http://localhost:8123/appendtag?token="WRITE_TOKEN"\&hash="HASH"\&labeltag="LABEL:TAG"`
## Configuration
- the server is configured via ~/.config/simple_object_storage/config.json which allows setting:
- the list of write access tokens
- the location for the object store (path on disk)

View File

@@ -58,7 +58,7 @@ fi
# Ensure the builder is used
docker buildx use sosbuilder
echo "Building multi-platform Docker image"
docker buildx build --push -t gitea.jde.nz/j/simple-object-storage:latest --platform linux/amd64,linux/arm64 .
docker buildx build --push -t gitea.jde.nz/public/simple-object-storage:latest --platform linux/amd64,linux/arm64 .
echo "Build completed successfully!"