Gramps installation on a VM on Synology NAS

Let me start by saying how amazing Gramps has been for me. I have only started my research and still have a long way to go but I would love to have some of my family members help me out.

The ideal situation for me is:

  1. Run Gramps on a VM on Synology.
  2. Run the Web API on a docker container
  3. Run the Gramps.js on a docker container.

Boom the setup is complete. Create users for my family members and get them all to build the DB.

I am only looking for the setup of Gramps on NAS, the remaining two points I will figure out when I have Gramps running. Considering the limited resources, a NAS has, I was hoping somebody out in the forum has tried this and give some suggestions or share the config for this setup.

Thanks in advance.

1 Like

Hi! It depends on your NAS model - the more expensive ones can run Docker, then you can simply follow this approach. Without that, I suspect it will not work as Gramps depends on lots of packages that are not available on the NAS’s OS.

In my case, the NAS doesn’t support Docker, so I’m running my Gramps on a Raspberry Pi lying next to it :slight_smile:

2 Likes

I have Gramps on multiple VM’s, both with full Graphical Linux Distros and Windows WSL2.

If your NAS can run a VM like KVM or similar VM Hosts, and it has enough RAM, it is just to install it as on any Linux Box.

I hav run Gramps with 2GB Ram for an Image on Hyper-V. I have not tested it with a large base, I think I had a totalt of 30-40k objects in the database.

2 Likes

Thanks for the replies @DavidMStraub and @StoltHD I will try with Ubuntu.
David, I will be hosting the webapi too in a docker env as you suggested but, I need gramps first up and running correct?

David, I will be hosting the webapi too in a docker env as you suggested but, I need gramps first up and running correct?

No, Gramps is installed in that docker image already. The Gramps Web API Dockerfile contains a line that bases it onto a Gramps image with Dockerfile here. You only need to make sure your Gramps database directory and media files are mounted correctly into the container

Can this set of steps be re-written the way it should actually occur? What are the assumptions? Since the WebAPI is still in a Read-Only stage, we are assuming a Tree has already been created on a local machine, right? So maybe we should start with the Example.gramps file already imported and that the Media Paths fixed after that import.

Here’s a tutorial on installing a different Docker image on the Synology site:

And other pages on Virtual Machine Manager specifications and maximum number of instances on various Synology products.

Can this set of steps be re-written the way it should actually occur? What are the assumptions?

  1. Choose an existing family tree you are using with Gramps (v5.1). Identify the database directory and the media base path.
  2. Make sure your family tree uses SQLite (and not BSDDB!). Convert if necessary.
  3. Copy/sync the database directory and media files to your server
  4. Follow the deployment instructions and make sure to get /path/to/grampsdb and /path/to/gramps_media right.

You can check whether your tree is correctly recognized by the Gramps inside the container by running

docker-compose run gramps_webapi gramps -L

This was probably not complete, let me know which steps are still missing…

2 Likes

Got it working. The docker deployment instructions was magic. I did have trouble in authorization, not sure where to get the JWT token, as I have no users created to get the token.
I added DISABLE_AUTH in the config file and everything is working. This is only for test and not for production.

My steps above were thinking I needed Gramps installed separately. Now that I know the web API has Gramps and all I needed was the DB and media. Things became a bit clearer.

I will write up, what I tried on docker on Synology.

Meanwhile, I do not think this is Read only, correct? That is why the gramps.js project is out there for collaboration and edit access.

1 Like

Great you got it working!

I did have trouble in authorization, not sure where to get the JWT token, as I have no users created to get the token.

We need to add documentation for the user system, in the meantime you can look at python3 -m gramps_webapi user --help.

Meanwhile, I do not think this is Read only, correct? That is why the gramps.js project is out there for collaboration and edit access.

It is currently still read only because this is what we implemented first. Next will be adding support for creating objects in the backend (and to add the corresponding UI in Gramps.js), then to allow editing objects (which I think is trickier than adding new objects).

