Home Information - Your home, your data, organized.
Python
Snap-Docker install fallback, env-var URL diagnostics, and server.py tests (#396)
Tony C770c7e27015a
diff --git a/.claude/commands/release.md b/.claude/commands/release.mdindex 3af9df99..c33ab7c3 100644--- a/.claude/commands/release.md+++ b/.claude/commands/release.md@@ -1,7 +1,7 @@---allowed-tools: Bash, Read, Edit, TodoWrite, Grep, Globdescription: Execute the complete release process from staging to master-argument-hint: [version] (e.g., 1.2.3)+argument-hint: [version] (e.g., v1.2.3)---Execute our complete release process following `docs/dev/workflow/release-process.md`:@@ -30,4 +30,4 @@ I need to execute our standardized release process with the following requiremen**Target branch:** master**Source branch:** staging-Begin the release process now.\ No newline at end of file+Begin the release process now.diff --git a/README.md b/README.mdindex 04d8cafa..451487fa 100644--- a/README.md+++ b/README.md@@ -25,7 +25,7 @@ See [Why Home Information?](docs/WhyHomeInformation.md) for more details on our**Requirements:** [Docker](https://docs.docker.com/get-docker/) installed and running.-**Get running in 30 seconds:**+**Get running in only minutes:**```shellcurl -fsSL https://raw.githubusercontent.com/cassandra/home-information/master/install.sh | bashdiff --git a/deploy/run_container.sh b/deploy/run_container.shindex b58ab18c..2dde8113 100755--- a/deploy/run_container.sh+++ b/deploy/run_container.sh@@ -8,7 +8,7 @@ EXTERNAL_PORT=9411BACKGROUND_FLAGS=""usage() {- echo "Usage: $0 [-env ENV_VAR_FILE] [-db DATA_DIR] [-port EXTERNAL_PORT] [-bg]"+ echo "Usage: $0 [-env ENV_VAR_FILE] [-dir DATA_DIR] [-port EXTERNAL_PORT] [-bg]"exit 1}diff --git a/docs/FAQ.md b/docs/FAQ.mdindex 2b573748..91dbd2c3 100644--- a/docs/FAQ.md+++ b/docs/FAQ.md@@ -100,6 +100,9 @@ We also provide some helper scripts [Helper Scripts README](../scripts/README.md### Q: The installation failed. What should I check?**A:** Most installation issues relate to Docker setup or system permissions. Check that Docker is running, you have sufficient disk space, and your user account has permissions to create files in your home directory. See the [Installation Guide](Installation.md) troubleshooting section for specific error messages.+### Q: My data is in `~/home-information` instead of `~/.hi` — is that right?+**A:** Yes. Home Information normally stores everything in the hidden `~/.hi` directory. However, **snap-packaged Docker** (and some other confined Docker setups) cannot read files inside hidden ("dot") directories, which makes the install fail with a `permission denied` error. When the installer detects this, it uses the visible `~/home-information` directory instead. Everything works the same — just substitute `~/home-information` for `~/.hi` in any instructions (your data lives in `~/home-information/database/` and `~/home-information/media/`). If you'd prefer the hidden `~/.hi` default, install Docker from the official apt/yum repository instead of the snap.+### Q: Can I access it from outside my home network?**A:** Yes, but it requires additional network configuration (port forwarding, dynamic DNS, etc.). For security reasons, we recommend using VPN access to your home network rather than exposing the service directly to the internet.diff --git a/docs/Installation.md b/docs/Installation.mdindex e665c957..d89a980f 100644--- a/docs/Installation.md+++ b/docs/Installation.md@@ -100,7 +100,7 @@ By default, the app only accepts requests to `localhost`. To access it from othe- For standalone Docker: edit `$HOME/.hi/env/local.env` and run `docker restart hi`- For unRAID: set the "Extra Host URLs" field under "Show more settings"-If you see `Invalid HTTP_HOST header` errors in the logs, this is the setting you need.+If you see `Invalid HTTP_HOST header` errors in the logs, this is the setting you need. However, note that this setting requires the full URL location, not just a hostname.**Email alerts not working?**Configure email settings in `$HOME/.hi/env/local.env`:diff --git a/docs/dev/workflow/release-process.md b/docs/dev/workflow/release-process.mdindex 666b03ca..337a75d5 100644--- a/docs/dev/workflow/release-process.md+++ b/docs/dev/workflow/release-process.md@@ -60,7 +60,7 @@ Common Mistakes to Avoid:Using GitHub CLI (preferred for automation):```bash-gh release create vX.X.X --title "vX.X.X" --generate-notes --latest+gh release create vX.X.X --title "vX.X.X" --generate-notes```Or via GitHub web interface:@@ -107,7 +107,7 @@ This is where the automated release process ends.### Refine Release- Read and refine the release notes on the github page.-- Attach an image to the release+- Attach image(s) to the release using permalinks from GitHub UI.### Validate Install Script Worksdiff --git a/install.sh b/install.shindex 66c54f6d..cd6588d5 100755--- a/install.sh+++ b/install.sh@@ -10,14 +10,24 @@ DOCKER_IMAGE="ghcr.io/cassandra/home-information" # GitHub Container RegistryDOCKER_TAG="${1:-latest}" # Allow override for testing (default: latest)CONTAINER_NAME="hi"EXTERNAL_PORT="9411"+# Install directory. Defaults to the hidden ~/.hi. choose_install_dir() may+# switch this to the non-hidden HI_HOME_VISIBLE at install time when Docker+# cannot read files inside dot-directories (e.g. snap-packaged Docker, whose+# confinement denies access to hidden home dirs). Derived paths are computed+# from the final HI_HOME by set_install_paths().HI_HOME="${HOME}/.hi"-ENV_DIR="${HI_HOME}/env"-DATABASE_DIR="${HI_HOME}/database"-MEDIA_DIR="${HI_HOME}/media"-ENV_FILE="${ENV_DIR}/local.env"-COMPOSE_FILE="${HI_HOME}/docker-compose.yml"+HI_HOME_VISIBLE="${HOME}/home-information"HAS_COMPOSE=0 # Set by check_docker_compose; 1 if `docker compose` is available.+# Derive all install paths from the (possibly updated) HI_HOME.+set_install_paths() {+ ENV_DIR="${HI_HOME}/env"+ DATABASE_DIR="${HI_HOME}/database"+ MEDIA_DIR="${HI_HOME}/media"+ ENV_FILE="${ENV_DIR}/local.env"+ COMPOSE_FILE="${HI_HOME}/docker-compose.yml"+}+# Colors for outputRED='\033[0;31m'GREEN='\033[0;32m'@@ -79,6 +89,36 @@ check_docker_compose() {fi}+# Choose the install directory. Snap-packaged (and otherwise AppArmor-confined)+# Docker cannot read files inside hidden "dot" directories, so it cannot parse a+# compose file or --env-file under ~/.hi and fails with an opaque "permission+# denied". Rather than fingerprint snap (brittle, and misses other confinement),+# we probe the real capability: ask Docker to read a throwaway compose file from+# a dot-directory. If that read is denied, fall back to a non-hidden directory.+#+# `docker compose config` only parses/reads the file (no image pull, no+# container, no network), so the probe is fast and side-effect-free. It needs+# the compose plugin; confined Docker (snap) always bundles it. Without the+# plugin we are on an old, unconfined daemon where the hidden default is fine.+choose_install_dir() {+ if (( HAS_COMPOSE == 0 )); then+ return+ fi++ local probe_dir="${HOME}/.hi-install-probe.$$"+ local probe_file="${probe_dir}/docker-compose.yml"+ mkdir -p "${probe_dir}"+ printf 'services:\n probe:\n image: busybox\n command: ["true"]\n' > "${probe_file}"++ if ! docker compose -f "${probe_file}" config &> /dev/null; then+ HI_HOME="${HI_HOME_VISIBLE}"+ print_info "Docker cannot read hidden directories (e.g. snap Docker);"+ print_info "using ${HI_HOME} instead of ${HOME}/.hi"+ fi++ rm -rf "${probe_dir}"+}+# Check if Python3 is installed (needed for secure secret generation)check_python() {print_info "Checking Python 3 installation..."@@ -212,7 +252,7 @@ INSTALL_ENV_FILE_EOFADMIN_PASSWORD="${DJANGO_ADMIN_PASSWORD}"}-# Write a fully-resolved docker-compose.yml to ~/.hi/. Always written, even+# Write a fully-resolved docker-compose.yml to ${HI_HOME}/. Always written, even# when compose is not available, so it is ready for use the moment the user# installs the compose plugin. Container name `hi` matches the legacy# `docker run --name hi` invocation so management commands like `docker logs@@ -381,6 +421,8 @@ main() {check_dockercheck_docker_compose+ choose_install_dir+ set_install_pathscheck_pythoncreate_directoriescreate_env_filediff --git a/scripts/export-all-attributes.sh b/scripts/export-all-attributes.shindex 116a0c03..d8cf7cdb 100755--- a/scripts/export-all-attributes.sh+++ b/scripts/export-all-attributes.sh@@ -6,8 +6,14 @@# Usage: ./scripts/export-all-attributes.sh#-# Database location (adjust if your installation differs)-DB_PATH="${HOME}/.hi/database/hi.sqlite3"+# Database location. install.sh uses ~/.hi by default, or ~/home-information+# when Docker can't read dot-directories (e.g. snap Docker); use whichever+# actually has the database file. Adjust if your installation differs.+if [ -f "${HOME}/home-information/database/hi.sqlite3" ]; then+ DB_PATH="${HOME}/home-information/database/hi.sqlite3"+else+ DB_PATH="${HOME}/.hi/database/hi.sqlite3"+fi# Check if database existsif [ ! -f "$DB_PATH" ]; thendiff --git a/scripts/export-item-attributes.sh b/scripts/export-item-attributes.shindex 86a6e12c..c0eadc5a 100755--- a/scripts/export-item-attributes.sh+++ b/scripts/export-item-attributes.sh@@ -6,8 +6,14 @@# Usage: ./scripts/export-item-attributes.sh#-# Database location (adjust if your installation differs)-DB_PATH="${HOME}/.hi/database/hi.sqlite3"+# Database location. install.sh uses ~/.hi by default, or ~/home-information+# when Docker can't read dot-directories (e.g. snap Docker); use whichever+# actually has the database file. Adjust if your installation differs.+if [ -f "${HOME}/home-information/database/hi.sqlite3" ]; then+ DB_PATH="${HOME}/home-information/database/hi.sqlite3"+else+ DB_PATH="${HOME}/.hi/database/hi.sqlite3"+fi# Check if database existsif [ ! -f "$DB_PATH" ]; thendiff --git a/scripts/export-location-attributes.sh b/scripts/export-location-attributes.shindex ea0bbe75..56a04a5c 100755--- a/scripts/export-location-attributes.sh+++ b/scripts/export-location-attributes.sh@@ -6,8 +6,14 @@# Usage: ./scripts/export-location-attributes.sh#-# Database location (adjust if your installation differs)-DB_PATH="${HOME}/.hi/database/hi.sqlite3"+# Database location. install.sh uses ~/.hi by default, or ~/home-information+# when Docker can't read dot-directories (e.g. snap Docker); use whichever+# actually has the database file. Adjust if your installation differs.+if [ -f "${HOME}/home-information/database/hi.sqlite3" ]; then+ DB_PATH="${HOME}/home-information/database/hi.sqlite3"+else+ DB_PATH="${HOME}/.hi/database/hi.sqlite3"+fi# Check if database existsif [ ! -f "$DB_PATH" ]; thendiff --git a/src/hi/apps/profiles/templates/profiles/svg/backgrounds/two_story-0.svg b/src/hi/apps/profiles/templates/profiles/svg/backgrounds/two_story-0.svgindex 1357a9f2..4fa02f7f 100644--- a/src/hi/apps/profiles/templates/profiles/svg/backgrounds/two_story-0.svg+++ b/src/hi/apps/profiles/templates/profiles/svg/backgrounds/two_story-0.svg@@ -2,4 +2,5 @@<g data-hi-editor="1" data-hi-name="My Home"><g id="bg-6953a389" class="hi-bg-element" data-bg-type="property-lines" data-bg-edit-type="closed" data-bg-layer="10" style=""><path class="property-lines" d=" M 21.762784936460413,21.762784936460413 L 1991.2948216861278,21.762784936460413 L 1980.4134292178976,1969.5320367496674 L 32.64417740469062,1969.5320367496674 Z" /></g><g id="bg-92128b69" class="hi-bg-element" data-bg-type="grass" data-bg-edit-type="closed" data-bg-layer="20" style=""><path class="grass" d=" M 21.762784936460413,21.762784936460413 L 1991.2948216861278,21.762784936460413 L 1980.4134292178976,1969.5320367496674 L 32.64417740469062,1969.5320367496674 Z" /></g><g id="bg-58757953" class="hi-bg-element" data-bg-type="pavement" data-bg-edit-type="closed" data-bg-layer="40" style=""><path class="pavement" d=" M 990.2067146089488,1545.1577304886894 L 1251.3601338464737,1545.1577304886894 L 1251.3601338464737,1643.0902627027613 L 1196.9531715053226,1643.0902627027613 L 1196.9531715053226,1958.6506442814373 L 1044.6136769501,1958.6506442814373 L 1044.6136769501,1643.0902627027613 L 990.2067146089488,1643.0902627027613 Z" /></g><g id="bg-f931a0bc" class="hi-bg-element" data-bg-type="pavement" data-bg-edit-type="closed" data-bg-layer="40" style=""><path class="pavement" d=" M 1838.9553271309048,1273.1229187829342 L 1958.6506442814373,1273.1229187829342 L 1958.6506442814373,1762.7855798532935 L 1196.9531715053226,1762.7855798532935 L 1196.9531715053226,1643.0902627027613 L 1838.9553271309048,1643.0902627027613 Z" /></g><g id="bg-77c99d32" class="hi-bg-element" data-bg-type="mulch" data-bg-edit-type="closed" data-bg-layer="60" style=""><path class="mulch" d=" M 272.03481170575515,1545.1577304886894 L 903.1555748631072,1545.1577304886894 L 904.028010438695,1592.5882049179083 L 899.3439274830541,1620.6927026517537 L 889.9757615717723,1644.1131174299583 L 871.2394297492087,1662.849449252522 L 843.1349320153632,1672.2176151638039 L 810.3463513258769,1676.9016981194447 L 369.96734391982704,1675.7344401074517 L 332.5698898505044,1672.2176151638039 L 304.46539211665896,1662.849449252522 L 285.72906029409535,1648.7972003855994 L 276.3608943828135,1630.0608685630357 L 271.6768114271726,1616.0086196961129 L 272.03481170575515,1599.5646928298404 Z" /></g><g id="bg-63f0dff5" class="hi-bg-element" data-bg-type="interior-floors" data-bg-edit-type="closed" data-bg-layer="130" style=""><path class="interior-floors" d=" M 219.50507403902773,292.673432052037 L 1838.9553271309048,293.7975966422156 L 1850.1141954718053,1546.9881408464812 L 219.50507403902773,1546.9881408464812 Z" /></g><g id="bg-80940722" class="hi-bg-element" data-bg-type="dead-space" data-bg-edit-type="closed" data-bg-layer="135" style=""><path class="dead-space" d=" M 1077.2578543547904,1099.020639291251 L 1207.834563973553,1099.020639291251 L 1207.834563973553,1207.834563973553 L 1077.2578543547904,1207.834563973553 Z" /></g><g id="bg-e557283b" class="hi-bg-element" data-bg-type="countertops" data-bg-edit-type="closed" data-bg-layer="150" style=""><path class="countertops" d=" M 1381.9368434652363,968.4439296724884 L 1566.9205154251497,968.4439296724884 L 1566.9205154251497,1088.1392468230206 L 1381.9368434652363,1088.1392468230206 Z" /></g><g id="bg-85fbf6a6" class="hi-bg-element" data-bg-type="countertops" data-bg-edit-type="closed" data-bg-layer="150" style=""><path class="countertops" d=" M 1381.9368434652363,1088.1392468230206 L 1675.7344401074517,1088.1392468230206 L 1675.7344401074517,1196.9531715053226 L 1381.9368434652363,1196.9531715053226 Z" /></g><g id="bg-ef71d1c8" class="hi-bg-element" data-bg-type="shelves" data-bg-edit-type="closed" data-bg-layer="160" style=""><path class="shelves" d=" M 924.9183597995676,293.7975966422156 L 990.2067146089488,293.7975966422156 L 990.2067146089488,609.3579782208916 L 924.9183597995676,609.3579782208916 Z" /></g><g id="bg-68ab7ad2" class="hi-bg-element" data-bg-type="shelves" data-bg-edit-type="closed" data-bg-layer="160" style=""><path class="shelves" d=" M 990.2067146089488,293.7975966422156 L 1044.6136769501,293.7975966422156 L 1044.6136769501,609.3579782208916 L 990.2067146089488,609.3579782208916 Z" /></g><g id="bg-434d8745" class="hi-bg-element" data-bg-type="shelves" data-bg-edit-type="closed" data-bg-layer="160" style=""><path class="shelves" d=" M 837.8672200537259,609.3579782208916 L 1131.6648166959415,609.3579782208916 L 1131.6648166959415,652.8835480938124 L 837.8672200537259,652.8835480938124 Z" /></g><g id="bg-f23adfde" class="hi-bg-element" data-bg-type="transitions" data-bg-edit-type="open" data-bg-layer="190" style=""><path class="transitions" d=" M 1001.088107077179,1643.0902627027613 L 1251.3601338464737,1643.0902627027613" /><path d=" M 1001.088107077179,1643.0902627027613 L 1251.3601338464737,1643.0902627027613" class="hi-bg-hit-area" /></g><g id="bg-6b868565" class="hi-bg-element" data-bg-type="transitions" data-bg-edit-type="open" data-bg-layer="190" style=""><path class="transitions" d=" M 1838.9553271309048,1479.8693756793082 L 1958.6506442814373,1479.8693756793082" /><path d=" M 1838.9553271309048,1479.8693756793082 L 1958.6506442814373,1479.8693756793082" class="hi-bg-hit-area" /></g><g id="bg-831ff843" class="hi-bg-element" data-bg-type="stairs" data-bg-edit-type="icon" data-bg-layer="200" transform="scale(2.1220496836042306 2.1220496836042306) translate(509.7007250701858, 570.2084586705328) rotate(0, 0, 0)"><path class="stairs" d="M 0,0 L 60,0 L 60,10 L 0,10 Z M 0,10 L 60,10 L 60,20 L 0,20 Z M 0,20 L 60,20 L 60,30 L 0,30 Z M 0,30 L 60,30 L 60,40 L 0,40 Z M 0,40 L 60,40 L 60,50 L 0,50 Z M 0,50 L 60,50 L 60,60 L 0,60 Z M 0,60 L 60,60 L 60,70 L 0,70 Z M 0,70 L 60,70 L 60,80 L 0,80 Z" /><rect x="0" y="0" width="60" height="80" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-a2483743" class="hi-bg-element" data-bg-type="interior-walls" data-bg-edit-type="open" data-bg-layer="210" style=""><path class="interior-wall-stroke" d=" M 217.62784936460412,914.0369673313373 L 837.8672200537259,914.0369673313373 L 837.8672200537259,881.3927899266467 M 837.8672200537259,293.7975966422156 L 837.8672200537259,609.3579782208916 L 1131.6648166959415,609.3579782208916 L 1131.6648166959415,304.6789891104458 M 990.2067146089488,304.6789891104458 L 990.2067146089488,609.3579782208916 M 837.8672200537259,707.2905104349634 L 1131.6648166959415,707.2905104349634 L 1131.6648166959415,609.3579782208916 L 837.8672200537259,609.3579782208916 L 837.8672200537259,772.5788652443447 M 1131.6648166959415,707.2905104349634 L 1164.3089941006322,707.2905104349634" /><path d=" M 217.62784936460412,914.0369673313373 L 837.8672200537259,914.0369673313373 L 837.8672200537259,881.3927899266467 M 837.8672200537259,293.7975966422156 L 837.8672200537259,609.3579782208916 L 1131.6648166959415,609.3579782208916 L 1131.6648166959415,304.6789891104458 M 990.2067146089488,304.6789891104458 L 990.2067146089488,609.3579782208916 M 837.8672200537259,707.2905104349634 L 1131.6648166959415,707.2905104349634 L 1131.6648166959415,609.3579782208916 L 837.8672200537259,609.3579782208916 L 837.8672200537259,772.5788652443447 M 1131.6648166959415,707.2905104349634 L 1164.3089941006322,707.2905104349634" class="hi-bg-hit-area" /></g><g id="bg-400e9d39" class="hi-bg-element" data-bg-type="interior-walls" data-bg-edit-type="open" data-bg-layer="210" style=""><path class="interior-wall-stroke" d=" M 1077.2578543547904,1207.834563973553 L 1077.2578543547904,914.0369673313373 L 1381.9368434652363,914.0369673313373 L 1381.9368434652363,1088.1392468230206 L 1838.9553271309048,1088.1392468230206 M 1273.1229187829342,707.2905104349634 L 1838.9553271309048,707.2905104349634 M 1381.9368434652363,707.2905104349634 L 1381.9368434652363,794.3416501808051" /><path d=" M 1077.2578543547904,1207.834563973553 L 1077.2578543547904,914.0369673313373 L 1381.9368434652363,914.0369673313373 L 1381.9368434652363,1088.1392468230206 L 1838.9553271309048,1088.1392468230206 M 1273.1229187829342,707.2905104349634 L 1838.9553271309048,707.2905104349634 M 1381.9368434652363,707.2905104349634 L 1381.9368434652363,794.3416501808051" class="hi-bg-hit-area" /></g><g id="bg-1973ec36" class="hi-bg-element" data-bg-type="exterior-walls" data-bg-edit-type="open" data-bg-layer="220" style=""><path class="exterior-wall-stroke" d=" M 1055.49506941833,1545.1577304886894 L 217.62784936460412,1545.1577304886894 L 217.62784936460412,293.7975966422156 L 1838.9553271309048,293.7975966422156 L 1838.9553271309048,1305.7670961876247 M 1838.9553271309048,1425.4624133381571 L 1838.9553271309048,1545.1577304886894 L 1175.1903865688623,1545.1577304886894" /><path d=" M 1055.49506941833,1545.1577304886894 L 217.62784936460412,1545.1577304886894 L 217.62784936460412,293.7975966422156 L 1838.9553271309048,293.7975966422156 L 1838.9553271309048,1305.7670961876247 M 1838.9553271309048,1425.4624133381571 L 1838.9553271309048,1545.1577304886894 L 1175.1903865688623,1545.1577304886894" class="hi-bg-hit-area" /></g><g id="bg-a675456f" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(1.2878961630546426 1.2878961630546426) translate(917.5577476515272, 1192.9941482670415) rotate(175, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71" /><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71" /><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-f4f141ea" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(-1.13815062325021 1.13815062325021) translate(-733.3290822022855, 774.4078180700437) rotate(270, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71" /><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71" /><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-ed414e4c" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(-1.111541536226149 1.111541536226149) translate(-1046.9500262136307, 636.314890688797) rotate(180, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71" /><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71" /><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-58886c1d" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(-1.2232799153640204 1.2232799153640204) translate(-1128.5118728750529, 745.4226692921069) rotate(270, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71" /><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71" /><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-1c8481e6" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(-1.2877442375572465 1.2877442375572465) translate(-1427.5930943341953, 1113.7052197709975) rotate(270, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71" /><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71" /><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-9ac0d0cf" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.6330540179952042 1.6330540179952042) translate(270.63030612505963, 176.14029968630268) rotate(0, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-0e0aa687" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.5515005169718687 1.5515005169718687) translate(144.70715690272507, 407.88035077862247) rotate(90, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-ec0db250" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.541754124134481 1.541754124134481) translate(142.7290881683745, 743.8851185734559) rotate(90, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-c0d82c5f" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.4737957180218078 1.4737957180218078) translate(359.68692873924863, 1044.8023025868222) rotate(0, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-2dd6bed9" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.5051501997863896 1.5051501997863896) translate(1021.7036222478315, 1022.303610682145) rotate(0, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-1c48d082" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.3662538774719857 1.3662538774719857) translate(1351.5973781144771, 528.0373323442393) rotate(90, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-7a48e6b6" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.4536733397152435 1.4536733397152435) translate(1004.7473048933712, 197.219987751336) rotate(0, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-1ec0d997" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.4407926989155289 1.4407926989155289) translate(1281.4129055123378, 273.5736777329555) rotate(90, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-c9248787" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.5429193072333054 1.5429193072333054) translate(883.2899915661335, 997.7019731842762) rotate(0, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-17b3e787" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(2.0787154432591337 2.0787154432591337) translate(413.95705734406073, 336.6814446334706) rotate(0, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z" /><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11" /><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-9b3640e7" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.8840749951546911 1.8840749951546911) translate(450.0095890129806, 181.341953187801) rotate(90, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z" /><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11" /><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-c5391803" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.838185613831079 1.838185613831079) translate(620.4448900572539, 186.82961890425827) rotate(90, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z" /><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11" /><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area" /></g></g>+</svg>diff --git a/src/hi/apps/profiles/templates/profiles/svg/backgrounds/two_story-1.svg b/src/hi/apps/profiles/templates/profiles/svg/backgrounds/two_story-1.svgindex f14abd72..0a0f856a 100644--- a/src/hi/apps/profiles/templates/profiles/svg/backgrounds/two_story-1.svg+++ b/src/hi/apps/profiles/templates/profiles/svg/backgrounds/two_story-1.svg@@ -1,5 +1,4 @@<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2000 2000"><g data-hi-editor="1" data-hi-name="Upstairs">-<g id="bg-6953a389" class="hi-bg-element" data-bg-type="property-lines" data-bg-edit-type="closed" data-bg-layer="10" style=""><path class="property-lines" d=" M 21.762784936460413,21.762784936460413 L 1991.2948216861278,21.762784936460413 L 1980.4134292178976,1969.5320367496674 L 32.64417740469062,1969.5320367496674 Z" /></g><g id="bg-92128b69" class="hi-bg-element" data-bg-type="grass" data-bg-edit-type="closed" data-bg-layer="20" style=""><path class="grass" d=" M 21.762784936460413,21.762784936460413 L 1991.2948216861278,21.762784936460413 L 1980.4134292178976,1969.5320367496674 L 32.64417740469062,1969.5320367496674 Z" /></g><g id="bg-1e97e705" class="hi-bg-element" data-bg-type="dead-space" data-bg-edit-type="closed" data-bg-layer="135" style=""><path class="dead-space" d=" M 217.62784936460412,1218.7159564417832 L 1838.9553271309048,1218.7159564417832 L 1838.9553271309048,1545.1577304886894 L 217.62784936460412,1545.1577304886894 Z" /></g><g id="bg-34ba1eb2" class="hi-bg-element" data-bg-type="dead-space" data-bg-edit-type="closed" data-bg-layer="135" style=""><path class="dead-space" d=" M 217.62784936460412,293.7975966422156 L 859.6300049901863,293.7975966422156 L 859.6300049901863,478.7812686021291 L 217.62784936460412,478.7812686021291 Z" /></g><g id="bg-93aea48b" class="hi-bg-element" data-bg-type="dead-space" data-bg-edit-type="closed" data-bg-layer="135" style=""><path class="dead-space" d=" M 1262.241526314704,293.7975966422156 L 1838.9553271309048,293.7975966422156 L 1838.9553271309048,489.6626610703593 L 1262.241526314704,489.6626610703593 Z" /></g><g id="bg-25dc26de" class="hi-bg-element" data-bg-type="countertops" data-bg-edit-type="closed" data-bg-layer="150" style=""><path class="countertops" d=" M 1120.7834242277113,293.7975966422156 L 1262.241526314704,293.7975966422156 L 1262.241526314704,544.0696234115103 L 1120.7834242277113,544.0696234115103 Z" /></g><g id="bg-831ff843" class="hi-bg-element" data-bg-type="stairs" data-bg-edit-type="icon" data-bg-layer="200" transform="scale(2.1220496836042306 2.1220496836042306) translate(509.70064219689715, 490.2151207399129) rotate(0, 0, 0)"><path class="stairs" d="M 0,0 L 60,0 L 60,10 L 0,10 Z M 0,10 L 60,10 L 60,20 L 0,20 Z M 0,20 L 60,20 L 60,30 L 0,30 Z M 0,30 L 60,30 L 60,40 L 0,40 Z M 0,40 L 60,40 L 60,50 L 0,50 Z M 0,50 L 60,50 L 60,60 L 0,60 Z M 0,60 L 60,60 L 60,70 L 0,70 Z M 0,70 L 60,70 L 60,80 L 0,80 Z" /><rect x="0" y="0" width="60" height="80" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-a2483743" class="hi-bg-element" data-bg-type="interior-walls" data-bg-edit-type="open" data-bg-layer="210" style=""><path class="interior-wall-stroke" d=" M 859.6300049901863,293.7975966422156 L 859.6300049901863,848.7486125219561 M 859.6300049901863,598.4765857526613 L 1022.8508920136394,598.4765857526613 L 1022.8508920136394,805.2230426490353 M 1229.5973489100134,805.2230426490353 L 1262.241526314704,805.2230426490353 L 1262.241526314704,293.7975966422156 M 859.6300049901863,805.2230426490353 L 1131.6648166959415,805.2230426490353" /><path d=" M 859.6300049901863,293.7975966422156 L 859.6300049901863,848.7486125219561 M 859.6300049901863,598.4765857526613 L 1022.8508920136394,598.4765857526613 L 1022.8508920136394,805.2230426490353 M 1229.5973489100134,805.2230426490353 L 1262.241526314704,805.2230426490353 L 1262.241526314704,293.7975966422156 M 859.6300049901863,805.2230426490353 L 1131.6648166959415,805.2230426490353" class="hi-bg-hit-area" /></g><g id="bg-400e9d39" class="hi-bg-element" data-bg-type="interior-walls" data-bg-edit-type="open" data-bg-layer="210" style=""><path class="interior-wall-stroke" d=" M 1077.2578543547904,1218.7159564417832 L 1077.2578543547904,1001.088107077179 L 848.7486125219561,1001.088107077179 L 848.7486125219561,957.5625372042582 M 1262.241526314704,837.8672200537259 L 1262.241526314704,805.2230426490353 M 1262.241526314704,957.5625372042582 L 1262.241526314704,1001.088107077179 L 1207.834563973553,1001.088107077179 L 1207.834563973553,1218.7159564417832 M 848.7486125219561,1001.088107077179 L 848.7486125219561,1218.7159564417832" /><path d=" M 1077.2578543547904,1218.7159564417832 L 1077.2578543547904,1001.088107077179 L 848.7486125219561,1001.088107077179 L 848.7486125219561,957.5625372042582 M 1262.241526314704,837.8672200537259 L 1262.241526314704,805.2230426490353 M 1262.241526314704,957.5625372042582 L 1262.241526314704,1001.088107077179 L 1207.834563973553,1001.088107077179 L 1207.834563973553,1218.7159564417832 M 848.7486125219561,1001.088107077179 L 848.7486125219561,1218.7159564417832" class="hi-bg-hit-area" /></g><g id="bg-f59c8437" class="hi-bg-element" data-bg-type="interior-walls" data-bg-edit-type="open" data-bg-layer="210" style=""><path class="interior-wall-stroke" d=" M 217.62784936460412,478.7812686021291 L 859.6300049901863,478.7812686021291 M 217.62784936460412,1218.7159564417832 L 1838.9553271309048,1218.7159564417832 M 1262.241526314704,489.6626610703593 L 1838.9553271309048,489.6626610703593" /><path d=" M 217.62784936460412,478.7812686021291 L 859.6300049901863,478.7812686021291 M 217.62784936460412,1218.7159564417832 L 1838.9553271309048,1218.7159564417832 M 1262.241526314704,489.6626610703593 L 1838.9553271309048,489.6626610703593" class="hi-bg-hit-area" /></g><g id="bg-1973ec36" class="hi-bg-element" data-bg-type="exterior-walls" data-bg-edit-type="open" data-bg-layer="220" style=""><path class="exterior-wall-stroke" d=" M 1175.1903865688623,1545.1577304886894 L 217.62784936460412,1545.1577304886894 L 217.62784936460412,293.7975966422156 L 1838.9553271309048,293.7975966422156 L 1838.9553271309048,1305.7670961876247 M 1838.9553271309048,1305.7670961876247 L 1838.9553271309048,1545.1577304886894 L 1175.1903865688623,1545.1577304886894" /><path d=" M 1175.1903865688623,1545.1577304886894 L 217.62784936460412,1545.1577304886894 L 217.62784936460412,293.7975966422156 L 1838.9553271309048,293.7975966422156 L 1838.9553271309048,1305.7670961876247 M 1838.9553271309048,1305.7670961876247 L 1838.9553271309048,1545.1577304886894 L 1175.1903865688623,1545.1577304886894" class="hi-bg-hit-area" /></g><g id="bg-f4f141ea" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(1.13815062325021 1.13815062325021) translate(758.2183557515999, 738.0774654526311) rotate(90, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71" /><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71" /><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-ed414e4c" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(-1.111541536226149 1.111541536226149) translate(-1009.7500277316166, 722.4621142197664) rotate(180, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71" /><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71" /><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-58886c1d" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(-1.2232799153640204 1.2232799153640204) translate(-1028.884748995511, 677.8186197242902) rotate(85, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71" /><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71" /><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-0e0aa687" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.5515005169718687 1.5515005169718687) translate(146.10984125796264, 499.0553752123392) rotate(90, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-7a48e6b6" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.4536733397152435 1.4536733397152435) translate(751.7391776881038, 200.21413127250958) rotate(0, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-1ec0d997" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.4407926989155289 1.4407926989155289) translate(1281.4128179442728, 527.3331375227327) rotate(90, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z" /><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-43a4b221" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.4374319663218258 1.4374319663218258) translate(595.003750158413, 719.1520529688137) rotate(90, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z" /><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11" /><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-3762e60c" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.4425239894562871 1.4425239894562871) translate(713.5962563230389, 426.9508240336943) rotate(90, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z" /><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11" /><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-c05d9b90" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.4864541464745629 1.4864541464745629) translate(837.450205144662, 814.0250280754217) rotate(0, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z" /><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11" /><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-3f5eb467" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.2747213748161301 1.2747213748161301) translate(488.27584866054275, 950.9428270337767) rotate(0, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z" /><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11" /><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-08af485f" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.3382506781008123 1.3382506781008123) translate(343.1305784281881, 352.8878686323562) rotate(0, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z" /><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11" /><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area" /></g><g id="bg-2eeacc59" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.1976257380148745 1.1976257380148745) translate(1252.0237631623106, 405.2268639552499) rotate(0, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z" /><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11" /><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area" /></g></g>-+<g id="bg-6953a389" class="hi-bg-element" data-bg-type="property-lines" data-bg-edit-type="closed" data-bg-layer="10" style=""><path class="property-lines" d=" M 21.762784936460413,21.762784936460413 L 1991.2948216861278,21.762784936460413 L 1980.4134292178976,1969.5320367496674 L 32.64417740469062,1969.5320367496674 Z"></path></g><g id="bg-92128b69" class="hi-bg-element" data-bg-type="grass" data-bg-edit-type="closed" data-bg-layer="20" style=""><path class="grass" d=" M 21.762784936460413,21.762784936460413 L 1991.2948216861278,21.762784936460413 L 1980.4134292178976,1969.5320367496674 L 32.64417740469062,1969.5320367496674 Z"></path></g><g id="bg-c27735e5" class="hi-bg-element" data-bg-type="interior-floors" data-bg-edit-type="closed" data-bg-layer="130" style=""><path class="interior-floors" d=" M 225.38552927899661,296.5599069460482 L 1838.6714230654989,296.5599069460482 L 1838.6714230654989,1542.1115161194507 L 225.38552927899661,1542.1115161194507 Z"></path></g><g id="bg-1e97e705" class="hi-bg-element" data-bg-type="dead-space" data-bg-edit-type="closed" data-bg-layer="135" style=""><path class="dead-space" d=" M 217.62784936460412,1218.7159564417832 L 1838.9553271309048,1218.7159564417832 L 1838.9553271309048,1545.1577304886894 L 217.62784936460412,1545.1577304886894 Z"></path></g><g id="bg-34ba1eb2" class="hi-bg-element" data-bg-type="dead-space" data-bg-edit-type="closed" data-bg-layer="135" style=""><path class="dead-space" d=" M 217.62784936460412,293.7975966422156 L 859.6300049901863,293.7975966422156 L 859.6300049901863,478.7812686021291 L 217.62784936460412,478.7812686021291 Z"></path></g><g id="bg-93aea48b" class="hi-bg-element" data-bg-type="dead-space" data-bg-edit-type="closed" data-bg-layer="135" style=""><path class="dead-space" d=" M 1262.241526314704,293.7975966422156 L 1838.9553271309048,293.7975966422156 L 1838.9553271309048,489.6626610703593 L 1262.241526314704,489.6626610703593 Z"></path></g><g id="bg-25dc26de" class="hi-bg-element" data-bg-type="countertops" data-bg-edit-type="closed" data-bg-layer="150" style=""><path class="countertops" d=" M 1120.7834242277113,293.7975966422156 L 1262.241526314704,293.7975966422156 L 1262.241526314704,544.0696234115103 L 1120.7834242277113,544.0696234115103 Z"></path></g><g id="bg-831ff843" class="hi-bg-element" data-bg-type="stairs" data-bg-edit-type="icon" data-bg-layer="200" transform="scale(2.1220496836042306 2.1220496836042306) translate(509.70064219689715, 490.2151207399129) rotate(0, 0, 0)"><path class="stairs" d="M 0,0 L 60,0 L 60,10 L 0,10 Z M 0,10 L 60,10 L 60,20 L 0,20 Z M 0,20 L 60,20 L 60,30 L 0,30 Z M 0,30 L 60,30 L 60,40 L 0,40 Z M 0,40 L 60,40 L 60,50 L 0,50 Z M 0,50 L 60,50 L 60,60 L 0,60 Z M 0,60 L 60,60 L 60,70 L 0,70 Z M 0,70 L 60,70 L 60,80 L 0,80 Z"></path><rect x="0" y="0" width="60" height="80" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-a2483743" class="hi-bg-element" data-bg-type="interior-walls" data-bg-edit-type="open" data-bg-layer="210" style=""><path class="interior-wall-stroke" d=" M 859.6300049901863,293.7975966422156 L 859.6300049901863,848.7486125219561 M 859.6300049901863,598.4765857526613 L 1022.8508920136394,598.4765857526613 L 1022.8508920136394,805.2230426490353 M 1229.5973489100134,805.2230426490353 L 1262.241526314704,805.2230426490353 L 1262.241526314704,293.7975966422156 M 859.6300049901863,805.2230426490353 L 1131.6648166959415,805.2230426490353"></path><path d=" M 859.6300049901863,293.7975966422156 L 859.6300049901863,848.7486125219561 M 859.6300049901863,598.4765857526613 L 1022.8508920136394,598.4765857526613 L 1022.8508920136394,805.2230426490353 M 1229.5973489100134,805.2230426490353 L 1262.241526314704,805.2230426490353 L 1262.241526314704,293.7975966422156 M 859.6300049901863,805.2230426490353 L 1131.6648166959415,805.2230426490353" class="hi-bg-hit-area"></path></g><g id="bg-400e9d39" class="hi-bg-element" data-bg-type="interior-walls" data-bg-edit-type="open" data-bg-layer="210" style=""><path class="interior-wall-stroke" d=" M 1077.2578543547904,1218.7159564417832 L 1077.2578543547904,1001.088107077179 L 848.7486125219561,1001.088107077179 L 848.7486125219561,957.5625372042582 M 1262.241526314704,837.8672200537259 L 1262.241526314704,805.2230426490353 M 1262.241526314704,957.5625372042582 L 1262.241526314704,1001.088107077179 L 1207.834563973553,1001.088107077179 L 1207.834563973553,1218.7159564417832 M 848.7486125219561,1001.088107077179 L 848.7486125219561,1218.7159564417832"></path><path d=" M 1077.2578543547904,1218.7159564417832 L 1077.2578543547904,1001.088107077179 L 848.7486125219561,1001.088107077179 L 848.7486125219561,957.5625372042582 M 1262.241526314704,837.8672200537259 L 1262.241526314704,805.2230426490353 M 1262.241526314704,957.5625372042582 L 1262.241526314704,1001.088107077179 L 1207.834563973553,1001.088107077179 L 1207.834563973553,1218.7159564417832 M 848.7486125219561,1001.088107077179 L 848.7486125219561,1218.7159564417832" class="hi-bg-hit-area"></path></g><g id="bg-f59c8437" class="hi-bg-element" data-bg-type="interior-walls" data-bg-edit-type="open" data-bg-layer="210" style=""><path class="interior-wall-stroke" d=" M 217.62784936460412,478.7812686021291 L 859.6300049901863,478.7812686021291 M 217.62784936460412,1218.7159564417832 L 1838.9553271309048,1218.7159564417832 M 1262.241526314704,489.6626610703593 L 1838.9553271309048,489.6626610703593"></path><path d=" M 217.62784936460412,478.7812686021291 L 859.6300049901863,478.7812686021291 M 217.62784936460412,1218.7159564417832 L 1838.9553271309048,1218.7159564417832 M 1262.241526314704,489.6626610703593 L 1838.9553271309048,489.6626610703593" class="hi-bg-hit-area"></path></g><g id="bg-1973ec36" class="hi-bg-element" data-bg-type="exterior-walls" data-bg-edit-type="open" data-bg-layer="220" style=""><path class="exterior-wall-stroke" d=" M 1175.1903865688623,1545.1577304886894 L 217.62784936460412,1545.1577304886894 L 217.62784936460412,293.7975966422156 L 1838.9553271309048,293.7975966422156 L 1838.9553271309048,1305.7670961876247 M 1838.9553271309048,1305.7670961876247 L 1838.9553271309048,1545.1577304886894 L 1175.1903865688623,1545.1577304886894"></path><path d=" M 1175.1903865688623,1545.1577304886894 L 217.62784936460412,1545.1577304886894 L 217.62784936460412,293.7975966422156 L 1838.9553271309048,293.7975966422156 L 1838.9553271309048,1305.7670961876247 M 1838.9553271309048,1305.7670961876247 L 1838.9553271309048,1545.1577304886894 L 1175.1903865688623,1545.1577304886894" class="hi-bg-hit-area"></path></g><g id="bg-f4f141ea" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(1.13815062325021 1.13815062325021) translate(758.2183557515999, 738.0774654526311) rotate(90, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71"></path><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71"></path><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-ed414e4c" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(-1.111541536226149 1.111541536226149) translate(-1009.7500277316166, 722.4621142197664) rotate(180, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71"></path><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71"></path><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-58886c1d" class="hi-bg-element" data-bg-type="door-standard" data-bg-edit-type="icon" data-bg-layer="240" transform="scale(-1.2232799153640204 1.2232799153640204) translate(-1028.884748995511, 677.8186197242902) rotate(85, 0, 0)"><path class="doors" d="M 0,0 L 70.71,70.71"></path><path class="door-arcs" d="M 100,0 C 100,26.52 89.46,51.96 70.71,70.71"></path><rect x="0" y="0" width="100" height="70.71" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-0e0aa687" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.5515005169718687 1.5515005169718687) translate(146.10984125796264, 499.0553752123392) rotate(90, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z"></path><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-7a48e6b6" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.4536733397152435 1.4536733397152435) translate(751.7391776881038, 200.21413127250958) rotate(0, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z"></path><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-1ec0d997" class="hi-bg-element" data-bg-type="window-standard" data-bg-edit-type="icon" data-bg-layer="250" transform="scale(1.4407926989155289 1.4407926989155289) translate(1281.4128179442728, 527.3331375227327) rotate(90, 0, 0)"><path class="windows" d="M 0,0 L 105,0 L 105,9 L 0,9 Z"></path><rect x="0" y="0" width="105" height="9" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-43a4b221" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.4374319663218258 1.4374319663218258) translate(595.003750158413, 719.1520529688137) rotate(90, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z"></path><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11"></line><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-3762e60c" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.4425239894562871 1.4425239894562871) translate(713.5962563230389, 426.9508240336943) rotate(90, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z"></path><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11"></line><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-c05d9b90" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.4864541464745629 1.4864541464745629) translate(837.450205144662, 814.0250280754217) rotate(0, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z"></path><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11"></line><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-3f5eb467" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.2747213748161301 1.2747213748161301) translate(488.27584866054275, 950.9428270337767) rotate(0, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z"></path><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11"></line><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-08af485f" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.3382506781008123 1.3382506781008123) translate(343.1305784281881, 352.8878686323562) rotate(0, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z"></path><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11"></line><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area"></rect></g><g id="bg-2eeacc59" class="hi-bg-element" data-bg-type="sliding-door" data-bg-edit-type="icon" data-bg-layer="260" transform="scale(1.1976257380148745 1.1976257380148745) translate(1252.0237631623106, 405.2268639552499) rotate(0, 0, 0)"><path class="sliding-doors" d="M 0,0 L 120,0 L 120,9 L 0,9 Z"></path><line class="sliding-doors-center" x1="60" y1="-2" x2="60" y2="11"></line><rect x="0" y="0" width="120" height="9" fill="transparent" class="hi-bg-hit-area"></rect></g></g></svg>diff --git a/src/hi/environment/server.py b/src/hi/environment/server.pyindex fee6efa6..a4f4891a 100644--- a/src/hi/environment/server.py+++ b/src/hi/environment/server.py@@ -1,6 +1,7 @@from dataclasses import dataclass, fieldimport osimport re+import sysfrom typing import Tupleimport urllib.parse@@ -125,7 +126,10 @@ class EnvironmentSettings:env_settings.REDIS_HOST,)try:- env_settings.REDIS_PORT = int( cls.get_env_variable('HI_REDIS_PORT') )+ env_settings.REDIS_PORT = int( cls.get_env_variable(+ 'HI_REDIS_PORT',+ env_settings.REDIS_PORT,+ ))except ( TypeError, ValueError ):pass@@ -191,7 +195,8 @@ class EnvironmentSettings:extra_host_urls_str = cls.get_env_variable( 'HI_EXTRA_HOST_URLS', '' )if extra_host_urls_str:- host_url_tuple_list = cls.parse_url_list_str( extra_host_urls_str )+ host_url_tuple_list = cls.parse_url_list_str(+ extra_host_urls_str, source_var = 'HI_EXTRA_HOST_URLS' )# Assume first extra host is the SITE_DOMAIN, but this does not# matter until the Django "sites" feature needs to be used (if@@ -207,7 +212,8 @@ class EnvironmentSettings:extra_csp_urls_str = cls.get_env_variable( 'HI_EXTRA_CSP_URLS', '' )if extra_csp_urls_str:- host_url_tuple_list = cls.parse_url_list_str( extra_csp_urls_str )+ host_url_tuple_list = cls.parse_url_list_str(+ extra_csp_urls_str, source_var = 'HI_EXTRA_CSP_URLS' )for host, url in host_url_tuple_list:cors_allowed_origins_list.append( url )continue@@ -246,29 +252,42 @@ class EnvironmentSettings:return valueif isinstance( value, str ):truthy_values = {'true', '1', 'on', 'yes', 'y', 't', 'enabled'}- if isinstance( value, str ):- return value.strip().lower() in truthy_values- return False+ return value.strip().lower() in truthy_valuesreturn bool( value )@classmethod- def parse_url_list_str( cls, a_string : str ):+ def parse_url_list_str( cls, a_string : str, source_var : str = 'HI_EXTRA_HOST_URLS' ):url_str_list = re.split( r'[\s\;\,]+', a_string )host_url_tuple_list = list()for url_str in url_str_list:+ if not url_str:+ continuetry:parsed_url = cls.parse_url( url_str )scheme = parsed_url.schemehost = parsed_url.hostnameport = parsed_url.portif port:- normalized_url_str = f'{scheme}://{host}:{port}'+ normalized_url_str = f'{scheme}://{host}:{port}'else:normalized_url_str = f'{scheme}://{host}'host_url_tuple_list.append( ( host, normalized_url_str ) )except ( TypeError, ValueError ):- pass+ # Loud, actionable feedback rather than a silent drop. Without+ # this, a bare hostname (exactly what Django's DisallowedHost+ # error tells users to add) is discarded with no signal. This+ # runs during settings construction, before Django logging is+ # configured, so write to stderr — it surfaces in `docker logs`+ # / compose output at startup, where the user is already looking.+ # The example is fixed (not built from the bad input, which+ # could produce a nonsense suggestion).+ print(+ f"WARNING: {source_var} value '{url_str}' was ignored — entries "+ f"must be full URLs including the scheme and the port you browse "+ f"to, e.g. 'http://myhost:9411'. See Installation.md.",+ file = sys.stderr,+ )continuereturn host_url_tuple_listdiff --git a/src/hi/environment/tests/test_server.py b/src/hi/environment/tests/test_server.pynew file mode 100644index 00000000..07effa88--- /dev/null+++ b/src/hi/environment/tests/test_server.py@@ -0,0 +1,261 @@+import io+import os+from contextlib import redirect_stderr+from unittest.mock import patch++from django.core.exceptions import ImproperlyConfigured++from hi.environment.server import EnvironmentSettings+from hi.testing.base_test_case import BaseTestCase+++def base_env():+ """A complete set of the env vars EnvironmentSettings.get() requires, so a+ test can copy it and tweak one thing at a time. (Required = a field whose+ default is None.)"""+ return {+ 'DJANGO_SETTINGS_MODULE': 'hi.settings.local',+ 'DJANGO_SECRET_KEY': 'test-secret-key',+ 'DJANGO_SUPERUSER_EMAIL': '[email protected]',+ 'DJANGO_SUPERUSER_PASSWORD': 'test-password',+ 'HI_DB_PATH': '/data/database',+ 'HI_MEDIA_PATH': '/data/media',+ }+++class GetEnvVariableTestCase(BaseTestCase):++ def test_returns_value_when_set(self):+ with patch.dict(os.environ, {'HI_TEST_VAR': 'value'}, clear=True):+ self.assertEqual(EnvironmentSettings.get_env_variable('HI_TEST_VAR'), 'value')++ def test_returns_default_when_unset(self):+ with patch.dict(os.environ, {}, clear=True):+ self.assertEqual(+ EnvironmentSettings.get_env_variable('HI_MISSING', 'fallback'), 'fallback')++ def test_empty_string_default_is_returned_not_treated_as_required(self):+ # '' is a valid (optional) default; only None means "required".+ with patch.dict(os.environ, {}, clear=True):+ self.assertEqual(EnvironmentSettings.get_env_variable('HI_MISSING', ''), '')++ def test_raises_when_unset_and_no_default(self):+ with patch.dict(os.environ, {}, clear=True):+ with self.assertRaises(ImproperlyConfigured):+ EnvironmentSettings.get_env_variable('HI_REQUIRED')+++class ToBoolTestCase(BaseTestCase):++ def test_bool_passthrough(self):+ self.assertIs(EnvironmentSettings.to_bool(True), True)+ self.assertIs(EnvironmentSettings.to_bool(False), False)++ def test_truthy_strings(self):+ for value in ['true', 'TRUE', '1', 'on', 'yes', 'y', 't', 'enabled', ' Yes ']:+ self.assertTrue(EnvironmentSettings.to_bool(value), value)++ def test_falsey_strings(self):+ for value in ['false', '0', 'no', 'off', '', 'random']:+ self.assertFalse(EnvironmentSettings.to_bool(value), value)++ def test_non_string_non_bool_uses_bool_builtin(self):+ self.assertTrue(EnvironmentSettings.to_bool(1))+ self.assertFalse(EnvironmentSettings.to_bool(0))+ self.assertFalse(EnvironmentSettings.to_bool(None))+++class ParseUrlTestCase(BaseTestCase):++ def test_valid_url_returns_parse_result(self):+ result = EnvironmentSettings.parse_url('http://myhost:9411')+ self.assertEqual(result.scheme, 'http')+ self.assertEqual(result.hostname, 'myhost')+ self.assertEqual(result.port, 9411)++ def test_non_http_scheme_is_accepted(self):+ # parse_url only requires scheme + netloc, not a specific scheme.+ result = EnvironmentSettings.parse_url('https://myhost')+ self.assertEqual(result.scheme, 'https')++ def test_empty_string_raises(self):+ with self.assertRaises(ValueError):+ EnvironmentSettings.parse_url('')++ def test_none_raises_valueerror(self):+ with self.assertRaises(ValueError):+ EnvironmentSettings.parse_url(None)++ def test_missing_scheme_raises(self):+ with self.assertRaises(ValueError):+ EnvironmentSettings.parse_url('myhost:9411')++ def test_missing_netloc_raises(self):+ with self.assertRaises(ValueError):+ EnvironmentSettings.parse_url('http://')+++class EnvironmentNameTestCase(BaseTestCase):++ def test_dotted_module_returns_last_segment(self):+ env = EnvironmentSettings(DJANGO_SETTINGS_MODULE='hi.settings.local')+ self.assertEqual(env.environment_name, 'local')++ def test_none_module_returns_unknown(self):+ env = EnvironmentSettings(DJANGO_SETTINGS_MODULE=None)+ self.assertEqual(env.environment_name, 'unknown')++ def test_single_segment_module_returns_unknown(self):+ env = EnvironmentSettings(DJANGO_SETTINGS_MODULE='local')+ self.assertEqual(env.environment_name, 'unknown')+++class ParseUrlListStrTestCase(BaseTestCase):+ """parse_url_list_str feeds ALLOWED_HOSTS and CORS/CSP origins from+ HI_EXTRA_HOST_URLS / HI_EXTRA_CSP_URLS. Entries must be full URLs; a value+ that isn't a parseable URL (e.g. a bare hostname, which is what Django's+ DisallowedHost error misleadingly tells users to add) is dropped, but with+ a loud stderr warning instead of silently."""++ def test_full_url_parsed_to_host_and_normalized_url(self):+ result = EnvironmentSettings.parse_url_list_str('http://myhost:9411')+ self.assertEqual(result, [('myhost', 'http://myhost:9411')])++ def test_url_without_port_normalized_without_port(self):+ result = EnvironmentSettings.parse_url_list_str('http://myhost')+ self.assertEqual(result, [('myhost', 'http://myhost')])++ def test_multiple_urls_split_on_space_comma_semicolon(self):+ result = EnvironmentSettings.parse_url_list_str(+ 'http://a:9411, http://b:9411; http://c:9411')+ self.assertEqual(+ result,+ [('a', 'http://a:9411'), ('b', 'http://b:9411'), ('c', 'http://c:9411')],+ )++ def test_bare_hostname_ignored_with_actionable_stderr_warning(self):+ err = io.StringIO()+ with redirect_stderr(err):+ result = EnvironmentSettings.parse_url_list_str(+ 'cassandra', source_var='HI_EXTRA_HOST_URLS')+ self.assertEqual(result, [])+ warning = err.getvalue()+ self.assertIn('HI_EXTRA_HOST_URLS', warning) # names the source variable+ self.assertIn("'cassandra'", warning) # names the ignored value+ self.assertIn('http://myhost:9411', warning) # fixed, valid example++ def test_warning_example_is_fixed_not_built_from_bad_input(self):+ # A token with a port but no scheme is invalid; the suggestion must not+ # be assembled from it (which would yield 'http://cassandra:9411:9411').+ err = io.StringIO()+ with redirect_stderr(err):+ EnvironmentSettings.parse_url_list_str('cassandra:9411')+ warning = err.getvalue()+ self.assertIn('http://myhost:9411', warning)+ self.assertNotIn('http://cassandra:9411:9411', warning)++ def test_mixed_input_keeps_valid_and_warns_only_invalid(self):+ err = io.StringIO()+ with redirect_stderr(err):+ result = EnvironmentSettings.parse_url_list_str(+ 'cassandra http://good:9411', source_var='HI_EXTRA_CSP_URLS')+ self.assertEqual(result, [('good', 'http://good:9411')])+ warning = err.getvalue()+ self.assertIn("'cassandra'", warning)+ self.assertIn('HI_EXTRA_CSP_URLS', warning)+ self.assertNotIn("'good'", warning)++ def test_empty_or_whitespace_yields_nothing_without_warning(self):+ err = io.StringIO()+ with redirect_stderr(err):+ result = EnvironmentSettings.parse_url_list_str(' ;, ')+ self.assertEqual(result, [])+ self.assertEqual(err.getvalue(), '')+++class EnvironmentSettingsGetTestCase(BaseTestCase):+ """End-to-end construction of EnvironmentSettings from the process+ environment via get()."""++ def _get_with(self, **overrides):+ env = base_env()+ env.update({k: v for k, v in overrides.items() if v is not None})+ for k, v in overrides.items():+ if v is None:+ env.pop(k, None)+ with patch.dict(os.environ, env, clear=True):+ return EnvironmentSettings.get()++ def test_minimal_valid_environment_populates_core_fields(self):+ env = self._get_with()+ self.assertEqual(env.DJANGO_SETTINGS_MODULE, 'hi.settings.local')+ self.assertEqual(env.SECRET_KEY, 'test-secret-key')+ self.assertEqual(env.DATABASES_NAME_PATH, '/data/database')+ self.assertEqual(env.MEDIA_ROOT, '/data/media')+ # VERSION is read from the HI_VERSION file (not the 'unknown' default).+ self.assertTrue(env.VERSION)+ self.assertNotEqual(env.VERSION, 'unknown')++ def test_missing_required_var_raises(self):+ for required in ['DJANGO_SETTINGS_MODULE', 'DJANGO_SECRET_KEY',+ 'DJANGO_SUPERUSER_EMAIL', 'HI_DB_PATH', 'HI_MEDIA_PATH']:+ with self.assertRaises(ImproperlyConfigured, msg=required):+ self._get_with(**{required: None})++ def test_loopback_host_and_cors_defaults_always_present(self):+ env = self._get_with()+ self.assertEqual(env.ALLOWED_HOSTS, ('127.0.0.1', 'localhost'))+ self.assertEqual(+ env.CORS_ALLOWED_ORIGINS,+ ('http://127.0.0.1:8000', 'http://localhost:8000'),+ )+ self.assertEqual(env.SITE_DOMAIN, 'localhost')++ def test_server_port_overrides_cors_default_port(self):+ env = self._get_with(DJANGO_SERVER_PORT='9999')+ self.assertEqual(env.DJANGO_SERVER_PORT, 9999)+ self.assertIn('http://localhost:9999', env.CORS_ALLOWED_ORIGINS)++ def test_invalid_server_port_falls_back_to_default(self):+ env = self._get_with(DJANGO_SERVER_PORT='not-a-number')+ self.assertEqual(env.DJANGO_SERVER_PORT, 8000)++ def test_redis_port_defaults_when_unset(self):+ # HI_REDIS_PORT is optional: absent -> the 6379 field default.+ env = self._get_with()+ self.assertEqual(env.REDIS_PORT, 6379)++ def test_redis_port_from_environment(self):+ env = self._get_with(HI_REDIS_PORT='6400')+ self.assertEqual(env.REDIS_PORT, 6400)++ def test_invalid_redis_port_falls_back_to_default(self):+ env = self._get_with(HI_REDIS_PORT='not-a-number')+ self.assertEqual(env.REDIS_PORT, 6379)++ def test_extra_host_urls_extend_allowed_hosts_cors_and_site_domain(self):+ env = self._get_with(HI_EXTRA_HOST_URLS='http://myhost:9411 http://other:9411')+ self.assertIn('myhost', env.ALLOWED_HOSTS)+ self.assertIn('other', env.ALLOWED_HOSTS)+ self.assertIn('http://myhost:9411', env.CORS_ALLOWED_ORIGINS)+ # First extra host becomes SITE_DOMAIN.+ self.assertEqual(env.SITE_DOMAIN, 'myhost')++ def test_extra_csp_urls_extend_cors_but_not_allowed_hosts(self):+ env = self._get_with(HI_EXTRA_CSP_URLS='http://csponly:9411')+ self.assertIn('http://csponly:9411', env.CORS_ALLOWED_ORIGINS)+ self.assertNotIn('csponly', env.ALLOWED_HOSTS)++ def test_email_use_tls_forces_ssl_off(self):+ env = self._get_with(HI_EMAIL_USE_TLS='true', HI_EMAIL_USE_SSL='true')+ self.assertTrue(env.EMAIL_USE_TLS)+ self.assertFalse(env.EMAIL_USE_SSL)++ def test_email_use_ssl_honored_when_tls_off(self):+ env = self._get_with(HI_EMAIL_USE_TLS='false', HI_EMAIL_USE_SSL='true')+ self.assertFalse(env.EMAIL_USE_TLS)+ self.assertTrue(env.EMAIL_USE_SSL)++ def test_suppress_authentication_parsed_as_bool(self):+ self.assertFalse(self._get_with(HI_SUPPRESS_AUTHENTICATION='false').SUPPRESS_AUTHENTICATION)+ self.assertTrue(self._get_with(HI_SUPPRESS_AUTHENTICATION='yes').SUPPRESS_AUTHENTICATION)diff --git a/update.sh b/update.shindex f93260af..a333e65b 100755--- a/update.sh+++ b/update.sh@@ -10,7 +10,15 @@ DOCKER_IMAGE="ghcr.io/cassandra/home-information"DOCKER_TAG="${1:-latest}" # Allow override for testing (default: latest)CONTAINER_NAME="hi"EXTERNAL_PORT="9411"-HI_HOME="${HOME}/.hi"+# Resolve the existing install directory. install.sh uses the hidden ~/.hi by+# default, but falls back to a non-hidden ~/home-information when Docker cannot+# read dot-directories (e.g. snap Docker). Detect by the install's env file+# (what this updater actually needs) rather than a bare directory.+if [[ -f "${HOME}/home-information/env/local.env" ]]; then+ HI_HOME="${HOME}/home-information"+else+ HI_HOME="${HOME}/.hi"+fiENV_FILE="${HI_HOME}/env/local.env"DATABASE_DIR="${HI_HOME}/database"MEDIA_DIR="${HI_HOME}/media"