Setting up a custom image server can seem like a daunting task. I struggled to find a simple, lightweight library for running a static file server. So I made one!
If you are starting from scratch, you will first need a server and a domain. I personally use a digitalocean droplet, and it works just fine for my purposes. Although not required, knowledge of nginx or apache is quite useful for the initial setup.
git clone https://github.com/clxxiii/simple-sharex-server.git
Create a new file in the base directory called .env
, and populate
it with the following variables:
STRING_LENGTH=8 # How long the filename should be
SECRET="secret" # A unique string to prevent others from uploading to your server
HOSTNAME="http://localhost:3000" # Your domain name & port (if necessary)
PORT=3000 # The port the server will run on
npm install -g pm2
# Make sure you are in the project directory
pm2 start index.js --name imgserver
Use the provided flameshot-script.sh, and fill out the provided secret
, and hostname
fields.
You can now run the shell script to upload to the server.
Additionally, you can add a keyboard shortcut to your WM, so you can run the script easily and quickly
This setup process is a lot easier. Right click on the sharex icon in your system tray, and go to Custom Uploader Settings
.
Make a new custom uploader, and fill out the Method
, Request URL
, Body
, and File form name
fields (highlighted on screenshot)