AKA ShareS - Feature full & Stable ShareX and file server in node. Includes images, videos, code, text, markdown rendering, password protected uploads, logging via discord, administration through Discord, url shortening, and a full front end. Use standalone or via reverse proxy
Go to file
Tanner Reynolds 54ff6f72db Update .eslintrc.json 2019-04-16 15:52:27 -07:00
.github/ISSUE_TEMPLATE Update issue templates 2019-01-24 22:18:59 -08:00
src finished linting /src/bot 2019-04-16 15:51:06 -07:00
.eslintrc.json Update .eslintrc.json 2019-04-16 15:52:27 -07:00
.gitattributes fixed md, added sxcu files 2019-03-10 15:05:18 -07:00
.gitignore fixed md, added sxcu files 2019-03-10 15:05:18 -07:00
Images_and_Files.sxcu fixed md, added sxcu files 2019-03-10 15:05:18 -07:00
LICENSE Initial commit 2018-01-29 17:20:04 -08:00
README.md /src/server fully linted 2019-04-16 11:15:48 -07:00
Text.sxcu fixed md, added sxcu files 2019-03-10 15:05:18 -07:00
URL_Shortener.sxcu fixed md, added sxcu files 2019-03-10 15:05:18 -07:00
install.sh moved install.sh, edited secure returns 2019-03-11 16:49:36 -07:00

README.md

Nodejs ShareX Server

Features

  • Image/Video/General file uploading

  • Text (With Syntax Highlighting) [Example]

  • URL shortening + a front end for the URL shortener as well [Example]

  • Markdown rendering files [Example]

  • Logging via a Discord channel

  • Password protected uploading

  • Server Administration using Discord bot commands

  • Front end upload page [Example]

You can demo the features/server here

Installation (Ubuntu 16.04 Server)

git clone https://github.com/TannerReynolds/ShareS.git
cd ShareS
chmod +x install.sh
./install.sh

Configuration

In the files you downloaded from this repository, you will see a file called config.json You must fill this out for the webserver to work properly. Below explains the configuration file and what each part does

{
  "key": "", // Password for private uploading
  "public": false, // Disables auth and does not render a password field for /upload
  "maxUploadSize": 50, // max upload size for non-admins using regular key in MB
  "markdown": true, // enables markdown rendering (upload whole .md file for render)
  "port": 80, // port to listen on
  "secure": true, // Whether or not you want https. (make sure key and cert.pem are in src directory)
  "securePort": 443, // Port to use when secure is true
  "ratelimit": 1000, // Ratelimit for POSTing in milliseconds
  "allowed":[
    "png", "jpg", "gif", "mp4", "mp3", "jpeg", "tiff", "bmp", "ico", "psd", "eps", "raw", "cr2", "nef", "sr2", "orf", "svg", "wav", "webm", "aac", "flac", "ogg", "wma", "m4a", "gifv"
  ], // Allowed file types for non-admins
  "admin":{
    "key": "", // Admin password for uploading & for gallery access
    "maxUploadSize": 1024, // Max upload size for admin in MB
    "allowed": [
    "png", "jpg", "gif", "mp4", "mp3","jpeg", "tiff", "bmp", "ico", "psd", "eps", "raw", "cr2", "nef", "sr2", "orf", "svg", "wav", "webm", "aac", "flac", "ogg", "wma", "m4a", "gifv", "html"
     ] // Allowed file types for admins
  },
  "paste": {
    "maxUploadSize": 20 // allowed paste upload size in MB
  },
  "discordToken": "", // Discord bot token
  "discordAdminIDs": ["discord IDs of people who can run commands go here", "Like this"], // User IDs in an array
  "discordChannelID": "", // Channel ID for monitoring uploads to
  "prefix": "" // Bot Prefix
}

Running The Server

Once you've properly configured your server, you can run node index.js in the src folder to start the server. You can keep your server running forever if you use a process manager, like pm2. pm2 installs along with your server if you used the install.sh script to install your server. Otherwise you can run npm i -g pm2 to install pm2. Then you can run your server by running pm2 start index.js, and monitor logs and such using pm2 monit

Setting up Discord logging

if you wish to log your webserver's activity in a Discord channel for whatever reason, you can. Here is information on how to setup a bot account and get the information needed for Discord logging

Configuring Your ShareX Client

Import From File

Importing File

  • Properly Configure Template ->

template

Purple: http or https. If your server's secure setting is set to true then use https.

Green: Your domain goes here along with any subdomain you may use. Example: i.qoilo.com

Red: Password goes here. if your public setting is set to true, dont worry about this.

Yellow: Ensure each field is using the correct setting

  • Change Destination Location

dest loc

Configuring for Password Protected Uploading

  • Add a field to your body called pupload, and then make the value whatever you want the password to be pupload1
  • Upload something, and the upload will give you a url to the authentication page pupload2
  • Type in your password, and it will display/download the file!

Credits

Ken - Initial File Uploader

Aetheryx - Webserver Structure

Jaex - ShareX

Cheap Hosting Options For Your Uploader