samba-config
v0.1.4
Published
Generating Samba configuration files
Downloads
15
Maintainers
Keywords
Readme
samba-config
Super tiny library for configuring samba shares with Javascript.
Functionalites
- generateShareConfig: Generate configuration for a new samba share.
generateShareConfig: function (shareName, params)
Params
- shareName: Name of the new share.
- params: JSON with the settings of the new share. The keys inside this JSON are the standard samba share configuration options.
- generateSection: Generate include line into the samba configuration.
generateSection: function (shareName, fileName, existingConfig)
Params
- shareName: Name of the new share.
- fileName: Name of the file, which contains the configuration of the new share.
- existingConfig: The already existing Samba configuration object.
- updateConfig: Generate share configuration and include configuration for the new share.
updateConfig: function (configPath, sectionFileName, sectionName, sectionParams)
Params
- configpath: Path of the Samba configuration file.
- sectionFileName: Filename of the newly generated share.
- sectionName: Name of the new share.
- sectionParams: Configuration options for the share.
Usage Examples
Generate one share configuration and include them into the samba configuration
await Generator.updateConfig('/etc/samba/smb.conf', 'developer.share.conf', 'developer', {path: '/srv/smb/developer'})
The main Samba configuration file is in the /etc/samba directory. The name of the new share is develper, the properties for this share is JSON Object: {path: '/srv/smb/developer'} and the name of the share configuration file is developer.share.conf
Change Log
Change log is available: here