This plugin allows you to change certain parameters at server start-up. Useful for regularly deploying data from another server and adapting settings, for example.
This plugin is used by placing a 'start-actions.xml' file in the WEB-INF/param folder on the server.
The file contains the instructions to be carried out.
The file is then archived as 'start-actions-2020-01-01T120000.000100.xml' so that it cannot be run a second time.
The file format is as follows:
<actions> <users-populations> ... </users-populations> <rights> ... </rights> <schedulables> ... </schedulables> </actions>
Dans la balise <users-populations> vous pouvez mettre des balises <users-population> au format :
<users-population id="POPULATIONID"> <user login="LOGIN"> <password>PASSWORD</password> </user> </users-population>
where :
This instruction is used to change the administrator password if it has been lost.
Population "admin_population" and login "admin".
Since 4.6, the administrator password must comply with the robustness requirements imposed by ametys:
* The password must contain at least 8 characters
* The password must contain at least one capital letter
* The password must contain at least one numeric character
* The password must contain at least one special character among !%&@#$^*?_~
Dans la balise <rights> vous pouvez mettre une balise <profiles> qui contient des balises <profile> :
<profiles> <profile id="PROFILEID"> <remove right="RIGHTID"/> </profile> </profiles>
where :
Available from version 1.2.0.
Dans la balise <schedulables>, pour lancer une tâche au démarrage, vous pouvez mettre des balises <schedulable> structurée comme suit :
<schedulable id="SCHEDULABLE_ID"> <params> <PARAM_NAME>PARAM_VALUE</PARAM_NAME> <PARAM_NAME type="config">PARAM_CONFIG_ID</PARAM_NAME> </params> </schedulable>
where :
Example of a script launch at startup, with results sent to the platform administrator via email :
<?xml version="1.0" encoding="UTF-8" ?>
<actions>
...
<schedulables>
<schedulable id="org.ametys.core.schedule.Script">
<params>
<recipient type="config">smtp.mail.sysadminto</recipient>
<script>
var logger = Ametys.getLogger("deploy-starter");
logger.error("Test !");
</script>
<workspace>admin</workspace>
</params>
</schedulable>
</schedulables>
</actions>