linuxserver / docker-airsonic

GNU General Public License v3.0
37 stars 8 forks source link

Mixed Content warnings behind HTTPS #13

Closed captn3m0 closed 6 years ago

captn3m0 commented 6 years ago

linuxserver.io

Host: Arch Linux

Launch Configuration: https://git.captnemo.in/nemo/nebula/src/branch/master/media/airsonic.tf

No symlinks on volume mounts

As documented at https://github.com/airsonic/airsonic/issues/594#issuecomment-395035695, linuxserver/airsonic does not support running behind a HTTPS Proxy, and gives mixed content warnings. The same does not happen with the airsonic/airsonic container.

j0nnymoe commented 6 years ago

Got an example of which pages give the mixed content warnings? I haven't noticed this myself on my setup.

captn3m0 commented 6 years ago

Warnings on the home page post login:

image

captn3m0 commented 6 years ago

Update: I've added the suggested JAVA_OPTS from the last few comments at https://github.com/airsonic/airsonic/issues/594#issuecomment-395035695 and it still doesn't work

This is the Config section from docker inspect:

 {
            "Hostname": "8e760f3184f0",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "4040/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PUID=1004",
                "PGID=1003",
                "TZ=Asia/Kolkata",
                "JAVA_OPTS=-Xmx512m -Dserver.use-forward-headers=true -Dserver.context-path=/",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "PS1=$(whoami)@$(hostname):$(pwd)$ ",
                "HOME=/root",
                "TERM=xterm",
                "AIRSONIC_HOME=/app/airsonic",
                "AIRSONIC_SETTINGS=/config"
            ],
            "Cmd": null,
            "ArgsEscaped": true,
            "Image": "sha256:74fa3512b63aef9e9acf6998a436060ba4545f520e555de1bba85d12f9b04892",
            "Volumes": {
                "/config": {},
                "/media": {},
                "/music": {},
                "/playlists": {},
                "/podcasts": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "/init"
            ],
            "OnBuild": null,
            "Labels": {
                "build_version": "Linuxserver.io version:- 54 Build-date:- June-08-2018-22:04:48-UTC",
                "maintainer": "sparklyballs",
                "traefik.enable": "true",
                "traefik.frontend.passHostHeader": "true",
                "traefik.frontend.rule": "Host:airsonic.in.bb8.fun,airsonic.bb8.fun",
                "traefik.port": "4040"
            }
        }
sparklyballs commented 6 years ago

lol, thought traefik was supposed to be "easy"

see more questions about it than nginx proxying

sparklyballs commented 6 years ago

i think it is more the combo of our docker and traefik than specifically our docker per se as we haven't seen this with nginx afaik

captn3m0 commented 6 years ago

I disagree. My traefik instance is sending in all the correct proxy headers: https://debug.bb8.fun/ (This is an nginx echo server running behind the same traefik).

Airsonic (the app) does not seem to be receiving the X-Forwarded-* headers. Pretty sure Jetty is, but not forwarding them correctly.

sparklyballs commented 6 years ago

well i'm not seeing that error in the console with an nginx reverse proxy to https://airsonic.sparklyballs.com

seeing something else

[Error] Error parsing header X-XSS-Protection: 1; mode=block, 1; mode=block, 1; mode=block: expected semicolon at character position 14. The default protections will be applied. (airsonic.sparklyballs.com, line 1)

but i'm sure that's resolvable by tweaking settings

j0nnymoe commented 6 years ago

@captn3m0 untitled That's mine - not getting the mixed content issue, this is using our nginx/letsencrypt container.

sparklyballs commented 6 years ago

and mine, now i've resolved the X-XSS-Protection settings

screen shot 2018-06-12 at 18 23 33

captn3m0 commented 6 years ago

Thanks. Do you mind sharing the output for docker inspect <container_id>? Just the Config and NetworkSettings section should do.

All of my other apps pick up the headers correctly, and I'm running out of ideas how I might fix this.

CHBMB commented 6 years ago

I also use an nginx reverse proxy and not having any issues. Will post those outputs once I put the kiddie to bed.

CHBMB commented 6 years ago

@captn3m0

