chore(docs): readme updates
This commit is contained in:
parent
fd7fa3b734
commit
9ff8a8f092
91
README.md
91
README.md
@ -1,72 +1,57 @@
|
||||
# 🌸 Blossom-server
|
||||
|
||||
blossom-server is a Typescript implementation of a [Blossom Server](https://github.com/hzrd149/blossom/blob/master/Server.md)
|
||||
[Blossom Server](https://git.nostrdev.com/stuff/blossom-cloudron) packaged to run as a [cloudron](https://www.cloudron.io/)app. Supports policies through the `/app/data/config.yaml` file.
|
||||
|
||||
## Supported BUDs
|
||||
The app is not yet in the Cloudron App Store, so for now you have to use the Cloudron CLI to install.
|
||||
|
||||
- BUD-01
|
||||
- `GET /<sha256>` Retrieve blob
|
||||
- `HEAD /<sha256>` Check blob
|
||||
- BUD-02
|
||||
- `PUT /upload` Upload blob
|
||||
- `GET /list<pubkey>` List blobs
|
||||
- `DELETE /<sha256>` Delete blob
|
||||
- BUD-04
|
||||
- `PUT /mirror` Mirror blob
|
||||
- BUD-06
|
||||
- `HEAD /upload` Upload check
|
||||
### Prerequisites
|
||||
|
||||
## Running with npx
|
||||
Install the [Cloudron CLI](https://docs.cloudron.io/packaging/cli/) - `npm install -g cloudron`
|
||||
|
||||
This app is also packaged as an npm module which you can easily run
|
||||
### Installation
|
||||
|
||||
```sh
|
||||
# copy the example config
|
||||
wget https://raw.githubusercontent.com/hzrd149/blossom-server/master/config.example.yml -O config.yml
|
||||
# run using npx
|
||||
npx blossom-server-ts
|
||||
```
|
||||
# Login with your cloudron credentials
|
||||
cloudron login your.instance.com
|
||||
|
||||
# Clone the project and change into it
|
||||
git clone https://git.nostrdev.com/stuff/blossom-cloudron
|
||||
cd blossom-cloudron
|
||||
|
||||
# Install latest version
|
||||
cloudron install --image git.nostrdev.com/stuff/blossom-cloudron:latest
|
||||
```
|
||||
|
||||
## Running with docker
|
||||
You will then be prompted for a location - so put the domain, eg `blossom.yourdomain.com`
|
||||
|
||||
An example config file can be found [here](./config.example.yml)
|
||||
## Configuration
|
||||
|
||||
```sh
|
||||
# create data volume
|
||||
docker volume create blossom_data
|
||||
# run container
|
||||
docker run -v blossom_data:/app/data -v $(pwd)/config.yml:/app/config.yml -p 3000:3000 ghcr.io/hzrd149/blossom-server:master
|
||||
The config file is under `/app/data/config.yml`
|
||||
|
||||
If you are using Blossom for a small subset of npubs, and don't need the discoverability feature, you could make the following changes:
|
||||
|
||||
```
|
||||
discovery:
|
||||
# find files by querying nostr relays
|
||||
nostr:
|
||||
enabled: false
|
||||
```
|
||||
|
||||
You can also run it using docker compose with the [`docker-compose.yml`](./docker-compose.yml) file
|
||||
and
|
||||
|
||||
## Running from source
|
||||
|
||||
This project uses [pnpm](https://pnpm.io/) to manage dependencies. It needs to be installed first in order to build the app
|
||||
|
||||
Next clone the repo, install the dependencies, and build
|
||||
|
||||
```sh
|
||||
git clone https://github.com/hzrd149/blossom-server.git
|
||||
cd blossom-server
|
||||
pnpm install
|
||||
cd admin && pnpm install && cd ../
|
||||
pnpm build
|
||||
```
|
||||
rules:
|
||||
# mime type of blob
|
||||
- type: "*"
|
||||
expiration: 2 years
|
||||
pubkeys:
|
||||
- "xxxnostrHEXkeyxxx" # comment
|
||||
```
|
||||
|
||||
Next copy the config and modify it
|
||||
and
|
||||
|
||||
```sh
|
||||
cp config.example.yml config.yml
|
||||
nano config.yml
|
||||
```
|
||||
|
||||
And finally start the app
|
||||
|
||||
```sh
|
||||
pnpm start
|
||||
# or
|
||||
node .
|
||||
upload:
|
||||
# only check rules that include "pubkeys"
|
||||
requirePubkeyInRule: true
|
||||
```
|
||||
|
||||
Once the server is running you can open `http://localhost:3000` to access the server
|
||||
|
Loading…
Reference in New Issue
Block a user