Comments (12)
Hello @v1r0x!
The latest version contains multiple fixes, one related to this exact issue, please check https://github.com/goniszewski/grimoire/releases/tag/v0.3.5!
Also I'm confused why the health check url contains
internal/
?
A: This is Grimoire's proxy path that is proxied internally to the default Pocketbase instance. Thus, we can keep all the API calls in the app itself and not via an external connection.
I'll keep this issue open and wait for your confirmation if it's fixed for you in the latest version!
from grimoire.
Hello @goniszewski
Thanks for your fast reply. I already tried that version after it came out 😉
Edit: Is it enough to run docker-compose pull
? Or should I checkout the git repo again?
Maybe I did something wrong with my setup? I'm far from an expert in docker or traefik 😀
Here's my docker-compose.yml
version: '3.7'
services:
pocketbase:
image: spectado/pocketbase:0.22.10
container_name: grimoire-pocketbase
restart: unless-stopped
ports:
- '8090:80'
volumes:
- pb_data:/pb_data
- pb_migrations:/pb_migrations/
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:80/api/health || exit 1
interval: 5s
timeout: 5s
retries: 5
env_file: .env
depends_on:
- grimoire
networks:
- proxy
labels:
- "traefik.enable=true"
# PocketBase
- "traefik.http.routers.pocketbase.entrypoints=http"
- "traefik.http.routers.pocketbase.rule=Host(`grimoire.mydomain.de`) && PathPrefix(`/pb/`)"
- "traefik.http.middlewares.pocketbase.stripprefix.prefixes=/pb"
- "traefik.http.middlewares.pocketbase-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.pocketbase.middlewares=pocketbase"
- "traefik.http.routers.pocketbase.middlewares=pocketbase-https-redirect"
- "traefik.http.routers.pocketbase-secure.entrypoints=https"
- "traefik.http.routers.pocketbase-secure.rule=Host(`grimoire.mydomain.de`) && PathPrefix(`/pb/`)"
- "traefik.http.routers.pocketbase-secure.tls=true"
- "traefik.http.routers.pocketbase-secure.tls.certresolver=http"
- "traefik.http.routers.pocketbase-secure.service=pocketbase"
- "traefik.http.services.pocketbase.loadbalancer.server.port=80"
- "traefik.docker.network=proxy"
grimoire:
image: goniszewski/grimoire:latest
container_name: grimoire
restart: unless-stopped
env_file: .env
volumes:
- pb_migrations:/app/pb_migrations/
build:
context: .
dockerfile: Dockerfile
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:$PORT/api/health || exit 1
interval: 5s
timeout: 5s
retries: 5
ports:
- '$PORT:$PORT'
networks:
- proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.grimoire.entrypoints=http"
- "traefik.http.routers.grimoire.rule=Host(`grimoire.mydomain.de`)"
- "traefik.http.middlewares.grimoire-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.grimoire.middlewares=grimoire-https-redirect"
- "traefik.http.routers.grimoire-secure.entrypoints=https"
- "traefik.http.routers.grimoire-secure.rule=Host(`grimoire.mydomain.de`)"
- "traefik.http.routers.grimoire-secure.tls=true"
- "traefik.http.routers.grimoire-secure.tls.certresolver=http"
- "traefik.http.routers.grimoire-secure.service=grimoire"
- "traefik.http.services.grimoire.loadbalancer.server.port=5173"
- "traefik.docker.network=proxy"
networks:
proxy:
external: true
volumes:
pb_data:
pb_migrations:
and .env
# Set it if you're using external PocketBase installation (default: http://pocketbase)
PUBLIC_POCKETBASE_URL=https://grimoire.mydomain.de/pb
[email protected]
ROOT_ADMIN_PASSWORD=password
PUBLIC_ORIGIN=https://grimoire.mydomain.de
PUBLIC_HTTPS_ONLY=true
PORT=5173
PUBLIC_SIGNUP_DISABLED=true
from grimoire.
I've checked again the configuration you've provided. I do not have a single suspect, but rather a couple of ideas, so please bear with me:
- Did you check this configuration while using
PUBLIC_POCKETBASE_URL
without any value after=
? It should then default tohttp://pocketbase
- Are you able to get to the app container and check related logs? The internal proxy may be to blame, and if it's true, then we can possibly have some logs to further investigate
- And there's the Origin, aka
PUBLIC_ORIGIN
env that, if not matching request's origin, can lead to CORS errors
Sorry I kept you waiting for so long!
from grimoire.
Sorry I kept you waiting for so long!
No problem at all! ❤️ Really appreciate your help!
Is there a specific log file inside the container? docker-compose logs
doesn't log much. (couldn't find anything related to internal log files)
from grimoire.
I left PUBLIC_POCKETBASE_URL
empty and now the initial error is gone! 🎉
BUT
When trying to add a new user and I click on "Sign up" nothing happens in the browser, but in the JS console/docker logs I get this error:
grimoire | {
grimoire | invalid: true,
grimoire | settings: {
grimoire | code: 'validation_json_size_limit',
grimoire | message: 'The maximum allowed JSON size is 0 bytes.'
grimoire | }
grimoire | }
from grimoire.
What value do you have in your .env
for BODY_SIZE_LIMIT
?
from grimoire.
I didn't set anything, but I tried to set it to the value from your Dockerfile
. Still the same error with 0 bytes
from grimoire.
Strange. Looks more like a proxy issue that is not directly related to the app itself.
from grimoire.
Ok, thanks for the info. Then I'll dig into traefik to find my problem. Should I keep this issue open? Feel free to close it :) I'll add a new comment when I fixed my problem
from grimoire.
It's OK to left it open. I hope you will stumble upon a solution to this problem and share it with us!
from grimoire.
Something is clearly wrong here with ENV variables in general or PUBLIC_POCKETBASE_URL specifically.
After adding some debug to all places where this is used (config.ts, server.ts, lib/utils/pb.ts), this is what is seen and used at those places.
With the following .env
file:
PUBLIC_POCKETBASE_URL=http://192.168.2.100:8090
[email protected]
ROOT_ADMIN_PASSWORD=changeme
PUBLIC_ORIGIN=http://localhost:5173
PUBLIC_HTTPS_ONLY=
PORT=5173
PUBLIC_SIGNUP_DISABLED=false
Env as seen from
Line 6 in 6542728
is:
~ config.ts env: {
PUBLIC_HTTPS_ONLY: '',
PUBLIC_ORIGIN: 'http://localhost:5173',
PUBLIC_POCKETBASE_URL: 'http://192.168.2.100:8090',
PUBLIC_SIGNUP_DISABLED: 'false'
}
so correctly so far.
but then immediately below (
Line 9 in 6542728
config
object gets PUBLIC_POCKETBASE_URL
differently:
🚀 ~ config.ts config: {
HTTPS_ONLY: false,
IS_DEV: false,
ORIGIN: 'http://localhost:5173',
POCKETBASE_URL: 'http://localhost:8090',
SIGNUP_DISABLED: false
}
and therefore the app prints:
Configuration used {
HTTPS_ONLY: false,
IS_DEV: false,
ORIGIN: 'http://localhost:5173',
POCKETBASE_URL: 'http://localhost:8090',
SIGNUP_DISABLED: false
}
and pb.ts also:
🚀 ~ pb.ts config: {
HTTPS_ONLY: false,
IS_DEV: false,
ORIGIN: 'http://localhost:5173',
POCKETBASE_URL: 'http://localhost:8090',
SIGNUP_DISABLED: false
}
🚀 ~ pbUrl: http://localhost:5173/internal/pb
The condition should be updated to something like:
POCKETBASE_URL:
env.PUBLIC_POCKETBASE_URL || getProcessEnvValue('PUBLIC_POCKETBASE_URL') || 'http://pocketbase',
or more elaborate to account for DEV environment. Right now the PUBLIC_POCKETBASE_URL is never used. @goniszewski
from grimoire.
Quick update from my side. I bought a new home server and tried to setup grimoire again. Now it works flawlessly! 🎉
Maybe this was related to my old arm setup instead of x86? I did not change anything, but somehow it works 🤷
from grimoire.
Related Issues (20)
- Ollama URL from settings is not respected. HOT 7
- Trying to add a bookmark without a category triggers an error HOT 3
- Could not connect to Pocketbase HOT 14
- Subcategories of subcategories do not show in left column
- Top-level category does not show all bookmarks under subcategories or the subcategories of those subcategories. HOT 2
- Feature request HOT 1
- Internal Proxy Cookies & docker-latest HOT 15
- Grimoire API not reachable HOT 6
- Add Bookmark and Edit buttons not working HOT 1
- Be able to search by text in the Content field HOT 1
- 500 error when searching on clean install: "Invalid filter parameters."
- Website favicon HOT 1
- Incorrect Tag Links HOT 1
- could not connect to pocketbase HOT 8
- Bookmark pictures not loading HOT 5
- [Feature] Link Behavior HOT 1
- Fuzzy search via search endpoint HOT 2
- Constantly being logged out and no media is loading HOT 2
- Cannot login as admin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grimoire.