Compare commits
No commits in common. "3d1926a2a70e38cc3425166cbb4b5fabd0fc42de" and "0993d94294f4bae0a7f6d8bae5ecffbbc71cb544" have entirely different histories.
3d1926a2a7
...
0993d94294
91
README.md
91
README.md
@ -1,57 +1,72 @@
|
|||||||
# 🌸 Blossom-server
|
# 🌸 Blossom-server
|
||||||
|
|
||||||
[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.
|
blossom-server is a Typescript implementation of a [Blossom Server](https://github.com/hzrd149/blossom/blob/master/Server.md)
|
||||||
|
|
||||||
The app is not yet in the Cloudron App Store, so for now you have to use the Cloudron CLI to install.
|
## Supported BUDs
|
||||||
|
|
||||||
### Prerequisites
|
- 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
|
||||||
|
|
||||||
Install the [Cloudron CLI](https://docs.cloudron.io/packaging/cli/) - `npm install -g cloudron`
|
## Running with npx
|
||||||
|
|
||||||
### Installation
|
This app is also packaged as an npm module which you can easily run
|
||||||
|
|
||||||
```
|
```sh
|
||||||
# Login with your cloudron credentials
|
# copy the example config
|
||||||
cloudron login your.instance.com
|
wget https://raw.githubusercontent.com/hzrd149/blossom-server/master/config.example.yml -O config.yml
|
||||||
|
# run using npx
|
||||||
# Clone the project and change into it
|
npx blossom-server-ts
|
||||||
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
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You will then be prompted for a location - so put the domain, eg `blossom.yourdomain.com`
|
## Running with docker
|
||||||
|
|
||||||
## Configuration
|
An example config file can be found [here](./config.example.yml)
|
||||||
|
|
||||||
The config file is under `/app/data/config.yml`
|
```sh
|
||||||
|
# create data volume
|
||||||
If you are using Blossom for a small subset of npubs, and don't need the discoverability feature, you could make the following changes:
|
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
|
||||||
discovery:
|
|
||||||
# find files by querying nostr relays
|
|
||||||
nostr:
|
|
||||||
enabled: false
|
|
||||||
```
|
```
|
||||||
|
|
||||||
and
|
You can also run it using docker compose with the [`docker-compose.yml`](./docker-compose.yml) file
|
||||||
|
|
||||||
```
|
## Running from source
|
||||||
rules:
|
|
||||||
# mime type of blob
|
This project uses [pnpm](https://pnpm.io/) to manage dependencies. It needs to be installed first in order to build the app
|
||||||
- type: "*"
|
|
||||||
expiration: 2 years
|
Next clone the repo, install the dependencies, and build
|
||||||
pubkeys:
|
|
||||||
- "xxxnostrHEXkeyxxx" # comment
|
```sh
|
||||||
|
git clone https://github.com/hzrd149/blossom-server.git
|
||||||
|
cd blossom-server
|
||||||
|
pnpm install
|
||||||
|
cd admin && pnpm install && cd ../
|
||||||
|
pnpm build
|
||||||
```
|
```
|
||||||
|
|
||||||
and
|
Next copy the config and modify it
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cp config.example.yml config.yml
|
||||||
|
nano config.yml
|
||||||
```
|
```
|
||||||
upload:
|
|
||||||
# only check rules that include "pubkeys"
|
And finally start the app
|
||||||
requirePubkeyInRule: true
|
|
||||||
|
```sh
|
||||||
|
pnpm start
|
||||||
|
# or
|
||||||
|
node .
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Once the server is running you can open `http://localhost:3000` to access the server
|
||||||
|
Loading…
Reference in New Issue
Block a user