Browse Source

Replace gonic with navidrome

tf-0.12
Nemo 3 months ago
parent
commit
c6ebee47d7
  1. 4
      main.tf
  2. 36
      media/gonic.tf
  3. 45
      media/navidrome.tf
  4. 16
      media/variables.tf
  5. 14
      secrets.tf

4
main.tf

@ -68,6 +68,10 @@ module "media" {
traefik-labels = "${var.traefik-common-labels}"
ips = "${var.ips}"
traefik-network-id = "${module.docker.traefik-network-id}"
lastfm_api_key = "${data.pass_password.navidrome-lastfm-api-key.password}"
lastfm_secret = "${data.pass_password.navidrome-lastfm-secret.password}"
spotify_id = "${data.pass_password.navidrome-spotify-id.password}"
spotify_secret = "${data.pass_password.navidrome-spotify-secret.password}"
}
module "monitoring" {

36
media/gonic.tf

@ -1,36 +0,0 @@
module "gonic" {
source = "../modules/container"
image = "sentriz/gonic"
name = "gonic"
resource {
memory = "512"
memory_swap = "512"
}
web {
port = 80
host = "gonic.bb8.fun"
expose = true
}
env = [
"GONIC_SCAN_INTERVAL=60",
"GONIC_MUSIC_PATH=/music",
"GONIC_DB_PATH=/data/gonic.db"
]
networks = "${list(docker_network.media.id, data.docker_network.bridge.id)}"
volumes = [
{
host_path = "/mnt/xwing/config/gonic"
container_path = "/data"
},
{
host_path = "/mnt/xwing/media/Music"
container_path = "/music"
read_only = true
}
]
}

45
media/navidrome.tf

@ -0,0 +1,45 @@
module "navidrome" {
source = "../modules/container"
image = "deluan/navidrome"
name = "navidrome"
user = 1004
resource {
memory = "1024"
memory_swap = "1024"
}
web {
port = 4533
host = "music.bb8.fun"
expose = true
}
env = [
"ND_SCANINTERVAL=1h",
"ND_LOGLEVEL=info",
"ND_SESSIONTIMEOUT=300h",
"ND_BASEURL=",
"ND_AUTOIMPORTPLAYLISTS=false",
# "ND_UIWELCOMEMESSAGE=Welcome to Scarif Music Archives",
"ND_LASTFM_APIKEY=${var.lastfm_api_key}",
"ND_LASTFM_SECRET=${var.lastfm_secret}",
"ND_SPOTIFY_ID=${var.spotify_id}",
"ND_SPOTIFY_SECRET=${var.spotify_secret}"
]
networks = "${list(docker_network.media.id, data.docker_network.bridge.id)}"
volumes = [
{
host_path = "/mnt/xwing/data/navidrome"
container_path = "/data"
},
{
host_path = "/mnt/xwing/media/Music"
container_path = "/music"
read_only = true
}
]
}

16
media/variables.tf

@ -18,3 +18,19 @@ variable "ips" {
}
variable "traefik-network-id" {}
variable "lastfm_api_key" {
description = "Navidrome Configuration for lastfm_api_key"
type = "string"
}
variable "lastfm_secret" {
description = "Navidrome Configuration for lastfm_secret"
type = "string"
}
variable "spotify_id" {
description = "Navidrome Configuration for spotify_id"
type = "string"
}
variable "spotify_secret" {
description = "Navidrome Configuration for spotify_secret"
type = "string"
}

14
secrets.tf

@ -153,3 +153,17 @@ data "pass_password" "klaxon-secret-key" {
data "pass_password" "klaxon-sendgrid-password" {
path = "klaxon-sendgrid-password"
}
data "pass_password" "navidrome-lastfm-api-key" {
path = "navidrome-lastfm-api-key"
}
data "pass_password" "navidrome-lastfm-secret" {
path = "navidrome-lastfm-secret"
}
data "pass_password" "navidrome-spotify-id" {
path = "navidrome-spotify-id"
}
data "pass_password" "navidrome-spotify-secret" {
path = "navidrome-spotify-secret"
}
Loading…
Cancel
Save