Ip_bans.yaml documentation?

How can I manually add IP addresses to my ip-bans.yaml file?
Is there documentation with examples some where?

I don’t know if there’s any documentation, but the file is in your config folder, you can just add it in the format (random IP added here):

43.51.129.33:
  banned_at: '2024-05-14T13:12:33.481381+00:00'

I know this may come across as a bit crass but just search the documents.

Not crass at all, I have been writing software and code most of my adult life… but I find Yaml rather frustrating. More of trial and error than actually knowing what I’m doing

So I can just make a list?

There is no other yaml characters needed? no dashes? no indent requirements?

The first time I tried that HA log thew an error that my ip_bans.yaml file lacked a “dictionary”

Is it like this
23.94.107.14:
banned_at: “2022-07-10T12:05:45.381696+00:00”
111.7.96.166:
banned_at: “2024-04-10T12:05:45.381697+00:00”
147.135.244.204:
banned_at: “2024-04-10T12:05:45.381698+00:00”

Or is it like this
-23.94.107.14:
banned_at: “2022-07-10T12:05:45.381696+00:00”
-111.7.96.166:
banned_at: “2024-04-10T12:05:45.381697+00:00”
-147.135.244.204:
banned_at: “2024-04-10T12:05:45.381698+00:00”

this is a list

- a:
   ...
- b:
   ...

This is a map (dictionary)

a:
  ...
b:
  ...

The dashes indicate the start of a new item in a list. The lack of a dash means it’s not a list.

So you can just add to the dictionary:

23.94.107.14:
  banned_at: “2022-07-10T12:05:45.381696+00:00”
111.7.96.166:
  banned_at: “2024-04-10T12:05:45.381697+00:00”
147.135.244.204:
  banned_at: “2024-04-10T12:05:45.381698+00:00”
2 Likes