tmpim / shitty.dl

Heavyweight featurecreep file hosting server in node.js
8 stars 4 forks source link

shitty.download

The backend behind shitty.download.

Configuration

Make a file called config.json, with the following properties:

{
    "logo": {
      "main": "poop.png",
      "px32": "poop32.png",
      "px96": "poop96.png",
      "px192": "poop192.png",
      "px512": "poop512.png"
    },
    "name": "shitty.download",
    "app_name": "Shitty",
    "name_color": "#a5673f",
    "background_color": "#dadada",
    "title": "lemmmy's file host lies here",
    "disclaimer": "for dmca etc., contact drew at lemmmy dot pw",
    "password": [
      ""
    ],
    "imagePath": "/path/to/images",
    "url": "https://your.host/",
    "listen": "3000",
    "fileLength": 4,
    "pasteThemePath": "https://atom.github.io/highlights/examples/atom-dark.css",
    "oldPasteThemeCompatibility": true,
    "sessionSecret": "",
    "uploadDeleteLink": true,
    "imageFiles": ["jpeg","jpg","png","gif"],
    "audioFiles": ["mp3","wav","flac","ogg"],
    "videoFiles": ["mp4","webm"],
    "languagePackages": [
      "language-lua"
    ],
    "rawPasteAgents": "^(?:computercraft|curl|wget)"
}

Custom names

You can implement your own custom naming function by creating a file called custom-name.js that exports a function that returns a filename. Here is an example:

const _ = require("lodash");
const fs = require("fs");

const nouns = fs.readFileSync("nouns.txt").toString().split("\n");

module.exports = () => {
    const noun = _.sample(nouns);
    return (noun.match(/^[aeiou]/i) ? "an-" : "a-") + noun;
};

More examples for custom naming functions can be found in the examples directory.

Notes