Jump to content
Froxlor Forum
  • 0
Steve Hannah

Creating default site content

Question

I'm automating the process of creating a web-based applications from a template in froxlor.  I'm using the API to:

1. Create a domain
2. Create a database

Then I'm bootstrapping the database and copying a web app (php files) into the domain's directory.

Right now I'm sort of brute forcing this, by running a CLI script as root, which does all of these things -- running as root allows me to explicitly run the froxlor cron script to generate the site, and then copy the files into the domain's directory and changing ownership to the domain's customer user.

However, I'd like to try to improve on this so that I don't need to run it as root.  

Ideally Froxlor would allow me to provide a custom "site template" for when it creates the site.  Then I wouldn't need to do any post-processing outside of froxlor.  Looking through the sources it looks like it doesn't do this right now - it just has a single "standardcustomer" template that it uses for all sites.

 

Is there any recommended approach for this?  

Thanks for any pointers.

Steve

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
8 minutes ago, Steve Hannah said:

However, I'd like to try to improve on this so that I don't need to run it as root.  

creation of domain will always require the cron (which requires root) to generate vhost config and restart the webserver service

9 minutes ago, Steve Hannah said:

Ideally Froxlor would allow me to provide a custom "site template" for when it creates the site.  Then I wouldn't need to do any post-processing outside of froxlor.  Looking through the sources it looks like it doesn't do this right now - it just has a single "standardcustomer" template that it uses for all sites.

froxlor does not include any "autoinstaller" for webapps, so what would such "site template" include for you?

Share this post


Link to post
Share on other sites
  • 0
6 minutes ago, d00p said:

creation of domain will always require the cron (which requires root) to generate vhost config and restart the webserver service

froxlor does not include any "autoinstaller" for webapps, so what would such "site template" include for you?

Being able to tell froxlor to use a different template using the Domains.add API call would be ideal.  Either a path or a URL.  Then I could generate this template before hand, place it somewhere before I make the API call to froxlor, and specify the path or URL to this template in the API call.  Then froxlor can use this template when it builds the site instead of its default template.  For the case where a URL to the template is provided (rather than a path), a ZIP/Tar file would be most practical.  For a path it wouldn't matter.  Due to security concerns in providing a path, it would probably be easiest to implement using some sort of "inbox" directory where a template could be written, then only the template name could be supplied to froxlor in the API.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...