-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[Bug] Print PDF in local self-hosted version not working #1623
Comments
Note:
|
You need put the bucket name in the storage url example: STORAGE_URL: http://localhost:9000/default source : https://www.reddit.com/r/selfhosted/comments/182n5th/comment/kapf8wg/ |
This is already the case, check back the |
This is my compose file : version: "3.8"
# In this Docker Compose example, it assumes that you maintain a reverse proxy externally (or chose not to).
# The only two exposed ports here are from minio (:9000) and the app itself (:3000).
# If these ports are changed, ensure that the env vars passed to the app are also changed accordingly.
services:
# Database (Postgres)
postgres:
image: postgres:15-alpine
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 10s
timeout: 5s
retries: 5
# Storage (for image uploads)
minio:
image: minio/minio
restart: unless-stopped
command: server /data
ports:
- 9000:9000
volumes:
- minio_data:/data
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
# Chrome Browser (for printing and previews)
chrome:
image: browserless/chrome:1.61.0-puppeteer-21.4.1
restart: unless-stopped
environment:
TOKEN: chrome_token
EXIT_ON_HEALTH_FAILURE: true
PRE_REQUEST_HEALTH_CHECK: true
# Redis (for cache & server session management)
redis:
image: redis:alpine
restart: unless-stopped
command: redis-server --requirepass password
app:
image: amruthpillai/reactive-resume:latest
restart: unless-stopped
ports:
- 80:80
depends_on:
- postgres
- minio
- redis
- chrome
environment:
# -- Environment Variables --
PORT: 80
NODE_ENV: production
# -- URLs --
PUBLIC_URL: http://localhost
STORAGE_URL: http://localhost:9000/default
# -- Printer (Chrome) --
CHROME_TOKEN: chrome_token
CHROME_URL: ws://chrome:3000
# -- Database (Postgres) --
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres
# explain this url postgresql://postgres:postgres@postgres:5432/postgres postgresql://username:password@host:port/database
# -- Auth --
ACCESS_TOKEN_SECRET: access_token_secret
REFRESH_TOKEN_SECRET: refresh_token_secret
# -- Emails --
MAIL_FROM: noreply@localhost
# SMTP_URL: smtp://user:pass@smtp:587 # Optional
# -- Storage (Minio) --
STORAGE_ENDPOINT: minio
STORAGE_PORT: 9000
STORAGE_REGION: us-east-1 # Optional
STORAGE_BUCKET: default
STORAGE_ACCESS_KEY: minioadmin
STORAGE_SECRET_KEY: minioadmin
STORAGE_USE_SSL: false
# -- Cache (Redis) --
REDIS_URL: redis://default:password@redis:6379
GITHUB_CLIENT_ID: github_client_id
GITHUB_CLIENT_SECRET: github_client_secret
GITHUB_CALLBACK_URL: http://localhost:3000/api/auth/github/callback
# -- Google (Optional) --
GOOGLE_CLIENT_ID: google_client_id
GOOGLE_CLIENT_SECRET: google_client_secret
GOOGLE_CALLBACK_URL: http://localhost:3000/api/auth/google/callback
volumes:
minio_data:
postgres_data:
It works perfectly for me but one thing that I noticed was that whenever I was connected to vpn the site on |
Ok, thanks for your answer, it looks like the same behavior for me. I guess something is wrong with the usage of browserless when running locally while not in dev mode. I'll soon retry behind a reverse proxy on a remote server and get back here. |
I have faced exactly the same issue today, adding chrome:
image: browserless/chrome:1.61.0-puppeteer-21.4.1
restart: unless-stopped
+ extra_hosts:
+ - host.docker.internal:host-gateway
environment:
TOKEN: chrome_token
EXIT_ON_HEALTH_FAILURE: true
PRE_REQUEST_HEALTH_CHECK: true |
Well, my environment is self-hosted, headless, with LAN access. It can be opened normally and enter the dashboard. If the code you mentioned is not added, "about:balnk" will be opened. If it is added, it will turn black and display ’chrome-1‘ log
popping up url is Any thought? ..... Is that a bug? If I manually change the 'localhost' into the IP of self-host machine running service, It start downloading. Hope this helps some people who are confused. Now I gotta to figure out the disappearance of picture |
Change |
Here's a proposed fix: #1676 |
Had same issue try this #1754 (comment) |
It worked for me. |
Are you SURE that is the IP you used???? |
I cannot fathom why, but switching from localhost to 127.0.0.1 for my kubernetes yaml declaration of the env variables for the container for reactive-resume seems to have solved PDF generation+download for me... the lack of documentation for self-hosted just blows me away, and I've been scraping the internet hard for like half a week trying to fix this. Thanks to the original poster for that insight because for the life of me that solution seems to be nowhere else on the internet. Thanks eStranger! |
I have found that when we build the application the pdf generation starts to work. I saw that when I had not built the application, not even once, the resume thumbnails were not rendering rather showing a JSON output that there was no such directory in the "dist/apps/client/index.html", |
Any solution? i'm doing inside or portainer in a nas but without open port on my router, o just want to use in local |
I was able to find the solution. It will work well if you are trying to access locally because the
points to local only. If you are hosting it on a server and it can be locally resolved, you can change the localhost to your server's IP. If you are trying to host it on a vps as this was my case, you will have to use a reverse proxy to point the domains to internal ip and port.
Or you can install a vpn like tailscale to only allow personal access to the site
Im using the simple.yml file and I just gave the containers a name so the the containers always keep the same name (It might not work if you already have containers with same name running, so change the values in file accordingly) . I also created two externally managed networks with 'docker network create NetworkName'. docker-compose.yml
|
Didn't work for me This is the docker compose I'm using
|
Is there an existing issue for this?
Product Variant
Self-Hosted
Current Behavior
I have a resume, when I press "download PDF" button, it opens a new tab
about:blank
and nothing is downloadedExpected Behavior
The resume in PDF should be downloaded
Steps To Reproduce
Here is the full docker-compose configuration that I use to test the app:
docker-compose.yml
What browsers are you seeing the problem on?
Firefox
What template are you using?
None
Anything else?
In the logs, I get this when pressing "Download PDF" button :
After a quick search in the code, I think this is due to this line where
localhost
is replaced byhost.docker.internal
IMPORTANT NOTE: I tried to replace
SERVER_URL
tohttp://localhost:3000
(i.e. without trailing slash) but I still getError: net::ERR_NAME_NOT_RESOLVED at http://host.docker.internal:3000/artboard/preview
)Edit
After changing
localhost
occurrences indocker-compose.yml
to127.0.0.1
I don't get the error anymore (I think it bypassed the issue), but I get a new one... (with the exact same behavior for the end user). Here are the logs:The text was updated successfully, but these errors were encountered: