v3.0.0/README.md

33 lines
1.7 KiB
Markdown
Raw Normal View History

2017-01-14 23:45:20 +01:00
![loli-safe](https://i.kanacchi.moe/R6GE.png)
2017-01-13 09:13:07 +01:00
# loli-safe
2017-01-13 08:34:21 +01:00
Pomf-like image uploading service, written in NodeJS
2017-01-13 08:48:18 +01:00
---
1. Clone
2. Rename `config.sample.js` to `config.js`
2017-01-14 22:42:38 +01:00
4. Modify port, basedomain and token options if desired
3. 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`.
2017-01-13 08:48:18 +01:00
---
## Using it
2017-01-14 22:42:38 +01:00
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:
2017-01-13 08:48:18 +01:00
2017-01-14 22:42:38 +01:00
```json
{
"url": "https://i.kanacchi.moe/pqkI.png"
}
```
2017-01-13 08:58:36 +01:00
2017-01-14 22:42:38 +01:00
This service works great with apps like ShareX, since it's a lot like [cuntflaps.me](https://cuntflaps.me) or [mixtape.moe](https://mixtape.moe).
A chrome extension to be able to `right click` images -> `send to safe` is in the works.
2017-01-13 08:58:36 +01:00
2017-01-14 22:42:38 +01:00
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`