chore: rename plugin to mx autologin
This commit is contained in:
@@ -21,7 +21,7 @@ test('keygen script creates plugin key and direct ssh authorized keys line', fun
|
||||
assert_contains('from="203.0.113.10"', $output);
|
||||
assert_contains('restrict,no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-pty', $output);
|
||||
assert_not_contains('command=', $output);
|
||||
assert_contains('KLUCZ PLUGINU mail-autologin DLA SERWERA h4', $output);
|
||||
assert_contains('KLUCZ PLUGINU MX-Autologin DLA SERWERA h4', $output);
|
||||
});
|
||||
|
||||
test('keygen script detects source ip without parameters', function (): void {
|
||||
@@ -108,5 +108,5 @@ test('keygen script prints helper forced command line when mx login mode is help
|
||||
assert_same(0, $code, implode("\n", $out));
|
||||
$output = implode("\n", $out);
|
||||
assert_contains('command="/usr/local/hitme_plugins/mail-login-helper/bin/create-login-url"', $output);
|
||||
assert_contains('KLUCZ PLUGINU mail-autologin DLA SERWERA h4', $output);
|
||||
assert_contains('KLUCZ PLUGINU MX-Autologin DLA SERWERA h4', $output);
|
||||
});
|
||||
|
||||
@@ -5,20 +5,20 @@ test('plugin metadata and packaging docs match project rules', function (): void
|
||||
$conf = file_get_contents(PLUGIN_ROOT . '/plugin.conf') ?: '';
|
||||
$packing = file_get_contents(PROJECT_ROOT . '/PACKING.md') ?: '';
|
||||
|
||||
assert_contains('name=mail-login', $conf);
|
||||
assert_contains('id=mail-login', $conf);
|
||||
assert_contains('name=MX-Autologin', $conf);
|
||||
assert_contains('id=mx_autologin', $conf);
|
||||
assert_contains('type=user', $conf);
|
||||
assert_contains('version=1.0.12', $conf);
|
||||
assert_contains('version=1.0.13', $conf);
|
||||
assert_contains('user_run_as=root', $conf);
|
||||
assert_contains('/Users/marek/GPT/ChatGPT/da_plugins/mail-login/src', $packing);
|
||||
assert_contains('/Users/marek/GPT/ChatGPT/da_plugins/mail-login/archives/X.Y.Z/mail-login.tar.gz', $packing);
|
||||
assert_contains('/Users/marek/GPT/ChatGPT/da_plugins/mail-login/archives/X.Y.Z/mx_autologin.tar.gz', $packing);
|
||||
});
|
||||
|
||||
test('package source excludes local-only files and dangerous placeholders', function (): void {
|
||||
$package = file_get_contents(PLUGIN_ROOT . '/scripts/package.sh') ?: '';
|
||||
assert_contains("--exclude='./.git'", $package);
|
||||
assert_contains("--exclude='./tests'", $package);
|
||||
assert_contains('mail-login.tar.gz', $package);
|
||||
assert_contains('mx_autologin.tar.gz', $package);
|
||||
assert_true(is_file(PLUGIN_ROOT . '/scripts/keygen.sh'));
|
||||
|
||||
$bad = [];
|
||||
@@ -38,3 +38,17 @@ test('package source excludes local-only files and dangerous placeholders', func
|
||||
}
|
||||
assert_same([], $bad);
|
||||
});
|
||||
|
||||
test('directadmin entry points use mx autologin directory and display label', function (): void {
|
||||
$txt = file_get_contents(PLUGIN_ROOT . '/hooks/user_txt.html') ?: '';
|
||||
$img = file_get_contents(PLUGIN_ROOT . '/hooks/user_img.html') ?: '';
|
||||
$login = file_get_contents(PLUGIN_ROOT . '/user/login.raw') ?: '';
|
||||
$index = file_get_contents(PLUGIN_ROOT . '/user/index.html') ?: '';
|
||||
|
||||
assert_contains('/CMD_PLUGINS/mx_autologin/login.raw', $txt);
|
||||
assert_contains('Zaloguj do serwera poczty', $txt);
|
||||
assert_contains('/CMD_PLUGINS/mx_autologin/images/user_icon.svg', $img);
|
||||
assert_contains('alt="Zaloguj do serwera poczty"', $img);
|
||||
assert_contains('/usr/local/directadmin/plugins/mx_autologin/php.ini', $login);
|
||||
assert_contains('/CMD_PLUGINS/mx_autologin/login.raw', $index);
|
||||
});
|
||||
|
||||
@@ -18,7 +18,7 @@ test('settings expose secure defaults from plugin-settings.conf', function (): v
|
||||
});
|
||||
|
||||
test('settings runtime file is the directadmin plugin settings file', function (): void {
|
||||
assert_same('/usr/local/directadmin/plugins/mail-login/plugin-settings.conf', Settings::EXTERNAL_SETTINGS);
|
||||
assert_same('/usr/local/directadmin/plugins/mx_autologin/plugin-settings.conf', Settings::EXTERNAL_SETTINGS);
|
||||
});
|
||||
|
||||
test('settings reject login key ttl outside production range', function (): void {
|
||||
|
||||
Reference in New Issue
Block a user