home&script
This commit is contained in:
@@ -9,7 +9,6 @@ let
|
|||||||
Entrypoint = [ "${pkgs.jellyfin}/bin/jellyfin" ];
|
Entrypoint = [ "${pkgs.jellyfin}/bin/jellyfin" ];
|
||||||
ExposedPorts = { "8096/tcp" = { }; };
|
ExposedPorts = { "8096/tcp" = { }; };
|
||||||
Env = [
|
Env = [
|
||||||
"HOME=/tmp"
|
|
||||||
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||||
"NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
"NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||||
];
|
];
|
||||||
@@ -42,6 +41,7 @@ in {
|
|||||||
# imageFile = image;
|
# imageFile = image;
|
||||||
port = 8096;
|
port = 8096;
|
||||||
extraEnv = {
|
extraEnv = {
|
||||||
|
HOME = "/config/data";
|
||||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = "1";
|
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = "1";
|
||||||
JELLYFIN_WEB_DIR = "${pkgs.jellyfin-web}/share/jellyfin-web";
|
JELLYFIN_WEB_DIR = "${pkgs.jellyfin-web}/share/jellyfin-web";
|
||||||
JELLYFIN_HttpListenerHost__BindAddress= "0.0.0.0"; #we can use settings.xml override
|
JELLYFIN_HttpListenerHost__BindAddress= "0.0.0.0"; #we can use settings.xml override
|
||||||
@@ -84,30 +84,30 @@ in {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! ${pkgs.curl}/bin/curl -sSf -X POST "''$JELLYFIN_URL/Startup/Configuration" \
|
if ! ${pkgs.curl}/bin/curl -sSf -X POST "$JELLYFIN_URL/Startup/Configuration" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"ServerName":"jellyfin","UICulture":"en-US","MetadataCountryCode":"US","PreferredMetadataLanguage":"en"}'; then
|
-d '{"ServerName":"Flix","UICulture":"en-US","MetadataCountryCode":"US","PreferredMetadataLanguage":"en"}'; then
|
||||||
echo "ERROR: Failed to set startup configuration."
|
echo "ERROR: Failed to set startup configuration."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SETUP_USER_PAYLOAD=$(${pkgs.jq}/bin/jq -n \
|
SETUP_USER_PAYLOAD=$(${pkgs.jq}/bin/jq -n \
|
||||||
--arg name "''\${DEFAULT_ADMIN_USERNAME}" \
|
--arg name "$DEFAULT_ADMIN_USERNAME" \
|
||||||
--arg pass "''\${DEFAULT_ADMIN_PASSWORD}" \
|
--arg pass "$DEFAULT_ADMIN_PASSWORD" \
|
||||||
'{"Name": $name, "Password": $pass}')
|
'{"Name": $name, "Password": $pass}')
|
||||||
|
|
||||||
echo "Payload to be sent to /Startup/User: ''$SETUP_USER_PAYLOAD"
|
echo "Payload to be sent to /Startup/User: $SETUP_USER_PAYLOAD"
|
||||||
|
|
||||||
if ! ${pkgs.curl}/bin/curl -sSf -X POST "''$JELLYFIN_URL/Startup/User" \
|
if ! ${pkgs.curl}/bin/curl -sSf -X POST "$JELLYFIN_URL/Startup/User" \
|
||||||
-H 'accept: */*' \
|
-H 'accept: */*' \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "''${SETUP_USER_PAYLOAD}"; then
|
-d "$SETUP_USER_PAYLOAD"; then
|
||||||
echo "ERROR: Failed to set admin user."
|
echo "ERROR: Failed to set admin user."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Enable remote access, disable UPnP auto-mapping
|
# Enable remote access, disable UPnP auto-mapping
|
||||||
if ! ${pkgs.curl}/bin/curl -sSf -X POST "''$JELLYFIN_URL/Startup/RemoteAccess" \
|
if ! ${pkgs.curl}/bin/curl -sSf -X POST "$JELLYFIN_URL/Startup/RemoteAccess" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"EnableRemoteAccess":true,"EnableAutomaticPortMapping":false}'; then
|
-d '{"EnableRemoteAccess":true,"EnableAutomaticPortMapping":false}'; then
|
||||||
echo "ERROR: Failed to configure remote access."
|
echo "ERROR: Failed to configure remote access."
|
||||||
|
|||||||
Reference in New Issue
Block a user