Skip to content

docs: fix the Docker backup, package install, dev setup and subfolder instructions - #70

Merged
gloriafolaron merged 7 commits into
masterfrom
docs/fix-backup-install-dev
Nov 15, 2026
Merged

gloriafolaron merged 7 commits into
masterfrom
docs/fix-backup-install-dev

Conversation

@gloriafolaron

Copy link
Copy Markdown
Contributor

Why

While adding the At a glance boxes (#63), I found pages whose instructions were wrong or would lose data. The worst: the Docker backup skipped the volume with your logo and public files, and its database command didn't match the official setup.

Changes

Backup & Restore (tested with the official docker-compose.yml and sample.env, MySQL 8.4):

  • What to back up: public/userfiles/ (logo and public files) is now included in every backup, restore, migration and pre-upgrade command. It's a separate volume (public_userfiles) in the official setup.
  • Docker dump: docker compose exec -T leantime_db … reads the database name, user and password from the official .env. The old commands used a container named leantime_db (it's mysql_leantime; leantime_db is the service) and a service named db.
  • --no-tablespaces: on MySQL 8, mysqldump as the Leantime user fails with "you need … the PROCESS privilege(s)". The flag fixes that, and the troubleshooting section now explains the error.
  • Docker file backup and restore:
    • copying volumes uses docker compose cp;
    • after a restore, a chown to www-data. Copied-in files are owned by your own user, so Leantime couldn't change or delete them (seen in the test).
  • Version: the old text said "Company Settings". The version is actually in the ? menu → System.
  • Links: fixed the broken installation guide link (quick-start.md).

Development Setup: rewritten from .dev/docker-compose.yaml and the Makefile.

  • Port: Leantime runs on 5080 (https 5443), not 8080.
  • Helper ports: MailDev, MySQL, Redis and S3 Ninja get random host ports, so the page gives the docker compose port command. There's no phpMyAdmin.
  • Config: .dev/.env doesn't exist; the settings are in the compose file.
  • MailDev: how to point Leantime at it.
  • Tests: make unit-test / make acceptance-test.
  • Without Docker: uses make build-dev and config/sample.env instead of configuration.php and the old "grunt" wording.

Package installation:

  • Database step: it's step 2, not step 1.
  • Typos: "a empty" and public\ are fixed.
  • Apache: the example listens on port 80 with your domain, and adds AllowOverride All, which public/.htaccess needs.
  • Nginx: step 7 says "restart Nginx", not Apache.
  • Config file: the step names sample.env, the actual file in the release package; the old text said .env.sample.

Configuration: the link to the full variable list pointed at a missing /.env.sample; it now goes to config/sample.env.

Subfolder: two pages gave different steps; one said "uncomment line 4" (no such line) and used configuration.php. subfolder.md is now the one guide:

  • RewriteBase + LEAN_APP_URL for Apache;
  • nginx-subfolder.example.conf for Nginx;
  • a note that updates replace .htaccess;
  • which folders to block.

other-methods.md links to it.

Checked

Not in this PR:

The Keycloak trailing-slash fix went to #66 instead (d01110a): Leantime trims the slash before comparing, so it's optional, as #60 says.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi

… setup ports, subfolder steps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved documentation issues omit required host PHP prerequisites and backed-up environment restoration, while leaving Apache subfolder mapping and Nginx PHP handling incorrect.

4 open issues
What changed in this PR

Updates Leantime’s self-hosting and development documentation to better match the supported setup, improve backup coverage, and consolidate subfolder instructions.

Changes:

  • Adds public files to backup workflows and revises Docker backup and restore commands.
  • Rewrites development setup instructions, including ports, services, configuration, and test commands.
  • Corrects package installation examples and configuration links, and centralizes subfolder guidance.
File Description
installation/​subfolder.md Consolidates Apache and Nginx subfolder setup and file-access guidance.
installation/​package-installation.md Corrects web-server examples, configuration filenames, and database instructions.
installation/​other-methods.md Replaces duplicate subfolder instructions with a link to the dedicated guide.
installation/​development.md Updates Docker and host development workflows, ports, and tooling.
installation/​configuration.md Corrects the link to the environment-variable reference.
installation/​backup-restore.md Expands file coverage and updates Docker backup, restore, and ownership commands.

Review effort: Balanced

Comment thread installation/backup-restore.md Resolved
Comment thread installation/development.md Resolved
Comment thread installation/subfolder.md Resolved
Comment thread installation/subfolder.md Resolved
gloriafolaron and others added 2 commits November 14, 2026 19:59
…r configs

- Backup & Restore: a Docker restore section that puts env_backup back as
  .env before the database starts, imports the dump, restarts Leantime,
  copies the files back and runs cache:clear and db:migrate. Tested by
  restoring a backup into a fresh Compose project.
- Development: make run-dev runs composer install on the host, so list
  PHP 8.2+ and its extensions as a requirement.
- Subfolder: install outside the document root and map /leantime to
  public/. Apache uses an Alias (no .htaccess change needed); Nginx uses
  alias with SCRIPT_FILENAME $request_filename. Both tested on Apache
  2.4.71 and Nginx with PHP-FPM: login, dashboard, assets and htmx calls.
  Stops linking nginx-subfolder.example.conf, whose PHP handler returns
  "File not found".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The documented setup can expose .htaccess files, allow writes during incomplete restores, and switch the existing development environment into test mode without warning or recovery guidance.

3 open issues
4 resolved since last review

Review effort: Balanced

Comment thread installation/backup-restore.md Resolved
Comment thread installation/development.md Resolved
Comment thread installation/subfolder.md Resolved
…Nginx subfolder block

- Backup & Restore: stop Leantime before the import, restore files into
  the stopped container, chown and migrate in one-off containers, then
  start a fresh container. Tested on a new Compose project and over a
  running one.
- Subfolder (Nginx): the ^~ block skips the site's own .ht rule, so
  /leantime/.htaccess was served (200). A nested deny returns 403.
- Development: make unit-test and acceptance-test restart leantime-dev in
  test mode; make run-dev switches back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

An unpublished finding about failed mail delivery in the documented development setup requires human assessment before approval.

No open issues 🎉

3 resolved since last review

Review effort: Balanced

@gloriafolaron

Copy link
Copy Markdown
Contributor Author

Copilot flagged an unpublished finding about mail delivery in the development setup. Checked it: the dev Compose file runs MailDev with MAILDEV_SMTP_PORT=465 (plain SMTP, no TLS), and Leantime passes LEAN_EMAIL_SMTP_SECURE (empty by default) and LEAN_EMAIL_SMTP_AUTO_TLS straight to PHPMailer, which does not turn on TLS for port 465 by itself. Sent test emails through PHPMailer from the Leantime image to a MailDev container with the documented settings (maildev, port 465, auth off, auto-TLS off); MailDev received them. No change needed.

location ^~ /leantime also caught the website's own /leantime.php and
similar pages. Match /leantime/ with a trailing slash on the alias and
redirect the bare /leantime. Same change as Leantime/leantime#4061, tested
there; Apache's Alias already matches whole path segments (tested).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi
@gloriafolaron

Copy link
Copy Markdown
Contributor Author

Follow-up from Copilot's review of the matching core example (Leantime/leantime#4061): location ^~ /leantime also caught the website's own /leantime.php and similar pages, sending them into Leantime ("File not found."). The Nginx block now matches /leantime/ with alias …/public/ and redirects the bare /leantime. Tested in a container: /leantime.php and /leantime-news.txt reach the website again, and Leantime still works. Apache's Alias /leantime doesn't have this problem, since it matches whole path segments (also tested).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the documentation updates to backup, restore, and installation guidance.

No open issues 🎉

Review effort: Balanced

Same fix as Leantime/leantime#4061: return 301 /leantime/$is_args$args.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi
@gloriafolaron

Copy link
Copy Markdown
Contributor Author

One more line after Copilot's approval, to match Leantime/leantime#4061: the Nginx redirect for the bare /leantime now keeps the query string (return 301 /leantime/$is_args$args;). Tested: /leantime?foo=bar&x=1 → /leantime/?foo=bar&x=1.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the installation, development, and backup/restore documentation updates.

No open issues 🎉

Review effort: Balanced

Same fix as Leantime/leantime#4061: try_files $uri @Leantime in the PHP
handler, so old download.php attachment links reach Leantime.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues with the backup, installation, and development documentation updates.

No open issues 🎉

Review effort: Balanced

@gloriafolaron
gloriafolaron merged commit 812bbf1 into master Nov 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants