8000 Trouble using rmfakecloud · Issue #44 · ddvk/rmfakecloud · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Trouble using rmfakecloud #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
< 8000 a class="author text-bold Link--secondary" data-hovercard-type="user" data-hovercard-url="/users/TheOrdinaryWow/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="/TheOrdinaryWow">TheOrdinaryWow opened this issue Apr 21, 2021 · 14 comments
Closed

Trouble using rmfakecloud #44

TheOrdinaryWow opened this issue Apr 21, 2021 · 14 comments

Comments

@TheOrdinaryWow
Copy link

I knew that my following issue would seems naive but… I really can’t find any tutorial or instructions or more detailed docs on using it.

Here’s how I’ve done:

  1. Establish a docker, which runs pretty good
  2. Use Nginx to route :3000 to :80 then used a custom SSL certificate to enable https.
  3. Configure the device via automatic script, set the domain to https://my.example.domain/ and all things in “Troubleshooting” part passed, as well as systemctl status proxy returning no warn or error.
  4. Open https://my.example.domain/ in browser returns Working, 0 clients as the screenshot shows
  5. (Actually till here I don’t know what to do since there’s literally no entry or instructions about what to do next) I logined the remarkable cloud on the device via a random code 000000 and it says i logined to a account called rmfake or what. But literally on that webpage it still shows Working, 0 clients.

I heard that I might need to configure a account or somewhat, but I really don’t know how to since some pages in README have been removed from GitHub.

It would be more than appreciate if you could please provide some help.

Living in China and as generally recognized, the web is limited. I’ve been working on this for three whole days.

Thanks! :))

@TheOrdinaryWow
Copy link
Author
TheOrdinaryWow commented Apr 21, 2021

Addition:
Do wget -qO- https://local.appspot.com get returns


wget: note: TLS certificate validation not implemented
Working, 0 clients

Do


echo Q | openssl s_client -connect localhost:443  -verify_hostname local.appspot.com -CAfile /etc/ssl/certs/ca-certificates.crt 2>&1 | grep Verify

Gets return


Verify return code: 0 (ok)

Well it seems normal by now but, when

Do systemctl status proxy and it returns


reMarkable systemd[1]: Started reverse proxy.
reMarkable rmfake-proxy[2499]: 2021/04/21 17:45:07 cert-file=/home/root/rmfakecloud/proxy.crt key-file=/home/root/rmfakecloud/proxy.key listen-addr=:443 upstream-url=https://my.example.domain
reMarkable rmfake-proxy[2499]: 2021/04/21 17:48:46 http: proxy error: context canceled

While do systemctl stop xochitl and


 QT_LOGGING_RULES=xochitl.*=true xochitl | grep -A3 QUrl

Then returns loop


xochitl.network.notificationsWaiting for hostname
xochitl.network.client   Received hostname for AbstractNetworkClient::Service(Notifications) : "local.appspot.com"
xochitl.network.notificationsSomething changed, checking if we need to connect

I dont’t really get what these means to if it’s normal or not so please do a favor checking them.

Thanks!

@TheOrdinaryWow
Copy link
Author
TheOrdinaryWow commented Apr 21, 2021

Then I found that the cloud on the device seems disconnected ( the icon has a ❌ on the cloud) and manual check cloud sync would failed, however server-side received the files in the DATADIR.

Structure:

-- uuid.metadata

-- uuid.zip
---- uuid
------ pagenum-metadata.json
------ pagenum.rm
---- uuid.content
---- uuid.pagedata

I suggest it’s done but, string in uuid.metadata seems showing that the sync has failed.

"Success":false

Btw: I set the LOGLEVEL to warn yet no warning has shown up.

So it did make me more confused hummm

@deetuned
Copy link

Are you running the most recent commit on the master branch? It seems it's not showing the UI that lets you generate a code to register with the account. What happens if you go to https://my.example.domain/generatecode?

@TheOrdinaryWow
Copy link
Author

Are you running the most recent commit on the master branch? It seems it's not showing the UI that lets you generate a code to register with the account. What happens if you go to https://my.example.domain/generatecode?

404 Not Found.

So it seems I do need to clone this repo and make a docker myself instead of using docker run -it --rm -p 3000:3000 ddvk/rmfakecloud.

I’ll try now. Thanks so much :))

@TheOrdinaryWow
Copy link
Author

Are you running the most recent commit on the master branch? It seems it's not showing the UI that lets you generate a code to register with the account. What happens if you go to https://my.example.domain/generatecode?

Should I use it via go or making a docker?
Seems that in the master branch I ran go get -u github.com/ddvk/rmfakecloud and got no response (end has been configured correctly)

@TheOrdinaryWow
Copy link
Author
TheOrdinaryWow commented Apr 22, 2021

New problem occurred:

  • I’ve abandoned docker and clone this repo then compile one myself.
  • Running rmfakecloud-x86 and use a Apache server to reverse proxy it to my domain.
  • Device-side configured properly and no error shown in systemctl status proxy
  • After signing on my device it started to backup automatically. Everything works fine. Upload finished.
  • Do manual cloud sync and it shows failed while as the file structure above appeared on server. Meanwhile device shows device didn’t connect to cloud, the documents section on webpage showed no documents.

Addition: while uploading files automatically, server-side showed:

INFO[0442] [auth-middleware] UserId: Nzbcorz deviceId: RM***-***-***** 
INFO[0442] accepting websocket from:Nzbcorz             
INFO[0442] upgrade:websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header 
INFO[0442] closing the ws

