mother-of-all-self-hosting / mash-playbook

🐋 Ansible playbook which helps you host various FOSS services as Docker containers on your own server
GNU Affero General Public License v3.0
448 stars 49 forks source link

Nextcloud not working with matrix-docker-ansible-deploy and non-root nextcloud_path_prefix #66

Open KlausHans opened 1 year ago

KlausHans commented 1 year ago

Hello, i've configed mash with nextcloud. The playbook finishes without error but if i access the nextcloud url it looks wrong: grafik The browser console throws errors, that indicate that assets are not found, e.g.:

GET
https://domain.de/core/css/server.css?v=ba222ded25d957b900c03bef914333cd

GET
    https://domain.de/core/css/server.css?v=ba222ded25d957b900c03bef914333cd
Status
404
Not Found
VersionHTTP/2
Übertragen175 B (0 B Größe)
Referrer Policyno-referrer

    content-length
        19
    content-type
        text/plain; charset=utf-8
    date
        Sat, 27 May 2023 11:44:27 GMT
    x-content-type-options
        nosniff
    X-Firefox-Spdy
        h2

    Accept
        text/css,*/*;q=0.1
    Accept-Encoding
        gzip, deflate, br
    Accept-Language
        de,en-US;q=0.7,en;q=0.3
    Connection
        keep-alive
    Cookie
        oc5w7620bgj3=12b1e895fc534e91251e5eab6cf45ea2
    DNT
        1
    Host
        domain.de
    Sec-Fetch-Dest
        style
    Sec-Fetch-Mode
        no-cors
    Sec-Fetch-Site
        same-origin
    Sec-GPC
        1
    TE
        trailers
    User-Agent
        Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0

I am wondering why the url is https://domain.de/core/css/server.css... . Shouldn't it be https://domain.de/nextcloud/core/css/server.css...?

My Nextcloud config in vars.yml is

########################################################################
#                                                                      #
# nextcloud                                                            #
#                                                                      #
########################################################################

nextcloud_enabled: true

nextcloud_hostname: domain.de
nextcloud_path_prefix: /nextcloud

# Redis configuration, as described below

########################################################################
#                                                                      #
# /nextcloud                                                           #
#                                                                      #
########################################################################

I've substituted the real domain with "domain" everywhere here.

I use Traefik from the Matrix-Playbook and configured it accodingly in the mash vars:

mash_playbook_reverse_proxy_type: other-traefik-container
mash_playbook_reverse_proxyable_services_additional_network: traefik

Any idea whats wrong?

KlausHans commented 1 year ago

If i change nextcloud_path_prefix: /nextcloud to nextcloud_path_prefix: / and access it accordingly it works. But that is not what i want.

KlausHans commented 1 year ago

I came across this: https://github.com/nextcloud/docker/issues/401#issuecomment-1370294958 I wanted to try it, but i am stuck because docker exec --user www-data mash-nextcloud-server php occ maintenance:update:htaccess returns Could not open input file: /var/www/html/occ. How can i use occ in mash? Close to giving up mash... :(

spantaleev commented 1 year ago

Try docker exec --user $(id -u mash) mash-nextcloud-server php occ

KlausHans commented 1 year ago

Thanks, that worked.

I made the changes suggested in the linked issue, changed to nextcloud_path_prefix: /nextcloud again and rerun the Playbook. Now i get an internal server error. just run-tags adjust-nextcloud-config didn't helped. I saw that most of the steps from the linked issue are made here too. Before changing nextcloud_path_prefix: /nextcloud to nextcloud_path_prefix: / i wasn't able to perform just run-tags adjust-nextcloud-config, it threw errors (i think because nextcloud wasn't initialised yet. I couldn't initialise it in the broken state).

spantaleev commented 1 year ago

From what I remember, you're supposed to do the adjust-config thing only after going through the installation steps via the web UI.

This is also documented here: https://github.com/mother-of-all-self-hosting/mash-playbook/blob/main/docs/services/nextcloud.md#usage