1
0
mirror of https://github.com/funkypenguin/geek-cookbook/ synced 2025-12-12 17:26:19 +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:
David Young
2021-01-13 12:36:50 +13:00
committed by GitHub
parent 5bf1acc403
commit 1e5cd5df29
16 changed files with 210 additions and 134 deletions

View File

@@ -1,4 +1,5 @@
mkdocs-material
mkdocs-autolinks-plugin
mkdocs-htmlproofer-plugin
mkdocs-git-revision-date-localized-plugin
mkdocs-git-revision-date-localized-plugin
mkdocs-macros-plugin

View File

@@ -3,4 +3,5 @@ FROM ghcr.io/squidfunk/mkdocs-material-insiders
RUN pip install \
mkdocs-autolinks-plugin \
mkdocs-htmlproofer-plugin \
mkdocs-git-revision-date-localized-plugin
mkdocs-git-revision-date-localized-plugin \
mkdocs-macros-plugin

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
!!! tip
!!! tip inline end
I share (_with my [sponsors](https://github.com/sponsors/funkypenguin)_) a private "[_premix_](https://geek-cookbook.funkypenguin.co.nz/premix/)" git repository, 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` 👍.
🚀 **Update**: Premix now includes an ansible playbook, so that sponsors can deploy an entire stack + recipes, with a single ansible command! (more [here](https://geek-cookbook.funkypenguin.co.nz/premix/ansible/operation/))
🚀 **Update**: Premix now includes an ansible playbook, so that sponsors can deploy an entire stack + recipes, with a single ansible command! (*more [here](https://geek-cookbook.funkypenguin.co.nz/premix/ansible/operation/)*)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,27 +0,0 @@
document.addEventListener("DOMContentLoaded", function() {
load_navpane();
});
function load_navpane() {
var width = window.innerWidth;
if (width <= 1200) {
return;
}
var nav = document.getElementsByClassName("md-nav");
for(var i = 0; i < nav.length; i++) {
if (typeof nav.item(i).style === "undefined") {
continue;
}
if (nav.item(i).getAttribute("data-md-level") && nav.item(i).getAttribute("data-md-component")) {
nav.item(i).style.display = 'block';
nav.item(i).style.overflow = 'visible';
}
}
var nav = document.getElementsByClassName("md-nav__toggle");
for(var i = 0; i < nav.length; i++) {
nav.item(i).checked = true;
}
}

View File

@@ -0,0 +1,6 @@
app.document$.subscribe(function() {
var tables = document.querySelectorAll("article table")
tables.forEach(function(table) {
new Tablesort(table)
})
})

BIN
manuscript/images/linx.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

@@ -6,8 +6,13 @@ hide:
# Welcome, fellow geek :wave:
## What is this?
Funky Penguin's "**[Geek Cookbook](https://geek-cookbook.funkypenguin.co.nz)**" is a collection of how-to guides for establishing your own container-based self-hosting platform, using either [Docker Swarm](/ha-docker-swarm/design/) or [Kubernetes](/kubernetes/).
[Dive into Docker Swarm](/ha-docker-swarm/design/){: .md-button .md-button--primary}
[Kick it with Kubernetes](/kubernetes/){: .md-button}
Running such a platform enables you to run self-hosted tools such as [AutoPirate](/recipes/autopirate/) (*Radarr, Sonarr, NZBGet and friends*), [Plex](https://www.plex.tv/), [NextCloud](https://nextcloud.com/), and includes elements such as:
* [Automatic SSL-secured access](/ha-docker-swarm/traefik/) to all services (*with LetsEncrypt*)

View File

@@ -40,7 +40,7 @@ config:
# cloudflare_api_key:
# if you're using route53
AWS_ACCESS_KEY_ID: "{{ vault_config.traefik.aws_access_key_id }}"
AWS_SECRET_ACCESS_KEY: "{{ vault_config.traefik.aws_secret_access_key }}"
AWS_ACCESS_KEY_ID: {{ "{{ vault_config.traefik.aws_access_key_id }}" }}
AWS_SECRET_ACCESS_KEY: {{ "{{ vault_config.traefik.aws_secret_access_key }}" }}
AWS_REGION: ""
```

View 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?
![Linx Screenshot](../images/linx.png){: 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"

View File

@@ -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

View File

@@ -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
![Linx Screenshot](../images/linx.png)
Intro
[Linx](https://github.com/andreimarcu/linx-server) is self-hosted file/media-sharing service, which features:
![NAME Screenshot](../images/name.jpg)
- :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"

View File

@@ -25,6 +25,8 @@ plugins:
- git-revision-date-localized:
type: date
- autolinks
- macros:
verbose: true
@@ -104,6 +106,7 @@ nav:
- OIDC Provider: recipes/keycloak/setup-oidc-provider.md
- OpenLDAP: recipes/keycloak/authenticate-against-openldap.md
- Komga: recipes/komga.md
- Linx: recipes/linx.md
- Minio: recipes/minio.md
- OpenLDAP: recipes/openldap.md
- OwnTracks: recipes/owntracks.md
@@ -150,24 +153,22 @@ nav:
- Chef's Favorites:
- Kanboard: recipes/kubernetes/kanboard.md
- Miniflux: recipes/kubernetes/miniflux.md
- 🍰 Get Premix!:
- 🚀 Get Premix!:
- Start: premix.md
- Ansible:
- Operation: premix/ansible/operation.md
- Design: premix/ansible/design.md
- Swarm: premix/swarm.md
- Kubernetes: premix/kubernetes.md
- CHANGELOG:
- Start: CHANGELOG.md
- Support:
- Start: support.md
- Contribute:
- Start: community/contribute.md
- CHANGELOG: CHANGELOG.md
- Support: support.md
- Contribute: community/contribute.md
- Community:
- Code of Conduct: community/code-of-conduct.md
- Discord: community/discord.md
- Support: support.md
- Contribute: community/contribute.md
- Discord: community/discord.md
- Code of Conduct: community/code-of-conduct.md
# # - Discourse: community/discourse.md
# # - GitHub: community/github.md
@@ -231,14 +232,16 @@ google_analytics:
- 'UA-139253-18'
- 'auto'
extra_css:
- 'stylesheets/mailchimp.css'
# extra_css:
extra_javascript:
- 'extras/javascript/discord.js'
- extras/javascript/discord.js
- extras/javascript/sortable-tables.js
- https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/tablesort.min.js
# Extensions
markdown_extensions:
- attr_list
- admonition
- codehilite:
linenums: true

View File

@@ -5,4 +5,5 @@ Markdown>=3.0.1
mkdocs-minify-plugin>=0.2
mkdocs-autolinks-plugin>=0.2.0
mkdocs-htmlproofer-plugin>=0.0.3
mkdocs-git-revision-date-localized-plugin>=0.4.8
mkdocs-git-revision-date-localized-plugin>=0.4.8
mkdocs-macros-plugin