Package: howitz
Play aroundInstall safelyMake and activate a virtualenv, install dependencies in that virtualenv:$ python3 -m venv howitz
$ source howitz/bin/activate
$ pip install -e .Howitz is deeply dependent on the libraryzinolib. When developing Howitz,
it might be prudent to add zinolib manually to the virtualenv by downloading
the source, entering the directory and runningpip install-e.. This will
make it very easy to switch between versions and branches of zinolib.Run in development-modeYou need to have either a minimal configuration file or set two environment varibles, seeConfiguration.Either of:$ python3 -m howitzor:$ flask --app howitz runshould get you a server running onhttp://127.0.0.1:5000/The database is by
default put in the current directory.Run in productionAlways use an installed howitz.gunicorn:gunicorn'howitz:create_app()'waitress:waitress-serve--callhowitz:create_appSeehttps://flask.palletsprojects.com/en/3.0.x/deploying/for more options and
additional details, and the respective server’s docs for server-specific
details.User managementUsers are by default stored in the file “./howitz.sqlite3”, this can be changed
in the configuration file.While it is possible to use an sqlite3-client to alter the database, setting
the password should be done via the command line, to ensure that the password
is hashed correctly.Get a list of the possible commands by running:$ flask --app howitz user
Usage: flask user [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  create
  delete
  list
  updateGet help for each sub-command with appending “–help”, for instance:$ flask -A howitz user update --help
Usage: flask user update [OPTIONS] USERNAME

Options:
  -p, --password TEXT
  -t, --token TEXT
  --help               Show this message and exit.All available commandscreatecreates a user, the username needs to be uniquedeleteremoves an existing userlistshows all known usernamesupdateis used to change the web password or zino token for an existing userConfigurationHowitzcanrun without a configuration file. Default values will be used for
listen-address (127.0.0.1), port (5000) and storage location
(./howitz.sqlite3). However, at minimum you also need to pass in a SECRET_KEY
for Flask and a zino server to fetch events from.These can be passed via a configuration file, “.howitz.toml” (in the current directory or user home directory) or via environment variables.Via configuration file:[flask]
SECRET_KEY = "long string!"

[zino.connections.default]
server = "some.server.tld"Directly via environment variables:HOWITZ_SECRET_KEY="long string!" HOWITZ_ZINO1_SERVER="some.server.tld"All config options can be overruled by environment variables. Prefix with
“HOWITZ_” for Flask-specific options and “HOWITZ_ZINO1_” for Zino-specific
options. It is also possible to override logging by setting “HOWITZ_LOGGING” to
a string of a python dict but we do not recommend it, use a config file instead.Poll interval for events table can be changed by adding for examplepoll_interval = 30to
the[howitz]-section or setting the environment variableHOWITZ_POLL_INTERVALto a new value.
Poll interval values represented seconds and must be integers. The default value is60seconds.Debugging can be turned on either by addingDEBUG = trueto the[flask]-section or setting the environment variableHOWITZ_DEBUGto1.Default timezone for timestamps isUTC. Timezone information can be changed by addingtimezone = "LOCAL"to
the[howitz]-section or setting the environment variableHOWITZ_TIMEZONEtoLOCAL. Timezone values other
thanLOCALandUTCprovided in config will be ignored and fall back toUTC.Example config-file for developmentFor development, copy the contents of the included filedev-howitz.tomlto.howitz.tomlin the same directory.Set[flask]->SECRET_KEYto some long string.Set[zino.connections.default]->serverto a Zino 1 server.Optionally set[zino.connections.other]->serverto a fallback Zino
1 server. If the default server stops working you can swap “other” with
“default” in the config-file and keep on working. If you don’t set it to
anything, comment it out/remove it.There’s a handler “debug” that will copy everything DEBUG or higher to a filedebug.log, you might want to use this handler for your code.The handlererrorwill likewise put everything WARNING or higher in theerror.logfile.Config file for productionIt is better to control[flask]->SECRET_KEYand[zino.connections.default]->servervia environment variables than
hardcoding them in the config file. It’s best to delete them from the config
file.[flask]->DEBUGshould befalse. You can stil override it via an
environment variable.[logging]will need adjustments. Increase the level of thewsgi-handler
or only use theerrorhandler. Change the error-handler to ship its log
somewhere else, via syslog or Sentry or similar.Run testsLinting:tox-elintTests:tox