Skip to content
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

List of files are empty after sync with dropbox #145

Open
leandroohf opened this issue Mar 11, 2023 · 4 comments
Open

List of files are empty after sync with dropbox #145

leandroohf opened this issue Mar 11, 2023 · 4 comments

Comments

@leandroohf
Copy link

leandroohf commented Mar 11, 2023

I am trying to host my version of org-web and sync with dropbox. Be advised that I do not know much about react-app, yarn, HTTP servers and dropbox apps either.

I read the issue #74 and the documentation on READMEorg. Based on that:

  1. I created my dropbox app, and I set the Redirect URIs to https://my-public-ip:3000/

  2. edit .env and set REACT_APP_DROPBOX_CLIENT_ID=MY DROPBOX APP key

  3. I changed the file package.json to "start": "HTTPS=true react-scripts start." So I can start the service with HTTPS instead of HTTP (Dropbox was complaining about that)

  4. I could start the HTTP server with the command yarn start. I accessed the org-web under https://my-public-ip:3000/

On https://my-public-ip:3000/ (landpage). I logged on to Dropbox after clicking Sign in -> Dropbox. But after being redirected to a page where the files are supposed to be listed, that page was empty.

issue

What are the possible problems?

@DanielDe
Copy link
Owner

Hey @leandroohf, I'm not exactly sure what's going on, but a couple thoughts:

  1. I see that your browser is complaining that this IP is "Not secure", likely because you don't actually have an SSL certificate for this site. It's possible that the Dropbox SDK isn't happy about this and is failing to load for that reason.
  2. Are you getting any errors in your browser console? You can access this by right clicking on the page, selecting "Inspect", and going to the "Console" tab
    CleanShot 2023-03-11 at 10 48 00
  3. Have you tried running this setup locally? This may help rule out some problems. You can add http://localhost:3000 as a redirect URI for your Dropbox app to test this.

Also happy to hop on a call with you if you'd like to help figure this out. Feel free to reach out to me at me@danielde.dev

@leandroohf
Copy link
Author

Hi Daniel - thanks for your quick reply.

  1. I checked the console, and I saw this message: Failed to "load resource: The server responded with a status of 409 (Conflict)". Based on the HTTP code 409, I am missing the SSL certificate part to start the server. Do you have any reference for setting up the SSL certificate and running the service with HTTPS protocol?

  2. I am deploying org-web on gcp instance. I believe adding http://localhost:3000 should not work.

One more thing. I also tried to deploy using Heroku. Follow the steps after running git push heroku master. I got an error in Heroku logs (heroku logs --tail) related to the command "serve build." See the output below:

2023-03-12T02:26:57.229679+00:00 heroku[web.1]: Starting process with command `serve build`
2023-03-12T02:26:58.561743+00:00 app[web.1]: /app/.heroku/node/lib/node_modules/serve/build/main.js:4
2023-03-12T02:26:58.561760+00:00 app[web.1]: import { cwd as getPwd, exit, env as env2, stdout } from "node:process";
2023-03-12T02:26:58.561760+00:00 app[web.1]: ^
2023-03-12T02:26:58.561761+00:00 app[web.1]: 
2023-03-12T02:26:58.561761+00:00 app[web.1]: SyntaxError: Unexpected token {
2023-03-12T02:26:58.561761+00:00 app[web.1]: at Module._compile (internal/modules/JCS/loader.js:760:23)
2023-03-12T02:26:58.561762+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
2023-03-12T02:26:58.561762+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:685:32)
2023-03-12T02:26:58.561762+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:620:12)
2023-03-12T02:26:58.561762+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
2023-03-12T02:26:58.561763+00:00 app[web.1]: at internal/main/run_main_module.js:21:11
2023-03-12T02:26:58.701201+00:00 heroku[web.1]: Process exited with status 1
2023-03-12T02:26:58.752243+00:00 heroku[web.1]: State changed from starting to crashed 

Would you like for me to start a new issue regarding that? Or could you keep it here?

@leandroohf
Copy link
Author

Hi Daniel - thanks for your quick reply.

  1. I checked the console, and I saw this message: Failed to "load resource: The server responded with a status of 409 (Conflict)". Based on the HTTP code 409, I am missing the SSL certificate part to start the server. Do you have any reference for setting up the SSL certificate and running the service with HTTPS protocol?

  2. I am deploying org-web on gcp instance. I believe adding http://localhost:3000 should not work.

One more thing. I also tried to deploy using Heroku. Follow the steps after running git push heroku master. I got an error in Heroku logs (heroku logs --tail) related to the command "serve build." See the output below:

2023-03-12T02:26:57.229679+00:00 heroku[web.1]: Starting process with command `serve build`
2023-03-12T02:26:58.561743+00:00 app[web.1]: /app/.heroku/node/lib/node_modules/serve/build/main.js:4
2023-03-12T02:26:58.561760+00:00 app[web.1]: import { cwd as getPwd, exit, env as env2, stdout } from "node:process";
2023-03-12T02:26:58.561760+00:00 app[web.1]: ^
2023-03-12T02:26:58.561761+00:00 app[web.1]: 
2023-03-12T02:26:58.561761+00:00 app[web.1]: SyntaxError: Unexpected token {
2023-03-12T02:26:58.561761+00:00 app[web.1]: at Module._compile (internal/modules/JCS/loader.js:760:23)
2023-03-12T02:26:58.561762+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
2023-03-12T02:26:58.561762+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:685:32)
2023-03-12T02:26:58.56176+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:620:12)
2023-03-12T02:26:58.561762+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
2023-03-12T02:26:58.561763+00:00 app[web.1]: at internal/main/run_main_module.js:21:11
2023-03-12T02:26:58.701201+00:00 heroku[web.1]: Process exited with status 1
2023-03-12T02:26:58.752243+00:00 heroku[web.1]: State changed from starting to crashed 

I tried deploying with these node versions: 11.10.0, 11.15.0, and 12.2.0. I change the contents of the file package.json to do that.

"engines": {
"node": "11.x"
},

What are the versions of nodejs you have tested org-web? Have you tried the latest? It seems version 11.x is too old.

Would you like for me to start a new issue regarding that? Or could you keep it here?

@DanielDe
Copy link
Owner

Ah well that explains it then!

Do you have any reference for setting up the SSL certificate and running the service with HTTPS protocol?

I don't know of any good references off the top of my head (nowadays when I do this stuff it's mostly managed by some service I'll mention below), but the company I'd recommend is Let's Encrypt: https://letsencrypt.org/. They're a non-profit that provides free SSL certificates.

However, this may be a particular pain for you to set up if you don't have a domain name.

What I'd really recommend is that you use a managed service like Netlify or Digital Ocean. I've used and can recommend both. They both make it super easy to set up a simple static site (which is all you need) and purchase a domain to go along with it. They'll also set up all the SSL stuff for you.

This will still require that you can build the app somehow, which gets us to the next part of your comment.

Version 11 of Node is quite old, yes, but you can still install it and use it just fine (I just did the other night to deploy a new version of org-web). The tool I'd recommend to manage Node versions is asdf.

So you'll need to do something like the following:

  1. Install asdf
  2. Install asdf-nodejs
  3. Install v11 of Node
  4. Build org-web
  5. Upload the built static files to Netlify or Digital Ocean.

Once again, happy to hop on a call and help you get set up with this if you'd like! I know it's a lot, especially if you're unfamiliar with the ecosystem of web tools.

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

2 participants