-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.SHELLFLAGS += -x -e | ||
.ONESHELL: | ||
PY_SOURCES = custom_components scripts | ||
HASS_VERSION = $(shell pip freeze | grep \^homeassistant | sed 's/==/\n/g' | tail -n 1) | ||
COMPOSE_ARGS = -f scripts/docker-compose.yml -p hass-auth-header | ||
|
||
all: lint-fix lint | ||
|
||
lint-fix: | ||
isort $(PY_SOURCES) | ||
black $(PY_SOURCES) | ||
ruff $(PY_SOURCES) | ||
|
||
lint: | ||
pylint $(PY_SOURCES) | ||
|
||
test-env-start: | ||
VERSION=${HASS_VERSION} docker-compose $(COMPOSE_ARGS) up -d | ||
|
||
test-env-stop: | ||
VERSION=${HASS_VERSION} docker compose $(COMPOSE_ARGS) down | ||
|
||
test-env-remove: | ||
VERSION=${HASS_VERSION} docker compose $(COMPOSE_ARGS) down -v | ||
|
||
hass-restart: | ||
docker-compose $(COMPOSE_ARGS) exec homeassistant killall -HUP python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# yaml-language-server: $schema=https://goauthentik.io/blueprints/schema.json | ||
version: 1 | ||
metadata: | ||
name: hass-auth-header - Testing setup | ||
context: | ||
# Needs to be changed if the test setup is completely in docker | ||
internal_host: http://localhost:8123 | ||
entries: | ||
- model: authentik_providers_proxy.proxyprovider | ||
id: provider | ||
identifiers: | ||
name: hass-auth-header | ||
attrs: | ||
authorization_flow: !Find [authentik_flows.flow, [slug, default-provider-authorization-implicit-consent]] | ||
mode: proxy | ||
internal_host: !Context internal_host | ||
external_host: http://hass-auth-header.127.0.0.1.nip.io:9000 | ||
- model: authentik_core.application | ||
identifiers: | ||
slug: hass-auth-header | ||
attrs: | ||
name: Homeassistant | ||
provider: !KeyOf provider | ||
- model: authentik_outposts.outpost | ||
identifiers: | ||
managed: goauthentik.io/outposts/embedded | ||
attrs: | ||
providers: | ||
- !KeyOf provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3' | ||
services: | ||
homeassistant: | ||
image: "ghcr.io/home-assistant/home-assistant:${VERSION}" | ||
volumes: | ||
- temp_config:/config | ||
- ../custom_components:/config/custom_components | ||
- ./fixed_config/configuration.yaml:/config/configuration.yaml | ||
- /etc/localtime:/etc/localtime:ro | ||
restart: unless-stopped | ||
ports: | ||
- 8123:8123 | ||
|
||
volumes: | ||
temp_config: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Loads default set of integrations. Do not remove. | ||
default_config: | ||
|
||
http: | ||
use_x_forwarded_for: true | ||
trusted_proxies: | ||
- 0.0.0.0/0 | ||
auth_header: | ||
username_header: X-authentik-username | ||
|
||
logger: | ||
default: info | ||
logs: | ||
custom_components.auth_header: debug |