Setting up a Gramps Web server without docker - getting a blank page

Gramps version: 5.1.5
Gramps Web Version: 3
Gramps API Version: 1.6.0

Hi - I’m trying to set up Gramps Web on an Ubunutu 23.10 server. I have many web based programs running as virtual hosts in apache2 and have never used docker, so I really do not want to run docker.

I have loaded Gramps, added Gramps Web to apache, and I think I hace loaded the API. When I run the gramps web server (https:///gramps) all I get is a blank page. I know it is reading thr index.html file, but not sure what it is supposed to do after that!

Any help would be appreciated.

hp

Please look at the docker files, which are also just an Ubuntu within docker. Anyway, I definitely do not recommend setting everything up manually.

I have looked at the docker files, and will continue to. And I’ve heard the “just use docker” before… well, exclusively. That’s the point of my post.
I’d rather set it up manually than add docker just for gramps.

Thanks for the reply - but does anyone have a hint of an answer to the question about the blank page?

Of course you are very welcome to set everything up manually, but it is a lot of work and I suspect nobody in this forum has the time to give detailed advice on this activity. At least myself I’m already busy helping users having troubles with the “easier” and officially documented way. I don’t mean to be rude, just honest - if you have some specific questions I might be able to help, but please don’t expect a step by step guide.

1 Like

Understood and thanks. All I would like are some hints - no step by step.

I have a good deal of experience in certain areas, but not others.
I am great with Linux OSs, but I am not a programmer.

The specific question is this: Is index.html in gramps-web-main intended to be the launch point of grampsweb, and if so, where should it point from there?

More detail:
In the package gramps-web-main, there is an index.html file.
This file loads from apache2 on my server via the web, but displays a blank page.
Obviously I do not understand how grumps web is intended to run as I know nothing about docker, but normally an index.xxx file would be the starting point of a web page and branch from there. It looks like it is meant to run config.js, but the page is blank.

Thanks

1 Like

If you manage to get Gramps Web working without docker, perhaps you would document your experience to help others.

1 Like

If I do - I will as best I can.

Regards.

2 Likes

I’m interested too. I haven’t been able to run it on an apache server yet.
I have stopped working on this for now, but I will try as soon as possible.

1 Like

I’ve gotten the login page, register page and the reset password page to load, but that’s it. I assume there is an initial config page or process, but I don’t know how to get that. I’m not sure where to set things like the sql database, URL base directory and stuff like that - it’s seems there are many files that are almost identical with some of those definition - so which one rules? Is it in URL root base, the .gramps/config, /app/*, or from the environment variables?

I’ll keep reading the docs…

hp

2 Likes

Can you share what you have done.
Two people is better than one.

Did you add WSGI variable in your apache config ?
How did you generate the web_api ?
Did you modify some config files ? (config.cfg, database.txt, setting.ini, …)

What kind of error do you get ?

2 Likes

I had a crash and need to start over - which is not a bad thing as sometimes it helps to start again from scratch.

I’ll get to it in the next few days.

1 Like

I’m quite new to Gramps and Grampsweb. I knew (know ?) virtually nothing about Docker and dreaded the idea of delving in to a new, to me, technology, at my stage (77). But, I dreaded even more the alternative.

Setting it up the docker way really was not that bad. Not pain free, not at all, but the level of docker knowledge I needed to gain seems rather minimal. From my current perspective of course.

YMMV.

1 Like

Did you manage it without docker?

The idea to run it in docker is good but docker has some own disatvantages.
For me, if i set up any app, usually i dedicade whole VPS server that has nothing but that app/web in there so there cannot be any conflicts with other apps. In that way it easier to manage and debug the app and it uses less resources than using the docker versions. I understand that there is lot more work to create auto-installer to run in the VPS console and setup whole app and all dependencies but in general you already did that in the docker. The main reason why i like custom programming is the efficiency and mostly i try to avoid large libs if i need only few functions from there but additional 50-500 will be loaded and will just sit in the memory. For instance the docker image after setting up takes ~5gb of space. Even without all the media has like 4,8gb image.Imagine how much of processing power is needed to manage app that is large like this. So i am going to rip off from docker the app and avoid it anyways. And i think i will create setup sh file on the way.

1 Like

Although not for use on the internet, you might be interested in taking a look at gramps-web-desktop. It uses non-dockerized gramps-web-api to serve local gramps’ databases via a web browser. Initial version discussed here. Some bug fixes since then.

(There is one bug in gramps-web-api that prevents it from working without installing pytorch but that can easily be worked around.)

1 Like

so far i’ve got to this point:

setup.sh

//update the system
sudo apt-get update
sudo apt-get upgrade -y

sudo apt-get install git -y

//backend install

//install build tools for PIP
sudo apt-get install build-essential pkg-config cmake libcairo2-dev libtool python3-dev python3-gi python-gi-dev python3-gi-cairo gir1.2-gtk-4.0 libicu-dev python3-icu libpq-dev gobject-introspection libgirepository1.0-dev -y
//to run the backend it is required to have gir1.2-gtk-3.0 installed so run this:
sudo apt-get install gir1.2-gtk-3.0 -y
cd /var/www
git clone GitHub - gramps-project/gramps-web-api: A RESTful web API for Gramps - backend of Gramps Web

//install pip module
cd /tmp
wget https://bootstrap.pypa.io/get-pip.py
python ./get-pip.py

//now the web rest api deps install/build
cd /var/www/gramps-web-api/
pip install --ignore-installed .
nano configfile.cfg
paste this:
TREE=“My Family Tree”
BASE_URL=“https://mytree.example.com
SECRET_KEY=“…” # your secret key
USER_DB_URI=“sqlite:////path/to/users.sqlite”
EMAIL_HOST=“mail.example.com
EMAIL_PORT=465
EMAIL_USE_TLS=True
EMAIL_HOST_USER="gramps@example.com"
EMAIL_HOST_PASSWORD=“…” # your SMTP password
DEFAULT_FROM_EMAIL="gramps@example.com"

CTRL+O and CTRL+X to exit.
then write:
LANGUAGE=en python3 -O -m gramps_webapi --config configfile.cfg run --port 5555
you can change the port, the config filename if you like. You will see the errors becouse GTK needs a init to function normaly. In ubuntu desktop version this should be gone (theoreticaly).
if you done right you should see the output like this:
Running Gramps Web API server…
Control+C to quit

  • Serving Flask app ‘gramps_webapi.app’
  • Debug mode: off
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on http://127.0.0.1:5555
    Press CTRL+C to quit

GJ! but it requires some kind of front end and it is only locally accessable. if you want you can run reverse proxy from nginx and use it with public address but generally only frontend pp that is running in the same server should get access to this.

at this point all the build tools needed to update/install the deps for the backend is installed.

Update: backend requires gir1.2-gtk-3.0 to be installed. so i edited the apt-get line to get it installed. Whole script updated, create the config file and run it. One part is done. Now the front end.

I believe that you don’t need those packages, and there is some way to use Gramps without them. I’m exploring…

If you want to get the frontend easily, here is a system to download and unpack it: gramps-web-desktop/make.py at main · dsblank/gramps-web-desktop · GitHub

Is anyone aware of prior attempts to package gramps-web? That is, create a .deb or .rpm package? I’m not a big fan of docker either, and would prefer packages.

If there’s no other attempts to clone from, I think I’ll start from the script above and see where I can get. It looks like there would need to be a package for installing the bits (maybe a front-end and a back-end pacake?) and a separate helper script for configuration (should probably post it on gitlab/github … ).

Did you see the post above on gramps-web-desktop?

It is a pip-installable package with the frontend (repo has a build command). It should be possible to use both gramps and gramps-web-api without any Gtk or docker complexities. But the core gramps code still brings in some Gtk/Gdk items unnecessarily. gramps-web-api used to require a 6 GB download, but now 2.7.0 can be used without the AI stuff (except still needs torch until a new version is released).

Yup, I did see that work, and it’s a great starting point. For now, I’ve been working through how pip works in this context (I’ve not done a complex python package before – mostly C, C++ and some assembler). Distros generally want to build strictly from source files for security reasons, so startiing from a tarball vs pip.