Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Nextcloud with Collabora/Docker on Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
NismoC32
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 214

PostPosted: Sun Nov 12, 2017 6:40 pm    Post subject: Nextcloud with Collabora/Docker on Gentoo Reply with quote

Hi
I'm trying to get collabora to work on my Gentoo server, but have run in to some problems I haven been able to solve.

Se the details in this thread on Nextcloud:
https://help.nextcloud.com/t/problem-getting-collabora-to-work-in-gentoo-with-docker/23259

Let me know if more info is needed.
Maybe someone here can help figure out whats wrong.

PS: Havent gotten apache access_log to work ether.

Thanks.
Back to top
View user's profile Send private message
NismoC32
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 214

PostPosted: Thu Nov 23, 2017 8:28 am    Post subject: Reply with quote

It looks like connection to https://127.0.0.1 is refused when attempting to connect to 127.0.0.1:9980
When I run 'docker ps' I get the following list:

Code:
 CONTAINER ID   IMAGE                 COMMAND                  CREATED            STATUS                          PORTS
655ddcae4bc6    collabora/code      "/bin/sh -c 'bash ..."    About an hour ago  Restarting (1) 42 seconds ago


Should the PORT show the connection info like 127:0.0.1:9980/tcp or something ?

I did use this command to start the docker image:
docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=office\\.mydomain\\.com' --restart always --cap-add MKNOD collabora/code

As explained here https://nextcloud.com/collaboraonline/

Is there something wrong here ?
Back to top
View user's profile Send private message
msst
Apprentice
Apprentice


Joined: 07 Jun 2011
Posts: 259

PostPosted: Thu Nov 23, 2017 7:38 pm    Post subject: Reply with quote

I have a nextcloud installation here as well. All working fine.

Was also once interested to install collabora. Then I saw it is only available as a docker crap version and have nor pursued it. Should anyone find out how to completely de-docker that stuff without a huge hassle and install it normally I may give it a try.

And by the way: If the docker stuff gives config troubles a normal installation likely bypasses that, because a normal installation should allow you to run it of your normal apache:80 system.
Back to top
View user's profile Send private message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1270

PostPosted: Thu Nov 23, 2017 9:00 pm    Post subject: Reply with quote

I am in the same boat, have a nice nextcloud installation here, and did not install colabora online cause of docker version. Then I have seen onlyoffice which offers similar functionality, and there is even an ebuild that compiled fine:
https://gpo.zugaina.org/app-office/onlyoffice
But I found no explanation where to go from there. If anyone is able to get it working, I would be glad to get any hint :)
Back to top
View user's profile Send private message
NismoC32
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 214

PostPosted: Thu Nov 23, 2017 9:31 pm    Post subject: Reply with quote

I do agree with you guys.

The only reason for trying to get docker/collabora to work is that it would be a nice tool for
me know when I'm studying in another country.

Maybe I should look into onlyoffice instead.
Back to top
View user's profile Send private message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1270

PostPosted: Fri Nov 24, 2017 7:51 pm    Post subject: Reply with quote

if you do and find out what to do after compiling onlyoffice, please share :)
Back to top
View user's profile Send private message
NismoC32
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 214

PostPosted: Sun Nov 26, 2017 6:02 pm    Post subject: Reply with quote

Hmm I might be wrong here but the 'ebuild' in the link over is for the desktop version of the suite
and not what they call the integration edition that is needed for integration with cloud servers.

If you look at this link on the onlyoffcie's web page regarding nextcloud it looks like you have to pay
to get the integration edition.
Check this link: https://www.onlyoffice.com/connectors-nextcloud.aspx
You at lest get a 30 day trial time.

One more thing, it seems to only support MS office formats, so this is at least a deal breaker for me.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Sun Nov 26, 2017 7:12 pm    Post subject: Reply with quote

NismoC32, I had to install nc + collabora recently, it took a bit of digging on the internet, trying and failing, but I eventually got it ot work using those 2 guides:
https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html
https://www.linuxbabe.com/cloud-storage/integrate-collabora-online-server-nextcloud-ubuntu-16-04
Those guides are for ubuntu, but it's irrelevant since they regard manual process.

