Skip to content

Commit

Permalink
sphinx changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stargo committed Sep 12, 2024
1 parent 83f5d42 commit 862af79
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ rich = "*"
django-debug-toolbar = "*"

[requires]
python_version = "3"
python_version = "3.8"
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Wichtiges zur Nutzung

./set-secrets.sh löscht secrets an lustigen Stellen - NICHT in einem schon konfigurierten Umfeld nutzen, sonst ist alles kaputt:

* Türenzugangsdaten werden in der mosquitto.passwd gelöscht


# Alte "Readme"


1. Add the hostname
1. in settings.py to ALLOWED_HOSTS
2. in nginx.conf to server_name
Expand Down
1 change: 1 addition & 0 deletions opa/policy/physical_access.rego
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ door_role_mapping = {
"2AB91A7B-26D5-4429-A2B8-9EE1C4DC1FC3" : ["MayOpenFrontDoor"],
"ED9AE67F-0779-4248-AE46-0167791A73AF" : ["MayOpenNordUG"],
"C840743E-F562-4DAC-8AEE-0622F000DCCF" : ["MayOpenNordEG"],
"b44db1f1-1acd-4997-819a-5634f6bc4481" : ["MayOpenNordEG"],
}

allow_member_open {
Expand Down
4 changes: 4 additions & 0 deletions set-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
set -euf -o pipefail
# set -x


echo "Falls du das wirklich machen willst, dann kommentier nachfolgende Zeile aus!"
exit 1

# stop and remove all containers, otherwise we can't pass the new parameters as environment variables
docker-compose down

Expand Down
13 changes: 8 additions & 5 deletions src/clientipaddress/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ def update_ip(self, locator_id, *, client, userdata, message: MQTTMessage):
# door_id, = unpack_topic("door/+/presence", message.topic)

ips = parsed_payload["ip_addresses"]
parsed_ip_networks = [ip_network(ip, strict=False) for ip in ips]
parsed_ip_networks = []
for ip in ips:
try:
parsed_ip_networks.append(ip_network(ip, strict=False))
except:
log.error("Failed to parse zam ip, thus ignoring entry: "+repr(ip))
self._ip_networks[locator_id] = parsed_ip_networks

# ic(self._ip_networks)
except:
log.error("Failed to parse door presence message.")
except Exception as e:
log.error("Failed to parse door presence message: "+repr(e))

def open(self, mqtt_id, timeout: Number):
payload = dict(not_after=timeout)
Expand Down
1 change: 1 addition & 0 deletions src/jinja-templates/web_homepage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ <h2>Hallo, {{ request.user.display_name }}!</h2>
{% endif %}
<div>
{% for door in doors %}
{# <!-- {{ door.display_name }} - doorid: {{door.id}}, doormqttid: {{door.mqtt_id}} --> #}
{% if can_open_doors[door] %}
<form action="{{ url("open", kwargs=dict(door_id=door.id)) }}" method="post">
{{ csrf_input }}
Expand Down

0 comments on commit 862af79

Please sign in to comment.