diff options
author | vuko <vuko@hackerspace.pl> | 2020-06-13 12:07:58 +0200 |
---|---|---|
committer | vuko <vuko@hackerspace.pl> | 2020-06-13 12:07:58 +0200 |
commit | bc53e2fe6b20e8d6642c369ceec819b7c7221e3a (patch) | |
tree | 0e9c177cb432a91549b636254062aeca2adc8c48 | |
parent | de59a1eb03c24a04a18be38bb4ef025cd7e3d4e7 (diff) | |
download | checkinator-bc53e2fe6b20e8d6642c369ceec819b7c7221e3a.tar.gz checkinator-bc53e2fe6b20e8d6642c369ceec819b7c7221e3a.tar.bz2 checkinator-bc53e2fe6b20e8d6642c369ceec819b7c7221e3a.zip |
add readme gitignore and update at.cfg.dist
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | README.rst | 32 | ||||
-rw-r--r-- | at.cfg.dist | 17 | ||||
-rw-r--r-- | run.py | 5 |
4 files changed, 52 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f2e0f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +at.cfg +at.db +*.egg-info +venv diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..28e4f8b --- /dev/null +++ b/README.rst @@ -0,0 +1,32 @@ +`Warsaw Hackerspace`_ presence tracker hosted on https://at.hackersapce.pl. It +uses dhcpd.leases file to track MAC adressess of devices connected to hs LAN +network. + +.. _Warsaw Hackerspace: https://hackerspace.pl + +Setup +----- +.. code:: bash + + cp at.cfg.dist at.dist + + # edit config file using your favourite editor + $EDITOR at.cfg + + # create new database file (or copy existing one) + sqlite3 at.db < dbsetup.sql + + # create python virtual environment + python3 -m venv vevnv + ./venv/bin/python3 -m pip install -r requirements + ./venv/bin/python3 -m pip install gunicorn + +Running +------- +.. code:: bash + + ./venv/bin/gunicorn run:app + +When running on OpenBSD make sure to pass '--no-sendfile' argument to gunicorn +command. This will prevent AttributeError on os.sendfile that seems to be +missing in this marvelous OS-es python3 stdlib. diff --git a/at.cfg.dist b/at.cfg.dist index b2e0720..3f32ce2 100644 --- a/at.cfg.dist +++ b/at.cfg.dist @@ -1,21 +1,26 @@ DB = './at.db' +DEBUG = False CAP_FILE = './dhcp-cap' LEASE_FILE = './dhcpd.leases' LEASE_OFFSET = -60 * 60 TIMEOUT = 1500 -WIKI_URL = 'http://hackerspace.pl/wiki/doku.php?id=people:%(login)s:start' +WIKI_URL = 'https://wiki.hackerspace.pl/people:%(login)s:start' -CLAIMABLE_PREFIX = '10.8.0.' #'192.168.1.' +CLAIMABLE_PREFIX = '10.8.0.' CLAIMABLE_EXCLUDE = [ -# '127.0.0.1', + # '127.0.0.1', ] +SECRET_KEY = 'CHANGEME' + +SPACEAUTH_CONSUMER_KEY = 'checkinator' +SPACEAUTH_CONSUMER_SECRET = 'CHANGEME' + SPECIAL_DEVICES = { 'kektops': ('90:e6:ba:84'), - 'esps': ('ec:fa:bc', 'dc:4f:22', 'd8:a0:1d', 'b4:e6:2d', 'ac:d0:74', 'a4:7b:9d', 'a0:20:a6', '90:97:d5', '68:c6:3a', '60:01:94', '5c:cf:7f', '54:5a:a6', '30:ae:a4', '2c:3a:e8', '24:b2:de', '24:0a:c4', '18:fe:34'), + 'esps': ('ec:fa:bc', 'dc:4f:22', 'd8:a0:1d', 'b4:e6:2d', 'ac:d0:74', 'a4:7b:9d', 'a0:20:a6', '90:97:d5', '68:c6:3a', '60:01:94', '5c:cf:7f', '54:5a:a6', '30:ae:a4', '2c:3a:e8', '24:b2:de', '24:0a:c4', '18:fe:34', '38:2b:78', 'bc:dd:c2:'), + 'vms': ('52:54:00'), # craptrap VMs } -SECRET_KEY = 'adaba' - PROXY_FIX = False @@ -0,0 +1,5 @@ +"""Entry point for running flask application""" + +import at.web +from pathlib import Path +app = at.web.app(Path(__file__).parent) |