Git Product home page Git Product logo

webtrees-docker's Introduction

Docker Image for webtrees

This is a multi-architecture, up-to-date, Docker image for webtrees served over HTTP or HTTPS. This can be put behind a reverse proxy such as CloudFlare or Traefik, or run standalone.

Usage

Quickstart

If you want to jump right in, take a look at the provided docker-compose.yml.

Environment Variables

There are many environment variables available to help automatically configure the container. For any environment variable you do not define, the default value will be used.

๐Ÿšจ WARNING ๐Ÿšจ These environment variables will be visible in the webtrees control panel under "Server information". Either lock down the control panel to administrators, or use the webtrees setup wizard.

Environment Variable Required Default Notes
PRETTY_URLS No False Setting this to any truthy value (True, 1, yes) will enable pretty URLs. This can be toggled at any time, however you must go through initial setup at least once first.
HTTPS or SSL No False Setting this to any truthy value (True, 1, yes) will enable HTTPS. If True, you must also fill out SSL_CERT_FILE and SSL_CERT_KEY_FILE
HTTPS_REDIRECT or SSL_REDIRECT No False Setting this to any truthy value (True, 1, yes) will enable a permanent 301 redirect to HTTPS . Leaving this off will allow webtrees to be accessed over HTTP, but not automatically redirected to HTTPS.
SSL_CERT_FILE No /certs/webtrees.crt Certificate file to use for HTTPS. Can either be absolute, or relative to /var/www/webtrees/data/.
SSL_CERT_KEY_FILE No /certs/webtrees.key Certificate key file to use for HTTPS. Can either be absolute, or relative to /var/www/webtrees/data/.
LANG Yes en-us webtrees localization setting. This takes a locale code. List: https://github.com/fisharebest/webtrees/tree/main/resources/lang/
BASE_URL Yes None Base URL of the installation, with protocol. This needs to be in the form of http://webtrees.example.com
DB_TYPE Yes mysql Database server type. See below for valid values.
DB_HOST Yes None Database server host.
DB_PORT Yes 3306 Database server port.
DB_USER or MYSQL_USER or MARIADB_USER or POSTGRES_USER Yes webtrees Database server username.
DB_PASS or MYSQL_PASSWORD or MARIADB_PASSWORD or POSTGRES_PASSWORD Yes None Database server password.
DB_NAME or MYSQL_DATABASE or MARIADB_DATABASE or POSTGRES_DB Yes webtrees Database name.
DB_PREFIX Yes wt_ Prefix to give all tables in the database. Set this to a value of "" to have no table prefix.
DB_KEY No None Key file used to verify the MySQL server. Only use with the mysql database driver. Relative to the /var/www/webtrees/data/ directory.
DB_CERT No None Certificate file used to verify the MySQL server. Only use with the mysql database driver. Relative to the /var/www/webtrees/data/ directory.
DB_CA No None Certificate authority file used to verify the MySQL server. Only use with the mysql database driver. Relative to the /var/www/webtrees/data/ directory.
DB_VERIFY No False Whether to verify the MySQL server. Only use with the mysql database driver. If True, you must also fill out DB_KEY, DB_CERT, and DB_CA.
WT_USER Yes None First admin account username. Note, this is only used the first time the container is run, and the database is initialized.
WT_NAME Yes None First admin account full name. Note, this is only used the first time the container is run, and the database is initialized.
WT_PASS Yes None First admin account password. Note, this is only used the first time the container is run, and the database is initialized.
WT_EMAIL Yes None First admin account email. Note, this is only used the first time the container is run, and the database is initialized.
PHP_MEMORY_LIMIT No 1024M PHP memory limit. See the PHP documentation
PHP_MAX_EXECUTION_TIME No 90 PHP max execution time for a request in seconds. See the PHP documentation
PHP_POST_MAX_SIZE No 50M PHP POST request max size. See the PHP documentation
PHP_UPLOAD_MAX_FILE_SIZE No 50M PHP max uploaded file size. See the PHP documentation
PUID No 33 See https://docs.linuxserver.io/general/understanding-puid-and-pgid/
PGID No 33 See https://docs.linuxserver.io/general/understanding-puid-and-pgid/

Additionally, you can add _FILE to the end of any environment variable name, and instead that will read the value in from the given filename. For example, setting DB_PASS_FILE=/run/secrets/my_db_secret will read the contents of that file into DB_PASS.

If you don't want the container to be configured automatically (if you're migrating from an existing webtrees installation for example), simply leave the database (DB_) and webtrees (WT_) variables blank, and you can complete the setup wizard like normal.

Database

webtrees recommends a MySQL (or compatible equivalent) database. You will need a separate container for this.

PostgreSQL and SQLite are additionally both supported by webtrees and this image, but are not recommended. This image does not support Microsoft SQL Server, in order to support multiple architectures. See issue: microsoft/msphpsql#441

SQLite Values

If you want to use a SQLite database, set the following values:

  • DB_TYPE to sqlite
  • DB_NAME to desiredfilename. Do not include any extension.

PostgreSQL Values

If you want to use a PostreSQL database, set the following values:

  • DB_TYPE to pgsql
  • DB_PORT to 5432

All other values are just like a MySQL database.

Volumes

The image mounts:

  • /var/www/webtrees/data/

(media is stored in the media subfolder)

If you want to add custom themes or modules, you can also mount the /var/www/webtrees/modules_v4/ directory.

Example docker-compose:

volumes:
  - app_data:/var/www/webtrees/data/
  - app_themes:/var/www/webtrees/modules_v4/
---
volumes:
  app_data:
    driver: local
  app_themes:
    driver: local

See the link above for information about v1.7 webtrees.

To install a custom theme or module, the process is generally as follows:

docker exec -it webtrees_app_1 bash   # connect to the running container
cd /var/www/webtrees/modules_v4/      # move into the modules directory
curl -L <download url> -o <filename>  # download the file

# if module is a .tar.gz file
tar -xf <filename.tar.gz>             # extract the tar archive https://xkcd.com/1168/
rm <filename.tar.gz>                  # remove the tar archive

# if module is a .zip file
apt update && apt install unzip       # install the unzip package
unzip <filename.zip>                  # extract the zip file
rm <filename.zip>                     # remove the zip file

exit                                  # disconnect from the container

Network

The image exposes port 80 and 443.

Example docker-compose:

ports:
  - 80:80
  - 443:443

If you have the HTTPS redirect enabled, you still need to expose port 80. If you're not using HTTPS at all, you don't need to expose port 443.

ImageMagick

ImageMagick is included in this image to speed up thumbnail creation. webtrees will automatically prefer it over gd with no configuration.

Tags

Specific Versions

Each stable, legacy, beta, and alpha release version of webtrees produces a version-tagged build of the Docker container.

Example:

image: ghcr.io/nathanvaughn/webtrees:2.1.2

Latest

Currently, the tags latest, latest-alpha, latest-beta and latest-legacy are available for the latest stable, alpha, beta and legacy versions of webtrees, respectively.

Example:

image: ghcr.io/nathanvaughn/webtrees:latest

Note Legacy versions of webtrees are no longer supported.

Issues

New releases of the Dockerfile are automatically generated from upstream webtrees versions. This means a human does not vette every release. While I try to stay on top of things, sometimes breaking issues do occur. If you have any, please feel free to fill out an issue.

Reverse Proxy Issues

webtrees does not like running behind a reverse proxy, and depending on your setup, you may need to adjust some database values manually.

For example, if you are accessing webtrees via a reverse proxy serving content over HTTPS, but using this container with HTTP, you might need to make the following changes in your database:

mysql -u webtrees -p

use webtrees;
update wt_site_setting set setting_value='https://example.com/login' where setting_name='LOGIN_URL';
update wt_site_setting set setting_value='https://example.com/' where setting_name='SERVER_URL';
quit;

For more info, see this.

Registry

This image is available from 3 different registries. Choose whichever you want:

webtrees-docker's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar nathanvaughn avatar soneji avatar sourcery-ai-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

webtrees-docker's Issues

