Idea [before/after command execute]

I have some idea.
Could we add directive in hestia that execute custom script before/after hestia command?

eg. when we call ./v-add-user we could define script which
a) execute before start v-add-user eg.: v-add-user-before
b) execute after end v-add-user : eg.: v-add-user-after

For calling a function after v-add-user

Create an file in /usr/local/hestia/data/packages/ with the same name as the package but .sh as extension instead of .pkg

For example: Package is test → .sh is called

v-add-user-composer "$1"
v-change-user-php-cli "$1" "7.4"

Will install composer and set php-cli on the wanted version

1 Like

Oh my god! This is gold! Now I can auto deploy wordpress upon user creation.

Not completely.
v-add-user is example. what about other commands?

Your solution is OK but it execute custom script once, when we setting up/change package for user.

What about v-add-domain, v-add-mail-domain … others?

Think…my suggestion could make hestia more flexible for more advanced users and business.
Instead modify hestia code, we could write own script for some commands.

Custom packages still need to be preset in the config as currently stands they are synced on every rebuild of the user…

All the commands currently possible settings in the Hestia are able to be executed via CLI / API

We currently work on an improved user handling and more security from within HestiaCP WebGUI and other improvements.

If you would like to install wp on web-domain creation:

For Web templates you can do the same. How ever you might need to add an check to see if files are installed or not and in that case call exit;

For example