mirror of
https://github.com/funkypenguin/geek-cookbook/
synced 2025-12-13 01:36:23 +00:00
Add Linx, apply formatting fixes (#145)
* Add Linx, apply formatting fixes Fixes #143 Signed-off-by: David Young <davidy@funkypenguin.co.nz> * Add macros plugin Signed-off-by: David Young <davidy@funkypenguin.co.nz>
This commit is contained in:
99
manuscript/recipes/linx.md
Normal file
99
manuscript/recipes/linx.md
Normal file
@@ -0,0 +1,99 @@
|
||||
# Linx
|
||||
|
||||
Ever wanted to quickly share a screenshot, but don't want to use imgur, sign up for a service, or have your image tracked across the internet for all time?
|
||||
|
||||
Want to privately share some log output with a password, or a self-destructing cat picture?
|
||||
|
||||
{: loading=lazy }
|
||||
|
||||
[Linx](https://github.com/andreimarcu/linx-server) is self-hosted file/media-sharing service, which features:
|
||||
|
||||
- :white_check_mark: Display common filetypes (*image, video, audio, markdown, pdf*)
|
||||
- :white_check_mark: Display syntax-highlighted code with in-place editing
|
||||
- :white_check_mark: Documented API with keys for restricting uploads
|
||||
- :white_check_mark: Torrent download of files using web seeding
|
||||
- :white_check_mark: File expiry, deletion key, file access key, and random filename options
|
||||
|
||||
|
||||
## Ingredients
|
||||
|
||||
!!! summary "Ingredients"
|
||||
Already deployed:
|
||||
|
||||
* [X] [Docker swarm cluster](/ha-docker-swarm/design/) with [persistent shared storage](/ha-docker-swarm/shared-storage-ceph.md)
|
||||
* [X] [Traefik](/ha-docker-swarm/traefik) configured per design
|
||||
* [X] DNS entry for the hostname you intend to use (*or a wildcard*), pointed to your [keepalived](/ha-docker-swarm/keepalived/) IP
|
||||
|
||||
|
||||
## 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
|
||||
```
|
||||
|
||||
### Setup Docker Swarm
|
||||
|
||||
Create a docker swarm config file in docker-compose syntax (v3), something like this:
|
||||
|
||||
--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>```
|
||||
|
||||
|
||||
[^1]: Since the whole purpose of media/file sharing is to share stuff with **strangers**, this recipe doesn't take into account any sort of authentication using [Traefik Forward Auth](/ha-docker-swarm/traefik-forward-auth/).
|
||||
|
||||
--8<-- "recipe-footer.md"
|
||||
@@ -97,6 +97,7 @@ Create a docker swarm config file in docker-compose syntax (v3), based on the or
|
||||
|
||||
--8<-- "premix-cta.md"
|
||||
|
||||
{% raw %}
|
||||
???+ note "This example is 274 lines long. Click here to collapse it for better readability"
|
||||
|
||||
```
|
||||
@@ -379,7 +380,7 @@ Create a docker swarm config file in docker-compose syntax (v3), based on the or
|
||||
!!! note
|
||||
Setup unique static subnets for every stack you deploy. This avoids IP/gateway conflicts which can otherwise occur when you're creating/removing stacks a lot. See [my list](/reference/networks/) here.
|
||||
|
||||
|
||||
{% endraw %}
|
||||
|
||||
## Serving
|
||||
|
||||
|
||||
@@ -1,47 +1,50 @@
|
||||
hero: Not all heroes wear capes
|
||||
# <///RECIPE NAME>
|
||||
|
||||
!!! danger "This recipe is a work in progress"
|
||||
This recipe is **incomplete**, and is featured to align the [sponsors](https://github.com/sponsors/funkypenguin)'s "premix" repository with the cookbook. "_premix_" is a private git repository available to [GitHub sponsors](https://github.com/sponsors/funkypenguin), which includes necessary docker-compose and env files for all published recipes. This means that sponsors can launch any recipe with just a ```git pull``` and a ```docker stack deploy``` 👍
|
||||
Ever wanted to quickly share a screenshot, but don't want to use imgur, sign up for a service, or have your image tracked across the internet for all time?
|
||||
|
||||
So... There may be errors and inaccuracies. Jump into [Discord](http://chat.funkypenguin.co.nz) if you're encountering issues 😁
|
||||
Want to privately share some log output with a password, or a self-destructing cat picture?
|
||||
|
||||
# NAME
|
||||

|
||||
|
||||
Intro
|
||||
[Linx](https://github.com/andreimarcu/linx-server) is self-hosted file/media-sharing service, which features:
|
||||
|
||||

|
||||
- :white_check_mark: Display common filetypes (*image, video, audio, markdown, pdf*)
|
||||
- :white_check_mark: Display syntax-highlighted code with in-place editing
|
||||
- :white_check_mark: Documented API with keys for restricting uploads
|
||||
- :white_check_mark: Torrent download of files using web seeding
|
||||
- :white_check_mark: File expiry, deletion key, file access key, and random filename options
|
||||
|
||||
Details
|
||||
|
||||
## Ingredients
|
||||
|
||||
1. [Docker swarm cluster](/ha-docker-swarm/design/) with [persistent shared storage](/ha-docker-swarm/shared-storage-ceph.md)
|
||||
2. [Traefik](/ha-docker-swarm/traefik) configured per design
|
||||
3. DNS entry for the hostname you intend to use, pointed to your [keepalived](/ha-docker-swarm/keepalived/) IP
|
||||
!!! summary "Ingredients"
|
||||
Already deployed:
|
||||
|
||||
* [X] [Docker swarm cluster](/ha-docker-swarm/design/) with [persistent shared storage](/ha-docker-swarm/shared-storage-ceph.md)
|
||||
* [X] [Traefik](/ha-docker-swarm/traefik) configured per design
|
||||
* [X] DNS entry for the hostname you intend to use (*or a wildcard*), pointed to your [keepalived](/ha-docker-swarm/keepalived/) IP
|
||||
|
||||
|
||||
## Preparation
|
||||
|
||||
### Setup data locations
|
||||
|
||||
We'll need several directories to bind-mount into our container, so create them in /var/data/wekan:
|
||||
First we create a directory to hold the data which linx will serve:
|
||||
|
||||
```
|
||||
mkdir /var/data/wekan
|
||||
cd /var/data/wekan
|
||||
mkdir -p {wekan-db,wekan-db-dump}
|
||||
mkdir /var/data/linx
|
||||
```
|
||||
|
||||
### Prepare environment
|
||||
### 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.
|
||||
|
||||
Create wekan.env, and populate with the following variables
|
||||
```
|
||||
OAUTH2_PROXY_CLIENT_ID=
|
||||
OAUTH2_PROXY_CLIENT_SECRET=
|
||||
OAUTH2_PROXY_COOKIE_SECRET=
|
||||
MONGO_URL=mongodb://wekandb:27017/wekan
|
||||
ROOT_URL=https://wekan.example.com
|
||||
MAIL_URL=smtp://wekan@wekan.example.com:password@mail.example.com:587/
|
||||
MAIL_FROM="Wekan <wekan@wekan.example.com>"
|
||||
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
|
||||
```
|
||||
|
||||
### Setup Docker Swarm
|
||||
@@ -51,67 +54,46 @@ Create a docker swarm config file in docker-compose syntax (v3), something like
|
||||
--8<-- "premix-cta.md"
|
||||
|
||||
```
|
||||
version: '3'
|
||||
version: "3.2" # https://docs.docker.com/compose/compose-file/compose-versioning/#version-3
|
||||
|
||||
services:
|
||||
|
||||
wekandb:
|
||||
image: mongo:3.2.15
|
||||
command: mongod --smallfiles --oplogSize 128
|
||||
networks:
|
||||
- internal
|
||||
linx:
|
||||
image: andreimarcu/linx-server
|
||||
env_file: /var/data/config/linx/linx.env
|
||||
command: -config /linx.conf
|
||||
volumes:
|
||||
- /var/data/wekan/wekan-db:/data/db
|
||||
- /var/data/wekan/wekan-db-dump:/dump
|
||||
|
||||
proxy:
|
||||
image: a5huynh/oauth2_proxy
|
||||
env_file: /var/data/wekan/wekan.env
|
||||
networks:
|
||||
- traefik_public
|
||||
- internal
|
||||
- /var/data/linx/:/files/
|
||||
- /var/data/config/linx/linx.conf:/linx.conf:ro
|
||||
deploy:
|
||||
labels:
|
||||
- traefik_public.frontend.rule=Host:wekan.example.com
|
||||
- traefik_public.docker.network=traefik_public
|
||||
- traefik_public.port=4180
|
||||
command: |
|
||||
-cookie-secure=false
|
||||
-upstream=http://wekan:80
|
||||
-redirect-url=https://wekan.example.com
|
||||
-http-address=http://0.0.0.0:4180
|
||||
-email-domain=example.com
|
||||
-provider=github
|
||||
# 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"
|
||||
|
||||
wekan:
|
||||
image: wekanteam/wekan:latest
|
||||
networks:
|
||||
- internal
|
||||
env_file: /var/data/wekan/wekan.env
|
||||
- traefik_public
|
||||
|
||||
networks:
|
||||
traefik_public:
|
||||
external: true
|
||||
internal:
|
||||
driver: overlay
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.16.3.0/24
|
||||
```
|
||||
|
||||
!!! note
|
||||
Setup unique static subnets for every stack you deploy. This avoids IP/gateway conflicts which can otherwise occur when you're creating/removing stacks a lot. See [my list](/reference/networks/) here.
|
||||
|
||||
|
||||
|
||||
## Serving
|
||||
|
||||
### Launch Wekan stack
|
||||
### Launch the Linx!
|
||||
|
||||
Launch the Wekan stack by running ```docker stack deploy wekan -c <path -to-docker-compose.yml>```
|
||||
Launch the Linx stack by running ```docker stack deploy linx -c <path -to-docker-compose.yml>```
|
||||
|
||||
Log into your new instance at https://**YOUR-FQDN**, with user "root" and the password you specified in gitlab.env.
|
||||
|
||||
[^1]: If you wanted to expose the Wekan UI directly, you could remove the oauth2_proxy from the design, and move the traefik_public-related labels directly to the wekan container. You'd also need to add the traefik_public network to the wekan container.
|
||||
[^1]: Since the whole purpose of media/file sharing is to share stuff with **strangers**, this recipe doesn't take into account any sort of authentication using [Traefik Forward Auth](/ha-docker-swarm/traefik-forward-auth/).
|
||||
|
||||
--8<-- "recipe-footer.md"
|
||||
Reference in New Issue
Block a user