Automatic webhosting script idea - Will this work?

I have developed a press portal for german fire departments. New fire departments should be able to register on my website and a cronjob should automatically create a new Hestia user with subdomain and database and send an email on the end. The whole script should be stored in a bash file.

To make sure that I have not forgotten anything, I ask once in the round whether the logic is correct.

(Example user and domain: department1)

My hestia script idea:

Only one user, one domain with SSL and one database should be created.

# new user
v-add-user department1 P40w@rD [email protected]

# add subdomain
v-add-domain department1 department1.domain.de

# set docroot (right?)
v-change-web-domain-docroot department1 department1.domain.de public/

# enable ssl
v-add-web-domain-ssl department1 department1.domain.de

# create database
v-add-database department1 department1 department1_portal Password!

After that comes the part with copying the software (git checkout) and generating the .env file with the database connection.

Will this work? Or do I still need to run a Hestia command?


BTW: Does it make sense to create a Hestia user for each department or can everything be managed by one user?

The portal is only accessed via the browser. No one gets database access or anything else.

1 Like

Use different users just in case one portal gets hacked.

That way the rest of them may not.

You can suspend users easier.

You may in the future want to grant someone access to the panel or maybe they ask for it.

Maybe some time from now a fire department wants access to the website to take everything and leave.

In that case if you grant access to the panel you won’t have to help them get their website running elsewhere. They might otherwise have problems getting it up and running and accuse you of giving a bad export of the database…

1 Like

Do you own a Valid SSL certificate or do you use Lets Encrypt in both cases it will not work…

See:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.