Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

core: remove superfluous {host, ...} site option

  • Loading branch information...
commit 954a1be8b82ed9562d403bfe76dcbcabd28fa7fb 1 parent 3a2197b
@arjan arjan authored
View
3  priv/skel/blog/config.in
@@ -3,9 +3,6 @@
% This site is enabled or not.
{enabled, true},
- % Atomic hostname, MUST be equal to the directory name of this site.
- {host, %%SITE%%},
-
% Hostname on which this site runs
{hostname, "%%SITE%%:8000"},
View
3  priv/skel/empty/config.in
@@ -3,9 +3,6 @@
% This site is enabled or not.
{enabled, true},
- % Atomic hostname, MUST be equal to the directory name of this site.
- {host, %%SITE%%},
-
% Hostname on which this site runs
{hostname, "%%SITE%%:8000"},
View
3  priv/skel/nodb/config.in
@@ -3,9 +3,6 @@
% This site is enabled or not.
{enabled, true},
- % Atomic hostname, MUST be equal to the directory name of this site.
- {host, %%SITE%%},
-
% Hostname on which this site runs
{hostname, "%%SITE%%:8000"},
View
13 src/support/z_sites_manager.erl
@@ -231,22 +231,13 @@ scan_sites() ->
parse_config(C) ->
case file:consult(C) of
{ok, [SiteConfig|_]} ->
- %% check host option
+ %% store host in site config
Host = list_to_atom(
hd(lists:reverse(
filename:split(
filename:dirname(C)
)))),
- case proplists:get_value(host, SiteConfig) of
- undefined ->
- lists:keystore(host, 1, SiteConfig, {host, Host});
- Host ->
- SiteConfig;
- InvalidHost ->
- error_logger:warning_msg("Ignoring invalid `host' option in site config: ~s: {host, ~p}~n",
- [C, InvalidHost]),
- lists:keystore(host, 1, proplists:delete(host, SiteConfig), {host, Host})
- end;
+ lists:keystore(host, 1, SiteConfig, {host, Host});
{error, Reason} ->
Message = io_lib:format("Could not consult site config: ~s: ~s", [C, file:format_error(Reason)]),
?ERROR("~s~n", [Message]),
Please sign in to comment.
Something went wrong with that request. Please try again.