guyzyl / whatsapp-contact-sync

Easy way to sync between the contact photos on WhatsApp to Google Contacts
https://whasync.com/
Other
159 stars 18 forks source link

Greyed out "get started" button #165

Open theoware opened 1 month ago

theoware commented 1 month ago

Hey,

using the Dockerfile I'm only able to get to the landing page. I'm pretty sure, I've set the variables right. I hope, you are able to help me.

Logs:

[+] Building 1.1s (29/29) FINISHED docker:default
 => [internal] load build definition from Dockerfile 
 => => transferring dockerfile: 1.58kB 
 => [internal] load metadata for docker.io/library/node:21-alpine0.9s
 => [internal] load .dockerignore
 => => transferring context: 160B
 => [internal] load build context
 => => transferring context: 378.60kB
 => [server-build1/10] FROM docker.io/library/node:21-alpine@sha256:db8772d9f5796ac4e8c47508038c413ea1478da010568a2e48672f19a8b80cd2 
 => CACHED [stage-2 2/9] WORKDIR /app/server 
 => CACHED [stage-2 3/9] RUN apk update && apk add --no-cache nss udev ttf-freefont chromium nginx && rm -rf /var/cache/apk/* /tmp/* 
 => CACHED [stage-2 4/9] COPY ./assets/nginx.conf /etc/nginx/nginx.conf
 => CACHED [stage-2 5/9] COPY ./assets/entrypoint.sh . 
 => CACHED [stage-2 6/9] RUN chmod 755 entrypoint.sh 
 => CACHED [web-build 2/7] WORKDIR /app/web
 => CACHED [web-build 3/7] COPY [web/package.json, web/package-lock.json*, ./] 
 => CACHED [web-build 4/7] RUN npm install 
 => CACHED [web-build 5/7] COPY ./interfaces /app/interfaces 
 => CACHED [web-build 6/7] COPY ./web .
 => CACHED [web-build 7/7] RUN npm run build 
 => CACHED [stage-2 7/9] COPY --from=web-build /app/web/dist /var/www/html 
 => CACHED [server-build2/10] WORKDIR /app/server
 => CACHED [server-build3/10] COPY [server/package.json, server/package-lock.json*, ./]
 => CACHED [server-build4/10] RUN npm install
 => CACHED [server-build5/10] COPY ./interfaces /app/interfaces
 => CACHED [server-build6/10] COPY ./server .
 => CACHED [server-build7/10] RUN npm run build
 => CACHED [server-build8/10] RUN npm prune --production 
 => CACHED [server-build9/10] RUN apk update && apk add curl && curl -sf https://gobinaries.com/tj/node-prune | sh 
 => CACHED [server-build 10/10] RUN mv node_modules/googleapis/build/src/apis/docs ./docs && node-prune --exclude "**/googleapis/**/docs/*.js" && mv ./docs node_modules/googleapis/build/src/apis/docs
 => CACHED [stage-2 8/9] COPY --from=server-build /app/server/node_modules ./node_modules
 => CACHED [stage-2 9/9] COPY --from=server-build /app/server/build ./build
 => exporting to image 
 => => exporting layers
 => => writing image sha256:beb8fae821c8a5711ea0255f1b40c81c4cfb1b3440533abd8e5ee0b6918fddb4 
 => => naming to docker.io/library/whasync 

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
(node:7) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Listening on port 8080
Starting Nginx server
192.168.178.129 - - [22/May/2024:15:06:15 +0000] "GET / HTTP/1.1" 200 325 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"
192.168.178.129 - - [22/May/2024:15:06:15 +0000] "GET /assets/index-Vs-X_rTS.js HTTP/1.1" 200 95513 "http://192.168.178.129/" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"
192.168.178.129 - - [22/May/2024:15:06:15 +0000] "GET /assets/index-PJwjaxPH.css HTTP/1.1" 200 55301 "http://192.168.178.129/" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"
192.168.178.129 - - [22/May/2024:15:06:15 +0000] "GET /logo.png HTTP/1.1" 200 574897 "http://192.168.178.129/" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"
192.168.178.129 - - [22/May/2024:15:06:15 +0000] "GET /assets/Home-MAK3bWtK.js HTTP/1.1" 200 1403 "http://192.168.178.129/assets/index-Vs-X_rTS.js" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"
2024/05/22 15:06:15 [error] 42#42: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.178.129, server: _, request: "GET /api/ HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "192.168.178.129", referrer: "http://192.168.178.129/"
192.168.178.129 - - [22/May/2024:15:06:15 +0000] "GET /api/ HTTP/1.1" 502 157 "http://192.168.178.129/" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"
2024/05/22 15:06:15 [error] 42#42: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.178.129, server: _, request: "GET /api/status HTTP/1.1", upstream: "http://127.0.0.1:8080/status", host: "192.168.178.129", referrer: "http://192.168.178.129/"
192.168.178.129 - - [22/May/2024:15:06:15 +0000] "GET /api/status HTTP/1.1" 502 157 "http://192.168.178.129/" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"
2024/05/22 15:06:15 [error] 44#44: *5 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.178.129, server: _, request: "GET /api/ws HTTP/1.1", upstream: "http://127.0.0.1:8080/ws", host: "192.168.178.129"
192.168.178.129 - - [22/May/2024:15:06:15 +0000] "GET /api/ws HTTP/1.1" 502 157 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0"

Screenshot of webpage: grafik

guyzyl commented 1 month ago

What command line did you use to run the container + do you see any errors in the dev console?

theoware commented 1 month ago

Hey, I used the following command:

sudo docker build -t whasync .
sudo docker run --rm -it -p 80:80 whasync

What do you mean by dev console? The logs I sent above are the whole output of these two commands

guyzyl commented 1 month ago

In chrome press F12 on your keyboard to open the dev console, you should see the frontend's errors there

theoware commented 1 month ago

Here you go:

Some cookies are misusing the recommended “SameSite“ attribute 4
The resource at “<URL>” was blocked because content blocking is enabled. 2
Firefox can’t establish a connection to the server at ws://192.168.178.156/api/ws. index-Vs-X_rTS.js:21:30232
WS error - [object Event] index-Vs-X_rTS.js:21:30333
Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Partitioned cookie or storage access was provided to “https://ghbtns.com/github-btn.html?user=guyzyl&repo=whatsapp-contact-sync&type=star&count=true&size=large” because it is loaded in the third-party context and dynamic state partitioning is enabled.
guyzyl commented 1 month ago

Everything seems OK from the frontend perspective. It seems that for some reason the backend is up (Listening on port 8080), but fails to respond to any of the requests it receives (failed (111: Connection refused) while connecting to upstream).

The thing is that the Docker image does work, it's what's powering whasync.com + I tried building it myself and running locally when you opened the issue.

My guess would be that it's a configuration problem of the backend. Have you configured all of the ENV vars as mentioned in README.md? If you're sure you have, I'll try to think of another way to test my theory (remotely).

theoware commented 1 month ago

It's really weird. I've tried using older versions, setting network to host, also allowing port 8080, setting the env variables in the command, seperating web and backend. I also tried using it on a different computer. Not only that, but I've also tried running it without docker using npm, that worked. Before, it also worked on my pc. So I think it's some sort of update breaking the program.

guyzyl commented 1 month ago

Does the latest version (main branch) work for you using npm?

It's hard for me to pinpoint where things are going wrong on your machine remotely, so I'm trying to ask guiding questions in the hopes that you'll find something that causes it all to break.

theoware commented 1 month ago

Just tested and I can confirm it works using npm

guyzyl commented 1 month ago

So it defiantly has something to do with the container itself, but it does work for me meaning it has to do something with you environment.

Have you modified any of the files? Are there any local changes you have that are not on the main branch of the repo?

theoware commented 1 month ago

Apart from the env and google auth thing, I haven't changed anything.

Just now, I've also tried running on a fresh clone of the repo. Still the same result

guyzyl commented 1 month ago

Can you upload the container you built to dockerhub? I'll try to check it out myself.

theoware commented 1 month ago

Sure, thanks! https://hub.docker.com/r/theoware/whasync/tags