Skip to content

fix(amuleweb): honor per-user template dir when spawned by the GUI - #72

Merged
got3nks merged 1 commit into
amule-org:masterfrom
ngosang:feature/fix_amuleweb
Jun 11, 2026
Merged

fix(amuleweb): honor per-user template dir when spawned by the GUI#72
got3nks merged 1 commit into
amule-org:masterfrom
ngosang:feature/fix_amuleweb

Conversation

@ngosang

@ngosang ngosang commented Jun 11, 2026

Copy link
Copy Markdown
Member

In --amule-config-file mode (the mode aMule and aMuled use to spawn amuleweb automatically), CamulewebApp::OnCmdLineParsed returns early and never reaches CaMuleExternalConnector::OnCmdLineParsed, which is where m_configDir is normally initialized. With m_configDir empty, GetTemplateDir looked for "webserver" relative to the current working directory, so the per-user template directory (/webserver/) was silently skipped and the lookup always fell through to the system-wide WEBSERVERDIR (/usr/share/amule/webserver/).

Derive m_configDir from the directory of the amule.conf file passed on the command line, so a GUI-spawned amuleweb resolves templates from the same config dir as the daemon that launched it. This also fixes the webserver locale lookup, which builds its path from m_configDir as well.

Verified by launching the rebuilt amuleweb with
--amule-config-file=~/.aMule/amule.conf and confirming it now serves templates from ~/.aMule/webserver/default/ instead of the installed copy.

In --amule-config-file mode (the mode aMule and aMuled use to spawn
amuleweb automatically), CamulewebApp::OnCmdLineParsed returns early
and never reaches CaMuleExternalConnector::OnCmdLineParsed, which is
where m_configDir is normally initialized. With m_configDir empty,
GetTemplateDir looked for "webserver" relative to the current working
directory, so the per-user template directory (<config>/webserver/)
was silently skipped and the lookup always fell through to the
system-wide WEBSERVERDIR (/usr/share/amule/webserver/).

Derive m_configDir from the directory of the amule.conf file passed
on the command line, so a GUI-spawned amuleweb resolves templates
from the same config dir as the daemon that launched it. This also
fixes the webserver locale lookup, which builds its path from
m_configDir as well.

Verified by launching the rebuilt amuleweb with
--amule-config-file=~/.aMule/amule.conf and confirming it now serves
templates from ~/.aMule/webserver/default/ instead of the installed
copy.
@got3nks

got3nks commented Jun 11, 2026

Copy link
Copy Markdown

Nice catch, thanks @ngosang. Traced the early-return path and the locale lookup at WebInterface.cpp:555 — same m_configDir, same silent breakage, also fixed by this one assignment. Merging.

@got3nks
got3nks merged commit 8edf03d into amule-org:master Jun 11, 2026
9 checks passed
@ngosang
ngosang deleted the feature/fix_amuleweb branch June 11, 2026 08:30
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