-
Text (With Syntax Highlighting) [Example]
-
Markdown rendering files [Example]
-
Front end upload page [Example]
-
Showcase images (image display pages that show metadata for photography) [Example]
https://github.com/TannerReynolds/ShareX-Upload-Server.git
cd ShareX-Upload-Server
chmod +x install.sh
./install.sh
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(s) for private uploading
"domain": "*.example.com", // Domain server will use. Will error if domain not used in request. Place "*" as the subdomain to enable wildcard subdomains for the webserver.
"puploadKeyGenLength": 64, // Amount of characters server should use for pupload files
"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(s) 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
}
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
If you're configuring this webserver to run through an Nginx reverse proxy, make sure you add these lines to your reverse proxy config
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
This is generally some things you want to add to your config, and is what's actually required for ShareS to work properly. This is because ShareS returns uploads like [http/https]://[requested url]/[filename]
and since you're running ShareS through a reverse proxy, unless you're passing along the original headers, ShareS is most likely just going to send you something like http://[server's real ip address]/[filename]
If you have multiple domains pointed to this webserver, only one (can include wildcard subdomain) can be used, unless the domain setting is set to just a single * like so: "domain": "*",
. This means that any domain will be accepted as a valid domain by the server, regardless of subdomain.
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
- Download this repository to the PC your ShareX is on
- Navigate to
Destinations -> Custom Uploader Settings
- Import the sxcu files from the downloaded zip one by one
- Properly Configure Template
- Change
Destination Location
- Add a field to your body called
pupload
, and then make the value whatever you want the password to be - Upload something, and the upload will give you a url to the authentication page
- Type in your password, and it will display/download the file!
In addition to being able to use any password you want for puploads, if you type in *random*
as your pupload field, the server will automatically generate a password for you. This password will include letters, numbers, and special characters. It will generate a key based on the length you specify in your config (puploadKeyGenLength). When making requests, the server will return the image URL with the key like so URL: https://qoilo.com/lhHr | KEY: Np$[CBk>X[c^YY{MDlCHH0|Qfm1uK0*lld^Mi$f4d62R5x6C2>~yaL}3*QYnziuZ
- Add a field to your body called
showCase
, and then make the valuetrue
- Upload an image
- Click the image to view image's metadata like camera, lens, iso, shutter speed, etc.
- Requires extra software to be installed to your server, called Exiftool to read metadata from uploaded images. The install file will automatically install this software on ubuntu.
- Windows servers using this feature wil need the Windows executable for exiftool and it will need to be added to your environment variables or ShareS will throw errors on upload and return 404s