SQLSTATE[HY000] [2002] No such file or directory (SQL: CREATE DATABASE IF NOT EXISTS

Hi ,

Please can you help. I have launched webtrees-docker using docker compose onto my server. I changed the host port from 80, as i already have 80 taken. However, when i try to go through the Webtrees setup wizard, i cannot get past the first page.

I get the following error: SQLSTATE[HY000] [2002] No such file or directory (SQL: CREATE DATABASE IF NOT EXISTS webtrees COLLATE utf8_unicode_ci)

Here is the log from the app

[NV_INIT] PRETTY_URLS found in environment variables [NV_INIT] HTTPS found in environment variables [NV_INIT] HTTPS_REDIRECT found in environment variables [NV_INIT] SSL_CERT_FILE NOT found in environment variables, using default: /certs/webtrees.crt [NV_INIT] SSL_CERT_KEY_FILE NOT found in environment variables, using default: /certs/webtrees.key [NV_INIT] BASE_URL found in environment variables [NV_INIT] LANG found in environment variables [NV_INIT] DB_TYPE found in environment variables [NV_INIT] DB_HOST found in environment variables [NV_INIT] DB_PORT found in environment variables [NV_INIT] DB_USER found in environment variables [NV_INIT] DB_PASS found in environment variables [NV_INIT] DB_NAME found in environment variables [NV_INIT] DB_PREFIX found in environment variables [NV_INIT] WT_USER found in environment variables [NV_INIT] WT_NAME found in environment variables [NV_INIT] WT_PASS found in environment variables [NV_INIT] WT_EMAIL found in environment variables [NV_INIT] DB_KEY NOT found in environment variables, using default: None [NV_INIT] DB_CERT NOT found in environment variables, using default: None [NV_INIT] DB_CA NOT found in environment variables, using default: None [NV_INIT] DB_VERIFY NOT found in environment variables, using default: None [NV_INIT] PHP_MEMORY_LIMIT NOT found in environment variables, using default: 1024M [NV_INIT] PHP_MAX_EXECUTION_TIME NOT found in environment variables, using default: 90 [NV_INIT] PHP_POST_MAX_SIZE NOT found in environment variables, using default: 50M [NV_INIT] PHP_UPLOAD_MAX_FILE_SIZE NOT found in environment variables, using default: 50M [NV_INIT] Setting up folder permissions for uploads [NV_INIT] Updating php.ini [NV_INIT] Creating php.ini [NV_INIT] Setting value for memory_limit in php.ini [NV_INIT] Setting value for max_execution_time in php.ini [NV_INIT] Setting value for post_max_size in php.ini [NV_INIT] Setting value for upload_max_filesize in php.ini [NV_INIT] Attempting to automate setup wizard [NV_INIT] Automating setup wizard [NV_INIT] Starting Apache in background [NV_INIT] Disabling site webtrees-redir Site webtrees-redir already disabled [NV_INIT] Disabling site webtrees-ssl Site webtrees-ssl already disabled [NV_INIT] Enabling site webtrees Enabling site webtrees. To activate the new configuration, you need to run: service apache2 reload [NV_INIT] Waiting for MySQL server to be ready AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message [Sat Jan 14 15:04:55.047674 2023] [mpm_prefork:notice] [pid 27] AH00163: Apache/2.4.54 (Debian) PHP/8.1.13 OpenSSL/1.1.1n configured -- resuming normal operations [Sat Jan 14 15:04:55.048058 2023] [core:notice] [pid 27] AH00094: Command line: 'apache2 -D FOREGROUND' [NV_INIT] Waiting for MySQL server to be ready [NV_INIT] Waiting for MySQL server to be ready [NV_INIT] Sending setup wizard request webtrees:80 127.0.0.1 - - [14/Jan/2023:15:04:57 +0000] "POST / HTTP/1.1" 200 3840 "-" "Python-urllib/3.9" [NV_INIT] Stopping Apache [NV_INIT] Updating config file [NV_INIT] Config file not found at /var/www/webtrees/data/config.ini.php. Nothing to update. [NV_INIT] Configuring HTTPS [NV_INIT] Removing HTTPS [NV_INIT] Disabling site webtrees-redir [Sat Jan 14 15:04:58.052091 2023] [mpm_prefork:notice] [pid 27] AH00169: caught SIGTERM, shutting down Site webtrees-redir already disabled [NV_INIT] Disabling site webtrees-ssl Site webtrees-ssl already disabled [NV_INIT] Enabling site webtrees Site webtrees already enabled [NV_INIT] Setting up folder permissions for uploads [NV_INIT] Starting Apache AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message [Sat Jan 14 15:04:58.319851 2023] [mpm_prefork:notice] [pid 64] AH00163: Apache/2.4.54 (Debian) PHP/8.1.13 OpenSSL/1.1.1n configured -- resuming normal operations [Sat Jan 14 15:04:58.320074 2023] [core:notice] [pid 64] AH00094: Command line: 'apache2 -D FOREGROUND' webtrees:80 127.0.0.1 - - [14/Jan/2023:15:05:24 +0000] "GET / HTTP/1.1" 200 6448 "-" "curl/7.74.0" webtrees:80 127.0.0.1 - - [14/Jan/2023:15:05:55 +0000] "GET / HTTP/1.1" 200 6448 "-" "curl/7.74.0" webtrees:80 127.0.0.1 - - [14/Jan/2023:15:06:25 +0000] "GET / HTTP/1.1" 200 6448 "-" "curl/7.74.0"

Here is the log from the db

2023-01-14 15:04:52+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.10.2+maria~ubu2204 started. 2023-01-14 15:04:56+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' 2023-01-14 15:04:56+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.10.2+maria~ubu2204 started. 2023-01-14 15:04:56+00:00 [Note] [Entrypoint]: MariaDB upgrade information missing, assuming required 2023-01-14 15:04:56+00:00 [Note] [Entrypoint]: MariaDB upgrade (mariadb-upgrade) required, but skipped due to $MARIADB_AUTO_UPGRADE setting 2023-01-14 15:04:56 0 [Note] mariadbd (server 10.10.2-MariaDB-1:10.10.2+maria~ubu2204) starting as process 1 ... 2023-01-14 15:04:56 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2023-01-14 15:04:56 0 [Note] InnoDB: Number of transaction pools: 1 2023-01-14 15:04:56 0 [Note] InnoDB: Using generic crc32 instructions 2023-01-14 15:04:56 0 [Note] mariadbd: O_TMPFILE is not supported on /tmp (disabling future attempts) 2023-01-14 15:04:56 0 [Warning] mariadbd: io_uring_queue_init() failed with ENOSYS: check seccomp filters, and the kernel version (newer than 5.1 required) 2023-01-14 15:04:56 0 [Warning] InnoDB: liburing disabled: falling back to innodb_use_native_aio=OFF 2023-01-14 15:04:56 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB 2023-01-14 15:04:56 0 [Note] InnoDB: Completed initialization of buffer pool 2023-01-14 15:04:57 0 [Note] InnoDB: File system buffers for log disabled (block size=4096 bytes) 2023-01-14 15:04:57 0 [Note] InnoDB: 128 rollback segments are active. 2023-01-14 15:04:57 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ... 2023-01-14 15:04:57 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB. 2023-01-14 15:04:57 0 [Note] InnoDB: log sequence number 46806; transaction id 14 2023-01-14 15:04:57 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool 2023-01-14 15:04:57 0 [Note] Plugin 'FEEDBACK' is disabled. 2023-01-14 15:04:57 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work. 2023-01-14 15:04:57 0 [Note] Server socket created on IP: '0.0.0.0'. 2023-01-14 15:04:57 0 [Note] Server socket created on IP: '::'. 2023-01-14 15:04:57 0 [Note] InnoDB: Buffer pool(s) load completed at 230114 15:04:57 2023-01-14 15:04:57 0 [Warning] 'user' entry 'root@36059ce60517' ignored in --skip-name-resolve mode. 2023-01-14 15:04:57 0 [Warning] 'proxies_priv' entry '@% root@36059ce60517' ignored in --skip-name-resolve mode. 2023-01-14 15:04:57 0 [Note] mariadbd: ready for connections. Version: '10.10.2-MariaDB-1:10.10.2+maria~ubu2204' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution 2023-01-14 15:04:57 3 [Warning] Aborted connection 3 to db: 'unconnected' user: 'unauthenticated' host: '172.19.0.3' (This connection closed normally without authentication) 2023-01-14 15:04:57 4 [Warning] Aborted connection 4 to db: 'unconnected' user: 'unauthenticated' host: '172.19.0.3' (This connection closed normally without authentication)

Database utf8_unicode_ci collation not supported

I'm trying to migrate my install of Webtrees from a standalone webserver into a Docker Swarm environment. The stack runs but when I try to create the database in the setup wizard I get:

SQLSTATE[HY000] [2054] Server sent charset (0) unknown to the client. Please, report to the developers (SQL: CREATE DATABASE IF NOT EXISTS webtrees COLLATE utf8_unicode_ci)

I'm using MariaDB 11.3.2 which appears to have deprecated utf8_unicode_ci in favour of utf8mb4_unicode_ci so that's probably why the error is happening. The fisharebest/webtrees repo has committed a change to use utf8mb4_unicode_ci but that wasn't in the 2.1.20 release.

I've tried the latest-beta and latest-alpha versions of webtrees-docker...latest beta reports an unsupported version of PHP 7.4 and still uses utf8_unicode_ci. latest-alpha won't run...but it's an alpha so I'm not complaining!

I'm not sure how webtrees-docker latest-alpha/beta compare to fisharebest/webtrees versions. Is it possible that alpha/beta might include the committedDB changes before they appear in v2.2.0 (??)?

Allow max_execution_time adjustments

Allow max_execution_time adjustments in the php.ini file as an environment variable in the deployment. Default is 90 seconds, I need to adjust it higher. Unless I'm missing a way to do this without creating my own docker image?

Supplying user & password in variables does not work

I have a separate container with MariaDB. I have linked webtrees containter with it. I have specified DB_HOST parameter and also MARIADB_USER, MARIADB_PASSWORD and MARIADB_DATABASE. I am getting Connection refused. When I've checked MariaDB logs, I'm getting attempts to connect as a root user without any password: Access denied for user 'root'@'xyz' (using password: NO). I have tried using MYSQL_ version of variables, but I am getting the same error. I have specified DB_TYPE as 'mysql'.

Disabled SSL, still get error in log and it won't start up

So I tried to disable everything that has with SSL to do, in order to make the proxy control the security, so I edited the docker-compose file as such:

environment:
      PRETTY_URLS: "1"
      HTTPS: "0"
      SSL: "0"
      HTTPS_REDIRECT: "0"
      SSL_REDIRECT: "0"
      LANG: "en-US"
      BASE_URL: "http://192.168.86.60"
      DB_TYPE: "sqlite"
      DB_NAME: "webtrees.sqlite"
      DB_PREFIX: "wt_"
      WT_USER: "username"
      WT_NAME: "Full Name"
      WT_PASS: "mybadpassword"
      WT_EMAIL: "[email protected]"

I also exposed port 8990 to internal port 80 as this port is taken by another service I run.

The problem is that the container still setting HTTPS according to the logs, and thus the app won't start up:

[NV_INIT] Setting folder permissions for uploads
[NV_INIT] Attempting to automate setup wizard
[NV_INIT] Config file NOT found
[NV_INIT] Not all variables required for setup wizard present
[NV_INIT] Attempting to set pretty URLs status
[NV_INIT] Config file NOT found, please setup webtrees
[NV_INIT] Attempting to set HTTPS status
[NV_INIT] Adding HTTPS, adding HTTPS redirect
Site webtrees already disabled
Site webtrees-redir already enabled
Site webtrees-ssl already enabled
[NV_INIT] Starting Apache
AH00526: Syntax error on line 6 of /etc/apache2/sites-enabled/webtrees-ssl.conf:
SSLCertificateFile: file '/certs/webtrees.crt' does not exist or is empty

database user and schema creation

I can't seem to get the docker container to create the user and the database schema webtrees. I think it requires access to the root user and thus cannot work with the current setup. I am using an already existing mysql database instance on the host.
I have resorted to creating a user and database schema manually, which works partially: all tables and keys are created but the docker container fails to create the initial adminuser (wt_user table is empty, can't login).
Also it is unclear to me which charset and collation to use for the database schema.
My docker-compose.yml (anonymized):

version: "3"
services:
  webtrees: 
    image: nathanvaughn/webtrees
    container_name: webtrees
    restart: unless-stopped
    environment:
      - BASE_URL=https://example.com
      - LANG=de
      - DB_TYPE=mysql
      - DB_HOST=localhost
      - DB_PORT=3306
      - DB_USER=webtrees
      - DB_NAME=webtrees
      - DB_PASS=webtrees_password
      - DB_PREFIX=wt_
      - WT_USER=john
      - WT_PASS=john_password
      - WT_NAME=John
      - [email protected]
    volumes:
      - data:/var/www/webtrees/data/
      - media:/var/www/webtrees/media/
      - themes:/var/www/webtrees/modules_v4/
volumes:
  data:
  media:
  themes:

DB Error in Initialization Wizard

Running this in docker desktop on Windows 10. After starting the web UI I enter the two pages of configuration items. Then I get this error:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'wt_gedcom' already exists (SQL: create table `wt_gedcom` (`gedcom_id` int not null auto_increment primary key, `gedcom_name` varchar(255) not null, `sort_order` int not null default '0') default character set utf8 collate 'utf8_unicode_ci' engine = InnoDB)

#0 /var/www/webtrees/vendor/illuminate/database/Connection.php(624): Illuminate\Database\Connection->runQueryCallback('create table `w...', Array, Object(Closure))
#1 /var/www/webtrees/vendor/illuminate/database/Connection.php(459): Illuminate\Database\Connection->run('create table `w...', Array, Object(Closure))
#2 /var/www/webtrees/vendor/illuminate/database/Schema/Blueprint.php(97): Illuminate\Database\Connection->statement('create table `w...')
#3 /var/www/webtrees/vendor/illuminate/database/Schema/Builder.php(278): Illuminate\Database\Schema\Blueprint->build(Object(Illuminate\Database\MySqlConnection), Object(Illuminate\Database\Schema\Grammars\MySqlGrammar))
#4 /var/www/webtrees/vendor/illuminate/database/Schema/Builder.php(167): Illuminate\Database\Schema\Builder->build(Object(Illuminate\Database\Schema\Blueprint))
#5 /var/www/webtrees/app/Schema/Migration0.php(44): Illuminate\Database\Schema\Builder->create('gedcom', Object(Closure))
#6 /var/www/webtrees/app/Services/MigrationService.php(71): Fisharebest\Webtrees\Schema\Migration0->upgrade()
#7 /var/www/webtrees/app/Http/RequestHandlers/SetupWizard.php(405): Fisharebest\Webtrees\Services\MigrationService->updateSchema('\\Fisharebest\\We...', 'WT_SCHEMA_VERSI...', 45)
#8 /var/www/webtrees/app/Http/RequestHandlers/SetupWizard.php(366): Fisharebest\Webtrees\Http\RequestHandlers\SetupWizard->createConfigFile(Array)
#9 /var/www/webtrees/app/Http/RequestHandlers/SetupWizard.php(200): Fisharebest\Webtrees\Http\RequestHandlers\SetupWizard->step6Install(Array)
#10 /var/www/webtrees/app/Http/Middleware/ReadConfigIni.php(69): Fisharebest\Webtrees\Http\RequestHandlers\SetupWizard->handle(Object(Nyholm\Psr7\ServerRequest))
#11 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerRequest), Object(Fisharebest\Webtrees\Http\RequestHandlers\SetupWizard))
#12 /var/www/webtrees/app/Http/Middleware/SecurityHeaders.php(48): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#13 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#14 /var/www/webtrees/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#15 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#16 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#17 /var/www/webtrees/app/Webtrees.php(241): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest))
#18 /var/www/webtrees/app/Webtrees.php(228): Fisharebest\Webtrees\Webtrees::dispatch(Object(Nyholm\Psr7\ServerRequest), Array)
#19 /var/www/webtrees/index.php(44): Fisharebest\Webtrees\Webtrees->httpRequest()
#20 {main}

I dropped the tables in the database and re-ran the same. Same error again.

WebTrees Image 2021-12-05T17:10:48Z 2.0.19
MariaDB: Linuxserver.io version:- 10.5.13-r0-ls46 Build-date:- 2022-01-29T06:47:05+01:00

Any help is appreciated.

Thomas

Uploading media fails

Hi there, I am running on a media upload issue that I have tried to discuss with the webtrees code owners (fisharebest/webtrees#4159) but it seems like this could be an issue with the docker environment perhaps.

The problem

Whenever I try and upload a new media file, nothing really happens. I select the file, give it a title and media type, i click Save but nothing happens, the popup dialog just stays open.

The browser network tab shows that there is a POST request, but it shows 117 bytes for an image that is actually 554 Kb. The server returns 500. The docker log only shows:

webtrees:80 172.19.0.1 - - [10/Jan/2022:13:29:21 +0000] "GET /tree/family/create-media-object HTTP/1.1" 200 2569 "https://webtrees.mydomain.com/tree/family/add-fact/X331/OBJE" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0"
webtrees:80 127.0.0.1 - - [10/Jan/2022:13:29:23 +0000] "GET / HTTP/1.1" 302 669 "-" "curl/7.74.0"

Here are some more findings on uploading the original image as well as smaller versions:

554Kb - 1030x1600 - FAIL
404Kb - 824x1280 - FAIL
165Kb - 515x800 - FAIL
99Kb - 412x640 - SUCCESS

I initially thought it could be the super high resolution, but yeah, it turns out I need to make the image a lot smaller for it to succeed.

Notice that in the upload popup it says Maximum upload size: 51,200 KB, so that doesn't seem to be the issue.

I bashed into the docker container and did both php -i | grep -i "post_max_size" and php -i | grep -i "upload_max_filesize", and they both return 50MB. I also ran these commands from outside the containers, and they both return 32MB.

Details of my setup:

Webtrees: 2.0.19

nginx config:

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name webtrees.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app xxx.xxx.xxx.xxx;
        set $upstream_port xxx;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }

}

docker-compose:

  webtrees:
    image: ghcr.io/nathanvaughn/webtrees:latest
    container_name: webtrees
    depends_on:
      - mariadb
    ports:
      - 9180:80
      - 9143:443
    volumes:
      - ${DOCKER_PATH}/webtrees/data:/var/www/webtrees/data/
      - ${DOCKER_PATH}/webtrees/media:/var/www/webtrees/media/
      - ${DOCKER_PATH}/webtrees/themes:/var/www/webtrees/themes/
      - ${DOCKER_PATH}/webtrees/modules:/var/www/webtrees/modules_v4/
    environment:
      - PRETTY_URLS=1
      - LANG=en-US
      - BASE_URL=${WEBTREES_URL}
      - DB_TYPE=mysql
      - DB_HOST=${IP}
      - DB_PORT=3306
      - DB_USER=${WEBTREESDB_USER}
      - DB_PASS=${WEBTREESDB_PSW}
      - DB_NAME=${WEBTREESDB_DB}
      - DB_PREFIX=wt_
      - WT_USER=${WEBTREES_USER}
      - WT_NAME=MyName
      - WT_PASS=${WEBTREES_PSW}
      - WT_EMAIL=${LE_EMAIL}
    restart: unless-stopped

Cant get this to run

Hi there, I am having trouble getting this application to run.

My docker-compose

Click me
version: "3"

services:
app:
  depends_on:
    - db
  environment:
    PRETTY_URLS: "1"
    HTTPS: "0"
    HTTPS_REDIRECT: "0"
    LANG: "en-US"
    BASE_URL: "http://localhost"
    DB_TYPE: "mysql"
    DB_HOST: "db"
    DB_PORT: "3306"
    DB_USER: "webtrees"
    DB_PASS: "badpassword"
    DB_NAME: "webtrees"
    DB_PREFIX: "wt_"
    WT_USER: "username"
    WT_NAME: "Full Name"
    WT_PASS: "mybadpassword"
    WT_EMAIL: "[email protected]"
  image: ghcr.io/nathanvaughn/webtrees:latest
  ports:
    - 86:80
    # - 443:443
  restart: unless-stopped
  volumes:
    # - ~/certs:/certs/
    - ./app_data:/var/www/webtrees/data/
    - ./app_media:/var/www/webtrees/media/

db:
  environment:
    MARIADB_DATABASE: "webtrees"
    MARIADB_USER: "webtrees"
    MARIADB_ROOT_PASSWORD: "badpassword"
    MARIADB_PASSWORD: "badpassword"
  image: docker.io/library/mariadb:latest
  restart: unless-stopped
  volumes:
    - ./db_data:/var/lib/mysql

# db:
#   environment:
#     POSTGRES_DB: "webtrees"
#     POSTGRES_USER: "webtrees"
#     POSTGRES_PASSWORD: "badpassword"
#   image: docker.io/library/postgres:latest
#   restart: unless-stopped
#   volumes:
#     - db_data:/var/lib/postgresql/data

volumes:
db_data:
  driver: local
app_data:
  driver: local
app_media:
  driver: local

Error message

I also tried this in unRaid where I tried to connect it to a separate mariadb container, in every case I get the error:

[NV_INIT] Disabling site webtrees-redir
[NV_INIT] Disabling site webtrees-ssl
[NV_INIT] Enabling site webtrees
[NV_INIT] Sending setup wizard request to http://127.0.0.1:80/
Traceback (most recent call last):
  File "/usr/lib/python3.11/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.11/http/client.py", line 941, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 851, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.11/socket.py", line 836, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/docker-entrypoint.py", line 535, in <module>
    main()
  File "/docker-entrypoint.py", line 520, in main
    setup_wizard()
  File "/docker-entrypoint.py", line 410, in setup_wizard
    resp = request.urlopen(
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 519, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 1377, in http_open
    return self.do_open(http.client.HTTPConnection, req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
Site webtrees-redir already disabled
Site webtrees-ssl already disabled
Site webtrees already enabled

Setting up fail2ban

Hello!

Are there any guidelines on how to setup fail2ban for this deployment?

Unfortunatley, the apache log does not contain any 401 replies, and from the browser perspective, unsuccessful login attempt gets reply 200...

media volume mounted incorrectely

The media volume sits at image
in my instance, so the media mount defined in the docker-compose.yml is never used. All media is written to /var/www/webtrees/data/media.
Is this intentional? Not sure whether I can change the media directory to the path recommended in the docker manual at all.
Here is an excerpt from the volume definiton from https://hub.docker.com/r/nathanvaughn/webtrees

    volumes:
      - data:/var/www/webtrees/data/
      - media:/var/www/webtrees/media/
      - themes:/var/www/webtrees/modules_v4/

Connection refused

Hello, I'd really like to use webtrees but I'm getting an error I can't figure out.

[NV_INIT] Automating setup wizard
[NV_INIT] Starting Apache in background
[NV_INIT] Disabling site webtrees-redir
Site webtrees-redir already disabled
[NV_INIT] Disabling site webtrees-ssl
Site webtrees-ssl already disabled
[NV_INIT] Enabling site webtrees
Site webtrees already enabled
[NV_INIT] Sending setup wizard request to http://127.0.0.1:80/
[NV_INIT] Attempt 0 for http://127.0.0.1:80/
Traceback (most recent call last):
  File "/usr/lib/python3.11/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/usr/lib/python3.11/http/client.py", line 941, in connect
    self.sock = self._create_connection(
                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/socket.py", line 851, in create_connection
    raise exceptions[0]
  File "/usr/lib/python3.11/socket.py", line 836, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/docker-entrypoint.py", line 558, in <module>
    main()
  File "/docker-entrypoint.py", line 543, in main
    setup_wizard()
  File "/docker-entrypoint.py", line 440, in setup_wizard
    retry_urlopen(
  File "/docker-entrypoint.py", line 200, in retry_urlopen
    resp = request.urlopen(url, data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 519, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 1377, in http_open
    return self.do_open(http.client.HTTPConnection, req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

This is my docker-compose.yml file:

version: "3"

services:
  app:
    container_name: webtrees
    depends_on:
      - db
    environment:
      - PRETTY_URLS=False
      - HTTPS=False
      - HTTPS_REDIRECT=False
      - LANG=en-US
      - BASE_URL=10.0.0.94
      - DB_TYPE=mysql
      - DB_HOST=db
      - DB_PORT=3306
      - DB_USER=username
      - DB_PASS=password-here
      - DB_NAME=webtrees
      - DB_PREFIX=wt_
      - WT_USER=name
      - WT_NAME=Name
      - WT_PASS=wt-password-here
      - WT_EMAIL=email-here
      - PUID=1000
      - PGID=1000
    image: ghcr.io/nathanvaughn/webtrees:latest
    ports:
      - 5990:80
      # - 443:443
    restart: unless-stopped
    volumes:
      # - ~/certs:/certs/
      - /Users/username/Docker/webtrees/data:/var/www/webtrees/data/
    labels:
      - com.centurylinklabs.watchtower.enable=true

  db:
    container_name: webtrees_db
    environment:
      - MARIADB_DATABASE=webtrees
      - MARIADB_USER=username
      - MARIADB_ROOT_PASSWORD=root-password-here
      - MARIADB_PASSWORD=password-here
    image: docker.io/library/mariadb:latest
    ports:
      - 7850:3306
    restart: unless-stopped
    volumes:
      - /Users/username/Docker/webtrees/db:/var/lib/mysql

  # db:
  #   environment:
  #     POSTGRES_DB: webtrees
  #     POSTGRES_USER: webtrees
  #     POSTGRES_PASSWORD: badpassword
  #   image: docker.io/library/postgres:latest
  #   restart: unless-stopped
  #   volumes:
  #     - db_data:/var/lib/postgresql/data

networks:
  default:
    name: lsio
    external: true

I have tried changing the 5990 to 80 (after removing the service I had on port 80) but that didn't work.

For BASE_URL I've tried 10.0.0.94:5990 and that didn't work either. Also tried that and 10.0.0.94 using http:// but that didn't work.

Any help would be greatly appreciated. Thank you!

Docker-Compuse Up not working, potentiol problem with start of apache2

I'm struggling installing and starting webtrees with the given docker-compose.yml file. Installation is on a Raspberri Pi 4 with an fresh installed Raspberry OS revision bookworm.

Docker log contains the following messages:
[NV_INIT] Starting Apache
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.3. Set the 'ServerName' directive globally to suppress this message
[Sun Dec 10 21:11:11.931452 2023] [mpm_prefork:notice] [pid 37] AH00163: Apache/2.4.57 (Debian) PHP/8.1.25 OpenSSL/3.0.11 configured -- resuming normal operations
Sun Dec 10 21:11:11.931579 2023] [core:notice] [pid 37] AH00094: Command line: 'apache2 -D FOREGROUND'
webtrees:80 127.0.0.1 - - [10/Dec/2023:21:11:41 +0000] "GET / HTTP/1.1" 500 4549 "-" "curl/7.88.1"
webtrees:80 127.0.0.1 - - [10/Dec/2023:21:12:11 +0000] "GET / HTTP/1.1" 500 4549 "-" "curl/7.88.1"

My docker-compose.yml is:
version: "3"
services:
app:
depends_on:
- webtrees_db
environment:
PRETTY_URLS: "1"
HTTPS: "0"
HTTPS_REDIRECT: "0"
LANG: "de-DE"
BASE_URL: "http://192.168.168.97:80"
DB_TYPE: "mysql"
DB_HOST: "webtrees_db"
DB_PORT: "3306"
DB_USER: "webtrees"
DB_PASSWORD: "Palomino"
DB_DATABASE: "webtrees"
DB_PREFIX: "wt_"
WT_USER: "Peter"
WT_NAME: "Peter Salomon"
WT_PASS: "Palomino"
WT_EMAIL: "[email protected]"
PUID: "1000"
PGID: "1000"
image: ghcr.io/nathanvaughn/webtrees:latest
ports:
- 80:80
# - 443:443
restart: unless-stopped
volumes:
# - ~/cernathanvaughn/webtreests:/certs/
- app_data:/var/www/webtrees/data/

webtrees_db:
environment:
MARIADB_DATABASE: "webtrees"
MARIADB_USER: "webtrees"
MARIADB_ROOT_PASSWORD: "Palomino"
MARIADB_PASSWORD: "Palomino"
image: docker.io/library/mariadb:latest
ports:
- 3306:3306
volumes:
- db_data:/var/lib/mysql/

volumes:
db_data:
driver: local
app_data:
driver: local

Opening "http;//127.0.0.1/webtrees" in a browser returns:
RuntimeException: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for webttees_db failed: Name or service not known in /var/www/webtrees/app/Http/Middleware/UseDatabase.php:119
Stack trace:
#0 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDatabase->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#1 /var/www/webtrees/app/Http/Middleware/BadBotBlocker.php(293): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#2 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BadBotBlocker->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#3 /var/www/webtrees/app/Http/Middleware/CompressResponse.php(71): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#4 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CompressResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#5 /var/www/webtrees/app/Http/Middleware/ContentLength.php(40): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#6 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ContentLength->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#7 /var/www/webtrees/vendor/middlewares/client-ip/src/ClientIp.php(65): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#8 /var/www/webtrees/app/Http/Middleware/ClientIp.php(47): Middlewares\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#9 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#10 /var/www/webtrees/app/Http/Middleware/HandleExceptions.php(89): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#11 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#12 /var/www/webtrees/app/Http/Middleware/BaseUrl.php(73): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#13 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BaseUrl->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#14 /var/www/webtrees/app/Http/Middleware/ReadConfigIni.php(68): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#15 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#16 /var/www/webtrees/app/Http/Middleware/SecurityHeaders.php(48): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#17 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#18 /var/www/webtrees/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#19 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher))
#20 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest))
#21 /var/www/webtrees/app/Webtrees.php(275): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest))
#22 /var/www/webtrees/app/Webtrees.php(262): Fisharebest\Webtrees\Webtrees::dispatch(Object(Nyholm\Psr7\ServerRequest), Array)
#23 /var/www/webtrees/index.php(51): Fisharebest\Webtrees\Webtrees->httpRequest()
#24 {main}

I saw found some reported issues pointing in the same direction. A suggested workaround was: "run the setup wizard manually".
Can anybody explain to me how to translate "docker-compse up" into a manual setup wizard?
Any help is really appreciated.

Best regards
Peter

Logs do not show up in /admin/logs

I've created a bug to the webtrees repo, but I'm not sure if the underlying issue is there or here. Here's the problem:

I've configured a docker-compose setup.

Everything was working correctly, then, for testing purposes, I changed the config.ini.php entry od dbpass to something wrong. After recreating the containers, it failed to work, as expected. Then I changed it back to the correct password. Please bare in mind that this might be unrelated to the issue, I don't know.

Now, I noticed that there are no logs visible in /admin/logs page. It simply says No records to display.

I connected to the DB using phpMyAdmin and the SELECT * FROM wt_log ORDER BY wt_log.log_time DESC shows the logs, including new ones.

What's going on here? Any ideas on how to debug this?

Language files missing in image?

Hey there,

i wanted to test your setup and im not able to access the frontend in the browser. This stack-trace is returned:

Fatal error: Uncaught ErrorException: file(/var/www/webtrees/app/../resources/lang/de/messages.po): failed to open stream: No such file or directory in /var/www/webtrees/vendor/fisharebest/localization/src/Translation.php:56 Stack trace: #0 [internal function]: Fisharebest\Webtrees\Webtrees::Fisharebest\Webtrees{closure}(2, 'file(/var/www/w...', '/var/www/webtre...', 56, Array) #1 /var/www/webtrees/vendor/fisharebest/localization/src/Translation.php(56): file('/var/www/webtre...') #2 /var/www/webtrees/app/I18N.php(306): Fisharebest\Localization\Translation->__construct('/var/www/webtre...') #3 /var/www/webtrees/app/Http/Controllers/SetupController.php(140): Fisharebest\Webtrees\I18N::init('de', true) #4 /var/www/webtrees/app/Http/Middleware/ReadConfigIni.php(69): Fisharebest\Webtrees\Http\Controllers\SetupController->setup(Object(Nyholm\Psr7\ServerRequest)) #5 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerReques in /var/www/webtrees/vendor/fisharebest/localization/src/Translation.php on line 56

A look in the running container shows, that all language files seem to be missing (/var/www/webtrees/resources/lang), allthough the parent folders are in place.

Automatic log out

Sometimes I'm logged out automatically.
In the middle of my work with max timeouts (no interactions on the website) of 1-2 minutes I try to click on a button or a link and then I'm redirected to the login page, because I'm not logged in anymore.

I've tried to check for a timeout value but I have only found in the rersponse headers this entry:

date | Sun, 16 Oct 2022 09:52:07 GMT
strict-transport-security | max-age=15724800; includeSubdomains

Issues with 2.1.16 (500 internal error)

2.1.16 is broken to me; reporting status 500 with the message below. I had to revert to 2.1.15

ParseError: syntax error, unexpected token "return", expecting "function" or "const" in /var/www/webtrees/app/Services/UpgradeService.php:342 Stack trace: #0 /var/www/webtrees/vendor/composer/ClassLoader.php(443): Composer\Autoload\ClassLoader::Composer\Autoload\{closure}('/var/www/webtre...') #1 [internal function]: Composer\Autoload\ClassLoader->loadClass('Fisharebest\\Web...') #2 /var/www/webtrees/vendor/illuminate/container/Container.php(877): ReflectionClass->__construct('Fisharebest\\Web...') #3 /var/www/webtrees/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build('Fisharebest\\Web...') #4 /var/www/webtrees/vendor/illuminate/container/Container.php(694): Illuminate\Container\Container->resolve('Fisharebest\\Web...', Array) #5 /var/www/webtrees/vendor/illuminate/container/Container.php(1027): Illuminate\Container\Container->make('Fisharebest\\Web...') #6 /var/www/webtrees/vendor/illuminate/container/Container.php(947): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter)) #7 /var/www/webtrees/vendor/illuminate/container/Container.php(908): Illuminate\Container\Container->resolveDependencies(Array) #8 /var/www/webtrees/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build('Fisharebest\\Web...') #9 /var/www/webtrees/vendor/illuminate/container/Container.php(694): Illuminate\Container\Container->resolve('Fisharebest\\Web...', Array) #10 /var/www/webtrees/app/Webtrees.php(312): Illuminate\Container\Container->make('Fisharebest\\Web...') #11 /var/www/webtrees/app/Helpers/functions.php(43): Fisharebest\Webtrees\Webtrees::make('Fisharebest\\Web...') #12 /var/www/webtrees/app/Services/ModuleService.php(662): app('Fisharebest\\Web...') #13 [internal function]: Fisharebest\Webtrees\Services\ModuleService::Fisharebest\Webtrees\Services\{closure}('Fisharebest\\Web...', 'check-for-new-v...') #14 /var/www/webtrees/vendor/illuminate/collections/Collection.php(695): array_map(Object(Closure), Array, Array) #15 /var/www/webtrees/app/Services/ModuleService.php(668): Illuminate\Support\Collection->map(Object(Closure)) #16 /var/www/webtrees/app/Services/ModuleService.php(616): Fisharebest\Webtrees\Services\ModuleService->coreModules() #17 /var/www/webtrees/app/Cache.php(60): Fisharebest\Webtrees\Services\ModuleService->Fisharebest\Webtrees\Services\{closure}() #18 /var/www/webtrees/vendor/symfony/cache/Adapter/ArrayAdapter.php(84): Fisharebest\Webtrees\Cache::Fisharebest\Webtrees\{closure}(Object(Symfony\Component\Cache\CacheItem), true) #19 /var/www/webtrees/app/Cache.php(61): Symfony\Component\Cache\Adapter\ArrayAdapter->get('372b64b23390f9d...', Object(Closure)) #20 /var/www/webtrees/app/Services/ModuleService.php(650): Fisharebest\Webtrees\Cache->remember('all-modules', Object(Closure)) #21 /var/www/webtrees/app/Services/ModuleService.php(573): Fisharebest\Webtrees\Services\ModuleService->all(true) #22 /var/www/webtrees/app/Http/Middleware/UseLanguage.php(84): Fisharebest\Webtrees\Services\ModuleService->findByInterface('Fisharebest\\Web...', true) #23 /var/www/webtrees/app/Http/Middleware/UseLanguage.php(63): Fisharebest\Webtrees\Http\Middleware\UseLanguage->languages(Object(Nyholm\Psr7\ServerRequest)) #24 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseLanguage->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #25 /var/www/webtrees/app/Http/Middleware/UseSession.php(78): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #26 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseSession->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #27 /var/www/webtrees/app/Http/Middleware/UpdateDatabaseSchema.php(57): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #28 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UpdateDatabaseSchema->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #29 /var/www/webtrees/app/Http/Middleware/UseDatabase.php(122): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #30 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\UseDatabase->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #31 /var/www/webtrees/app/Http/Middleware/BadBotBlocker.php(282): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #32 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BadBotBlocker->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #33 /var/www/webtrees/app/Http/Middleware/CompressResponse.php(73): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #34 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\CompressResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #35 /var/www/webtrees/app/Http/Middleware/ContentLength.php(40): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #36 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ContentLength->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #37 /var/www/webtrees/vendor/middlewares/client-ip/src/ClientIp.php(65): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #38 /var/www/webtrees/app/Http/Middleware/ClientIp.php(47): Middlewares\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #39 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ClientIp->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #40 /var/www/webtrees/app/Http/Middleware/HandleExceptions.php(90): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #41 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\HandleExceptions->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #42 /var/www/webtrees/app/Http/Middleware/BaseUrl.php(73): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #43 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\BaseUrl->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #44 /var/www/webtrees/app/Http/Middleware/ReadConfigIni.php(68): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #45 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #46 /var/www/webtrees/app/Http/Middleware/SecurityHeaders.php(48): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #47 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\SecurityHeaders->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #48 /var/www/webtrees/app/Http/Middleware/EmitResponse.php(57): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #49 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\Webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #50 /var/www/webtrees/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #51 /var/www/webtrees/app/Webtrees.php(275): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest)) #52 /var/www/webtrees/app/Webtrees.php(262): Fisharebest\Webtrees\Webtrees::dispatch(Object(Nyholm\Psr7\ServerRequest), Array) #53 /var/www/webtrees/index.php(51): Fisharebest\Webtrees\Webtrees->httpRequest() #54 {main}

Reverse proxy (i think) setup issue

Hey Nathan, thanks for making this project. I've got an issue and could use some help. I am trying to setup web trees via docker-compose:

  webtrees_db:
    container_name: webtrees_db
    image: mariadb:latest
    restart: unless-stopped
    networks:
      - webtrees-net
    env_file: .env
    environment:  
      MARIADB_ROOT_PASSWORD: ${DB_ROOT}
      MARIADB_USER: webtrees
      MARIADB_PASSWORD: ${WT_PASS}
      MARIADB_DATABASE: webtrees
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - webtrees_db:/var/lib/mysql
    labels:
      - "traefik.enable=false"
  webtrees:
      container_name: webtrees
      image: ghcr.io/nathanvaughn/webtrees:latest
      restart: unless-stopped
      depends_on:
      - webtrees_db
      networks:
      - webtrees-net
      env_file: .env
      environment:
        PRETTY_URLS: "0"
        HTTPS: "0"
        HTTPS_REDIRECT: "0"
        LANG: "en-US"
        BASE_URL: "http://webtrees.${WT_DOMAIN}.${WT_TLD}"
        DB_TYPE: "mysql"
        DB_HOST: "webtrees_db"
        DB_PORT: "3306"
        MARIADB_USER: "webtrees"
        MARIADB_PASSWORD: ${WT_PASS}
        MARIADB_DATABASE: "webtrees"
        DB_PREFIX: "wt_"
        WT_USER: "admin"
        WT_NAME: ${WT_NAME}
        WT_PASS: ${WT_PASS}
        WT_EMAIL: ${WT_EMAIL}
      volumes:
        - webtrees_data:/var/www/webtrees/data/
        - webtrees_media:/var/www/webtrees/media/
        - webtrees_themes:/var/www/webtrees/modules_v4/
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.webtrees.rule=Host(`${WT_DOMAIN}.${WT_TLD}`)"
        - "traefik.http.routers.webtrees.entrypoints=websecure"
        - "traefik.http.routers.webtrees.service=webtrees"
        - "traefik.http.routers.webtrees.tls=true"
        - "traefik.http.routers.webtrees.tls.certresolver=letsencrypt"
        - "traefik.http.services.webtrees.loadbalancer.server.port=80"

This works on the first run: I can set up the website and see the database has tables created. I can navigate the site, so I'm confident there are no major issues with your image, Cloudflare, or Traefik. The issue happens when I restart the container. I get a 500 error:

[NV_INIT] PRETTY_URLS found in environment variables
[NV_INIT] HTTPS found in environment variables
[NV_INIT] HTTPS_REDIRECT found in environment variables
[NV_INIT] SSL_CERT_FILE NOT found in environment variables, using default: /certs/webtrees.crt
[NV_INIT] SSL_CERT_KEY_FILE NOT found in environment variables, using default: /certs/webtrees.key
[NV_INIT] BASE_URL found in environment variables
[NV_INIT] LANG found in environment variables
[NV_INIT] DB_TYPE found in environment variables
[NV_INIT] DB_HOST found in environment variables
[NV_INIT] DB_PORT found in environment variables
[NV_INIT] MYSQL_USER NOT found in environment variables, using default: None
[NV_INIT] MARIADB_USER found in environment variables
[NV_INIT] MYSQL_PASSWORD NOT found in environment variables, using default: None
[NV_INIT] MARIADB_PASSWORD found in environment variables
[NV_INIT] MYSQL_DATABASE NOT found in environment variables, using default: None
[NV_INIT] MARIADB_DATABASE found in environment variables
[NV_INIT] DB_PREFIX found in environment variables
[NV_INIT] WT_USER found in environment variables
[NV_INIT] WT_NAME found in environment variables
[NV_INIT] WT_PASS found in environment variables
[NV_INIT] WT_EMAIL found in environment variables
[NV_INIT] DB_KEY NOT found in environment variables, using default: None
[NV_INIT] DB_CERT NOT found in environment variables, using default: None
[NV_INIT] DB_CA NOT found in environment variables, using default: None
[NV_INIT] DB_VERIFY NOT found in environment variables, using default: None
[NV_INIT] PHP_MEMORY_LIMIT NOT found in environment variables, using default: 1024M
[NV_INIT] PHP_MAX_EXECUTION_TIME NOT found in environment variables, using default: 90
[NV_INIT] PHP_POST_MAX_SIZE NOT found in environment variables, using default: 50M
[NV_INIT] PHP_UPLOAD_MAX_FILE_SIZE NOT found in environment variables, using default: 50M
[NV_INIT] Setting up folder permissions for uploads
[NV_INIT] Updating php.ini
[NV_INIT] Creating php.ini
[NV_INIT] Setting value for memory_limit in php.ini
[NV_INIT] Setting value for max_execution_time in php.ini
[NV_INIT] Setting value for post_max_size in php.ini
[NV_INIT] Setting value for upload_max_filesize in php.ini
[NV_INIT] Updating config file
[NV_INIT] Setting value for rewrite_urls in config
[NV_INIT] Setting value for base_url in config
[NV_INIT] Setting value for dbtype in config
[NV_INIT] Setting value for dbhost in config
[NV_INIT] Setting value for dbport in config
[NV_INIT] Setting value for dbuser in config
[NV_INIT] Setting value for dbpass in config
[NV_INIT] Setting value for dbname in config
[NV_INIT] Setting value for tblpfx in config
[NV_INIT] Configuring HTTPS
[NV_INIT] Removing HTTPS
[NV_INIT] Disabling site webtrees-redir
Site webtrees-redir already disabled
[NV_INIT] Disabling site webtrees-ssl
Site webtrees-ssl already disabled
[NV_INIT] Enabling site webtrees
Enabling site webtrees.
To activate the new configuration, you need to run:
  service apache2 reload
[NV_INIT] Setting up folder permissions for uploads
[NV_INIT] Starting Apache
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.22.0.5. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.22.0.5. Set the 'ServerName' directive globally to suppress this message
[Wed May 24 16:37:12.375426 2023] [mpm_prefork:notice] [pid 32] AH00163: Apache/2.4.54 (Debian) PHP/8.1.14 OpenSSL/1.1.1n configured -- resuming normal operations
[Wed May 24 16:37:12.376582 2023] [core:notice] [pid 32] AH00094: Command line: 'apache2 -D FOREGROUND'
webtrees:80 127.0.0.1 - - [24/May/2023:16:37:41 +0000] "GET / HTTP/1.1" 500 4378 "-" "curl/7.74.0"

I see your Reverse Proxy Issues section in the readme, and the UPDATE command didn't work, so I did an INSERT and added those settings:

MariaDB [webtrees]> select * from wt_site_setting;
+-------------------+--------------------------------+
| setting_name      | setting_value                  |
+-------------------+--------------------------------+
| LANGUAGE          | en-US                          |
| LOGIN_URL         | https://domain.tld/login       |
| SERVER_URL        | https://domain.tld/            |
| WT_SCHEMA_VERSION | 45                             |
+-------------------+--------------------------------+
4 rows in set (0.001 sec)

Even after that and playing around with the HTTPS/BASE_URL variables, I need help figuring this out. I might be overlooking something basic here, and any help would be appreciated, thank you!

Container restart resets config file permissions

Fatal error: Uncaught ErrorException: parse_ini_file(/var/www/webtrees/data/config.ini.php)

I get this error every time the webtrees container gets restarted. This blocks the application entirely. When I look at the file permissions of the config.ini.php file,

---------- 1 www-data www-data 231 Mar 18 15:12 config.ini.php

Currently I fix it everytime by manually running

chmod 700 config.ini.php

Is this a configuration issue on my side, or an idempotency issue in the Dockerfile? I believe we needn't generate/edit the config.ini.php file everytime.

Routing traffic to container

Hi!

I'm quite inexperienced working with DNS, and I am trying to figure out what is the correct way to host this container on a registered domain? I'm assuming I can host the container on a remote server and route the domain name to the IP of the remote server. I'm running into some issues with this approach, and I just wanted to check if I'm missing something? Also, what is the point of the base url env variable then?

php.ini modifications

I'm trying to add session.gc_maxlifetime = 86400 to the "/usr/local/etc/php/php.ini" file in order to extend the lifetime of an authenticated session to 24 hours. However every time the docker container starts up, the startup script docker-entrypoint.py clobbers my php.ini file and overwrites my changes. If I create a php.ini file on the host, mount it in the container in my compose file, mark it as read only, the /docker-entrypoint.py errors out and the container fails to start entirely:

[NV_INIT] Creating php.ini
Traceback (most recent call last):
  File "/docker-entrypoint.py", line 503, in <module>
    main()
  File "/docker-entrypoint.py", line 486, in main
    php_ini()
  File "/docker-entrypoint.py", line 287, in php_ini
    with open(php_ini_filename, "w") as fp:
OSError: [Errno 30] Read-only file system: '/usr/local/etc/php/php.ini'

I see a few potential solutions:

  1. add a new variable to the docker container for the "session.gc_maxlifetime" setting
  2. modify the docker-entrypoint.py so it will not crash when it can't write to the php.ini file because it's read only
  3. docker-entrypoint.py script only creates php.ini when it doesn't already exist
  4. docker-entrypoint.py only modifies specific php.ini config lines that are configurable with docker variables rather than overwriting the whole file - this would allow both docker variables and manual customizations to exist together

Where are the webtree logs

Im trying to find why it says 500 in the logs for apache and I cant find where the logs are in the server container

Login

I can't seem to figure out how to login to the default account. It seems like there's no account creation page to go to if there's not a default.

Can't start container

`> [NV_INIT] PRETTY_URLS found in environment variables

[NV_INIT] HTTPS found in environment variables
[NV_INIT] HTTPS_REDIRECT found in environment variables
[NV_INIT] SSL_CERT_FILE NOT found in environment variables, using default: /certs/webtrees.crt
[NV_INIT] SSL_CERT_KEY_FILE NOT found in environment variables, using default: /certs/webtrees.key
[NV_INIT] BASE_URL found in environment variables
[NV_INIT] LANG found in environment variables
[NV_INIT] DB_TYPE found in environment variables
[NV_INIT] DB_HOST found in environment variables
[NV_INIT] DB_PORT found in environment variables
[NV_INIT] DB_USER found in environment variables
[NV_INIT] DB_PASS found in environment variables
[NV_INIT] DB_NAME found in environment variables
[NV_INIT] DB_PREFIX found in environment variables
[NV_INIT] WT_USER found in environment variables
[NV_INIT] WT_NAME found in environment variables
[NV_INIT] WT_PASS found in environment variables
[NV_INIT] WT_EMAIL found in environment variables
[NV_INIT] DB_KEY NOT found in environment variables, using default: None
[NV_INIT] DB_CERT NOT found in environment variables, using default: None
[NV_INIT] DB_CA NOT found in environment variables, using default: None
[NV_INIT] DB_VERIFY NOT found in environment variables, using default: None
[NV_INIT] PHP_MEMORY_LIMIT NOT found in environment variables, using default: 1024M
[NV_INIT] PHP_MAX_EXECUTION_TIME NOT found in environment variables, using default: 90
[NV_INIT] PHP_POST_MAX_SIZE NOT found in environment variables, using default: 50M
[NV_INIT] PHP_UPLOAD_MAX_FILE_SIZE NOT found in environment variables, using default: 50M
[NV_INIT] Setting up folder permissions for uploads
[NV_INIT] Updating php.ini
[NV_INIT] Setting value for memory_limit in php.ini
[NV_INIT] Setting value for max_execution_time in php.ini
[NV_INIT] Setting value for post_max_size in php.ini
[NV_INIT] Setting value for upload_max_filesize in php.ini
[NV_INIT] Attempting to automate setup wizard
[NV_INIT] Automating setup wizard
[NV_INIT] Starting Apache in background
[NV_INIT] Disabling site webtrees-redir
Site webtrees-redir already disabled
[NV_INIT] Disabling site webtrees-ssl
Site webtrees-ssl already disabled
[NV_INIT] Enabling site webtrees
Site webtrees already enabled
[NV_INIT] Sending setup wizard request
Traceback (most recent call last):
File "/usr/lib/python3.9/urllib/request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/lib/python3.9/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.9/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/lib/python3.9/http/client.py", line 950, in send
self.connect()
File "/usr/lib/python3.9/http/client.py", line 921, in connect
self.sock = self._create_connection(
File "/usr/lib/python3.9/socket.py", line 843, in create_connection
raise err
File "/usr/lib/python3.9/socket.py", line 831, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/docker-entrypoint.py", line 520, in
main()
File "/docker-entrypoint.py", line 505, in main
setup_wizard()
File "/docker-entrypoint.py", line 399, in setup_wizard
resp = request.urlopen(
File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.9/urllib/request.py", line 517, in open
response = self._open(req, data)
File "/usr/lib/python3.9/urllib/request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/lib/python3.9/urllib/request.py", line 1375, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.9/urllib/request.py", line 1349, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 111] Connection refused>`

Dockerfile

org.opencontainers.image.version=$POWERPANEL_VERSION

must be $WEBTRESS_VERSION

Upgrade prompt is still shown

Because the webtrees version should be pinned in the container, need to get the upgrade prompt properly disabled.

Email not working after webtrees update 2.0.19 > 2.0.21

Hello there, first of all thanks so much for this lovely docker image.

Since 2.0.19 update to 2.0.21 email does not work and getting this error message when sending test mail from control panel.
Im using gmail account and SMTP options well configured (Port, user & pass)

the update was just pull latest image and run the docker-compose up -d command

Here the error:

Fatal error: Declaration of Egulias\EmailValidator\Validation\MessageIDValidation::isValid(string $email, Egulias\EmailValidator\EmailLexer $emailLexer): bool must be compatible with Egulias\EmailValidator\Validation\EmailValidation::isValid($email, Egulias\EmailValidator\EmailLexer $emailLexer) in /var/www/webtrees/vendor/egulias/email-validator/src/Validation/MessageIDValidation.php on line 23

Same happened a time ago but can't remember what I did to solve it.

Any idea?

Thanks so much in advance.

System: Raspberry pi 4 running raspbian and webtres in a docker container

Transitioning from local access to public external access

Hi and thanks for this Docker image. I have been using WebTrees for a week or so now and I love it. I initially tried to setup external HTTPS access, but I cound't manage to (I kept failing to reach WebTrees), so I ended up going for a simpler local access.

I currently reach WebTrees on http://myip:port.
I am running the Docker comtainer on a Synology NAS, connecting to a separate MariaDB container.
Note that I use swag (nginx) as reverse proxy solution to reach all my containers externally.

My docker-compose currently looks like this:

webtrees:
    image: ghcr.io/nathanvaughn/webtrees:latest
    container_name: webtrees
    depends_on:
      - mariadb
    #build: .
    ports:
      - 9980:80
      - 9943:443
    volumes:
      - ${DOCKER_PATH}/webtrees/certs:/certs/
      - ${DOCKER_PATH}/webtrees/data:/var/www/webtrees/data/
      - ${DOCKER_PATH}/webtrees/media:/var/www/webtrees/media/
      - ${DOCKER_PATH}/webtrees/themes:/var/www/webtrees/themes/
      - ${DOCKER_PATH}/webtrees/modules:/var/www/webtrees/modules_v4/
    environment:
      #- PRETTY_URLS=0
      #- HTTPS=0
      #- HTTPS_REDIRECT=0
      - LANG=en-US
      - BASE_URL=http://192.168.X.X:9980
      - DB_TYPE=mysql
      - DB_HOST=${IP}
      - DB_PORT=3306
      - DB_USER=${WEBTREESDB_USER}
      - DB_PASS=${WEBTREESDB_PSW}
      - DB_NAME=${WEBTREESDB_DB}
      - DB_PREFIX=wt_
      - WT_USER=${WEBTREES_USER}
      - WT_NAME=Alex
      - WT_PASS=${WEBTREES_PSW}
      - WT_EMAIL=${LE_EMAIL}
    restart: unless-stopped

Now that I have a pretty big tree, I would like to share it with other family members, but I am obviously still struggling to understand how to do that. The goal is to reach WebTrees via a subdomain using HTTPS. This is what I did so far:

  1. In the database, under wt_site_setting, i have added LOGIN_URL with value https://tree.domain.com/login.php, and SERVER_URL with value http://tree.domain.com. Is this necessary? Also, is it intentional that the second uses HTTP protocol instead of HTTPS?
  2. In CloudFlare I have a CNAME record that points to my DDNS url, which then routes the traffic to my Synology NAS. I am unsure if I should add trusted_headers="cf-connecting-ip" to my config.ini.php file, or trusted_proxies="192.168.x.x" (server ip).
  3. The docs say that I have to put a crt and a key file in the /cert folder. Can you explain if there is a common/proper way of generating those? I do have SSL certificates for my server, but they are in .pem format. I also tried following this commands, but I am not sure if that's a valid option.
  4. set PRETTY_URLS=1, HTTPS=1, HTTPS_REDIRECT=1 in the docker-compose. This seems fine, but I noticed that I started getting some really odd redirect from https://my.domain.com to my server homepage (rather than the correct container port. Is HTTPS_REDIRECT necessary?
  5. My nginx config looks like this:
    server {
       listen 443 ssl;
        listen [::]:443 ssl;
        server_name tree.*;
        include /config/nginx/ssl.conf;
        client_max_body_size 0;
       
        location / {
           include /config/nginx/proxy.conf;
           include /config/nginx/resolver.conf;
           set $upstream_app 192.168.X.X;
           set $upstream_port 9980;
           set $upstream_proto http;
           proxy_pass $upstream_proto://$upstream_app:$upstream_port;
       }
    }
    
  6. From what I understand, the docker-compose environment variables are only used to do the initial database setup. Is that correct? Does that mean I have to now do some manual changes to the database to transition from internal to external access?

I think this pretty much covers all my questions, I hope someone can help me out with this process. Thank you!

Keep the plugins

Im running your docker application, but if I was to update the docker image, the plugins would be removed.
Is there a way to mount that directory onto the host to keep it from changing

The username or password is incorrect.

I've set up the docker compose just as you had it and setting the image to the latest. I also get the username or password is incorrect when using the wt_user and wt_pass parameters in docker-compose.yml.

version: "3"

services:
  app:
    depends_on:
      - db
    environment:
      PRETTY_URLS: "1"
      HTTPS: "0"
      HTTPS_REDIRECT: "0"
      LANG: "en-US"
      BASE_URL: "http://localhost:4080"
      DB_TYPE: "mysql"
      DB_HOST: "db"
      DB_PORT: "3306"
      DB_USER: "webtrees"
      DB_PASS: "badpassword"
      DB_NAME: "webtrees"
      DB_PREFIX: "wt_"
      WT_USER: "username"
      WT_NAME: "Full Name"
      WT_PASS: "mybadpassword"
      WT_EMAIL: "[email protected]"
      PUID: "1000"
      PGID: "1000"
    image: ghcr.io/nathanvaughn/webtrees:latest
    ports:
      - 4080:80
      # - 443:443
    restart: unless-stopped
    volumes:
      # - ~/certs:/certs/
      - /mnt/md0/webtrees/data:/var/www/webtrees/data/

  db:
    environment:
      MARIADB_DATABASE: "webtrees"
      MARIADB_USER: "webtrees"
      MARIADB_ROOT_PASSWORD: "badpassword"
      MARIADB_PASSWORD: "badpassword"
    image: docker.io/library/mariadb:latest
    restart: unless-stopped
    volumes:
      - db_data:/var/lib/mysql

  # db:
  #   environment:
  #     POSTGRES_DB: "webtrees"
  #     POSTGRES_USER: "webtrees"
  #     POSTGRES_PASSWORD: "badpassword"
  #   image: docker.io/library/postgres:latest
  #   restart: unless-stopped
  #   volumes:
  #     - db_data:/var/lib/postgresql/data

volumes:
  db_data:
    driver: local
  app_data:
    driver: local

After update fatal error

Edit: I did a reinstallation especially to renew the "config.ini.php", now everything works as expected.

Tonight watchtower updated my docker container to the latest available. If I now open the webtree page I get the following error. Any ideas what happened or what's the reason for this error?
Unfortunately I am not very skilled and don't understand the error.

Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Container\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/webtrees/vendor/illuminate/container/Container.php:1214 Stack trace: #0 /var/www/webtrees/vendor/illuminate/container/Container.php(15): Fisharebest\Webtrees\Webtrees::Fisharebest\Webtrees{closure}(8192, 'Return type of ...', '/var/www/webtre...', 1214) #1 /var/www/webtrees/vendor/composer/ClassLoader.php(571): include('/var/www/webtre...') #2 /var/www/webtrees/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile('/var/www/webtre...') #3 /var/www/webtrees/app/Webtrees.php(300): Composer\Autoload\ClassLoader->loadClass('Illuminate\Cont...') #4 /var/www/webtrees/app/Webtrees.php(220): Fisharebest\Webtrees\Webtrees::set('Psr\Http\Messag...', 'Nyholm\Psr7\Fac...') #5 /var/www/webtrees/index.php(44): Fisharebest\Webtrees\Webtrees->httpRequest() #6 {main} in /var/www/webtrees/vendor/illuminate/container/Container.php on line 15

I disabled every Module, so this should not be the issue.

Investigate having data/config.ini.php be auto-generated

Something like this.

; <?php exit; ?> DO NOT DELETE THIS LINE
dbhost="mariadb"
dbport="3306"
dbuser="webtrees"
dbpass="password"
dbname="webtrees"
tblpfx="wt_"
base_url="https://webtrees"
rewrite_urls="1"

I don't know if webtrees will automatically create the database schema, or if that's only done on setup. Want to investigate some. More of a reminder to myself.

docker-compose not working

Hello,
the docker compose file like this is not working. for some reason the login and db credentials are not working together
here my compose file:
`version: "3"

services:
app:
depends_on:
- db
environment:
PRETTY_URLS: "1"
HTTPS: "0"
HTTPS_REDIRECT: "0"
LANG: "de"
BASE_URL: "http://192.168.178.105"
DB_TYPE: "mysql"
DB_HOST: "db"
DB_PORT: "3303"
DB_USER: "webtrees"
DB_PASS: "webtreesUser"
DB_NAME: "webtrees"
DB_PREFIX: "wt_"
WT_USER: "admin"
WT_NAME: "Full Name"
WT_PASS: "secretpassw"
WT_EMAIL: "[email protected]"
image: ghcr.io/nathanvaughn/webtrees:latest
ports:
- 8080:80
restart: unless-stopped
volumes:
- app_data:/var/www/webtrees/data/
- app_media:/var/www/webtrees/media/

db:
environment:
MARIADB_DATABASE: "webtrees"
MARIADB_USER: "webtrees"
MARIADB_ROOT_PASSWORD: "webtreesUser"
MARIADB_PASSWORD: "webtreesUser"
image: docker.io/library/mariadb:latest
ports:
- 3303:3306
restart: unless-stopped
volumes:
- db_data:/var/lib/mysql
volumes:
db_data:
driver: local
app_data:
driver: local
app_media:
driver: local`

the error at the db container is:
2023-01-04 22:23:56 11 [Warning] Access denied for user 'root'@'192.168.144.3' (using password: NO) 2023-01-04 22:24:24 12 [Warning] Access denied for user 'root'@'192.168.144.3' (using password: NO)

Error at the webtree container ist:
File "/docker-entrypoint.py", line 399, in setup_wizard resp = request.urlopen( File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.9/urllib/request.py", line 517, in open response = self._open(req, data) File "/usr/lib/python3.9/urllib/request.py", line 534, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain result = func(*args) File "/usr/lib/python3.9/urllib/request.py", line 1375, in http_open return self.do_open(http.client.HTTPConnection, req) File "/usr/lib/python3.9/urllib/request.py", line 1349, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno 111] Connection refused> [NV_INIT] PRETTY_URLS found in environment variables [NV_INIT] HTTPS found in environment variables [NV_INIT] HTTPS_REDIRECT found in environment variables [NV_INIT] SSL_CERT_FILE NOT found in environment variables, using default: /certs/webtrees.crt [NV_INIT] SSL_CERT_KEY_FILE NOT found in environment variables, using default: /certs/webtrees.key [NV_INIT] BASE_URL found in environment variables [NV_INIT] LANG found in environment variables [NV_INIT] DB_TYPE found in environment variables [NV_INIT] DB_HOST found in environment variables [NV_INIT] DB_PORT found in environment variables [NV_INIT] DB_USER found in environment variables [NV_INIT] DB_PASS found in environment variables [NV_INIT] DB_NAME found in environment variables [NV_INIT] DB_PREFIX found in environment variables [NV_INIT] WT_USER found in environment variables [NV_INIT] WT_NAME found in environment variables [NV_INIT] WT_PASS found in environment variables [NV_INIT] WT_EMAIL found in environment variables [NV_INIT] DB_KEY NOT found in environment variables, using default: None [NV_INIT] DB_CERT NOT found in environment variables, using default: None [NV_INIT] DB_CA NOT found in environment variables, using default: None [NV_INIT] DB_VERIFY NOT found in environment variables, using default: None [NV_INIT] PHP_MEMORY_LIMIT NOT found in environment variables, using default: 1024M [NV_INIT] PHP_MAX_EXECUTION_TIME NOT found in environment variables, using default: 90 [NV_INIT] PHP_POST_MAX_SIZE NOT found in environment variables, using default: 50M [NV_INIT] PHP_UPLOAD_MAX_FILE_SIZE NOT found in environment variables, using default: 50M [NV_INIT] Setting up folder permissions for uploads [NV_INIT] Updating php.ini [NV_INIT] Setting value for memory_limit in php.ini [NV_INIT] Setting value for max_execution_time in php.ini [NV_INIT] Setting value for post_max_size in php.ini [NV_INIT] Setting value for upload_max_filesize in php.ini [NV_INIT] Attempting to automate setup wizard [NV_INIT] Automating setup wizard [NV_INIT] Starting Apache in background [NV_INIT] Disabling site webtrees-redir Site webtrees-redir already disabled [NV_INIT] Disabling site webtrees-ssl Site webtrees-ssl already disabled [NV_INIT] Enabling site webtrees Site webtrees already enabled [NV_INIT] Sending setup wizard request Traceback (most recent call last): File "/usr/lib/python3.9/urllib/request.py", line 1346, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/usr/lib/python3.9/http/client.py", line 1255, in request self._send_request(method, url, body, headers, encode_chunked) File "/usr/lib/python3.9/http/client.py", line 1301, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/usr/lib/python3.9/http/client.py", line 1250, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/usr/lib/python3.9/http/client.py", line 1010, in _send_output self.send(msg) File "/usr/lib/python3.9/http/client.py", line 950, in send self.connect() File "/usr/lib/python3.9/http/client.py", line 921, in connect self.sock = self._create_connection( File "/usr/lib/python3.9/socket.py", line 843, in create_connection raise err File "/usr/lib/python3.9/socket.py", line 831, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/docker-entrypoint.py", line 520, in <module> main() File "/docker-entrypoint.py", line 505, in main setup_wizard() File "/docker-entrypoint.py", line 399, in setup_wizard resp = request.urlopen( File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.9/urllib/request.py", line 517, in open response = self._open(req, data) File "/usr/lib/python3.9/urllib/request.py", line 534, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain result = func(*args) File "/usr/lib/python3.9/urllib/request.py", line 1375, in http_open return self.do_open(http.client.HTTPConnection, req) File "/usr/lib/python3.9/urllib/request.py", line 1349, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [Errno 111] Connection refused>

A second issue i noticed is:
if u use local mapped folders instead of docker volumes for persistant data, there are permission and ownership problems creating or starting the db container the first time, so it will not create the db files properly

thanks for your help

latest tag does not include all images - only amd64

I have been using the yaml file below for webtrees without issues until the latest change.

I now see the following error when updating the stack.

Failure
failed to deploy a stack: volumes Additional property /srv/dev-disk-by-uuid/Files/AppData/Databases/webtrees is not allowed

The error is on the volumes:

I am using Open Media Vault with Docker 5:20.10.93-0debian-buster and deploying the stack with Portainer 2.9.1. The system is a Raspberry PI 4 with 4 GB RAM.

It has worked perfectly until today when I had to update the stack due to the issue with PHP8 being downgraded to PHP7.4.

Is there a solution?

version: "2.1"
services:
app:
depends_on:
- db
image: ghcr.io/nathanvaughn/webtrees:latest
environment:
PRETTY_URLS: "1"
LANG: "en-US"
BASE_URL: "https://webtrees.falcigno.tk"
DB_TYPE: "mysql"
DB_HOST: "db"
DB_PORT: "3306"
DB_USER: "webtrees"
DB_PASS: "badpassword"
DB_NAME: "webtrees"
DB_PREFIX: "wt_"
WT_USER: "username"
WT_NAME: "Full Name"
WT_PASS: "mybadpassword"
WT_EMAIL: "[email protected]"
ports:
- 8091:80
links:
- db
restart: unless-stopped
volumes:
- /srv/dev-disk-by-uuid/Files/AppData/Config/webtrees/data:/var/www/webtrees/data/
- /srv/dev-disk-by-uuid/Files/AppData/Config/webtrees/media:/var/www/webtrees/media/
- /srv/dev-disk-by-uuid/Files/AppData/Config/webtrees/themes:/var/www/webtrees/modules_v4/

db:
image: yobasystems/alpine-mariadb:10.4.17
command: "--default-authentication-plugin=mysql_native_password"
environment:
MYSQL_DATABASE: "webtrees"
MYSQL_USER: "webtrees"
MYSQL_ROOT_PASSWORD: "badpassword"
MYSQL_PASSWORD: "badpassword"
restart: unless-stopped
volumes:
- /srv/dev-disk-by-uuid/Files/AppData/Databases/webtrees:/var/lib/mysql

volumes:
/srv/dev-disk-by-uuid/Files/AppData/Databases/webtrees:
driver: local
/srv/dev-disk-by-uuid/Files/AppData/Config/webtrees/data:
driver: local
/srv/dev-disk-by-uuid/Files/AppData/Config/webtrees/media:
driver: local
/srv/dev-disk-by-uuid/Files/AppData/Config/webtrees/themes:
driver: local

Clarify usage of themes folder

Hey Nathan,

thank you very much for your work! I'm currently testing webtrees via your docker image and it looks really solid.

I wanted to install a custom theme and to do so I unzipped it into the volume that is mounted to /var/www/webtrees/themes/. Upon that, nothing happens. After reading the documentation of webtrees it seems as if themes belong in modules_v4. When moving the theme folder into that directory, it appears inside webtrees.

Could you please clarify the intended usage of - app_themes:/var/www/webtrees/themes/ - did I overlook something?

Thank you
Sebastian

Add HTTPS support

I'd like to be able for users to optionally add SSL certs via environment variables or a mount or something.

/data folder accessible over web

The webtrees security page says to ensure the /data folder is not accessible, and provides a simple test to check that.

When accessing webtrees.mydomain.com/data/config.ini.php I don't get the access denied error, and instead see the semi-colon they state as expected when the data folder is accessible.

I've tried changing the permissions on the mapped /data volume on the host machine, but this did not seem to help.

Any tips on how to resolve this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.