Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Infers hostname for "localvm" setting #16

Merged
merged 1 commit into from
Mar 11, 2020
Merged

Infers hostname for "localvm" setting #16

merged 1 commit into from
Mar 11, 2020

Conversation

conorsch
Copy link
Contributor

@conorsch conorsch commented Mar 5, 2020

Still checks the config first, but if the "localvm" flag isn't set
there, defaults to the hostname provided by the system. Useful for
simplfying config story between TemplateVMs & AppVMs in Qubes.

Refs: freedomofpress/securedrop-workstation#476

Testing

See full test plan in the SDW repo, and follow the steps there. Order of operations:

Still checks the config first, but if the "localvm" flag isn't set
there, defaults to the hostname provided by the system. Useful for
simplfying config story between TemplateVMs & AppVMs in Qubes.
Copy link
Contributor

@emkll emkll left a comment

Choose a reason for hiding this comment

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

Reviewing as part of freedomofpress/securedrop-workstation#476, looks good to me, package builds and works properly. Running into issues with some of the changes introduced here, however whonix-based VMs, which return host as hostname (more detail will be provided in the securedrop-worksation pr). Another comment/question inline

@@ -81,7 +82,7 @@ def onInit():
config = configparser.ConfigParser()
config.read('/etc/sd-rsyslog.conf')
logvmname = config['sd-rsyslog']['remotevm']
Copy link
Contributor

Choose a reason for hiding this comment

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

sd-rsyslog-example.conf included in this package provides an example configuration, but sd-syslog.conf is not provisioned via the packaging logic. would it make sense to provide a default sd-syslog.conf that will work in most conditions, containing just remotevm=sd-log and overwrite/append with salt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shipping a default file to /etc/ does indeed make sense to me @emkll, although we'll have to be mindful of conffiles behavior over time. If we plan to customize that file over time, we'll have to do so in postinst or via salt.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's defer the conffiles update until post-pilot, given the QA load involved with sufficient testing.

Copy link
Contributor

@emkll emkll left a comment

Choose a reason for hiding this comment

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

changes reviewed in freedomofpress/securedrop-workstation#487 (review) , visual diff LGTM

@emkll emkll merged commit 6e0dc3f into master Mar 11, 2020
@emkll emkll deleted the infer-hostname branch March 11, 2020 18:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants