diff --git a/CHANGELOG.md b/CHANGELOG.md index 206dbef2c..473768374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ project adheres to [Semantic Versioning][SemVer]. for macOS. ### Changed +- The environment variable `ETURNAL_ETC_PREFIX` has been deprecated in favor of + `ETURNAL_ETC_DIR`. If the former was used with previous releases, + `ETURNAL_ETC_DIR` should now be set to `$ETURNAL_ETC_PREFIX/etc`. - `mod_stats_prometheus`: Fine tune bucket sizes for TURN sessions, e.g., drop the 1 KiB bucket, as the 4 KiB bucket size should be sufficient to identify "inactive" sessions. Also, slightly alter the other bucket sizes. diff --git a/Formula/eturnal.rb b/Formula/eturnal.rb index 307f5e4fe..9cdcecd33 100644 --- a/Formula/eturnal.rb +++ b/Formula/eturnal.rb @@ -26,7 +26,7 @@ def install end ## change default default config dir inreplace "config/sys.config" do |s| - s.gsub! "$ETURNAL_ETC_PREFIX/etc/#{name}.yml", "#{etc}/#{name}.yml" + s.gsub! "$ETURNAL_ETC_DIR/#{name}.yml", "#{etc}/#{name}.yml" end ## !!! patch eturnalctl script, !!! ## !!! remove before updating to newer version than 1.10.1 !!! diff --git a/build.config b/build.config index 235df42ff..158ab17d3 100644 --- a/build.config +++ b/build.config @@ -5,6 +5,7 @@ {eturnal_user, "eturnal"}. % The user running eturnal. {eturnal_prefix, "/opt/eturnal"}. % The installation directory. +{eturnal_etc_dir, "/etc"}. % The directory containing the eturnal.yml. {erl_epmd_address, "127.0.0.1"}. % See . {erl_dist_port, ""}. % Specify a port number to avoid spawning EPMD. {code_loading, "static"}. % Specify "dynamic" to avoid hard-coded dep versions. diff --git a/config/sys.config b/config/sys.config index e331832b6..21b4c8db6 100644 --- a/config/sys.config +++ b/config/sys.config @@ -5,5 +5,5 @@ #{single_line => false, template => ["[", level, "] ", msg, "\n"]}}}}]}]}, {conf, - [{file, "$ETURNAL_ETC_PREFIX/etc/eturnal.yml"}, + [{file, "$ETURNAL_ETC_DIR/eturnal.yml"}, {on_fail, halt}]}]. diff --git a/doc/overview.edoc b/doc/overview.edoc index d013e6e55..a0af9d67d 100644 --- a/doc/overview.edoc +++ b/doc/overview.edoc @@ -93,9 +93,9 @@ The eturnal server is configured by editing the `eturnal.yml' file (and optionally setting one or more {@section Environment Variables}). If `/etc/eturnal.yml' doesn't exist, eturnal will (by default) search for `etc/eturnal.yml' within the installation directory. In order to use a different -path, the environment variable {@section ETURNAL_ETC_PREFIX} can be specified. -As an alternative, the arguments ``-conf file '"/path/to/eturnal.yml"''' (note -the double quoting) can be appended to the `eturnalctl' command line used for starting up eturnal. The `eturnal.yml' file uses the &2 + echo "Warning: Set ETURNAL_ETC_DIR=$ETURNAL_ETC_PREFIX/etc instead." >&2 + export ETURNAL_ETC_DIR="$ETURNAL_ETC_PREFIX/etc" +fi + +if ! [ -e "$ETURNAL_ETC_DIR/eturnal.yml" ] +then + for dir in '/etc' "$RELEASE_ROOT_DIR/etc" + do + if [ -e "$dir/eturnal.yml" ] + then + export ETURNAL_ETC_DIR="$dir" + break + fi + done fi # Until https://github.com/erlware/relx/issues/905 is fixed: diff --git a/windows/make-installer b/windows/make-installer index 27880cccd..d743e9775 100755 --- a/windows/make-installer +++ b/windows/make-installer @@ -54,7 +54,7 @@ grep -q 'mkdir, "log"' 'rebar.config' || sed -i -e '/TLS certificate/,+3d' \ -e 's|#log_dir.*|log_dir: "@INSTALL_DIR@/log"\ run_dir: "@INSTALL_DIR@/run"|' 'config/eturnal.yml' -sed -i 's/$ETURNAL_ETC_PREFIX/@INSTALL_DIR@/' 'config/sys.config' +sed -i 's|$ETURNAL_ETC_DIR|@INSTALL_DIR@/etc|' 'config/sys.config' echo "$myself: Cleaning $rel_name repository ..." rm -rf '_build'