When attempting a conversion, install the lmdb package if its missing.
This should resolve issues with containers or new installations that
want to migrate a previous db to sqlite.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Sqlite versions older than 3.33.0 store schema information in the
sqlite_master table rather than the sqlite_schema table.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Remove lmdb python and system dependencies. Bump
streaming-form-data to 1.15.0 and remove smart_open
as the issue import issue has been resolved.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Add a UserInfo class which provides type annotations for each member.
This class easily converts to a dict or tuple, simplifying conversion
for usage in SQL statements.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
When possible record the name of the user that requested the
job. The klippy_api's component now takes an optional user
argument in its "start_print" method. This user is broadcast
in an event after a print request successfully returns.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The HistoryDataField class can be instantiated by any
component. It can then be used to register additional fields
tracked in the job history.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The history component requires no specific configuration, is
generally always used, and has no dependencies that prevent
loading at startup. Convert history to a core component,
making it eligible for lookup/use in optional components.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The default behavior of systemd is to remove shared memory
files when the user that created them logs out. This breaks
instance ID tracking for most installations. While its possible
to overcome this by changing the user type or the logind
configuration, these solutions required elevated privileges.
The simple solution is to store iids in a temporary file, with
access protected by a flock.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Uses linux flock to create lock files that can be used
to protect access across multiple processes.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Remote API docs tweaks. Some leading commas removed for JSON serialization. Also found an unclosed json section.
Signed-off-by: David Zwart <davidzwa@gmail.com>
"Delete a webcam" section contained a wrong url. Some response examples were wrapped in result, and some others were not. I've removed "result": { } for consistency. Finally I've removed many leading commas causing problems with JSON deserialization.
Signed-off-by: David Zwart <davidzwa@gmail.com>