Yet Another Node Image Upload Server
(The name is actually a lie. You can upload every file type.)
git clone https://github.com/DerEnderKeks/Yanius.git
cd Yanius
sudo apt-get install build-essential
npm install
cp config/default.json.example config/default.json
Make a PR if you know how to install this on other systems
As long the Major
part of the version number (Major.Minor.Patch
) didn't change, you can update using git pull
.
Otherwise you also have to execute the appropriate migration scripts. You can find them in /scripts/migration/
.
If it doesn't start after an update do rm -rf node_modules && npm i
before asking for help.
To update from 0.x.x to 1.x.x you have to:
- execute
node ./scripts/migration/0_x_x-to-1_x_x.js
- pray to a god of your choice
Edit config/default.json
.
You have to insert your rethinkdb connection data there.
Also, you can set the url of your Yanius instance there.
If you want to use secure cookies you have to use a proxy server like nginx.
You also have to insert proxy_set_header X-Forwarded-Proto https;
into your nginx proxy configuration to use secure cookies.
npm start
DEBUG="yanius:*" node --harmony ./bin/www
DEBUG="yanius:*" NODE_ENV="development" node --harmony ./bin/www
WARNING: Don't use this in production. Seriously. This mode shows stacktraces to the user.
You could use a custom script/program to upload files. You can use mine if you want.
You can use ShareX.
In ShareX
- go to
Destinations -> Destination settings... -> Custom uploaders
- click on
Import -> From URL...
- insert
http://goo.gl/D1BX26
- click
Ok
- adjust
Request URL
andArguments -> apikey
- click
Update
on the left side of the window - close that window
- select
Custom [Image, File, Text] Uploader
inDestinations -> [Image, File, Text] uploader
If you want to make your own script/program to upload files make sure it does the following:
POST
request to/api/upload
- Form field
apikey
is set to your API Key (Get it from/dashboard/account
) - Form field
file
is set to the file you want to upload - (Optional) Form field
hidden
is set totrue
orfalse
(if a file is hidden nobody can download it)
The server responds as JSON.
If the upload was successful:
{
"message": "File uploaded",
"url": "your.domain/<shortname>"
}
Otherwise:
{
"message": "<error message>"
}