Nextcloud trusted domain not in the GUI anymore --> how accessing config.php

behzad

Dabbler
Joined
Feb 14, 2022
Messages
15
Hi, it seems that i can't config the trusted domain over the GUI when installing Nextcloud as an App (Docker and the official container). I played around with it on a normal Linux distro, but now after installing Nextcloud with a docker container in TrueNAS Scale i realized that i cant acces the config file to add trusted networks manually.
I couldn't find any good how to's :/
 

li_chang

Dabbler
Joined
May 31, 2017
Messages
35
Hi,

You can use docker cmd to access the app:

sudo docker exec -it $(sudo docker container ls -q --filter name="*your_app_name*") bash

App name can be found via sudo docker container ls (if you use TrueCharts to install NextCloud, name could start with k8s_nextcloud_)

After that, you can edit /var/www/html/config/config.php with vim. Don't forget to restart apache service after editing.
 
Last edited:

behzad

Dabbler
Joined
Feb 14, 2022
Messages
15
problem is that inside the docker, there is no editor preinstalled so i can't use vim/nano...
 

behzad

Dabbler
Joined
Feb 14, 2022
Messages
15
nvm, i completely forgot to update apt first...
thanks li_chang

1. get the name of your docker container
Code:
sudo docker container ls

2. get inside your docker container with
Code:
sudo docker exec -it $(sudo docker container ls -q --filter name="*your_app_name*") bash

3. update apt
Code:
apt-get update

4. install vim or nano
Code:
apt-get install vim
or
Code:
apt-get install nano
 
Last edited by a moderator:

AndyMcSchopf

Dabbler
Joined
Feb 8, 2022
Messages
11
If you use an Host-Path for the config you can use the normal shell to get there. In my case /config ist mapped on Host: /mnt/Pool1/Docker/nextcloud/config . There you can use the normal Tools (vim is installed in the underlying Debian)...
 

behzad

Dabbler
Joined
Feb 14, 2022
Messages
15
If you use an Host-Path for the config you can use the normal shell to get there. In my case /config ist mapped on Host: /mnt/Pool1/Docker/nextcloud/config . There you can use the normal Tools (vim is installed in the underlying Debian)...
i didn't know what to do with the host path, thats why i skipped it. For what exactly is it?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
i didn't know what to do with the host path, thats why i skipped it. For what exactly is it?
A host path is a redirected path/directory from your host that is mounted to the selected location in the container... this is actually essential when using kubernetes as SCALE does since containers can (and will) be scrapped at any time and recreated (losing your changes from inside the container).

When you set up the host path, you can then operate on the host's copy (actually not a copy, just a bad analogy I'm trying to use) to edit the files how you like them and those will appear on the container side no matter how many times the container is recreated.
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
Hi,

You can use docker cmd to access the app:

sudo docker exec -it $(sudo docker container ls -q --filter name="*your_app_name*") bash

App name can be found via sudo docker container ls (if you use TrueCharts to install NextCloud, name could start with k8s_nextcloud_)

After that, you can edit /var/www/html/config/config.php with vim. Don't forget to restart apache service after editing.

Please don't advice people to use docker commands when dealing with Kubernetes deployed containers.
Kubernetes uses kubectl instead. Bypassing kubectl can have consequences.
 

AndyMcSchopf

Dabbler
Joined
Feb 8, 2022
Messages
11
i didn't know what to do with the host path, thats why i skipped it. For what exactly is it?
Well you can see it as an overlay or "mount point" of the Host Storage inside the container. The container is the "shell" which does the work, the Host path is the point where the configuration and actual data reside even if you kill the container and restart them. So you should use one for the config and one for the nextcloud data.
 

behzad

Dabbler
Joined
Feb 14, 2022
Messages
15
Well you can see it as an overlay or "mount point" of the Host Storage inside the container. The container is the "shell" which does the work, the Host path is the point where the configuration and actual data reside even if you kill the container and restart them. So you should use one for the config and one for the nextcloud data.
Thanks for the info. I try to reconfigure the nextcloud app so i can use the host path. Now i am confused how to do that in the best possible way. If i am understanding correctly i should not only put the data dir outside of the container, i should also do that with the config files. Am i right?
To do that i have here the option "Configure Nextcloud Extra Host Path Volumes". But here i need a host path + the mount path of the pod. Here's the point where i need the help. After reading this about pods, my understanding of it, is that the pod is actually the container itself in my case. So i dont want to change the location of the container itself, i just want to change the host path.
How should i go on now?


Screenshot 2022-02-18 at 00.09.45.png



My second question is just for the understanding: This data directory is about where to put the data when it is inside the container and the other one when i am using a host path, which is outside of the container!?
Screenshot 2022-02-18 at 00.09.38.png
 

