ddvk / rmfakecloud

host your own cloud for the remarkable
GNU Affero General Public License v3.0
751 stars 61 forks source link

Toltec install of rmfakecloud-proxy and docker container of rmfakecloud behind nginx #246

Closed Aephir closed 1 year ago

Aephir commented 1 year ago

I seem to be stuck with:

  1. reMarkable 2 downgraded to 2.15.1.1189 with Toltec and rmfakecloud-proxy installed.
  2. rmfakecloud running in a docker container, webUI accessible at rmfakecloud.MY.DOMAIN (behind nginx).
  3. rmfakecloud-proxy configured (it says upstream: https://rmfakecloud.MY.DOMAIN in the /opt/etc/rmfakecloud-proxy/config file) as described here.
  4. webUI Generatet Code works.

But when using the code on the reMarkable, nothing happens. It started by saying "invalid code". I saw the notes about nginx. The services and files mentioned don't exist (since I installed with Toletc?), so I tried editing /etc/systemd/system/multi-user.target.wants/rmfakecloud-proxy.service as described instead (stopping/starting rmfakecloud-proxy service in place of the non-existing proxy).

This didn't work, and I reverted the changes. After this, it just hangs at "Logging in" if I try entering a code on the reMarkable tablet.

docker logs rmfakecloud shows no activity when entering the code on the reMarkable, so it's probably an issue on the reMarkable or with nginx (though a laptop on same network as reMarkable can access the webUI though the FQDN).

I'm a bit unsure from the docs whether the data/users should be generated in the mounted docker volume when I initially log in via the webUI? But if it is supposed to, it is not actually doing that. The directory is created when I first start the container, but that's it, it's empty. Also after initial log in when I can see one "user" under Users in the webUI.

Eeems commented 1 year ago

What does rmfakecloudctl status return? Did you manually configure the proxy config file, or did you use rmfakecloudctl to configure it?

Aephir commented 1 year ago
reMarkable: ~/ rmfakecloudctl status
Status: enabled (active)
Upstream server: https://rmfakecloud.MY.DOMAIN (unreachable)
Run `rmfakecloudctl disable` to disable rmfakecloud-proxy.
Run `rmfakecloudctl set-upstream https://<server>` to set the upstream server.
reMarkable: ~/

I used

rmfakecloudctl set-upstream https://rmfakecloud.MY.DOMAIN
rmfakecloudctl enable

as described here, if that's what you mean

Eeems commented 1 year ago

Okay, so your device doesn't know how to reach the site you've configured. https://rmfakecloud.MY.DOMAIN needs to be a valid address it can reach over the network.

Aephir commented 1 year ago

Yes, which seems weird to me, since I can access the webUI (create users, generate code, etc.) at https://rmfakecloud.MY.DOMAIN through a browser both when on my home network or from outside.

Edit: that is, I can access the url from a laptop connected to the same WiFi/VLAN as the reMarkable tablet.

Eeems commented 1 year ago

Can you ping the server from your tablet? ping rmfakecloud.MY.DOMAIN If not, it might be DNS or a firewall, depending on the error.

Aephir commented 1 year ago

Yes, ping from reMarkable to rmfakecloud.MY.DOMAIN seems to work fine.

Eeems commented 1 year ago

What about a wget https://rmfakecloud.MY.DOMAIN? Does that work as expected?

Aephir commented 1 year ago

No, wget doesn't work, it throws

reMarkable: ~/ wget https://rmfakecloud.MY.DOMAIN
--2023-06-29 20:36:02--  https://rmfakecloud.MY.DOMAIN/
Resolving rmfakecloud.MY.DOMAIN... MY_IP
Connecting to rmfakecloud.MY.DOMAIN|MY_IP|:443... connected.
ERROR: no certificate subject alternative name matches
    requested host name 'rmfakecloud.MY.DOMAIN'.
To connect to rmfakecloud.MY.DOMAIN insecurely, use `--no-check-certificate'.

where MY_IP is the correct IP.

Well, with the caveat that I've been messing around, trying to see if I could find a fix, and rmfakecloudctl status now shows Status: enabled (failed) instead of Status: enabled (active), not sure if this changes anything?

Eeems commented 1 year ago

It looks like your ssl certificate isn't configured right on your server. So your device doesn't trust it. Likely, you are ignoring the ssl errors when testing in a browser. You will need a valid certificate for the domain name used for it to work.

Aephir commented 1 year ago

Oops, found the problem.

I made the *.conf file for nginx, but I'm running in docker (linuxserver/swag) where you have to add sub-domains in the docker-compose.

Stupid oversight, but it seems to work now. Thanks a lot for the troubleshooting help!