chore(psk): rename boot_file to init_file

This commit is contained in:
zhouzb 2021-09-23 10:07:36 +08:00
parent 2f18f5e8b5
commit 4ca9628899
3 changed files with 10 additions and 10 deletions

View File

@ -6,14 +6,14 @@ psk {
## Whether to enable the PSK feature. ## Whether to enable the PSK feature.
enable = true enable = true
## If boot file is specified, emqx will import PSKs from the file ## If init file is specified, emqx will import PSKs from the file
## into the built-in database at startup for use by the runtime. ## into the built-in database at startup for use by the runtime.
## ##
## The file has to be structured line-by-line, each line must be in ## The file has to be structured line-by-line, each line must be in
## the format: <PSKIdentity>:<SharedSecret> ## the format: <PSKIdentity>:<SharedSecret>
## boot_file = {{ platform_data_dir }}/boot.psk ## init_file = {{ platform_data_dir }}/init.psk
## Specifies the separator for PSKIdentity and SharedSecret in the boot file. ## Specifies the separator for PSKIdentity and SharedSecret in the init file.
## The default is colon (:) ## The default is colon (:)
## separator = ":" ## separator = ":"
} }

View File

@ -110,7 +110,7 @@ init(_Opts) ->
true -> load(); true -> load();
false -> ok false -> ok
end, end,
case boot_file() of case init_file() of
undefined -> ok; undefined -> ok;
BootFile -> import_psks(BootFile) BootFile -> import_psks(BootFile)
end, end,
@ -145,8 +145,8 @@ code_change(_OldVsn, State, _Extra) ->
is_enable() -> is_enable() ->
emqx_config:get([psk, enable]). emqx_config:get([psk, enable]).
boot_file() -> init_file() ->
emqx_config:get([psk, boot_file], undefined). emqx_config:get([psk, init_file], undefined).
separator() -> separator() ->
emqx_config:get([psk, separator], ?DEFAULT_DELIMITER). emqx_config:get([psk, separator], ?DEFAULT_DELIMITER).

View File

@ -28,7 +28,7 @@ roots() -> [].
fields("psk") -> fields("psk") ->
[ {enable, fun enable/1} [ {enable, fun enable/1}
, {boot_file, fun boot_file/1} , {init_file, fun init_file/1}
, {separator, fun separator/1} , {separator, fun separator/1}
]. ].
@ -36,9 +36,9 @@ enable(type) -> boolean();
enable(default) -> false; enable(default) -> false;
enable(_) -> undefined. enable(_) -> undefined.
boot_file(type) -> binary(); init_file(type) -> binary();
boot_file(nullable) -> true; init_file(nullable) -> true;
boot_file(_) -> undefined. init_file(_) -> undefined.
separator(type) -> binary(); separator(type) -> binary();
separator(default) -> <<":">>; separator(default) -> <<":">>;