Now, I tihnk I set it with 2 separate domains (so vhost 'nextcloud' served nextcloud instance and vhost 'collabora' was set with all the proxy stuff you can find in that guide - take this bit with a grain of salt though, it's been some time ago)
However, the most critical part was this one: at some point you will be asked for collabora's domain. Your answer (the parameter provided to docker as -e 'domain=<your answer>) is "nextcloud\\.your\\.domain"
Yup. You're expected to enter the domain assigned to nextcloud instance rather than collabora. And you escape dots with double backslashes.
Back to top
View user's profile Send private message
NismoC32
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 214

PostPosted: Mon Nov 27, 2017 9:49 am    Post subject: Reply with quote

Thanks for the info szatox.

I have now concluded that my problem is docker.

Here is my problem, when I start the image with
docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=mydomain\\.com' --restart always --cap-add MKNOD collabora/code

My nextcloud url is https://mydomin.com
My collabora url is https://office.mydomain.com

The docker ps shows:

Code:
docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES
f71410eea895        collabora/code      "/bin/sh -c 'bash ..."   22 seconds ago      Restarting (1) 8 seconds ago                       compassionate_ardinghelli


As you can see no PORTS shows.

The Docker info shows this:

Quote:
docker info
Containers: 1
Running: 0
Paused: 0
Stopped: 1
Images: 1
Server Version: 17.06.2-ce
Storage Driver: btrfs
Build Version: Btrfs v4.10.2
Library Version: 102
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 6e23458c129b551d5c9871e5174f6b1b7f6d1170
runc version: 810190 (expected: 810190ceaa507aa2727d7ae6f4790c76ec150bd2)
init version: v0.16.1 (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
seccomp
Profile: default
Kernel Version: 4.12.12-gentoo
Operating System: Gentoo/Linux
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 62.83GiB
Name: fserver
ID: EALV:7DBY:37JF:JZAY:VTLC:FAFU:5MNC:A4FI:UF7H:MYY6:JYJ5:CBMY
Docker Root Dir: /mnt/Cloud/Docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false


And it says no containers are running.

So something is wrong here why does't the container show as started ?

Here is the docker.log output:

Quote:
time="2017-11-27T11:54:26.966204931+01:00" level=info msg="stopping containerd after receiving terminated"
time="2017-11-27T11:54:45.192846140+01:00" level=info msg="libcontainerd: new containerd process, pid: 24132"
time="2017-11-27T11:54:46.198222738+01:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
time="2017-11-27T11:54:46.198657457+01:00" level=info msg="Loading containers: start."
time="2017-11-27T11:54:46.200716443+01:00" level=warning msg="libcontainerd: client is out of sync, restore was called on a fully synced container (f71410eea895935d7a5f1d1e3d16fa6ac6abc4d512c020b72d36b00823816433)."
time="2017-11-27T11:54:46.201023083+01:00" level=warning msg="libcontainerd: failed to retrieve container f71410eea895935d7a5f1d1e3d16fa6ac6abc4d512c020b72d36b00823816433 state: rpc error: code = 2 desc = containerd: container not found"
time="2017-11-27T11:54:46.201076236+01:00" level=warning msg="failed to cleanup ipc mounts:\nfailed to umount /mnt/Cloud/Docker/containers/f71410eea895935d7a5f1d1e3d16fa6ac6abc4d512c020b72d36b00823816433/shm: invalid argument"
time="2017-11-27T11:54:46.287015889+01:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
time="2017-11-27T11:54:46.449357108+01:00" level=info msg="Loading containers: done."
time="2017-11-27T11:54:46.452594622+01:00" level=info msg="Daemon has completed initialization"
time="2017-11-27T11:54:46.452622488+01:00" level=info msg="Docker daemon" commit=cec0b72 graphdriver=btrfs version=17.06.2-ce
time="2017-11-27T11:54:46.458565623+01:00" level=info msg="API listen on /var/run/docker.sock"
time="2017-11-27T11:54:46.465450914+01:00" level=warning msg="Failed to delete conntrack state for 172.17.0.2: invalid argument"
time="2017-11-27T11:54:46.738953765+01:00" level=warning msg="Failed to delete conntrack state for 172.17.0.2: invalid argument"
time="2017-11-27T11:54:47.074959632+01:00" level=warning msg="Failed to delete conntrack state for 172.17.0.2: invalid argument"
time="2017-11-27T11:54:47.633899053+01:00" level=warning msg="Failed to delete conntrack state for 172.17.0.2: invalid argument"
time="2017-11-27T11:54:48.568007165+01:00" level=warning msg="Failed to delete conntrack state for 172.17.0.2: invalid argument"
time="2017-11-27T11:54:50.321796849+01:00" level=warning msg="Failed to delete conntrack state for 172.17.0.2: invalid argument"
time="2017-11-27T11:54:53.657912743+01:00" level=warning msg="Failed to delete conntrack state for 172.17.0.2: invalid argument"
time="2017-11-27T11:55:00.213890442+01:00" level=warning msg="Failed to delete conntrack state for 172.17.0.2: invalid argument"



Last edited by NismoC32 on Fri Dec 01, 2017 4:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Mon Nov 27, 2017 8:42 pm    Post subject: Reply with quote

I'm not a big fan of docker and I don't know its design, but setting storage driver to device mapper seemed important. You have it set to btrfs. I had similar issues there and I suppose this was the cause.
Also, I think it's supposed to work with routed networking (AKA NAT mode) rather than with bridged networking, though I'm not quite sure how to read this output from your docker info. Either way, set storage driver first.
Back to top
View user's profile Send private message
NismoC32
Apprentice
Apprentice


Joined: 07 Apr 2003
Posts: 214

PostPosted: Thu Nov 30, 2017 7:02 am    Post subject: Reply with quote

Well I have now changed the btrfs storage driver to overlay2 on a ext4 file system and that fixed the problems with
docker. It now works like it should :D Thanks szatox.

Here is the output from 'ip addr' after docker now working.:
Code:

4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:4c:af:d1:f5 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:4cff:feaf:d1f5/64 scope link
       valid_lft forever preferred_lft forever
1544: veth7d28fd4@if1543: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default
    link/ether 56:ec:97:af:0c:d2 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet6 fe80::54ec:97ff:feaf:cd2/64 scope link
       valid_lft forever preferred_lft forever


But the collabora still does not work in nextcloud.

The problem have to be the link between docker - apache(proxy).

As mentioned before my nexcloud address is: https://mydomain.com
and the collabora is set up to use: https://office.mydomain.com

I therefore used this command to start the collabora docker image:
Code:
docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=mydomain\\.com' --restart always --cap-add MKNOD collabora/code


Code:
netstat -lnpt

Code:
tcp        0      0 127.0.0.1:9980          0.0.0.0:*               LISTEN      7530/docker-proxy   


Code:
docker network ls

Code:
docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
e728b9917d57        bridge              bridge              local
ccddd5565a72        host                host                local
6911be7f7248        none                null                local


You mention routed networking instead of bridged, how do you achieve that ?

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3131

PostPosted: Sun Dec 03, 2017 2:25 pm    Post subject: Reply with quote

Good, at least one thing sorted out.
Now, as I said before I'm not a big fan of docker and I had rather a limited experience with it. Either way, collabora actually exposes a port and a socket, so perhaps you're already set with this part. Maybe some other members could chime in on the topic of docker's networking.

Anyway, where are you with the proxy part? Do you have your vhosts ready? Are apache's proxy modules enabled? AFAIR you need proxy, http proxy and wss proxy or something like that.
Can you poke at that vhost with curl and see any valid response? (and http 503 bad gateway when collabora is down?)
Any problems / errors there?

The final step is about enabling collabora (And providing collabora's address: office.something.... I suppose 127.0.0.1 would also work if you bound the proxy vhost to our loopback, making second domain expendable. Haven't tested.) in nextcloud administrator's panel.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum