User Guide¶
Configuration¶
Configurations for both the web application and deamon and stored in a standard ini style file, passed to the program on execution.
A full detailed list of all the available configuration is shown below
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | # Lan Auth options
# Webserver options:
# host: The address to bind to (To accecpt from all hosts use: 0.0.0.0)
# port: The port to listen on
# debug: Run in Flasks debug mode
#
[flask]
host = 0.0.0.0
port = 8080
secret_key = secret
debug = true
# Database connection settings:
# driver: SQLalchemy driver: http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html
# host: The IP or hostname of the database host
# database: The name of the database to use
# username: The username to connect as
# password: The password for this user
#
[database]
driver = mysql+pymysql
host = localhost
database = lanauth
username = lanauth
password = lanauth
# Generate the whole db uri
# Disabled for testing. Will force the use of an in-memory sqlite instance
#uri = %(driver)s://%(username)s:%(password)s@%(host)s/%(database)s
# LanWebsite API settings
# url: Base url of the LAN Website
# key: API authentication key
[lan_api]
url = https://dev.lan.lsucs.org.uk
key = LAN_WEBSITE_KEY
# Device SSH configuration
# name: Name for this device, shown in the logs
# address: The IP address of the device
# port: The port to connect on using ssh (default 22)
# username: The username to connect as
# keyfile: Path to the SSH private key to use
# cmd: The remote command to run for authentication (script)
#
[device]
name = EdgeRouter
address = 192.168.0.1
port = 22
username = lsucs
keyfile = ~/.ssh/keys/router.key
cmd = ~/lan-auth.sh
# Daemon configuration
# interval: Interval to sleep for between checks in seconds
[daemon]
interval = 5
|
For more information on database drivers see: SQLAlchemy engines
Note
Database tables in the project will be auto generated on execution, however if a non-SQLite database such as MySQL is used the user, password and database will need to be created in advance.
Running¶
The webserver and deamon components can be called using a the lanauth console script generated by the installer.
When running the script the config file option -c / --config must be passed.
UWSGI¶
To be implemented
Admin Panel¶
The admin panel can be accessed at /admin. The admin password set in the site Configuration will be needed to login.
Once logged in the admin panel shows a breakdown of the current site settings and displays the current authentication list.