nextcloud / all-in-one

📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.
https://hub.docker.com/r/nextcloud/all-in-one
GNU Affero General Public License v3.0
5.55k stars 643 forks source link

Collabora IPv6 check not working #2014

Closed Zoey2936 closed 1 year ago

Zoey2936 commented 1 year ago

Steps to reproduce

  1. Use a Domain with IPv6 Support
  2. Read logs of Nextcloud container

Expected behavior

IPv6 address gets recognized

Actual behavior

Config value wopi_allowlist for app richdocuments set to \<ipv4>,127.0.0.1/8,192.168.0.0/16,172.16.0.0/12,10.0.0.0/8,fd00::/8,::1,\<domain>

Host OS

Debian 11 (Backports)

Nextcloud AIO version

v4.4.1

Current channel

Beta

Other valuable info

    COLLABORA_IPv6_Address="<?php \$record = dns_get_record('$NC_DOMAIN', DNS_AAAA);"
    COLLABORA_IPv6_Address+='if (!empty($record)) {echo $record[0]["ipv6"];}'
    COLLABORA_IPv6_Address="$(echo "$COLLABORA_IPv6_Address" | php | head -1)"

    if [ -n "$COLLABORA_IPv6_ADDRESS" ]; then
        if ! echo "$COLLABORA_ALLOW_LIST" | grep -q "$COLLABORA_IPv6_ADDRESS"; then
            if [ -z "$COLLABORA_ALLOW_LIST" ]; then
                COLLABORA_ALLOW_LIST="$COLLABORA_IPv6_ADDRESS"
            else
                COLLABORA_ALLOW_LIST+=",$COLLABORA_IPv6_ADDRESS"
            fi
        fi
    else
        echo "No ipv6-address found for $NC_DOMAIN."
    fi
+ COLLABORA_IPv6_Address='<?php $record = dns_get_record('\''<domain>'\'', DNS_AAAA);'
+ COLLABORA_IPv6_Address+='if (!empty($record)) {echo $record[0]["ipv6"];}'
++ echo ++ php
'<?php $record = dns_get_record('\''<domain>'\'', DNS_AAAA);if (!empty($record)) {echo $record[0]["ipv6"];}'
++ head -1
+ COLLABORA_IPv6_Address=<ipv6-address>
+ '[' -n '' ']'
+ echo 'No ipv6-address found for <domain>.'
No ipv6-address found for <domain>.
bash-5.1# COLLABORA_IPv6_Address="<?php \$record = dns_get_record('$NC_DOMAIN', DNS_AAAA);"
bash-5.1# COLLABORA_IPv6_Address+='if (!empty($record)) {echo $record[0]["ipv6"];}'
bash-5.1# COLLABORA_IPv6_Address="$(echo "$COLLABORA_IPv6_Address" | php | head -1)"
bash-5.1# echo $COLLABORA_IPv6_Address
<ipv6-address>

The logic seems to know the IPv6 Address...

Zoey2936 commented 1 year ago

Maybe because of this: $COLLABORAIPv6Address $COLLABORAIPv6ADDRESS

szaimen commented 1 year ago

Maybe because of this: $COLLABORAIPv6Address $COLLABORAIPv6ADDRESS

Right. Thanks for finding 😅

szaimen commented 1 year ago

Do you mind creating a PR? :)

Zoey2936 commented 1 year ago

Do you mind creating a PR? :)

done

szaimen commented 1 year ago

Thanks! :)

szaimen commented 1 year ago

This is now fixed v4.5.0 Beta. Testing and feedback is welcome! See https://github.com/nextcloud/all-in-one#how-to-switch-the-channel