Cannot modify config.php in my snap installation to add trusted domain

I cannot connect to my fresh Nextcloud installation from Android, neither through the app nor via DavDroid. Android App and Davdroid both ask me to accept the self-signed certificate. After that AndroidApp claims “Unknown error occured” and DavDroid “Could not find CalDAC and CardDAV service”.

/var/snap/nextcloud/common/nextcloud/data/nextcloud.log points to a “trusted domain” issue.

{"reqId":"jO+hcbe33VRnEXXINv9G","remoteAddr":"","app":"core","message":"Trusted domain error. \"\" tried to access using \"\" as host.","level":2,"time":"2017-08-09T12:42:32+00:00","method":"PROPFIND","url":"\/","user":"--","version":""}

But I cannot edit my /snap/nextcloud/2184/htdocs/config/config.php to add trusted domains.

$ sudo touch /snap/nextcloud/2184/htdocs/config/x
touch: cannot touch '/snap/nextcloud/2184/htdocs/config/x': Read-only file system

I thought switching to maintenance mode may allow me to edit config.php:

$ sudo nextcloud.occ maintenance:mode

But I get “Maintenance mode is currently disabled” ;(

Note that syncing contacts between Thunderbird/CardBook and Nextcloud on the same computer works fine. Please help.

Nextcloud 11.0.3snap7, fresh Ubuntu install 17.04 64bit

Hi @Christiann .

It seems like you might be having two problems.

First, to configure your trusted domain, please see this post: Trusted Domain in Snap install of Next Cloud

Second, to get a non self-signed certificate, nextcloud integrates wonderfully with letsencrypt (from our friends at the EFF).

If you already have a domain set up (that is, when you visit, it sends you to your public ip), you can run this command:

sudo snap run nextcloud.enable-https lets-encrypt

Hope this helps!