Aucune description

kanadeko 15fbca2420 Rewrote panel js il y a 7 ans
controllers a114d298d0 Rewrote token handling and upload.js il y a 7 ans
database f42202259d Changed upload from single file to array il y a 7 ans
pages a114d298d0 Rewrote token handling and upload.js il y a 7 ans
public 15fbca2420 Rewrote panel js il y a 7 ans
routes a114d298d0 Rewrote token handling and upload.js il y a 7 ans
.eslintrc.json 376cf10663 First version il y a 7 ans
.gitignore b81cf72ac4 Changed from ip whitelist to token based auth il y a 7 ans
README.md 329aec24ee Changed header image on readme il y a 7 ans
config.sample.js bdfd512c10 token handling and verification il y a 7 ans
lolisafe.js 79e786f3b8 Added 500 error page il y a 7 ans
package.json b81cf72ac4 Changed from ip whitelist to token based auth il y a 7 ans

README.md

loli-safe

loli-safe

Pomf-like image uploading service, written in NodeJS


  1. Clone
  2. Rename config.sample.js to config.js
  3. Modify port, basedomain and token options if desired
  4. run npm install to install all dependencies
  5. run pm2 start lolisafe.js or node lolisafe.js to start the service

Token

This service supports running both as public and private. The only difference is that one needs a token and the other one doesn't. If you want it to be public so anyone can upload files either from the website or API, just leave the token empty on the config file.

But if you want to run it privately, you need to specify a random string, which you'll need to provide in every API call as a header called auth.


Using it

Once the service starts, you can start hitting the upload endpoint at /api/upload. When sending a file to it, be sure the form name is set to file, and if the app you're using asks, the type of form is multipart/form-data. Once the request has been made, if everything goes smoothly you should be receiving a json with the key url. Sample:

{
    "url": "https://i.kanacchi.moe/pqkI.png"
}

This service works great with apps like ShareX, since it's a lot like cuntflaps.me or mixtape.moe. A chrome extension to be able to right click images -> send to safe is in the works.

If you are using nginx, you should set inside your location block the following directive, replacing the number with the one you want set up client_max_body_size 512M; If using apache, you should change the following directives on your config RLimitMEM 512M