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

cinny doesnt go further than "Heating up" #1757

Closed
licentiapoetica opened this issue Jun 2, 2024 · 3 comments · Fixed by #1837
Closed

cinny doesnt go further than "Heating up" #1757

licentiapoetica opened this issue Jun 2, 2024 · 3 comments · Fixed by #1837

Comments

@licentiapoetica
Copy link

Describe the bug

After pulling the latest changes and building the docker image I was greeted by "Heating up"
20240602_205901

It doesn't go further than this.

In my nginx log I found this:

172.17.0.1 - - [02/Jun/2024:18:57:55 +0000] "GET /home/olm.wasm HTTP/1.1" 404 153 "http://localhost:8080/home/" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0" "-"
2024/06/02 18:57:55 [error] 30#30: *1 open() "/usr/share/nginx/html/home/olm.wasm" failed (2: No such file or directory), client: 172.17.0.1, server: localhost, request: "GET /home/olm.wasm HTTP/1.1", host: "localhost:8080", referrer: "http://localhost:8080/home/"
2024/06/02 18:57:55 [error] 30#30: *1 open() "/usr/share/nginx/html/home/olm.wasm" failed (2: No such file or directory), client: 172.17.0.1, server: localhost, request: "GET /home/olm.wasm HTTP/1.1", host: "localhost:8080", referrer: "http://localhost:8080/home/"
172.17.0.1 - - [02/Jun/2024:18:57:55 +0000] "GET /home/olm.wasm HTTP/1.1" 404 153 "http://localhost:8080/home/" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0" "-"

Reproduction

pull the latest repo version
follow the steps in the documentation to build the docker image
run it
go to localhost:8080 and log in
wait indefinetly for the heat up

Expected behavior

Login works and I can see cinny chat

Platform and versions

Docker version 20.10.24+dfsg1, build 297e128
Debian 12 Bookworm
Firefox 126.0.1

Additional context

No response

@licentiapoetica
Copy link
Author

The issue is because the olm.wasm is expected to be found on /home/olm.wasm but is only being served on /olm.wasm with a custom nginx config this can be fixed by doing something dirty like this

       location /home/olm.wasm {
            proxy_pass http://localhost:8080/olm.wasm;
        }

@RoblKyogre
Copy link

the proposed workaround didn't work for me, but I tried another method that did fix it for me, though it does also redirect any */olm.wasm to the wasm file (which appears to be correct based on the netlify.toml file)
In the container's /etc/nginx/conf.d/default, I added the following:

        location ~ ^/(.*)/olm.wasm {
                try_files $uri /olm.wasm;
                alias /app;
        }

@compuguy
Copy link

compuguy commented Jun 30, 2024

the proposed workaround didn't work for me, but I tried another method that did fix it for me, though it does also redirect any */olm.wasm to the wasm file (which appears to be correct based on the netlify.toml file) In the container's /etc/nginx/conf.d/default, I added the following:

        location ~ ^/(.*)/olm.wasm {
                try_files $uri /olm.wasm;
                alias /app;
        }

Yeah what I did is add is a new nginx file based on the cinny/contrib/nginx/cinny.domain.tld.conf file:

server {
	listen 80;
	listen [::]:80;

	location / {
		root /usr/share/nginx/html;
		index index.html;
	}
	location /home {
		rewrite ^/home?$ /index.html break;
	}
	location ~* ^\/(login|register) {
		try_files $uri $uri/ /index.html;
	}
	# See https://github.com/cinnyapp/cinny/issues/1757#issuecomment-2149010847
        location ~ ^/(.*)/olm.wasm {
        try_files $uri /olm.wasm;
        alias /app;
	}
}

Then modify the dockerfile to put this in the place of default/default.conf:

## Builder
FROM node:20.12.2-alpine3.18 AS builder

WORKDIR /src

COPY .npmrc package.json package-lock.json /src/
RUN npm ci
COPY . /src/
ENV NODE_OPTIONS=--max_old_space_size=4096
RUN npm run build
COPY /contrib/nginx/cinny-docker.conf /src/

## App
FROM nginx:1.27.0-alpine

RUN apk --no-cache -U upgrade

COPY --from=builder /src/dist /app
COPY --from=builder /src/cinny-docker.conf /etc/nginx/conf.d/default.conf

RUN rm -rf /usr/share/nginx/html \
  && ln -s /app /usr/share/nginx/html

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

Successfully merging a pull request may close this issue.

3 participants