From 00b1b18d4deb8019620f556e3deca71403a6ef7e Mon Sep 17 00:00:00 2001 From: David Young Date: Mon, 11 Dec 2017 21:00:15 +1300 Subject: [PATCH] Fix mkdocs/material updates --- manuscript/recipies/autopirate.md | 113 ++++++++++++++++++++++++++++++ mkdocs.yml | 10 +-- 2 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 manuscript/recipies/autopirate.md diff --git a/manuscript/recipies/autopirate.md b/manuscript/recipies/autopirate.md new file mode 100644 index 0000000..62c55e5 --- /dev/null +++ b/manuscript/recipies/autopirate.md @@ -0,0 +1,113 @@ +# AutoPirate + +Usenet is a geeky alternative to torrents for file-sharing. Because it's so damn complicated, a host of automated tools exist to automate the process of finding, downloading, and managing content. + +This recipe presents a method to combine these tools into a single swarm deployment, and make them available securely. + +![NAME Screenshot](../images/name.jpg) + +Details + +## Ingredients + +1. [Docker swarm cluster](/ha-docker-swarm/) with [persistent shared storage](/ha-docker-swarm/shared-storage-ceph.md) +2. [Traefik](/ha-docker-swarm/traefik) configured per design + +## Preparation + +### Setup data locations + +We'll need several directories to bind-mount into our container, so create them in /var/data/wekan: + +``` +mkdir /var/data/wekan +cd /var/data/wekan +mkdir -p {wekan-db,wekan-db-dump} +``` + +### Prepare environment + +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 " +``` + +### Setup Docker Swarm + +Create a docker swarm config file in docker-compose syntax (v3), something like this: + +!!! tip + I share (_with my [patreon patrons](https://www.patreon.com/funkypenguin)_) a private "_premix_" git repository, which includes necessary docker-compose and env files for all published recipes. This means that patrons can launch any recipe with just a ```git pull``` and a ```docker stack deploy``` 👍 + + +``` +version: '3' + +services: + + wekandb: + image: mongo:3.2.15 + command: mongod --smallfiles --oplogSize 128 + networks: + - internal + volumes: + - /var/data/wekan/wekan-db:/data/db + - /var/data/wekan/wekan-db-dump:/dump + + proxy: + image: zappi/oauth2_proxy + env_file: /var/data/wekan/wekan.env + networks: + - traefik + - internal + deploy: + labels: + - traefik.frontend.rule=Host:wekan.example.com + - traefik.docker.network=traefik + - traefik.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 + + wekan: + image: wekanteam/wekan:latest + networks: + - internal + env_file: /var/data/wekan/wekan.env + +networks: + traefik: + 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 Wekan stack by running ```docker stack deploy wekan -c ``` + +Log into your new instance at https://**YOUR-FQDN**, with user "root" and the password you specified in gitlab.env. + +## Chef's Notes + +1. If you wanted to expose the Wekan UI directly, you could remove the oauth2_proxy from the design, and move the traefik-related labels directly to the wekan container. You'd also need to add the traefik network to the wekan container. diff --git a/mkdocs.yml b/mkdocs.yml index 841c9f7..01dc3ee 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,8 +18,7 @@ docs_dir: 'manuscript' copyright: 'Copyright © 2016 - 2017 David Young' -theme: material -theme_dir: mkdocs-material +#theme_dir: mkdocs-material pages: - Home : index.md - Introduction: @@ -40,6 +39,7 @@ pages: - Kanboard: recipies/kanboard.md - Miniflux: recipies/miniflux.md - Gollum: recipies/gollum.md + - AutoPirate: recipies/autopirate.md - Menu: - Ghost: recipies/ghost.md - GitLab: recipies/gitlab.md @@ -54,10 +54,12 @@ pages: - git-docker : reference/git-docker.md - OpenVPN : reference/openvpn.md -extra: +theme: + name: 'material' + custom_dir: 'mkdocs-material' disqus: 'geeks-cookbook' logo: 'images/site-logo.png' - site_favicon: 'images/favicon.ico' + favicon: 'images/favicon.ico' feature: tabs: false palette: