1
0
mirror of https://github.com/funkypenguin/geek-cookbook/ synced 2025-12-13 01:36:23 +00:00
Files
geek-cookbook/docs/recipes/template.md
David Young 98ce09a173 Add recipe for Nitter (#276)
* Add recipe for Nitter

Signed-off-by: David Young <davidy@funkypenguin.co.nz>

* Add new status to Nitter

Signed-off-by: David Young <davidy@funkypenguin.co.nz>

---------

Signed-off-by: David Young <davidy@funkypenguin.co.nz>
2023-03-15 00:54:36 +00:00

2.8 KiB

description, recipe, title, image
description recipe title image
Neat one-sentence description of recipe for social media previews Recipe Name Short, punchy title for search engine results / social previews /images/<recipe name>.png

{{ page.meta.recipe }} on Docker Swarm

![Screenshot of {{ page.meta.recipe }}]({{ page.meta.image }}){ loading=lazy }

Linx is self-hosted file/media-sharing service, which features:

  • Display common filetypes (image, video, audio, markdown, pdf)
  • Display syntax-highlighted code with in-place editing
  • Documented API with keys for restricting uploads
  • Torrent download of files using web seeding
  • File expiry, deletion key, file access key, and random filename options

{{ page.meta.recipe }} Requirements

--8<-- "recipe-standard-ingredients.md"

Preparation

Setup data locations

First we create a directory to hold the data which linx will serve:

mkdir /var/data/linx

Create config file

Linx is configured using a flat text file, so create this on the Docker host, and then we'll mount it (read-only) into the container, below.

mkdir /var/data/config/linx
cat << EOF > /var/data/config/linx/linx.conf
# Refer to https://github.com/andreimarcu/linx-server for details
cleanup-every-minutes = 5
EOF

{{ page.meta.recipe }} Docker Swarm config

Create a docker swarm config file in docker-compose syntax (v3), something like the example below:

--8<-- "premix-cta.md"

version: "3.2" # https://docs.docker.com/compose/compose-file/compose-versioning/#version-3

services:
  linx:
    image: andreimarcu/linx-server
    env_file: /var/data/config/linx/linx.env
    command: -config /linx.conf
    volumes:
      - /var/data/linx/:/files/
      - /var/data/config/linx/linx.conf:/linx.conf:ro
    deploy:
      labels:
        # traefik common
        - traefik.enable=true
        - traefik.docker.network=traefik_public

        # traefikv1
        - traefik.frontend.rule=Host:linx.example.com
        - traefik.port=8080     

        # traefikv2
        - "traefik.http.routers.linx.rule=Host(`linx.example.com`)"
        - "traefik.http.routers.linx.entrypoints=https"
        - "traefik.http.services.linx.loadbalancer.server.port=8080" 

    networks:
      - traefik_public

networks:
  traefik_public:
    external: true

Serving

Launch the Linx!

Launch the Linx stack by running docker stack deploy linx -c <path -to-docker-compose.yml>

--8<-- "recipe-footer.md"