Skip to content

Commit

Permalink
Set timeout, add default motd, add docker proxy to readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
ways committed Oct 22, 2024
1 parent 98428a5 commit 9343c27
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.vscode/
deny.txt
motd.txt
useragent.txt
data/

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ Or:
* Start redis: `docker run -it --rm --network host redis`
* Start fingr.py

If you don't see real IPs in the log, you may need to set this in /etc/docker/daemon.json:

{
"userland-proxy": false
}

## Testing

- create a venv and install tox
Expand All @@ -77,5 +83,7 @@ See legacy.txt for the transition from pyyrascii to this.

## TODO

* Return error when no location found.
* Merge read_denylist, read_motdlist.
* Set default dirs for configs.
* Mount configs in docker compose file.
2 changes: 1 addition & 1 deletion fingr.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def service_usage():
motdlist = read_motdlist()
user_agent = read_useragent()
r = None # redis.Redis()
geolocator = Nominatim(user_agent=user_agent)
geolocator = Nominatim(user_agent=user_agent, timeout=3)
timezone_finder = timezonefinder.TimezoneFinder()

if __name__ == "__main__":
Expand Down
2 changes: 2 additions & 0 deletions motd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Message to show below forecast. One per line.
Weather forecast from yr.no, delivered by the Norwegian Meteorological Institute and the NRK.

0 comments on commit 9343c27

Please sign in to comment.