Skip to content

fix: improve subpath handling in docker#942

Merged
PartyDonut merged 1 commit intoDonutWare:developfrom
schembriaiden:feat/enhance-docker-sub-path
Apr 12, 2026
Merged

fix: improve subpath handling in docker#942
PartyDonut merged 1 commit intoDonutWare:developfrom
schembriaiden:feat/enhance-docker-sub-path

Conversation

@schembriaiden
Copy link
Copy Markdown
Contributor

@schembriaiden schembriaiden commented Apr 12, 2026

Pull Request Description

This pull request improves the Docker setup and entrypoint logic for the Fladder web application, focusing on better handling of custom web paths and permissions. The main changes involve normalizing and applying the FLADDER_WEBPATH variable more robustly, dynamically generating the Nginx configuration based on the deployment context, and ensuring correct file ownership for Nginx.

Entrypoint and Nginx configuration improvements:

  • The docker-entrypoint.sh script now normalizes the FLADDER_WEBPATH variable, ensuring it always starts and ends with a single slash, and updates the <base href> in index.html accordingly.
  • The script dynamically generates the Nginx configuration in /etc/nginx/conf.d/default.conf depending on whether Fladder is served at the root or a subpath, and selects the correct port based on the user (root or rootless).

File and directory permissions:

  • Both Dockerfile and Dockerfile-rootless now ensure that /usr/share/nginx/html and /etc/nginx/conf.d are owned by the nginx user, preventing permission issues at runtime.
  • Ownership of the docker-entrypoint.sh script is explicitly set to nginx:nginx in the rootless Dockerfile for consistency.

Issue Being Fixed

Resolves #917 (reply in thread)

Screenshots / Recordings

Tested On

  • Android
  • Android TV
  • iOS
  • Linux
  • Windows
  • macOS
  • Web

Checklist

  • If a new package was added, did you ensure it works for all supported platforms? Is the package well maintained
  • Check that any changes are related to the issue at hand.

@schembriaiden schembriaiden force-pushed the feat/enhance-docker-sub-path branch from 2d769cc to 33cd9a5 Compare April 12, 2026 10:39
@schembriaiden schembriaiden changed the title chore: improve subpath handling in docker entrypoint fix: improve subpath handling in docker entrypoint Apr 12, 2026
@schembriaiden schembriaiden force-pushed the feat/enhance-docker-sub-path branch from 33cd9a5 to f176eb8 Compare April 12, 2026 10:39
@Zepmann
Copy link
Copy Markdown

Zepmann commented Apr 12, 2026

Consider an alternative: do not move files. Adjust the nginx configuration instead. That is more in line with other configuration files adjusted when starting a container.

@schembriaiden schembriaiden force-pushed the feat/enhance-docker-sub-path branch from f176eb8 to 17abe52 Compare April 12, 2026 11:19
@schembriaiden schembriaiden changed the title fix: improve subpath handling in docker entrypoint fix: improve subpath handling in docker Apr 12, 2026
@Zepmann
Copy link
Copy Markdown

Zepmann commented Apr 12, 2026

@schembriaiden

Tested from my end. Looks good! Configured the environment variable:

FLADDER_WEBPATH=/fladder/

Without any workarounds from a reverse proxy running in front, Fladder is successfully served from https://example.com/fladder/ (also works without a backslash at the end).

Copy link
Copy Markdown
Collaborator

@PartyDonut PartyDonut left a comment

Choose a reason for hiding this comment

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

Looks good to me thanks for the quick implementation.

And thanks @Zepmann voor testing it out 👍🏼

@PartyDonut PartyDonut added the bug Something isn't working label Apr 12, 2026
@PartyDonut PartyDonut merged commit 0abb818 into DonutWare:develop Apr 12, 2026
1 check passed
@github-project-automation github-project-automation bot moved this to Done in Fladder Apr 12, 2026
@schembriaiden schembriaiden deleted the feat/enhance-docker-sub-path branch April 12, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants