Skip to content

stash.red is a Small footprint File host (Specificly for Image/Video and Audio files)

Notifications You must be signed in to change notification settings

cmd430/stash.red

Repository files navigation

stash.red is a Small footprint File host (Specificly for Image/Video and Audio files)

GitHub last commit GitHub issues GitHub repo size GitHub license GitHub badges

Image showing uploading to stash.red


Table of Contents


Prerequisites

NOTE: all instructions will assume you are using Debain, Cloudflare, Sqlite3 and File Storage

  • A server to host the code
  • A Domain name (recommended registrar: Cloudflare)
  • A Reverse Proxy capable Webserver (reccomended: Nginx)
  • Node LTS Tested on versions 18.18.2 and 20.9.0 (recommended: use Node Version Manager)
  • Git
    $ sudo apt install git
  • Essential Build tools
    $ sudo apt install build-essential

Optional Highly Reccomended


Installation

It is Recommended to begin in your Home directory (cd ~)

Clone

  • Clone this repository using
    $ git clone https://github.com/cmd430/stash.red yourdomainname.tld

Setup

  • Change into the newly created directory and install dependencies
    $ cd yourdomainname.tld
    $ npm i --omit=dev
  • Copy ./config/sql/002-Config.template to ./config/sql/002-Config.sql
  • Edit any options in ./config/sql/002-Config.sql

    note: it is reccomended to only change settings tagged with: <CHANGE_ME:setting_explaination> unless you know what you are doing

    $ nano ./config/sql/002-Config.sql
If using PM2
  • Start with PM2 and run continuously
    $ pm2 start ecosystem.config.cjs
If not using PM2 (NOT reccomended)
  • Start the server
    $ node main
    # or
    $ npm start

Configure Reverse Proxy (Nginx)

  • Create site config
    $ sudo nano /etc/nginx/sites-available/yourdomainname.tld
    • add the following config (change where necessary) and save
      server {
        server_name <yourdomainname.tld>;
      
        listen 443 ssl;
        ssl_certificate <path_to_cloudflare_origin_certificate>/origin-cert.pem;
        ssl_certificate_key <path_to_cloudflare_origin_private_key>/private-key.pem;
      
        location / {
          proxy_pass http://localhost:3000;
          proxy_http_version 1.1;
          proxy_set_header X-Forwarded-Proto https;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection 'upgrade';
          proxy_set_header Host $host;
          proxy_cache_bypass $http_upgrade;
          proxy_request_buffering off;
        }
        client_max_body_size 0;
      }
  • Create a symbolic link in ../sites-enabled/ and reload nginx
    $ sudo ln -s /etc/nginx/sites-available/yourdomainname.tld /etc/nginx/sites-enabled/yourdomainname.tld
    $ sudo nginx -s reload

Testing

If everything is working correctly you should be able to open https://yourdomainname.tld in your browser


Features

  • Account creation with hashed and salted passwords and captcha
  • Private uploads (hidden unless you have the link)
  • Simple Album and Single file support
  • User pages to see files uploaded by specific users
  • Ability to easily find content by User or by Album
  • Zero loss in quality of uploaded files

License

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

Full ISC License

About

stash.red is a Small footprint File host (Specificly for Image/Video and Audio files)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published