home&script
This commit is contained in:
@@ -9,7 +9,6 @@ let
|
||||
Entrypoint = [ "${pkgs.jellyfin}/bin/jellyfin" ];
|
||||
ExposedPorts = { "8096/tcp" = { }; };
|
||||
Env = [
|
||||
"HOME=/tmp"
|
||||
"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;
|
||||
port = 8096;
|
||||
extraEnv = {
|
||||
HOME = "/config/data";
|
||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = "1";
|
||||
JELLYFIN_WEB_DIR = "${pkgs.jellyfin-web}/share/jellyfin-web";
|
||||
JELLYFIN_HttpListenerHost__BindAddress= "0.0.0.0"; #we can use settings.xml override
|
||||
@@ -84,30 +84,30 @@ in {
|
||||
exit 0
|
||||
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" \
|
||||
-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."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SETUP_USER_PAYLOAD=$(${pkgs.jq}/bin/jq -n \
|
||||
--arg name "''\${DEFAULT_ADMIN_USERNAME}" \
|
||||
--arg pass "''\${DEFAULT_ADMIN_PASSWORD}" \
|
||||
--arg name "$DEFAULT_ADMIN_USERNAME" \
|
||||
--arg pass "$DEFAULT_ADMIN_PASSWORD" \
|
||||
'{"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 "Content-Type: application/json" \
|
||||
-d "''${SETUP_USER_PAYLOAD}"; then
|
||||
-d "$SETUP_USER_PAYLOAD"; then
|
||||
echo "ERROR: Failed to set admin user."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 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" \
|
||||
-d '{"EnableRemoteAccess":true,"EnableAutomaticPortMapping":false}'; then
|
||||
echo "ERROR: Failed to configure remote access."
|
||||
|
||||
Reference in New Issue
Block a user