Replace gonic with navidrome

This commit is contained in:
Nemo 2021-02-16 19:58:53 +05:30
parent 1a0021fb31
commit c6ebee47d7
5 changed files with 79 additions and 36 deletions

View File

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

View File

@ -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 Normal file
View File

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

View File

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

View File

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