From 4ca9628899aabe8188c1bf6651bab5732cbfa3f7 Mon Sep 17 00:00:00 2001 From: zhouzb Date: Thu, 23 Sep 2021 10:07:36 +0800 Subject: [PATCH] chore(psk): rename boot_file to init_file --- apps/emqx_psk/etc/emqx_psk.conf | 6 +++--- apps/emqx_psk/src/emqx_psk.erl | 6 +++--- apps/emqx_psk/src/emqx_psk_schema.erl | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/emqx_psk/etc/emqx_psk.conf b/apps/emqx_psk/etc/emqx_psk.conf index 61bfa233c..4373b3b50 100644 --- a/apps/emqx_psk/etc/emqx_psk.conf +++ b/apps/emqx_psk/etc/emqx_psk.conf @@ -6,14 +6,14 @@ psk { ## Whether to enable the PSK feature. 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. ## ## The file has to be structured line-by-line, each line must be in ## the format: : - ## 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 (:) ## separator = ":" } diff --git a/apps/emqx_psk/src/emqx_psk.erl b/apps/emqx_psk/src/emqx_psk.erl index 844d5bd0b..e3dfbbc81 100644 --- a/apps/emqx_psk/src/emqx_psk.erl +++ b/apps/emqx_psk/src/emqx_psk.erl @@ -110,7 +110,7 @@ init(_Opts) -> true -> load(); false -> ok end, - case boot_file() of + case init_file() of undefined -> ok; BootFile -> import_psks(BootFile) end, @@ -145,8 +145,8 @@ code_change(_OldVsn, State, _Extra) -> is_enable() -> emqx_config:get([psk, enable]). -boot_file() -> - emqx_config:get([psk, boot_file], undefined). +init_file() -> + emqx_config:get([psk, init_file], undefined). separator() -> emqx_config:get([psk, separator], ?DEFAULT_DELIMITER). diff --git a/apps/emqx_psk/src/emqx_psk_schema.erl b/apps/emqx_psk/src/emqx_psk_schema.erl index b459e1934..0179ced22 100644 --- a/apps/emqx_psk/src/emqx_psk_schema.erl +++ b/apps/emqx_psk/src/emqx_psk_schema.erl @@ -28,7 +28,7 @@ roots() -> []. fields("psk") -> [ {enable, fun enable/1} - , {boot_file, fun boot_file/1} + , {init_file, fun init_file/1} , {separator, fun separator/1} ]. @@ -36,9 +36,9 @@ enable(type) -> boolean(); enable(default) -> false; enable(_) -> undefined. -boot_file(type) -> binary(); -boot_file(nullable) -> true; -boot_file(_) -> undefined. +init_file(type) -> binary(); +init_file(nullable) -> true; +init_file(_) -> undefined. separator(type) -> binary(); separator(default) -> <<":">>;