From 89668e21f486a0b9ad069f9b8f9be2d5fdedaa4d Mon Sep 17 00:00:00 2001 From: Conor Schaefer Date: Mon, 2 Mar 2020 10:03:14 -0800 Subject: [PATCH] Infers hostname for "localvm" setting 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. --- VERSION | 2 +- changelog.md | 4 ++++ sd-rsyslog | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 6e8bf73..17e51c3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 +0.1.1 diff --git a/changelog.md b/changelog.md index 1456efc..32937ae 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +## 0.1.1 + + * Infers hostname from system settings, if no config value found. + ## 0.1.0 * Initial beta release. diff --git a/sd-rsyslog b/sd-rsyslog index 4f3233e..0943226 100644 --- a/sd-rsyslog +++ b/sd-rsyslog @@ -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 @@ -81,7 +82,7 @@ def onInit(): config = configparser.ConfigParser() config.read('/etc/sd-rsyslog.conf') logvmname = config['sd-rsyslog']['remotevm'] - 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,