li_chang

Dabbler
Joined
May 31, 2017
Messages
35
Thanks for the info. I try to reconfigure the nextcloud app so i can use the host path. Now i am confused how to do that in the best possible way. If i am understanding correctly i should not only put the data dir outside of the container, i should also do that with the config files. Am i right?
To do that i have here the option "Configure Nextcloud Extra Host Path Volumes". But here i need a host path + the mount path of the pod. Here's the point where i need the help. After reading this about pods, my understanding of it, is that the pod is actually the container itself in my case. So i dont want to change the location of the container itself, i just want to change the host path.
How should i go on now?





My second question is just for the understanding: This data directory is about where to put the data when it is inside the container and the other one when i am using a host path, which is outside of the container!?
Hi,

For the first question, "mount path in pod" is the path inside the pod (to mount to the TrueNAS host). If you are using TrueCharts-based Nextcloud, and want to mount config folder only, "mount path in pod" should be /var/www/html/config, and the host path is somewhere you want to access this config folder in TrueNAS host. Note that the folder owner should go with www-data:root. You can create a dataset and assign owner/group to that while creating.

For your second question, yes this data directory is about where to put the data when it is inside the container. If you want to mount to the host, you can configure multiple "Nextcloud Host Path Volume" (shown in the first screenshot). Or you can just mount the parent folder /var/www/html (although I don't think it's a good idea). Note that there will be some permissions issues if you want to handle files in both host (where the user is not www-data) and Nextcloud webgui. It's fine if handling all the file in Nextcloud or use "external storage" feature in Nextcloud (SMB/CIFS) to access files in the host.
 
Last edited:

stavros-k

Patron
Joined
Dec 26, 2020
Messages
231
If you only want to access and edit config.php, and you are using truecharts nextcloud...
Edit app and on the bottom you will see the Code Server Addon. Tick this and save the app.
Now you can access a VSCode instance on the web with access to all files of the specific app. (You can do this with every app in TC catalog).

Just be careful, as some apps don't like someone messing with files while running!
 

taaangy234

Dabbler
Joined
Dec 7, 2016
Messages
18
For my case, I had nextcloud deployed from the Official Charts, reflecting to the
  1. Create a NextCloud dataset before deploying you nextcloud
  2. using Host Path for Nextcloud Data Volume: ie. /mnt/NAS/NextCloud
  3. TrueNAS Scale go to Storage select NextCloud data set, edit permissions and granted your windows client SMB full access to the dataset.
  4. Navigate to \\192.168.0.30\nas\NextCloud\config\config.php, and edit the file on a windows machine save the file.
  5. Stop the app, then Start, then verify your external access is working.
 

Attachments

  • 20220520Applications - 192.168.0.30 and 11 more pages - Personal - Microsoft​ Edge.png
    20220520Applications - 192.168.0.30 and 11 more pages - Personal - Microsoft​ Edge.png
    32.1 KB · Views: 2,955
  • 20220520Storage - 192.168.0.30 and 11 more pages - Personal - Microsoft​ Edge.png
    20220520Storage - 192.168.0.30 and 11 more pages - Personal - Microsoft​ Edge.png
    103 KB · Views: 3,270
  • 20220520___192.168.0.30_nas_NextCloud_config_config.php - Notepad++.png
    20220520___192.168.0.30_nas_NextCloud_config_config.php - Notepad++.png
    23.6 KB · Views: 2,884
Last edited:

ihijynx

Cadet
Joined
Jun 30, 2022
Messages
2
sorry if this is a stupid question but i cant find the answer any where when i get the smb share working and get to the config.php file it says i dont have access to it how to i give myself permission do i have to give the permissions to the users i logged into the smb share into on file explorer if so how can i do that
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925

Victor87

Dabbler
Joined
Aug 28, 2022
Messages
16
Hello all
i got some troubles after above steps. The ip host and domain are not available anymore after adding on trust domain something. Even after i delete the added domains, ip host get same error...
I attached screen shots before and after adding domains on config.php file.
On server is running Truenas scale 22.02.4 and NextCloud 24.0.6_1.6.12 installed from official catalog.
Forward port is active on router to be accessible from outside networks. Same error like on screenshots
Thanks for supporting
 

Attachments

  • 1.jpg
    1.jpg
    133.8 KB · Views: 2,590
  • 2.jpg
    2.jpg
    143.6 KB · Views: 1,460
  • 3.jpg
    3.jpg
    201.4 KB · Views: 1,402
  • 4.jpg
    4.jpg
    198.3 KB · Views: 1,015
Last edited:
Top