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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.1.1
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.1

* Infers hostname from system settings, if no config value found.

## 0.1.0

* Initial beta release.
Expand Down
3 changes: 2 additions & 1 deletion sd-rsyslog
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import os
import logging
import configparser
from subprocess import Popen, PIPE
from socket import gethostname

# Global definitions specific to your plugin
process = None
Expand Down Expand Up @@ -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.

localvmname = config['sd-rsyslog']['localvm']
localvmname = config['sd-rsyslog'].get('localvm', gethostname())
process = Popen(
["/usr/lib/qubes/qrexec-client-vm", logvmname, "securedrop.Log"],
stdin=PIPE,
Expand Down