Skip to content

GUACAMOLE-462: Add support for associating connection history with logs/recordings.#698

Merged
necouchman merged 16 commits intoapache:masterfrom
mike-jumper:history-storage
Mar 2, 2022
Merged

GUACAMOLE-462: Add support for associating connection history with logs/recordings.#698
necouchman merged 16 commits intoapache:masterfrom
mike-jumper:history-storage

Conversation

@mike-jumper
Copy link
Contributor

@mike-jumper mike-jumper commented Feb 12, 2022

This change adds API representation of logs and recordings at the history entry level, and allows those resources to be retrieved from history entries via the REST API.

This is achieved by:

  1. Adding a deterministic (and optional) UUID for history entries with semantics that allow the UUID to be known prior to the connection being fully established, as well as an optional identifier that allows individual history entries to be retrieved directly.
  2. Adding an extension, "guacamole-history-recording-storage", which automatically searches a defined path (/var/lib/guacamole/recordings/ by default) for files matching history entry UUIDs. If any are found, their type is identified and the file is associated with the history entry via decoration.
  3. Adding ${HISTORY_PATH} and ${HISTORY_UUID} tokens that allow recordings, etc. to be saved and later reassociated with the history entries that correspond to the connections that created those recordings.

Thus, history entries and recordings may be tied together without requiring database schema changes.

Users are only able to retrieve recordings/logs for a history entry if they have access to that history entry. It's up to the implementation to define whether users may view history entries, however the database restricts this to only users that can view both the relevant connection and relevant user. The storage extension implemented here additionally requires that a user have UPDATE permission on the associated connection to be able to retrieve a history entry, as it seems sensible to limit access to logs/recordings to only those that manage the connection. It might make sense for this to be configurable in the future.

Copy link
Contributor

@necouchman necouchman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few initial comments - you'll have to forgive the sarcastic humor, it seems especially strong tonight.

@mike-jumper mike-jumper force-pushed the history-storage branch 10 times, most recently from 1d6717e to a9c7395 Compare February 14, 2022 20:13
@mike-jumper mike-jumper marked this pull request as ready for review February 14, 2022 20:14
@mike-jumper
Copy link
Contributor Author

No more draft - retrieval of individual records is now implemented.

@necouchman
Copy link
Contributor

Okay, will work on reviewing tonight.

@mike-jumper
Copy link
Contributor Author

Thanks!

Copy link
Contributor

@necouchman necouchman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay - took a couple of days longer. Just a few minor documentation clean-up things and I think it'll be ready to ship.

…ections.

Besides restoring historically-provided functionality, the ID generated
by the database for connection history records is needed to generate a
deterministic UUID that can be injected into connection configurations
with ${HISTORY_UUID}. Having such a token allows session recordings to
be given names that can be reliably matched with history records.
@necouchman necouchman merged commit b256250 into apache:master Mar 2, 2022
@mike-jumper mike-jumper deleted the history-storage branch March 2, 2022 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants