From a0e5f7edd71ee90d76d31e47adc18b70eb07c519 Mon Sep 17 00:00:00 2001 From: Nemo Date: Sun, 26 Nov 2017 13:15:28 +0530 Subject: [PATCH] Adds more and more things --- docker/conf/transmission.json | 10 +-- docker/conf/wiki.yml | 141 ++++++++++++++++++++++++++++++++++ docker/data.tf | 19 +++++ docker/images.tf | 15 ++++ docker/main.tf | 115 +++++++++++++++++++++++++++ docker/volumes.tf | 4 +- 6 files changed, 297 insertions(+), 7 deletions(-) create mode 100644 docker/conf/wiki.yml diff --git a/docker/conf/transmission.json b/docker/conf/transmission.json index 5b58c72..ba0052f 100644 --- a/docker/conf/transmission.json +++ b/docker/conf/transmission.json @@ -8,17 +8,17 @@ "alt-speed-up": 50, "bind-address-ipv4": "0.0.0.0", "bind-address-ipv6": "::", - "blocklist-enabled": false, - "blocklist-url": "http://www.example.com/blocklist", - "cache-size-mb": 4, + "blocklist-enabled": true, + "blocklist-url": "http://john.bitsurge.net/public/biglist.p2p.gz", + "cache-size-mb": 16, "dht-enabled": true, - "download-dir": "/downloads/complete", + "download-dir": "/downloads", "download-queue-enabled": true, "download-queue-size": 5, "encryption": 1, "idle-seeding-limit": 30, "idle-seeding-limit-enabled": false, - "incomplete-dir": "/downloads/incomplete", + "incomplete-dir": "/downloads", "incomplete-dir-enabled": true, "lpd-enabled": false, "message-level": 2, diff --git a/docker/conf/wiki.yml b/docker/conf/wiki.yml new file mode 100644 index 0000000..c5f4b3d --- /dev/null +++ b/docker/conf/wiki.yml @@ -0,0 +1,141 @@ +####################################################################### +# Wiki.js - CONFIGURATION # +####################################################################### +# Full explanation + examples in the documentation: +# https://docs.requarks.io/wiki/install +# You can use an ENV variable by using $(ENV_VAR_NAME) as the value + +# --------------------------------------------------------------------- +# Title of this site +# --------------------------------------------------------------------- + +title: Nemo's Wiki + +# --------------------------------------------------------------------- +# Full public path to the site, without the trailing slash +# --------------------------------------------------------------------- +# INCLUDE CLIENT PORT IF NOT 80/443! + +host: http://wiki.in.bb8.fun:8888 + +# --------------------------------------------------------------------- +# Port the main server should listen to (80 by default) +# --------------------------------------------------------------------- +# To use process.env.PORT, comment the line below: + +port: 3000 + +# --------------------------------------------------------------------- +# Data Directories +# --------------------------------------------------------------------- + +paths: + repo: /repo + data: /data + +# --------------------------------------------------------------------- +# Upload Limits +# --------------------------------------------------------------------- +# In megabytes (MB) + +uploads: + maxImageFileSize: 5 + maxOtherFileSize: 100 + +# --------------------------------------------------------------------- +# Site Language +# --------------------------------------------------------------------- +# Possible values: en, de, es, fa, fr, ja, ko, nl, pt, ru, sr, tr or zh + +lang: en + +# Enable for right to left languages (e.g. arabic): +langRtl: false + +# --------------------------------------------------------------------- +# Site Authentication +# --------------------------------------------------------------------- + +public: false + +auth: + defaultReadAccess: false + local: + enabled: true + google: + enabled: true + clientId: GOOGLE_CLIENT_ID + clientSecret: GOOGLE_CLIENT_SECRET + +# --------------------------------------------------------------------- +# Secret key to use when encrypting sessions +# --------------------------------------------------------------------- +# Use a long and unique random string (256-bit keys are perfect!) + +sessionSecret: 83941e2642ff1feafa410f35497c4ac6bc28d3226ca438225319ae1c9e670cdb + +# --------------------------------------------------------------------- +# Database Connection String +# --------------------------------------------------------------------- + +db: mongodb://mongo:27017/wiki + +# --------------------------------------------------------------------- +# Git Connection Info +# --------------------------------------------------------------------- + +git: + url: https://github.com/Organization/Repo + branch: master + auth: + + # Type: basic or ssh + type: ssh + + # Only for Basic authentication: + username: marty + password: MartyMcFly88 + + # Only for SSH authentication: + privateKey: /etc/wiki/keys/git.pem + + sslVerify: true + + # Default email to use as commit author + serverEmail: marty@example.com + + # Whether to use user email as author in commits + showUserEmail: true + +# --------------------------------------------------------------------- +# Features +# --------------------------------------------------------------------- +# You can enable / disable specific features below + +features: + linebreaks: true + mathjax: false + +# --------------------------------------------------------------------- +# External Logging +# --------------------------------------------------------------------- + +externalLogging: + bugsnag: false + loggly: false + papertrail: false + rollbar: false + sentry: false + +# --------------------------------------------------------------------- +# Color Theme +# --------------------------------------------------------------------- + +theme: + primary: indigo + alt: blue-grey + viewSource: all # all | write | false + footer: blue-grey + code: + dark: true + colorize: true \ No newline at end of file diff --git a/docker/data.tf b/docker/data.tf index 34f7f6c..a0a718e 100644 --- a/docker/data.tf +++ b/docker/data.tf @@ -1,6 +1,14 @@ +# Database versions shouldn't be upgraded + data "docker_registry_image" "mariadb" { name = "mariadb:10.3" } +# This is a lighter image, than the official one +data "docker_registry_image" "mongo" { + name = "mvertes/alpine-mongo:3.4.10-0" +} + +# Leave all other apps at latesst data "docker_registry_image" "emby" { name = "emby/embyserver:latest" @@ -22,6 +30,9 @@ data "docker_registry_image" "traefik" { name = "traefik:latest" } +# The gitea latest is built against master +# so can't use that, and 1.3 isn't released yet +# https://github.com/go-gitea/gitea/releases data "docker_registry_image" "gitea" { name = "gitea/gitea:1.3.0-rc1" } @@ -36,4 +47,12 @@ data "docker_registry_image" "airsonic" { data "docker_registry_image" "wikijs" { name = "requarks/wiki:latest" +} + +data "docker_registry_image" "headphones" { + name = "linuxserver/headphones:latest" +} + +data "docker_registry_image" "muximux" { + name = "linuxserver/muximux:latest" } \ No newline at end of file diff --git a/docker/images.tf b/docker/images.tf index 327a259..e59e6f8 100644 --- a/docker/images.tf +++ b/docker/images.tf @@ -46,4 +46,19 @@ resource "docker_image" "airsonic" { resource "docker_image" "wikijs" { name = "${data.docker_registry_image.wikijs.name}" pull_triggers = ["${data.docker_registry_image.wikijs.sha256_digest}"] +} + +resource "docker_image" "mongo" { + name = "${data.docker_registry_image.mongo.name}" + pull_triggers = ["${data.docker_registry_image.mongo.sha256_digest}"] +} + +resource "docker_image" "headphones" { + name = "${data.docker_registry_image.headphones.name}" + pull_triggers = ["${data.docker_registry_image.headphones.sha256_digest}"] +} + +resource "docker_image" "muximux" { + name = "${data.docker_registry_image.muximux.name}" + pull_triggers = ["${data.docker_registry_image.muximux.sha256_digest}"] } \ No newline at end of file diff --git a/docker/main.tf b/docker/main.tf index c35cabd..7e7ebf8 100644 --- a/docker/main.tf +++ b/docker/main.tf @@ -327,4 +327,119 @@ resource "docker_container" "sickrage" { "PUID=1000", "TZ=Asia/Kolkata", ] +} + +resource "docker_container" "headphones" { + name = "headphones" + image = "${docker_image.headphones.latest}" + + restart = "unless-stopped" + destroy_grace_seconds = 10 + must_run = true + + volumes { + host_path = "/mnt/xwing/config/headphones" + container_path = "/config" + } + + volumes { + host_path = "/mnt/xwing/media/DL" + container_path = "/downloads" + } + + volumes { + host_path = "/mnt/xwing/media/Music" + container_path = "/music" + } + + labels { + "traefik.port" = 8181 + "traefik.enable" = "true" + } + + # lounge:tatooine + env = [ + "PUID=1004", + "PGID=1003", + "TZ=Asia/Kolkata", + ] +} + +resource "docker_container" "wiki" { + name = "wiki" + image = "${docker_image.wikijs.latest}" + + # This is the wiki user account + user = "1006" + restart = "unless-stopped" + destroy_grace_seconds = 10 + must_run = true + + upload { + content = "${file("${path.module}/conf/wiki.yml")}" + file = "/var/wiki/config.yml" + } + + volumes { + host_path = "/mnt/xwing/data/wiki/data" + container_path = "/data" + } + + volumes { + host_path = "/mnt/xwing/data/wiki/repo" + container_path = "/repo" + } + + labels { + "traefik.port" = 3000 + "traefik.enable" = "true" + } + + env = [ + "WIKI_ADMIN_EMAIL=me@captnemo.in", + ] + + links = ["mongo"] +} + +resource "docker_container" "mongo" { + name = "mongo" + image = "${docker_image.mongo.latest}" + + restart = "unless-stopped" + destroy_grace_seconds = 10 + must_run = true + + volumes { + volume_name = "${docker_volume.mongo_data_volume.name}" + container_path = "/data/db" + host_path = "${docker_volume.mongo_data_volume.mountpoint}" + } +} + +resource "docker_container" "muximux" { + name = "muximux" + image = "${docker_image.muximux.latest}" + + restart = "unless-stopped" + destroy_grace_seconds = 10 + must_run = true + + + volumes { + host_path = "/mnt/xwing/config/muximux" + container_path = "/config" + } + + labels { + "traefik.port" = 80 + "traefik.enable" = "true" + } + + # lounge:tatooine + env = [ + "PUID=1004", + "PGID=1003", + "TZ=Asia/Kolkata", + ] } \ No newline at end of file diff --git a/docker/volumes.tf b/docker/volumes.tf index ec5d0ce..7f65745 100644 --- a/docker/volumes.tf +++ b/docker/volumes.tf @@ -6,6 +6,6 @@ resource "docker_volume" "gitea_volume" { name = "gitea_volume" } -resource "docker_volume" "wiki_data_volume" { - name = "wiki_data_volume" +resource "docker_volume" "mongo_data_volume" { + name = "mongo_data_volume" } \ No newline at end of file