This repository has been archived on 2023-05-12. You can view files and clone it, but cannot push or open issues or pull requests.
media-host/docs/get-started/configure.md

4.8 KiB

configuration

Here's how you can configure your media-host server.

example config

Here's the config.example.json file, if this suffices for you, simply copy config.example.json to config.json.

{
  "port": 8182,
  "db-url": "mongodb://127.0.0.1:27017/mediahost",
  "media-folder": "private/",
  "remux": {
    "enabled": true,
    "folder": "remux/",
    "video-codec": "libx264",
    "audio-codec": "aac",
    "container": "mp4"
  },
  "meta": {
    "name": "Media Host",
    "tagline": "Your one stop shop to host images, videos, audio and more.",
    "short-tagline": "Your one stop shop to host anything.",
    "domain": "media.host",
    "icon": null
  },
  "max-file-size": 524288000,
  "max-anon-file-size": 52428800,
  "sharex-support": true,
  "allow-signup": true,
  "allow-anon-uploads": false,
  "captcha": {
    "enabled": false,
    "sitekey": "",
    "secret": "",
    "show-at-signup": true,
    "show-at-login": true,
    "show-at-report": true,
    "show-at-anon-upload": true
  },
  "expect-reply-from": "put-your-email@here.com",
  "reject-tor": false,
  "store-anon-ips": false,
  "transparent-reports": true,
  "insert-in-head": []
}

explanations

If you're a bit confused, don't worry. This will help you understand each part of the config file.

  • port is the HTTP port the server will run on. If port is set to 8182, the server should be at 127.0.0.1:8182.
  • db-url is the URL to the MongoDB server you want the metadata to be stored on. If you haven't messed with MongoDB's settings at all, leave this as is.
  • media-folder is where the files themselves are stored. If it's set to private/, the files should be inside private/ folder in the root of the media-host folder.
  • remux is an object where you can set up remuxing a video via FFMPEG to be playable on the web, when not compatible.
    • enabled is to enable or disable remuxing
    • folder is the folder where remuxes live
    • video-codec is the video codec it remuxes to
    • audio-codec is the autio codec it remuxes to
    • container is the container it remuxes to
  • meta is an object where basic metadata of the server is stored.
    • name is the name of the server, shown at the top of the page on every page.
    • tagline is the text under the title on every page.
    • short-tagline is meant to be the shorter version of tagline.
    • domain is the website you plan to host the site on.
    • icon is the local URL of the favicon you would like to use, if any.**
  • max-file-size is a number to limit the size of files uploaded to the server, measured in bytes.
  • max-anon-file-size is a similar number to max-file-size, but for Anonymous uploads (if they're enabled). Set 0 to make Anonymous uploads use max-file-size.
  • sharex-support is not useful right now, but is meant to enable and disable support for the ShareX application.
  • allow-signup is meant to enable and disable signups to your server.
  • allow-anon-uploads is meant to enable and disable anonymous uploads to your server. Not recommended to be set to true on public servers.
  • captcha is an object for CAPTCHA settings. This only works for H-Captcha right now.
    • enabled is to enable and disable CAPTCHAs on your website.
    • sitekey is the sitekey for your site on H-Captcha. Retrieved from the H-Captcha website.
    • secret is your H-Captcha secret. Retrieved from the H-Captcha website.
    • show-at-signup is to enable and disable the requirement of a CAPTCHA on the signup screen.
    • show-at-login is to enable and disable the requirement of a CAPTCHA on the login screen.
    • show-at-report is to enable and disable the requirement of a CAPTCHA on the report screen.
    • show-at-anon-upload is to enable and disable the requirement of a CAPTCHA upon an anonymous upload
  • expect-reply-from is to set an email to reply from for things like reports.
  • reject-tor is set to prevent Tor exit nodes from uploading and signing up to your service, if set to true. They can still view and download files.
  • store-anon-ips is set to store anonymous uploader's IPs, if set to true. This does not mean logged in user's IPs get stored. Note: All reports have their IPs logged, in both cases, IPs are never public information.
  • transparent-reports is set to allow the public to see resolved reports, if set to true. Admins can do this in their panel.
  • insert-in-head is an arry of strings (meant to be HTML5 tags) to insert into the head of every HTML page served by your server.

Requirements for meta.icon

This requires you to create a folder inside the static folder called custom. You then place the favicon inside of ./static/custom and set meta.icon to /custom/<favicon path>.