1 Like

This is wonderful work @DavidMStraub
I will try my best to record the entire process and put it on YouTube if it helps. Will be my first video so not sure how it will sound or come out but want to help.

Meanwhile will track the Auth piece.

1 Like

@DavidMStraub Starting off I would like to apologise if this is a dumb question. As an embarrassing excuse, I would like to say I am a n00b.

When you suggested, I look at:

python3 -m gramps_webapi user --help

I assumed, I go into the docker container and run this command, correct?
I did the same, using Portainer.

The commands are shown below:

root@c6ec47c30e02:/app# python3 -m gramps_webapi user --help
Usage: python3 -m gramps_webapi [OPTIONS] COMMAND [ARGS]...
Try 'python3 -m gramps_webapi --help' for help.

Error: Missing option '--config'.
root@c6ec47c30e02:/app# python3 -m gramps_webapi --help
Usage: python3 -m gramps_webapi [OPTIONS] COMMAND [ARGS]...

  Gramps web API command line interface.

Options:
  --config TEXT  Set the path to the config file  [required]
  --help         Show this message and exit.

Commands:
  run     Run the app.
  search  Manage the full-text search index.
  user    Manage users.
root@c6ec47c30e02:/app# ls
config  db  indexdir  media  src  static  thumbnail_cache  users
root@c6ec47c30e02:/app# cd config
root@c6ec47c30e02:/app/config# ls
config.cfg
root@c6ec47c30e02:/app/config# cd ..
root@c6ec47c30e02:/app# python3 -m gramps_webapi --config ./config/config.cfg
Usage: python3 -m gramps_webapi [OPTIONS] COMMAND [ARGS]...
Try 'python3 -m gramps_webapi --help' for help.

Error: Missing command.
root@c6ec47c30e02:/app# cd config
root@c6ec47c30e02:/app/config# 
root@c6ec47c30e02:/app/config# pwd
/app/config
root@c6ec47c30e02:/app/config# cd ..
root@c6ec47c30e02:/app# python3 -m gramps_webapi --config /app/config/config.cfg
Usage: python3 -m gramps_webapi [OPTIONS] COMMAND [ARGS]...
Try 'python3 -m gramps_webapi --help' for help.

Error: Missing command.
root@c6ec47c30e02:/app# 

The config is on my NAS and I know it works, like I mentioned the API works fine when I changed the entry DISABLE_AUTH=True in the config file.

I am a little lost again, hoping I could get some directions.
Thanks.

Sorry, my bad, I had forgotten that that command only works when specifying a config file:

python3 -m gramps_webapi --config /path/to/config user --help

This will display the available commands, e.g. for adding a new user

python3 -m gramps_webapi --config /path/to/config user USERNAME PASSWORD --fullname FULLNAME --email EMAIL --role ROLE

where ROLE is an integer corresponding to a user role, see here:

gramps-webapi/const.py at master · gramps-project/gramps-webapi · GitHub

As said, we really need to document this…

1 Like

Was able to get it working.

python3 -m gramps_webapi --config /app/config/config.cfg user add admin admin --fullname Administrator --email admin@test.com --role 4

@DavidMStraub mind if I try to contribute to the Wiki? Need permission to contribute. vnl (Vivian Lobo) (github.com)

2 Likes

Please PLEASE do!

Writing an article tends to reveal issues that were overlooked. And, while it is nice to have an outline by the programmer, user docs tend to turn out better when written by someone who did NOT know what the programmer intended. (Then the programmer tells us about the Easter Eggs that were missed!)

Here’s a link on how to take advantage of a templates when write a tutorial style article for the wiki:

https://gramps-project.org/wiki/index.php/Write_a_"How_Do_I..."_Article

1 Like

Thanks for the offer, that would be great! Added an issue to decide how to do it.

1 Like

@DavidMStraub Thanks for taking care of it. I will wait for the official way to write those wikis.

