Adds tt-rss and radarr

This commit is contained in:
Nemo 2018-01-30 01:39:36 +05:30
parent bad8b86aa1
commit e06a21286a
10 changed files with 139 additions and 4 deletions

View File

@ -11,6 +11,9 @@ defaultEntryPoints = ["http", "https"]
[[entryPoints.https.tls.certificates]]
certFile = "/etc/traefik/git.captnemo.in.crt"
keyFile = "/etc/traefik/git.captnemo.in.key"
[[entryPoints.https.tls.certificates]]
certFile = "/etc/traefik/rss.captnemo.in.crt"
keyFile = "/etc/traefik/rss.captnemo.in.key"
[docker]
# Make sure you mount this as readonly

View File

@ -57,6 +57,16 @@ resource "docker_container" "traefik" {
file = "/etc/traefik/git.captnemo.in.key"
}
upload {
content = "${file("/home/nemo/projects/personal/certs/rss.captnemo.in/fullchain.pem")}"
file = "/etc/traefik/rss.captnemo.in.crt"
}
upload {
content = "${file("/home/nemo/projects/personal/certs/rss.captnemo.in/privkey.pem")}"
file = "/etc/traefik/rss.captnemo.in.key"
}
volumes {
host_path = "/var/run/docker.sock"
container_path = "/var/run/docker.sock"

View File

@ -32,6 +32,12 @@ module "radicale" {
domain = "radicale.bb8.fun"
}
module "tt-rss" {
source = "tt-rss"
domain = "rss.captnemo.in"
mysql_password = "${var.mysql-ttrss-password}"
}
module "media" {
source = "media"
domain = "bb8.fun"

55
media/radarr.tf Normal file
View File

@ -0,0 +1,55 @@
data "docker_registry_image" "radarr" {
name = "linuxserver/radarr:latest"
}
resource "docker_image" "radarr" {
name = "${data.docker_registry_image.radarr.name}"
pull_triggers = ["${data.docker_registry_image.radarr.sha256_digest}"]
}
resource docker_container "radarr" {
name = "radarr"
image = "${docker_image.radarr.latest}"
labels {
"traefik.port" = 7878
"traefik.enable" = "true"
"traefik.frontend.headers.SSLTemporaryRedirect" = "true"
"traefik.frontend.headers.STSSeconds" = "2592000"
"traefik.frontend.headers.STSIncludeSubdomains" = "false"
"traefik.frontend.headers.contentTypeNosniff" = "true"
"traefik.frontend.headers.browserXSSFilter" = "true"
"traefik.frontend.passHostHeader" = "true"
# TODO: wildcard certs needed!
"traefik.frontend.rule" = "Host:git.${var.domain}"
}
memory = 512
restart = "unless-stopped"
destroy_grace_seconds = 10
must_run = true
volumes {
host_path = "/mnt/xwing/config/radarr"
container_path = "/config"
}
volumes {
host_path = "/mnt/xwing/media/DL"
container_path = "/downloads"
}
volumes {
host_path = "/mnt/xwing/media/Movies"
container_path = "/movies"
}
env = [
"PUID=1004",
"PGID=1003",
"TZ=Asia/Kolkata",
]
links = ["emby", "transmission"]
}

View File

@ -48,4 +48,6 @@ resource docker_container "sonarr" {
"PGID=1003",
"TZ=Asia/Kolkata",
]
links = ["emby", "transmission"]
}

View File

@ -1,6 +1,3 @@
# # This is pending on https://github.com/hashicorp/go-version/pull/34
# Create a Database
resource "mysql_database" "lychee" {
name = "lychee"
}
@ -18,7 +15,6 @@ resource "mysql_grant" "lychee" {
privileges = ["ALL"]
}
# Create a Database
resource "mysql_database" "airsonic" {
name = "airsonic"
}

16
tt-rss/db.tf Normal file
View File

@ -0,0 +1,16 @@
resource "mysql_database" "ttrss" {
name = "ttrss"
}
resource "mysql_user" "ttrss" {
user = "ttrss"
host = "%"
plaintext_password = "${var.mysql_password}"
}
resource "mysql_grant" "ttrss" {
user = "${mysql_user.ttrss.user}"
host = "${mysql_user.ttrss.host}"
database = "${mysql_database.ttrss.name}"
privileges = ["ALL"]
}

40
tt-rss/main.tf Normal file
View File

@ -0,0 +1,40 @@
data "docker_registry_image" "tt-rss" {
name = "linuxserver/tt-rss:latest"
}
resource "docker_image" "tt-rss" {
name = "${data.docker_registry_image.tt-rss.name}"
pull_triggers = ["${data.docker_registry_image.tt-rss.sha256_digest}"]
}
resource docker_container "tt-rss" {
name = "tt-rss"
image = "${docker_image.tt-rss.latest}"
labels {
"traefik.port" = 80
"traefik.enable" = "true"
"traefik.frontend.headers.SSLTemporaryRedirect" = "true"
"traefik.frontend.headers.STSSeconds" = "2592000"
"traefik.frontend.headers.STSIncludeSubdomains" = "false"
"traefik.frontend.headers.contentTypeNosniff" = "true"
"traefik.frontend.headers.browserXSSFilter" = "true"
"traefik.frontend.passHostHeader" = "true"
"traefik.frontend.rule" = "Host:${var.domain}"
}
volumes {
host_path = "/mnt/xwing/config/tt-rss"
container_path = "/config"
}
links = ["mariadb"]
env = [
"TZ=Asia/Kolkata",
]
restart = "unless-stopped"
destroy_grace_seconds = 10
must_run = true
}

5
tt-rss/variables.tf Normal file
View File

@ -0,0 +1,5 @@
variable "domain" {
type = "string"
}
variable "mysql_password" {}

View File

@ -21,6 +21,8 @@ variable "mysql_airsonic_password" {}
variable "mysql_kodi_password" {}
variable "mysql-ttrss-password" {}
variable "wiki_session_secret" {
type = "string"
}