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

Enabling samba doesn't always trigger configuration #2108

Closed
defmonk0 opened this issue Jan 20, 2020 · 0 comments · Fixed by #2109
Closed

Enabling samba doesn't always trigger configuration #2108

defmonk0 opened this issue Jan 20, 2020 · 0 comments · Fixed by #2109

Comments

@defmonk0
Copy link
Contributor

When enabling samba from the UI under services, it opens an edit modal where you can supply a workgroup and custom global config. Filling out this config then overwrites the /etc/samba/smb.conf file with the defaults needed for Rockstor.

The relevant code for this can be found here:

if (this.configurable_services.indexOf(serviceName) > -1 && !serviceModel.get('config') && state) {
app_router.navigate('services/' + serviceName + '/edit', {
trigger: true
});
} else {
if (state) {
this.startService(serviceName);
} else {
this.stopService(serviceName);
}
}

This code is generic to be reused for all services listed on that page, but has a check to navigate to the edit URI if needed.

If instead you navigate to Storage->File Sharing->Samba and use the toggle there, this edit modal is never presented. This means if it has not previously been configured, this will enable samba with the default smb.conf supplied at install time.

The relevant code for this is here:

switchStatus: function(event, state) {
if (state) {
this.startService();
} else {
this.stopService();
}
},

This lacks any check at all for the configuration required.


Another example that came up during discussion is the Rock-Ons service, which properly presents the edit dialog in both locations. This is the expected behavior.

It can be seen here that it still checks for the config before toggling the service:

switchStatus: function(event, state) {
if (!this.service.get('config')) {
app_router.navigate('services/docker/edit', {
trigger: true
});
} else {
if (state) {
this.startService();
} else {
this.stopService();
}
}
},

phillxnet added a commit that referenced this issue Feb 11, 2020
Enabling samba doesn't always trigger initial configuration dialog. Fixes #2108
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.

1 participant