I run Virtualmin GPL on a development server and share files via Samba. Every time I add a new virtual server, I have to manually add the Samba share through Webmin->Servers->Samba Windows File Sharing->Edit Config File.
All I need to do is add [domain] path=/home/domain/public_html at the end of the file. Is there an easy way of automating this?
In Virtualmin -> System Settings -> Virtualmin Configuration: Advanced you could use the ‘Command to run after making changes to a server’ box to execute a command or run a script to append an entry to your Samba config. You could use environmental variables such as VIRTUALSERVER_DOM, VIRTUALSERVER_IP, VIRTUALSERVER_USER, VIRTUALSERVER_HOME, VIRTUALSERVER_PASS, and more. Any variable found in the /etc/webmin/virtual-server/domains/$DOM file will be available as an environment variable. Also see https://www.virtualmin.com/documentation/developer/cli
… most modules which involve user management, like MySQL, Samba and etc, have an option to automatically synchronize its users upon new UNIX user creation :
Hi, thanks. At the moment, I don’t need to create any users. I have a dev.test domain and all sites are a sub-server so have the same user (dev). I want to be able to automatically create a share to the sub-servers public_html directory.