add readme gitignore and update at.cfg.dist

master^2
vuko 2020-06-13 12:07:58 +02:00
parent de59a1eb03
commit bc53e2fe6b
4 changed files with 52 additions and 6 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
at.cfg
at.db
*.egg-info
venv

32
README.rst Normal file
View File

@ -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.

View File

@ -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

5
run.py Normal file
View File

@ -0,0 +1,5 @@
"""Entry point for running flask application"""
import at.web
from pathlib import Path
app = at.web.app(Path(__file__).parent)