1GB test updated.
This commit is contained in:
52
README.md
52
README.md
@@ -12,52 +12,70 @@ 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:
|
||||
- Objects are accessed via a label and tag, or via their hash. For example:
|
||||
- `wget http://localhost:8123/object/squashkiwi:latest`
|
||||
- `wget http://localhost:8123/object/4528400792837739857`
|
||||
|
||||
### Check Object Existence
|
||||
- Check if an object exists by label:tag or hash:
|
||||
- `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.:
|
||||
- Get the hash for a given label and tag:
|
||||
- `curl http://localhost:8123/hash/squashkiwi:latest`
|
||||
- Response format: `{"result":"success","hash":"4528400792837739857"}`
|
||||
|
||||
### List Store Contents
|
||||
- you can get a full list of {label:tag,hash} entries (one tag per entry) with:
|
||||
- Get a full list of {label:tag,hash} entries:
|
||||
- `curl http://localhost:8123/dir`
|
||||
- Response format: `{"result":"success","entries":[{"label_tag":"example:latest","hash":"4528400792837739857"}]}`
|
||||
|
||||
### Retrieve Metadata
|
||||
- get all metadata for a tag:
|
||||
- Get all metadata for a tag:
|
||||
- `curl http://localhost:8123/meta/squashkiwi:latest`
|
||||
- Response format: `{"result":"success","metadata":{"description":"Example file","tags":["test","example"],"custom_field":"custom value"}}`
|
||||
|
||||
### Service Status Check
|
||||
- quick status check:
|
||||
- `curl http://localhost:8123/status`
|
||||
|
||||
Write actions:
|
||||
- Quick status check:
|
||||
- `curl http://localhost:8123/status`
|
||||
- Response format: `{"result":"success","status":"ok"}`
|
||||
|
||||
## Write actions (require authentication):
|
||||
|
||||
### Upload Object
|
||||
- to upload a file (via http put)
|
||||
```
|
||||
- Upload a file with metadata (via HTTP PUT):
|
||||
```bash
|
||||
curl -X PUT \
|
||||
-H "Authorization: Bearer YOUR_TOKEN" \
|
||||
-F "file=@/path/to/your/file.txt" \
|
||||
-F 'metadata={"labeltag":"example:latest","description":"Example file","tags":["test","example"],"custom_field":"custom value"}' \
|
||||
"http://localhost:8123/upload"
|
||||
```
|
||||
- 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.
|
||||
- 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.
|
||||
- Response format: `{"result":"success","hash":"4528400792837739857"}`
|
||||
|
||||
### Delete Object
|
||||
- to delete an object (and all tags on that object):
|
||||
- `curl http://localhost:8123/deleteobject?token="WRITE_TOKEN"\&hash="HASH"`
|
||||
- Delete an object and all its tags:
|
||||
- `curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:8123/deleteobject?hash=4528400792837739857`
|
||||
- Response format: `{"result":"success"}`
|
||||
|
||||
## 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)
|
||||
- The server is configured via `~/.config/simple_object_storage/config.json` which allows setting:
|
||||
- `write_tokens`: List of valid write access tokens
|
||||
- `object_store_path`: Location for the object store (path on disk)
|
||||
- `host`: Server host (default: "0.0.0.0")
|
||||
- `port`: Server port (default: 8123)
|
||||
|
||||
Example config.json:
|
||||
```json
|
||||
{
|
||||
"write_tokens": ["your-secret-token-1", "your-secret-token-2"],
|
||||
"object_store_path": "/data/storage",
|
||||
"host": "0.0.0.0",
|
||||
"port": 8123
|
||||
}
|
||||
```
|
||||
|
||||
Dockcross is used to cross-build for both 64-bit x86 and arm64 (combining both into one docker container image).
|
||||
|
Reference in New Issue
Block a user