Git Product home page Git Product logo

blossom-server's Introduction

🌸 Blossom-server

blossom-server is a Typescript implementation of a Blossom Server

Running with npx

This app is also packaged as an npm module which you can easily run

# 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

Or you can install the module using npm or yarn

# npm
npm install
./node_modules/.bin/blossom-server-ts

# yarn
yarn add blossom-server-ts
yarn run blossom-server-ts

Running with docker

An example config file can be found here

# 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

You can also run it using docker compose with the docker-compose.yml file

Running from source

This project uses yarn to manage dependencies. It needs to be installed first in order to build the app

Next clone the repo, install the dependencies, and build

git clone https://github.com/hzrd149/blossom-server.git
cd blossom-server
yarn install
cd admin && yarn install && cd ../
yarn build

Next copy the config and modify it

cp config.example.yml config.yml
nano config.yml

And finally start the app

yarn start
# or
node .

Once the server is running you can open http://localhost:3000 to access the server

blossom-server's People

Contributors

hzrd149 avatar sebdeveloper6952 avatar

Stargazers

 avatar  avatar space-shell avatar Lyu Ji avatar ⚡️2FakTor⚡️ avatar Caleb Simpson avatar SigmaEnterprise avatar Luke avatar Sebastian Hagens avatar mroxso avatar  avatar OceanSlim avatar Aljaz Ceru avatar  avatar PastaGringo avatar Erik Brakke avatar

Watchers

 avatar

blossom-server's Issues

websocket-polyfill problem

Installing from docker and from source I get an error.

Docker:

# docker run -v blossom_data:/app/data -v $(pwd)/config.yml:/app/config.yml -p 3000:3000 ghcr.io/hzrd149/blossom-server:master

Unable to find image 'ghcr.io/hzrd149/blossom-server:master' locally
master: Pulling from hzrd149/blossom-server
4abcf2066143: Pull complete 
7231dd947546: Pull complete 
58ec58ffa356: Pull complete 
853d72f1314b: Pull complete 
c2c363068bce: Pull complete 
5b77f188786e: Pull complete 
90feb962d4b7: Pull complete 
cee29b128def: Pull complete 
8ce2194a071b: Pull complete 
50793f4c7b48: Pull complete 
7da88de86e03: Pull complete 
Digest: sha256:fede0235753aebbb469aacfc0f61751e95b663ce3c2d8e01c9df387c4f63cd78
Status: Downloaded newer image for ghcr.io/hzrd149/blossom-server:master
/app/node_modules/websocket-polyfill/lib/index.js:8
    (_a = (_b = global).WebSocket) !== null && _a !== void 0 ? _a : (_b.WebSocket = (0, import2_1.default)("ws"));
                                                                                                          ^

TypeError: (0 , import2_1.default) is not a function
    at Object.<anonymous> (/app/node_modules/websocket-polyfill/lib/index.js:8:107)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at cjsLoader (node:internal/modules/esm/translators:348:17)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:297:7)
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

Node.js v20.13.1

Source:

`# yarn start
yarn run v1.22.22
$ node build/index.js
/mnt/user/blossom/blossom-server/node_modules/websocket-polyfill/lib/index.js:8
(_a = (_b = global).WebSocket) !== null && _a !== void 0 ? _a : (_b.WebSocket = (0, import2_1.default)("ws"));
^

TypeError: (0 , import2_1.default) is not a function
at Object. (/mnt/user/blossom/blossom-server/node_modules/websocket-polyfill/lib/index.js:8:107)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at cjsLoader (node:internal/modules/esm/translators:348:17)
at ModuleWrap. (node:internal/modules/esm/translators:297:7)
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)

Node.js v20.13.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
`

upload broken on 4.1.0

It seems that ctx.request.body is empty. I can confirm that the data comes through the nginx's reverse proxy by listening the port with netcat.

I believe this is what triggers the error for me:
if (ctx.request.body) {
upload = await uploadWriteStream(ctx.req);
mimeType = contentType || upload.type;
} else throw new Error("Invalid upload");

blossom-server:rules Looking for match image/png 336ccc3bac7ab8ea4d48e60fabd66bb8f258da997107a1a33585856a8158b6f8 +0ms
blossom-server:rules Found rule for 1 week +0ms
Error: Invalid upload

Browser gets 500 error "Something went wrong".

When I tried 4.0.1 version, it works without problems.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.