Repository navigation
docs: fix the Docker backup, package install, dev setup and subfolder instructions - #70
Conversation
… setup ports, subfolder steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FGYRyhyPHQyrtvsu5aawzi
There was a problem hiding this comment.
🟡 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
…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
There was a problem hiding this comment.
🟡 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
…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 flagged an unpublished finding about mail delivery in the development setup. Checked it: the dev Compose file runs MailDev with |
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
|
Follow-up from Copilot's review of the matching core example (Leantime/leantime#4061): |
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
|
One more line after Copilot's approval, to match Leantime/leantime#4061: the Nginx redirect for the bare |
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


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.ymlandsample.env, MySQL 8.4):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 compose exec -T leantime_db …reads the database name, user and password from the official.env. The old commands used a container namedleantime_db(it'smysql_leantime;leantime_dbis the service) and a service nameddb.--no-tablespaces: on MySQL 8,mysqldumpas the Leantime user fails with "you need … the PROCESS privilege(s)". The flag fixes that, and the troubleshooting section now explains the error.docker compose cp;chowntowww-data. Copied-in files are owned by your own user, so Leantime couldn't change or delete them (seen in the test).quick-start.md).Development Setup: rewritten from
.dev/docker-compose.yamland theMakefile.docker compose portcommand. There's no phpMyAdmin..dev/.envdoesn't exist; the settings are in the compose file.make unit-test/make acceptance-test.make build-devandconfig/sample.envinstead ofconfiguration.phpand the old "grunt" wording.Package installation:
public\are fixed.AllowOverride All, whichpublic/.htaccessneeds.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 toconfig/sample.env.Subfolder: two pages gave different steps; one said "uncomment line 4" (no such line) and used
configuration.php.subfolder.mdis now the one guide:RewriteBase+LEAN_APP_URLfor Apache;nginx-subfolder.example.conffor Nginx;.htaccess;other-methods.mdlinks to it.Checked
chowncommands were run on the official compose stack. The data and files came back, and the files were owned bywww-dataafter thechown.make run-dev). The dev page was written from the compose file, Makefile andxdebug.ini.package-installation.md(the PHP-FPM socket line) andother-methods.md(Raspberry Pi), in other lines.npm run buildpasses, and all links are valid.Not in this PR:
user-management.md, which is part of the user guide refresh.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