root@server:~# docker inspect airsonic
[
    {
        "Id": "6852003c2d39f9c51dc6d94053a84cccf45366ed096abd614f415ed522477dfb",
        "Created": "2018-06-08T23:02:46.716804869Z",
        "Path": "/init",
        "Args": [],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 30106,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2018-06-11T02:46:20.188995569Z",
            "FinishedAt": "2018-06-11T02:00:06.155158317Z"
        },
        "Image": "sha256:74fa3512b63aef9e9acf6998a436060ba4545f520e555de1bba85d12f9b04892",
        "ResolvConfPath": "/var/lib/docker/containers/6852003c2d39f9c51dc6d94053a84cccf45366ed096abd614f415ed522477dfb/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/6852003c2d39f9c51dc6d94053a84cccf45366ed096abd614f415ed522477dfb/hostname",
        "HostsPath": "/var/lib/docker/containers/6852003c2d39f9c51dc6d94053a84cccf45366ed096abd614f415ed522477dfb/hosts",
        "LogPath": "/var/lib/docker/containers/6852003c2d39f9c51dc6d94053a84cccf45366ed096abd614f415ed522477dfb/6852003c2d39f9c51dc6d94053a84cccf45366ed096abd614f415ed522477dfb-json.log",
        "Name": "/airsonic",
        "RestartCount": 0,
        "Driver": "btrfs",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/mnt/user/music/1. Playlists/:/playlists:rw",
                "/mnt/user/books/audiobooks/podcasts/:/podcasts:rw",
                "/mnt/user/music/:/media:rw",
                "/mnt/disks/virtualisation/.appdata/airsonic:/config:rw,slave",
                "/mnt/user/music/:/music:rw"
            ],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "bridge",
            "PortBindings": {
                "4040/tcp": [
                    {
                        "HostIp": "",
                        "HostPort": "4041"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "shareable",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": [],
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0
        },
        "GraphDriver": {
            "Data": null,
            "Name": "btrfs"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/mnt/user/music/1. Playlists",
                "Destination": "/playlists",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/mnt/user/books/audiobooks/podcasts",
                "Destination": "/podcasts",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/mnt/user/music",
                "Destination": "/media",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/mnt/disks/virtualisation/.appdata/airsonic",
                "Destination": "/config",
                "Mode": "rw,slave",
                "RW": true,
                "Propagation": "slave"
            },
            {
                "Type": "bind",
                "Source": "/mnt/user/music",
                "Destination": "/music",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "6852003c2d39",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "ExposedPorts": {
                "4040/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "TZ=Europe/London",
                "HOST_OS=unRAID",
                "PUID=99",
                "PGID=100",
                "CONTEXT_PATH=airsonic",
                "JAVA_OPTS=-Xms256m -Xmx512m",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "PS1=$(whoami)@$(hostname):$(pwd)$ ",
                "HOME=/root",
                "TERM=xterm",
                "AIRSONIC_HOME=/app/airsonic",
                "AIRSONIC_SETTINGS=/config"
            ],
            "Cmd": null,
            "ArgsEscaped": true,
            "Image": "linuxserver/airsonic",
            "Volumes": {
                "/config": {},
                "/media": {},
                "/music": {},
                "/playlists": {},
                "/podcasts": {}
            },
            "WorkingDir": "",
            "Entrypoint": [
                "/init"
            ],
            "OnBuild": null,
            "Labels": {
                "build_version": "Linuxserver.io version:- 54 Build-date:- June-08-2018-22:04:48-UTC",
                "maintainer": "sparklyballs"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "13d1df9dac5e764a677ab92da8daddf615dbe1bf6c9cf8b1bdc01856f07f5283",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "4040/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "4041"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/13d1df9dac5e",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "e4037e6db0b93172056ddc96dcc6907d72d3bdf670a79cff7e15cb70436351a6",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "639b5ca941cc60b4c4e6bb4df21da8bdeface5f3df528464c4f2b1b9778ab0e0",
                    "EndpointID": "e4037e6db0b93172056ddc96dcc6907d72d3bdf670a79cff7e15cb70436351a6",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02",
                    "DriverOpts": null
                }
            }
        }
    }
]
ironicbadger commented 6 years ago

Closing due to inactivity.

Friday13th87 commented 4 years ago

this was closed due inactivity but does anyone knows, now at 2020, how to get this working for traefik reverse proxy? i need to enable unsafe scripts to fully access the airsonic page i added Dserver.context-path=/ and Dserver.use-forward-headers=true as java_ops every other linuxserver container is running fine with traefik but airsonic