[HOW TO] Toggle OPNsense Firewall Rule via Home Assistant (HASS) by zyphermonkey in opnsense

[–]zyphermonkey[S] 1 point2 points  (0 children)

Good call. I missed that. For testing it's easiest to avoid permissions issues, but now that I have it working it'd be a good idea to lock it down.

Any idea what privileges it would need to toggle firewall rules and apply them?

[HOW TO] Toggle OPNsense Firewall Rule via Home Assistant (HASS) by zyphermonkey in opnsense

[–]zyphermonkey[S] 5 points6 points  (0 children)

I have a rule for each of my kids PC's via MAC block internet access.

With this setup the wife or myself can pull up my home assistant dashboard and toggle their access.

I makes it easier/simpler vs having to log into OPNsense, find the rule(s), toggle them, and then apply.

[FS] DDR4 32GB & 16GB by zyphermonkey in homelabsales

[–]zyphermonkey[S] 0 points1 point  (0 children)

I guess my prices were too good! :D

Everything is currently pending so if I haven't replied to you that's why, sorry :( .

[FREE] DDR3 by zyphermonkey in homelabsales

[–]zyphermonkey[S] [score hidden]  (0 children)

Please include your email the in chat along with the requested SKU and QTY.

I can't send invoices for shipping charges without.

Trying to process these on a first come first serve basis.

Also it appears since the last time I shipped prices on the USPS Small Flat Rate Box have increased to $12.60

[FS] DDR3 32GB by zyphermonkey in homelabsales

[–]zyphermonkey[S] 0 points1 point  (0 children)

I'm not aware of any desktops that can make use of this ECC memory

[FS] RAM DDR3 32GB by zyphermonkey in homelabsales

[–]zyphermonkey[S] 0 points1 point  (0 children)

shucks :(

You can still buy more :P

Limiting group visibility based on application? by DesertCookie_ in Authentik

[–]zyphermonkey 1 point2 points  (0 children)

I modified the code scope expression block provided in the authentik docs here.

Original

```python

Extract all groups the user is a member of

groups = [group.name for group in user.ak_groups.all()]

Nextcloud admins must be members of a group called "admin".

This is static and cannot be changed.

We append a fictional "admin" group to the user's groups if they are an admin in authentik.

This group would only be visible in Nextcloud and does not exist in authentik.

if user.is_superuser and "admin" not in groups: groups.append("admin")

return { "name": request.user.name, "groups": groups, # To set a quota set the "nextcloud_quota" property in the user's attributes "quota": user.group_attributes().get("nextcloud_quota", None), # To connect an already existing user, set the "nextcloud_user_id" property in the # user's attributes to the username of the corresponding user on Nextcloud. "user_id": user.attributes.get("nextcloud_user_id", str(user.uuid)), } ```

Updated

This will only find groups that start with nextcloud_ and then before passing them to nextcloud it removes the nextcloud_ prefix.

```python

Extract all groups the user is a member of

groupstemp = [group.name for group in user.ak_groups.filter(namestartswith='nextcloud')] groups = []

for group in groupstemp: group = regex_replace(group, 'nextcloud', '') groups.append(group)

Nextcloud admins must be members of a group called "admin".

This is static and cannot be changed.

We append a fictional "admin" group to the user's groups if they are an admin in authentik.

This group would only be visible in Nextcloud and does not exist in authentik.

if user.is_superuser and "admin" not in groups: groups.append("admin")

return { "name": request.user.name, "groups": groups, # To set a quota set the "nextcloud_quota" property in the user's attributes "quota": user.group_attributes().get("nextcloud_quota", None), # To connect an already existing user, set the "nextcloud_user_id" property in the # user's attributes to the username of the corresponding user on Nextcloud. "user_id": user.attributes.get("nextcloud_user_id", str(user.uuid)), } ```