]> mop.ddnsfree.com - git repositories - brisk.git/commit
INSTALL.sh: the root of the site is no longer asked of apache
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 13 Sep 2026 10:33:53 +0000 (12:33 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 13 Sep 2026 10:33:53 +0000 (12:33 +0200)
commit994b9b2a4909630397c4088b540fecf13d53d77f
treec272f39c3b35e2aabdb70e87d6910d084feab9b6
parent80368ea76eeab95768c5fb0a8fe9954806e92985
INSTALL.sh: the root of the site is no longer asked of apache

    document_root="$(grep DocumentRoot "${apache_conf}" | ... | awk '{ print $2 }')"

Three defects in one line: it tied INSTALL.sh to apache (nginx uses "root",
not "DocumentRoot"), it took the first match in any VirtualHost without
knowing which site was the right one, and it did not cope with quotes around
the path.

The value, though, can already be deduced from the parameters: web_path ends
with prefix_path, so removing the latter from the former leaves the root.

    web_path    = /home/brisk/web/brisk
    prefix_path = /brisk/
                  -------------------
    root        = /home/brisk/web

No server to ask, and it works with multi segment prefixes too
(/var/www/html/games/brisk with -P /games/brisk/ gives /var/www/html).

The -R option was added to force an explicit value, and the old grep over the
file named by -A was kept as a last resort; it now recognises both
DocumentRoot and root and strips quotes and semicolons. If no route produces
a value, INSTALL.sh stops with a clear message instead of going on with an
empty string (which ended up producing requires of
"/Etc/brisk_spu.conf.pho").

The derived value is now printed among the parameters, like the others.

Checked in the container by running INSTALL.sh WITHOUT -A: it derives
/home/brisk/web, writes it into $DOCUMENT_ROOT inside spush/*.ph* and
donometer.php, and installs the files from docroot/ there. The site answers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014M1jiEq9cHdE5SE5j6vFuE
INSTALL.sh