[tor-commits] [sbws/master] Fix broken envvar in config.default.ini

pastly at torproject.org pastly at torproject.org
Wed Sep 5 19:44:54 UTC 2018


commit c0885dcb4e77c58eb0afe9635172a5a93557dd0e
Author: Matt Traudt <sirmatt at ksu.edu>
Date:   Tue Aug 28 14:20:27 2018 -0400

    Fix broken envvar in config.default.ini
---
 CHANGELOG.md            | 5 +++++
 sbws/config.default.ini | 2 +-
 sbws/util/config.py     | 3 ++-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index e1a6d1a..b760644 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 
 ## [Unreleased]
 
+### Fixed
+
+- Broken environment variable in default sbws config. To use envvar $FOO, write
+  $$FOO in the config.
+
 ## [0.7.0] - 2018-08-09
 
 **Important changes**:
diff --git a/sbws/config.default.ini b/sbws/config.default.ini
index 0ad0ebf..e7950b1 100644
--- a/sbws/config.default.ini
+++ b/sbws/config.default.ini
@@ -59,7 +59,7 @@ max_download_size = 1073741824
 [tor]
 datadir = ${paths:sbws_home}/tor
 # create runtime dir for data that does not need to be persistent
-run_dpath = $XDG_RUNTIME_DIR/sbws
+run_dpath = $$XDG_RUNTIME_DIR/sbws
 control_socket = ${tor:run_dpath}/control
 pid = ${tor:run_dpath}/tor.pid
 # note this is a directory
diff --git a/sbws/util/config.py b/sbws/util/config.py
index 9532bdc..3577c5a 100644
--- a/sbws/util/config.py
+++ b/sbws/util/config.py
@@ -26,7 +26,8 @@ log = logging.getLogger(__name__)
 
 def _expand_path(path):
     """Expand path string containing shell variables and ~ constructions
-    into their values.
+    into their values. Environment variables have to have their $ escaped by
+    another $. For example: $$XDG_RUNTIME_DIR/foo.bar
     """
     return os.path.expanduser(os.path.expandvars(path))
 





More information about the tor-commits mailing list