Accessing the Nextcould server.

Put support questions regarding OPI here. Examples are hardware related issues and other questions that are specific to OPI.
Post Reply
misiu_mp
Posts: 3
Joined: Wed Nov 11, 2020 1:09 am

Accessing the Nextcould server.

Post by misiu_mp » Wed Nov 11, 2020 1:29 am

I have recently dug up the old OPI and upgraded it to 20.07, which went fine (email required a hefty port forwarding set).
Now I want to install a desktop/mobile Nextcloud synchronisation app.
First obstacle is pointing to the actual server address. After some searching I put opi/nextcloud, which got me to the next step. I have a feeling this should be better advertised.
I got a lot of certificate errors, due to connecting through the lan domain - certificate is for the public facing address. I want to do it through LAN now so that NAT is not a problem. Are there any ports I should think of to forward for this to work from WAN?
I get an OPI/KEEP branded login window, which after accepting my login credentials displays "Redirecting ..." and hangs there. Nothing happens. What should I do?

User avatar
pa
Posts: 74
Joined: Thu Aug 14, 2014 7:44 am

Re: Accessing the Nextcould server.

Post by pa » Mon Nov 16, 2020 6:34 am

Hi,

I agree, we should try to make this easier to find. The url is actually in the manual, but under the "Android sync", but it should be easier to find.
Another not so well known feature is that from within the local network, you can reach your device on "local.device-name.mykeep.net", which is also included in the certificate so there should be no certificate errors on that domain name.

So for example, if you have registered "joes.mykeep.net", it can be accessed on "local.joes.mykeep.net".

Regarding ports for nextcloud it is only the https port (443) that needs to be forwarded.

When do you get the redirection error, when accessing using the web directly or is this when accessing through the sync-client?

/PA

misiu_mp
Posts: 3
Joined: Wed Nov 11, 2020 1:09 am

Re: Accessing the Nextcould server.

Post by misiu_mp » Tue Nov 17, 2020 1:54 am

The problem is when im trying to connect from the nextcould sync client (from https://nextcloud.com/install/#install-clients). Both from the desktop (linux, appimage) and the android app.
The web interface through OPI works fine.

I tried to access through local.myname.mykeep.net, but it does not resolve an ip adress. Is there something im missing? myname.mykeep.net does work.

User avatar
pa
Posts: 74
Joined: Thu Aug 14, 2014 7:44 am

Re: Accessing the Nextcould server.

Post by pa » Tue Nov 17, 2020 6:45 am

We will need to get back to you on the nextcloud topic.

Regarding the DNS lookup, can you send us an email on support@openproducts.com with your device name?

Maybe I can find some clues on the server side then.

/PA

User avatar
tor
Posts: 120
Joined: Thu Aug 14, 2014 3:42 am
Contact:

Re: Accessing the Nextcould server.

Post by tor » Thu Nov 19, 2020 9:36 pm

Hi misiu_mp,

I can confirm your issues with the sync-client. I'm able to reproduce it. Unfortunately i have not yet found a workaround. I will try investigate this further and get back asap.

/Tor

User avatar
tor
Posts: 120
Joined: Thu Aug 14, 2014 3:42 am
Contact:

Re: Accessing the Nextcould server.

Post by tor » Mon Nov 23, 2020 10:48 am

Hi again,

After investigating this some more there is some mis-configuration. Possibly due to the Nextcloud server being quite old.

If you are comfortable with the commandline there is a workaround that seems to work for me at least. Log in to your device using ssh. As root edit the file:

/etc/nginx/apps/nextcloud-nginx.conf

and add a location like this:

Code: Select all

location /remote.php/webdav {
        rewrite ^/(.*)$ /nc/$1 redirect;
}
so that the file ends up something like:

Code: Select all

location = /.well-known/carddav {
        return 301 $scheme://$host/nc/remote.php/dav;
}

location = /.well-known/caldav {
        return 301 $scheme://$host/nc/remote.php/dav;
}

location /owncloud {
        rewrite ^/owncloud(.*)$ /nc$1 redirect;
}

location /nextcloud {
        rewrite ^/nextcloud(.*)$ /nc$1 redirect;
}

location /remote.php/webdav {
        rewrite ^/(.*)$ /nc/$1 redirect;
}

location /nc {
        index index.php;
        alias /usr/share/nextcloud;
        
        rewrite ^/nc/caldav(.*)$ /remote.php/caldav$1 redirect;
        rewrite ^/nc/carddav(.*)$ /remote.php/carddav$1 redirect;
        rewrite ^/nc/webdav(.*)$ /remote.php/webdav$1 redirect;
        
        error_page 403 /nc/core/templates/403.php;
        error_page 404 /nc/core/templates/404.php;

        location = /nc/index.php/settings/users {
                return 301 /nc/index.php;
        }

        location ~ ^/nc/(data|scripts|config|\.ht|db_structure\.xml|README) {
                deny all;
        }

        location ~ \/nc\/(.+?\.php)(/.*)?$ {
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root/$1;
                fastcgi_param SCRIPT_NAME /nc/$1;
                fastcgi_param PATH_INFO $2;
                fastcgi_param HTTPS on;
                fastcgi_pass php-handler;
                fastcgi_request_buffering off;
        }
}
Save it and then reload the web-server by issuing:

Code: Select all

systemctl reload nginx
We need to test this a bit further but then we most likely will release an update fixing the issue. So if the above seems to complicated, wait for the update.

/Tor

misiu_mp
Posts: 3
Joined: Wed Nov 11, 2020 1:09 am

Re: Accessing the Nextcould server.

Post by misiu_mp » Fri Dec 11, 2020 1:56 am

It does work after the proposed changes. Although the performance is very low. Takes many minutes to scan 120 files of 60MB in total, and to copy them. Is it overhead of nexcloud, webdav or just the slow hardware in the old opi?

User avatar
pa
Posts: 74
Joined: Thu Aug 14, 2014 7:44 am

Re: Accessing the Nextcould server.

Post by pa » Fri Dec 18, 2020 8:09 am

I would say that it is a combination.

Nextcloud adds a lot of overhead, and together with the limited hardware of OPI it is no longer an ideal situation.

/PA

User avatar
tor
Posts: 120
Joined: Thu Aug 14, 2014 3:42 am
Contact:

Re: Accessing the Nextcould server.

Post by tor » Tue Dec 22, 2020 8:07 am

Hi,

We released an upgrade today which should hopefully fix the issue with the sync client.

/Tor

Post Reply