Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subdirectory config file not reloaded #2566

Closed
rradu92 opened this issue Dec 18, 2018 · 1 comment · Fixed by haraka/haraka-config#46
Closed

Subdirectory config file not reloaded #2566

rradu92 opened this issue Dec 18, 2018 · 1 comment · Fixed by haraka/haraka-config#46

Comments

@rradu92
Copy link

rradu92 commented Dec 18, 2018

system info

Haraka Haraka.js — Version: 2.8.23
Node v6.14.3
OS Linux smtp1.raclus.net 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
openssl OpenSSL 1.0.2k-fips 26 Jan 2017

Expected behavior

Reload config file on change it

Observed behavior

When file is changed not reloaded

Steps to reproduce

Creat a plugin with with the config file in a subdirectory

exports.register = function () {
    const plugin = this;
    plugin.load_acl_ini();
    plugin.register_hook('connect_init', 'ip_check');
}

exports.load_acl_ini = function () {
    const plugin = this;
    plugin.cfg = plugin.config.get('/mysubdirectory/acl.ini', function () {
        plugin.load_acl_ini();
    });
}

On change the file mysubdirectory/acl.ini the config file is not reloaded in haraka.

msimerson added a commit to haraka/haraka-config that referenced this issue Dec 20, 2018
@msimerson
Copy link
Member

Unfortunately, it's likely the only resolution to this PR is changing your expectations. While the fs module does have a recursive option it only works on Mac OS and Windows platforms.

msimerson added a commit to haraka/haraka-config that referenced this issue Dec 20, 2018
* refactor config.js as es6 class
* use path.resolve instead of ./dir/file
* test: replace a few functions with fat arrows
* watch: recursive=true, fixes haraka/Haraka#2566
* permit retrieval of fully qualified path, fixes haraka/Haraka#2521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants