For samba in linux,provide a convenient interface to maintain Samba on Linux ,easy to use
The program will automatically apply the new configuration and restart the SMB service.
/config [GET] get samba config
{
"sections": [
{
"name": "global",
"fields": {
"log file": "/var/log/samba/log.%m",
"logging": "file",
...
}
},
{
"name": "sambashare",
"fields": {
"browsable": "yes",
...
}
},
]
}/folders/add [POST] add share folder
{
"name":"share",
"properties":{
"available": "yes",
...
}
}/folders/update [POST] update share folder
{
"name":"share",
"properties":{
"available": "yes",
...
}
}/folders/delete?name={folder_name} [DELETE] remove share folder
note: only remove folder on config,not delete real folder
The configuration file needs to be placed with the program, named config.json
example (NAS in ubuntu 20.04)
{
"addr": ":8200",
"smb_config_path": "/etc/samba/smb.conf",
"start_script": "sudo service smbd start",
"restart_script": "sudo service smbd restart",
"stop_script": "sudo service smbd stop"
}addr : service address
smb_config_path: smb config file position
start_script: start smb service command
restart_script: restart smb service command
stop_script: stop smb service command
TODO:
- Web GUI