Has anyone using Cloudflare made any progress on this? Evernote is raising my annual rate 42% from $34.95 to $49.95. This is the last straw so I've been moving over to Joplin. I installed Joplin Server running on docker accessible through Cloudflare. I have imported almost a dozen of my notebooks without a single issue - very nice! Everything is available in the desktop client. However, I just realized nothing is being synch'ed. When I try to sync using my external (Cloudflare) URL I get the error reported in this thread (Unexpected token < in JSON).
If I access the ping url (https://joplin.mydomain.org/api/ping) it reports in the browser:
{"status":"ok","message":"Joplin Server is running"}
The ping does show up in my server logs:
2023-08-21 21:34:53: App: GET /joplin/ping (404) (1ms)
2023-08-21 21:35:05: App: GET /api/ping (200) (1ms)
However, none of the synchronization attempts show up in the server logs. If I use the curl
command from the client dev tool, it appears to connect (though this connection doesn't show in the server log):
curl -v -X POST -H "X-API-MIN-VERSION: 2.6.0" -H "Content-Type: application/json" -H "Content-Length: 56" --data '{"email":"andy@mydomain.org","password":"password"}' 'https://joplin.mydomain.org/api/sessions'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 172.67.194.16:443...
* TCP_NODELAY set
* Connected to joplin.mydomain.org (172.67.194.16) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=mydomain.org
* start date: Jul 5 18:48:42 2023 GMT
* expire date: Oct 3 18:48:41 2023 GMT
* subjectAltName: host "joplin.mydomain.org" matched cert's "*.mydomain.org"
* issuer: C=US; O=Google Trust Services LLC; CN=GTS CA 1P5
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55eda6777300)
> POST /api/sessions HTTP/2
> Host: joplin.mydomain.org
> user-agent: curl/7.68.0
> accept: */*
> x-api-min-version: 2.6.0
> content-type: application/json
> content-length: 56
>
* We are completely uploaded and fine
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
* Connection state changed (MAX_CONCURRENT_STREAMS == 256)!
< HTTP/2 302
< date: Mon, 21 Aug 2023 21:46:15 GMT
< location: https://mydomain.cloudflareaccess.com/cdn-cgi/access/login/joplin.mydomain.org?kid=c1fabf9d5161f8b001a1e91df9bdb64c5331c684ad91990b1d16405a66d25a06&redirect_url=%2Fapi%2Fsessions&meta=eyJraWQiOiJmNTNjN2U4ZWEyMTk2OTI0MGMwOGIwZDYxMTQ0OTVmZDZhMTBiOGYyNzNlZDlkYjA0MWU0MDc1ZWZiMTU4MDU4wiYWxnIjoiUlMyNTYiLCJ0eXAiOiJKV1QifQ.eyJzZXJ2aWNlX3Rva2VuX3N0YXR1cyI6ZmFsc2UsImlhdCI6MTY5MjY1NDM3NSwic2VydmljZV90b2tlbl9pZCI6IiIsImF1ZCI6ImMxZmFiZlkNTE2MWY4YjAwMWExZTkxZGY5YmRiNjRjNTMzMWM2ODRhZDkxOTkwYjFkMTY0MDVhNjZkMjVhMDYiLCJob3N0bmFtZSI6ImpvcGxpbi5hbnQyMDAxLm9yZyIsImFwcF9zZXNzaW9uX2hhc2giiI3Zjc3YTgyYTI2NDg5OGQ1MjYzMGM5YTU1ZWY2YWUzYTQzNWZlOWRhODk3MjFmZTE3M2RjZmI1NzczYTZhZjg4IiwibmJmIjoxNjkyNjU0Mzc1LCJpc193YXJwIjpmYWxzZSwiaXNfZ2F0ZXdeSI6ZmFsc2UsInR5cGUiOiJtZXRhIiwicmVkaXJlY3RfdXJsIjoiXC9hcGlcL3Nlc3Npb25zIiwibXRsc19hdXRoIjp7ImNlcnRfaXNzdWVyX3NraSI6IiIsImNlcnRfcHJlc2VudGVkIjpmYWxzZSwiY2VydF9zZXJpYWwiOiIiLCJjZXJ0X2lzc3Vlcl9kbiI6IiIsImF1dGhfc3RhdHVzIjoiTk9ORSJ9LCJhdXRoX3N0YXR1cyI6Ik5PTkUifQ.HtiVMSFORb_LBSK8hHc8EIZY4CfVq6dgGyv6NcwAYFXWS6_ugF7B4K4g4cE_NHz_7OphaqICoFEPcHrgmd6_hl18yrENqpQ2PE29sjL6Nb08msfUQEKUOL7f8KeQ-Q40kBSSJun3pdo6d4mhgs3Y72t7Rk1Ywnnqa8_vKGqv0oa0sW2wKG6yDrxbQejvw5zVuWwkNlld5fo-p6o35bdDntXhBG6LJTCcHCjaXP5-Gw_-mbrlC4CV_gtDBZkrl_-Jj-1YLnZxLcPCnMyp1N9iGZvxWbCn35zptoRS3cyXBVjLu77FHA0Q-PZQfvfAHBzbwjn0W6UvLgORwn0i-2FQyQ
< set-cookie: CF_AppSession=n36ecdc54a2da7ba5; Expires=Tue, 22 Aug 2023 21:46:15 GMT; Path=/; Secure; HttpOnly
< access-control-allow-credentials: true
< cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< expires: Thu, 01 Jan 1970 00:00:01 GMT
< report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=J8o2mJHquONVLzvCPLw3OIvHdtwYm1pEIblMeVSJFQLDMvKmjCrqaU9p57YgtWQQyM%2F%2BrbOvb1lsWfP3BnE1srUnSMozcGFpfhJEV6gZ1ja1mBJ3%2BC2OAIbnV9mkyEpaI6TrM80%3D"}],"group":"cf-nel","max_age":604800}
< nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
< x-content-type-options: nosniff
< server: cloudflare
< cf-ray: 7fa61153d9f8ef7f-PDX
< alt-svc: h3=":443"; ma=86400
<
* Connection #0 to host joplin.mydomain.org left intact
Is this output not getting passed back from Cloudflare correctly? It seems this is where the <
character is coming from but I'm not sure because I'm not sure what the output is supposed to look like.
Could anyone help with confirming if this output is wrong (additional adornments such as <
and/or *
)? Any other suggestions? Thanks for any suggestions!
Andy