Hello,
I’m using Gramps Web as a Docker installation on a Synology NAS. I installed Gramps Web following these instructions: How to Install Gramps Web on Your Synology NAS – Marius Hosting
Gramps 6.0.8
Gramps Web API 3.18.0
Gramps Web Frontend 26.7.0
Gramps QL 0.4.0
Sifts 1.3.1
locale: de
multi-tree: false
task queue: false
OCR: true
chat: false
How can I define variables for the frontend in the Stacks Web Editor?
For example, hideDNALink to hide the DNA menu item in Gramps Web.
Thanks for you support
Hi,
please note that the tutorial you linked is not part of the official docs, so I cannot comment on it.
This is the official doc site:
Best,
David
Okay, I see…
Is it possible to define a frontend variable in the docker-compose.yml file?
Mit Docker bereitstellen - Gramps Web
There’s a section called “environment” here. Can I define the frontend variable “hideDNALink” here? What’s the syntax for that?
Thanks,
Werner
No, you have to create the file config.js and mount it to the right place, which you can do in your Docker Compose file. Should be /app/src/config.js in the default docker images I think. If you can confirm that, an improvement of the above doc page would be very welcome.
I can’t see the Docker image in DSM—it’s invisible to all users, including the admin.
My config.js looks like this:
window.grampsjsConfig = {
hideDnaLink: true
}
In docker-compose.yml, I’ve tried the following entries:
volumes:
- /volume2/docker/grampsweb/app/config.js:/app/static/config.js:ro
and
volumes:
- /volume2/docker/grampsweb/app/config.js:/app/src/config.js:ro
After restarting the container, Gramps Web starts up, but the DNA Link is still there in all cases.
Oh, can you try /app/static/config.js:ro on the RHS?
… and, independently of that (i.e. before and after), can you please check what the content of https://your.grampsweb.instance/config.js is in the browser? (Hard reload can’t hurt.)
This is the current docker-compose.yml
services:
grampsweb:
image: Package grampsweb · GitHub
container_name: Gramps-Web
healthcheck:
test: timeout 10s bash -c ‘:> /dev/tcp/127.0.0.1/5000’ || exit 1
interval: 10s
timeout: 5s
retries: 3
start_period: 90s
security_opt:
- no-new-privileges:true
ports:
- 5449:5000
environment:
GRAMPSWEB_TREE: Cubus-Family-Tree
LANGUAGE: de_DE.UTF8
LANG: de_DE.UTF8
LC_ALL: de_DE.UTF8
volumes:
- /volume2/docker/grampsweb/app/config.js:/app/static/config.js:ro
- /volume2/docker/grampsweb/dbuser:/app/users:rw
- /volume2/docker/grampsweb/indexdir:/app/indexdir:rw
- /volume2/docker/grampsweb/thumbnail:/app/thumbnail_cache:rw
- /volume2/docker/grampsweb/cache:/app/cache:rw
- /volume2/docker/grampsweb/secret:/app/secret:rw
- /volume2/docker/grampsweb/database:/root/.gramps/grampsdb:rw
- /volume2/docker/grampsweb/media:/app/media:rw
- /volume2/docker/grampsweb/tmp:/tmp:rw
restart: on-failure:5
And this is what config.js looks like in the Chrome browser. I cleared the browser cache beforehand:
DNA is still displayed in the menu.
That’s great news because it means your backend config is correct!
But perhaps there’s a frontend bug then…
I take that back - look closely at your config file and the docs again. hideDNALink.
I changed the entry in config.js.
Now it works—the DNA link is hidden.
Thanks for your help.