Meanwhile, I jumped ahead with setting up Gramps.js. So, a quick question here, what is “Set Home Person”?
In the demo server you have set up, I type a couple of letters and it suggests a name and all good.

In my deployment, my DB has only one name. This was a test DB. I do not get the prompt and now cannot proceed basically.
I was reading: Web based Gramps - Ideas - The Gramps Project (Discourse Forum & Mailing List) but did not get an answer.

Do I need to update the DB with more people?

Update: I realised; I needed a bigger family tree. So used the example DB and copied it over to the db volume. Deleted the older folder.
Q1: Can we have multiple DBs?

Update2: With this new Example DB, I am still not able to set the home person on Gramps.js. Typing a letter or two does not prompt any user to select as home person.

Noticed in the container logs:


[2021-07-13 16:45:19 +0000] [7] [INFO] Starting gunicorn 20.1.0

[2021-07-13 16:45:19 +0000] [7] [INFO] Listening at: http://0.0.0.0:5000 (7)

[2021-07-13 16:45:19 +0000] [7] [INFO] Using worker: sync

[2021-07-13 16:45:19 +0000] [10] [INFO] Booting worker with pid: 10

[2021-07-13 16:45:19 +0000] [11] [INFO] Booting worker with pid: 11

[2021-07-13 16:45:19 +0000] [12] [INFO] Booting worker with pid: 12

[2021-07-13 16:45:19 +0000] [13] [INFO] Booting worker with pid: 13

[2021-07-13 16:45:19 +0000] [14] [INFO] Booting worker with pid: 14

[2021-07-13 16:45:19 +0000] [16] [INFO] Booting worker with pid: 16

[2021-07-13 16:45:19 +0000] [17] [INFO] Booting worker with pid: 17

[2021-07-13 16:45:19 +0000] [20] [INFO] Booting worker with pid: 20

Unable to init server: Could not connect: Connection refused

Unable to init server: Could not connect: Connection refused

Web Api Config:

TREE="Example"  # set the name of your family tree
SECRET_KEY="lHgRmZ_AbwuDH6f3YkD9Y_rj0um_jjcRTfUk1vZw1gk" # set your secret key
DISABLE_AUTH=True
# do not change the following lines as they refer to paths within the container
USER_DB_URI="sqlite:////app/users/users.sqlite"
MEDIA_BASE_DIR="/app/media"
SEARCH_INDEX_DIR="/app/indexdir"
STATIC_PATH="/app/static"
CORS_ORIGINS="*"

I dearly hope that you will not wait and instead try to record that video tutorial you suggested earlier.

It might jumpstart a few users and give this project some extra contributors.

Plus, it is helpful to record such a thing while the memory of what felt un-intuitive is still fresh. Those are the items that need special mention in the video. And, when the developers watch the video, they will see where users missed opportunities.

That makes sense; I will record it as soon as possible. I would like to mention, I absolutely hate my voice when recorded.

Meanwhile, I should split the video into two as I have not sorted out Gramps.js

1 Like

I think that most of us do. (Well, those of us who are not narcissistic enough to be entranced by the sound of their own voices.)

I was tasked with a being the ‘talent’ and script writer on a series of hour-long tutorial videos in the 90s teaching techniques in 3D modeling. The company sold bunches of videos on different techniques but I was embarrassed by every one of them. And also when my voice was recognized at tradeshow. I preferred being behind the scenes as head of the tech support.

But our videographer flatly refused to work with anyone else… because my voice temperature and cadence was very consistent. That made edits on the video effortless, even when inserting a ‘take’ from a different week.

A decent recording environment can make a world of difference. Typically, a computer room has a lot of echo that will sound pretty bad. The cheapest solution is to put a blanket over your head while recording a voice over! Seriously, it will eliminate all the echo!! Or record in a walk-in clothes closet. Also, if you are going to do a fair amount of recording, there are now USB microphones for less than US $100 that do a pretty decent job. If you are interested, just search for inexpensive podcasting set ups.

Craig

1 Like