mirror of
https://github.com/kmein/niveum
synced 2026-03-20 03:51:07 +01:00
feat(mpd-fm): allow network access with password
This commit is contained in:
@@ -4,6 +4,7 @@ let
|
|||||||
di-fm-key = lib.strings.fileContents <secrets/di.fm/key>;
|
di-fm-key = lib.strings.fileContents <secrets/di.fm/key>;
|
||||||
};
|
};
|
||||||
multi-room-audio-port = 8000;
|
multi-room-audio-port = 8000;
|
||||||
|
password = lib.strings.fileContents <system-secrets/mpd-web.key>;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@@ -12,10 +13,13 @@ in
|
|||||||
|
|
||||||
services.mpd = {
|
services.mpd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
network.listenAddress = "0.0.0.0";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
log_level "default"
|
log_level "default"
|
||||||
auto_update "yes"
|
auto_update "yes"
|
||||||
|
|
||||||
|
password "${password}@read,add,control"
|
||||||
|
|
||||||
audio_output {
|
audio_output {
|
||||||
type "pulse"
|
type "pulse"
|
||||||
name "zaatar single room audio system"
|
name "zaatar single room audio system"
|
||||||
@@ -62,7 +66,8 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
networking.firewall.allowedTCPPorts = [ 80 config.services.mpd.network.port ];
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedGzipSettings = true;
|
recommendedGzipSettings = true;
|
||||||
@@ -70,7 +75,7 @@ in
|
|||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedTlsSettings = true;
|
||||||
virtualHosts.default = {
|
virtualHosts.default = {
|
||||||
basicAuth.dj = lib.strings.fileContents <system-secrets/mpd-web.key>;
|
basicAuth.dj = password;
|
||||||
locations."= /listen.ogg" = {
|
locations."= /listen.ogg" = {
|
||||||
proxyPass = "http://127.0.0.1:${toString multi-room-audio-port}";
|
proxyPass = "http://127.0.0.1:${toString multi-room-audio-port}";
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user