Please do reply me if you need more information.

Thanks!

@ddvk
Copy link
Owner
ddvk commented Apr 22, 2021

apache is not proxying webosckets correctly , it needs extra configuration. nginx seems to be easier.

you can run TLS directly now (just have to pass the certificate in the variables).
the no documents is misleading, it is not implemented yet

@TheOrdinaryWow
Copy link
Author

Well I switched to Nginx, and do a websocket reverse proxy. The problem stills.

INFO[0442] [auth-middleware] UserId: Nzbcorz deviceId: RM***-***-***** 
INFO[0442] accepting websocket from:Nzbcorz             
INFO[0442] upgrade:websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header 
INFO[0442] closing the ws

It seems that the problem was on the device, instead of the server.

@TheOrdinaryWow
Copy link
Author

Finally I used the method in section How to HTTPS and it’s working with Nginx.
The device can now sync properly.
But column Documents on webpage is still empty.
11FAFECA-DA22-4F1B-8C4B-517886C1B19A

@ddvk
Copy link
Owner
ddvk commented Apr 22, 2021

yes, this is still work in progress, the documents are not shown yet, but are there. this is the next on the list

@TheOrdinaryWow
Copy link
Author
TheOrdinaryWow commented Apr 22, 2021

Thanks so much for help! Problem solved.

And perhaps you might/can update your docker image :p

Meanwhile is there a tutorial/introduction about how to use it on other deices like Win/iOS via its offical app? (*tho I knew rmapi works but I just wonder if it’s accessible on other devices)
I’ve checked #38 but I’m not really sure about what proxy/what should I do to direct remarkable’s offical cloud api to the one I host.

I’m using a iOS device and I tried to direct the lists I picked from Tablet Setup section.

hwr-production-dot-remarkable-production.appspot.com
service-manager-production-dot-remarkable-production.appspot.com
local.appspot.com
my.remarkable.com
ping.remarkable.com
internal.cloud.remarkable.com

as well as the following two domains i caught in http requests.

hwr-production-dot-remarkable-production.appspot.com
service-manager-production-dot-remarkable-production.appspot.com

I tried solving them to my host’s ip via a proxy app called Quantumult X, but this way didn’t work out. Offical app returns invalid onetime code.
I also tried rewrite the urls above http307 to my domain, which failed either.

So I’m wondering that what advanced config does it require to use it on my device.

Thanks so much!

@ddvk
Copy link
Owner
ddvk commented Apr 23, 2021

for ios, you have to install the ca.crt on the device. then run a reverse proxy or rmfakecloud on por 443, with the proxy.crt and key, and change the DNS to resolve the aformentioned urls to the proxy/rmfakecloud

@y0grt
Copy link
Contributor
y0grt commented Nov 11, 2023

just an update for the ios app.
the domain list that works with the latest version of the app:

hwr-production-dot-remarkable-production.appspot.com
service-manager-production-dot-remarkable-production.appspot.com
local.appspot.com
my.remarkable.com
ping.remarkable.com
internal.cloud.remarkable.com
webapp-prod.cloud.remarkable.engineering

I'll leave here as well an nginx config file to use with the rmfakecloud docker image

worker_processes auto;                                                                                                                                                                    
                                                                                                                                                                                          
events {                                                                                                                                                                                  
    worker_connections 1024;                                                                                                                                                              
}                                                                                                                                                                                         
                                                                                                                                                                                          
http {                                                                                                                                                                                    
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    server {
        listen 80;
        server_name hwr-production-dot-remarkable-production.appspot.com service-manager-production-dot-remarkable-production.appspot.com local.appspot.com my.remarkable.com ping.remarkable.com internal.cloud.remarkable.com webapp-prod.cloud.remarkable.engineering;
        
        location / {
            return 301 https://$host$request_uri;
        }
    }

    server {
        listen 443 ssl;
        server_name hwr-production-dot-remarkable-production.appspot.com service-manager-production-dot-remarkable-production.appspot.com local.appspot.com my.remarkable.com ping.remarkable.com internal.cloud.remarkable.com webapp-prod.cloud.remarkable.engineering;

        ssl_certificate /etc/nginx/certs/server.crt;
        ssl_certificate_key /etc/nginx/certs/server.key;

        ssl_protocols TLSv1.2 TLSv1.3;
        ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384';

        ssl_prefer_server_ciphers off;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 5m;

        location / {
            proxy_pass http://rmfakecloud:3000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
}

and how to generate the certs

openssl req -x509 -nodes -newkey rsa:2048 -keyout server.key -out server.crt -subj "/CN=hwr-production-dot-remarkable-production.appspot.com" -addext "subjectAltName=DNS:service-manager-production-dot-remarkable-production.appspot.com,DNS:local.appspot.com,DNS:my.remarkable.com,DNS:ping.remarkable.com,DNS:internal.cloud.remarkable.com,DNS:registry-1.docker.io,DNS:webapp-prod.cloud.remarkable.engineering" -days 3650

the app works like a charm.
remember to copy the server.crt to the iphone, add the profile and enable it in the certificate trust list.

@aoaim
Copy link
aoaim commented May 8, 2024

I tried solving them to my host’s ip via a proxy app called Quantumult X, but this way didn’t work out.

Hi, are you still using rmfakecloud via Quantumult X? I'm having the same problem with Surge and would like to refer to your solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
0