This project allows for the launching of a local server, intended for hosting screenshots taken with the Sharex program.
- Configured
CORS
- Ready logger:
morgan
- Middlewares ready to handle common errors:
429
Too Many Requests408
Request Timeout404
Not Found500
Internal Server Error
- A static
public
folder - A
robots.txt
file that blocks screenshot indexing - A preconfigured
ecosystem.config.js
file for PM2
With this solution, you don't have to upload screenshots to external services. Being an administrator, you can delete screenshots from the server with just a few clicks, thereby revoking everyone's access to the screenshot file.
-
For those utilizing Cloudflare, enhancing your security measures by incorporating specific expressions into the Web Application Firewall (WAF) comes highly recommended. This approach can significantly bolster your website's defense. Please visit this repository.
-
If you are using any proxy server (for example, Cloudflare), make sure to adjust the
trust proxy
setting in the index.js file. A value of 1 indicates a single proxy server. This adjustment is necessary for the server to accurately read the IP addresses of visitors.
- Clone the repository:
git clone https://github.com/sefinek/Node-Sharex-Server.git
- Install the necessary packages using
npm install
. - Rename the
.env.default
file to.env
and fill in the necessary data. - Run the server using:
node .
- Hosting:
- At home (if you lack open ports or an external IP)
See Cloudflare Tunnel Documentation. Remember, your domain must have Cloudflare DNS settings (at least that's what I believe).
- At home (if you lack open ports or an external IP)
- File server:
- SAMBA
See this tutorial.
- SAMBA
- Configuration:
- That's it! You can now take screenshots and upload them to your server.
If you find this repository useful, please consider giving it a star. If you need assistance or have any questions, feel free to open a new Issue.
This project is licensed under the MIT License.