Files
Tony C 440010f78d Fix Redis test isolation — tests no longer modify real Redis state (Issue #269) (#272)
* Isolate tests from real Redis via custom test runner

Tests were modifying real Redis state used by the development server —
the direct StrictRedis client hit real Redis and weather tests called
cache.clear() which executed FLUSHDB. This caused side effects like
unwanted console auto-locking after running the test suite.

Add HiTestRunner (configured via TEST_RUNNER in settings) that runs
once before any test class and:
- Replaces the global Redis client with fakeredis (in-memory Redis
  implementation) so no direct Redis calls reach real Redis
- Overrides Django CACHES to LocMemCache so cache.clear() only
  clears in-memory state

This catches ALL test classes regardless of base class (BaseTestCase,
TransactionTestCase, unittest.TestCase, etc.) since the runner
executes before any test is instantiated.

Also fix bug in clear_redis_client() referencing undefined variable.

* Remove unused REDIS_KEY_PREFIX setting

REDIS_KEY_PREFIX was only used in Django's CACHES KEY_PREFIX but was
always empty — providing no actual isolation. The direct StrictRedis
client never used it, so it gave a false sense of namespace separation.
The HI_REDIS_KEY_PREFIX env var and unRAID config entry are also
removed. The hardcoded 'main:' prefix in KEY_PREFIX is retained to
separate Django cache keys from direct Redis keys.
2026-04-14 14:53:05 -05:00
..

Unraid Installation Guide

Home Information is available as a Community App for Unraid systems.

  1. Install Community Applications Plugin (if not already installed):

    • Go to Apps tab in Unraid
    • Install "Community Applications" by squid
  2. Search for Home Information:

    • Apps tab → Search for "Home Information"
    • Click "Install"
  3. Configure Settings:

    • IMPORTANT: Change the Django Secret Key to a random string
    • IMPORTANT: Change the admin password from default
    • Adjust port if 9411 conflicts with other services
    • Review storage paths (defaults are fine for most users)
  4. Access: http://YOUR-UNRAID-IP:9411

Manual Installation

If the app isn't in Community Apps yet, you can install manually:

  1. Apps tabPrevious AppsAdd Container
  2. Template URL: https://raw.githubusercontent.com/cassandra/home-information/master/unraid/home-information.xml
  3. Click Add Container
  4. Configure settings as above

Configuration Details

Required Settings

  • Django Secret Key: Generate a random 50-character string for security
  • Admin Password: Change from default for security

Storage Paths

  • Database: /mnt/user/appdata/home-information/database (SQLite database)
  • Media: /mnt/user/appdata/home-information/media (uploaded files)
  • Config: /mnt/user/appdata/home-information/env (optional environment files)

Network Settings

  • Port: 9411 (default, change if needed)
  • Network: Bridge mode (recommended)

Integrations

Home Assistant

If you're running Home Assistant on Unraid:

  1. Note your Home Assistant URL (e.g., http://192.168.1.100:8123)
  2. In Home Information, go to Settings → Integrations
  3. Add Home Assistant integration with your URL and access token

ZoneMinder

If you're running ZoneMinder on Unraid:

  1. Note your ZoneMinder URL (e.g., http://192.168.1.100:8080/zm)
  2. In Home Information, go to Settings → Integrations
  3. Add ZoneMinder integration with your URL and credentials

Troubleshooting

Container Won't Start

  • Check Unraid logs: docker logs home-information
  • Ensure storage paths are writable
  • Verify no port conflicts

Can't Access WebUI

  • Check container is running
  • Verify port mapping (default 9411)
  • Check firewall settings

Authentication Issues

  • Default: Authentication is disabled for local network use
  • To enable: Set HI_SUPPRESS_AUTHENTICATION to false

Security Notes

  • Local Network Only: By default, authentication is disabled for convenience on local networks
  • Change Defaults: Always change the Django secret key and admin password
  • Firewall: Don't expose port 9411 to the internet without proper authentication

Support