useful information for operations.
famoser/agnes
does the deployment heavy lifting.
server must fulfil requirements of composer.json
& include ghostscript (gs
)
see the ./.env
file for how to configure
to deploy master to all instances, simply run
- ./vendor/bin/agnes deploy *:*:* master
if you want to use a staging area, run the following commands:
- ./vendor/bin/agnes run *:*:prod backup_db
- ./vendor/bin/agnes deploy *:*:staging master
- ./vendor/bin/agnes run *:*:staging restore_db
Some commands should run regularly to optimized memory usage & security.
command | proposed schedule |
---|---|
php bin/console app:cache:clear --renders --reports |
sunday every week |
php bin/console app:authentication:refresh |
every 30 minutes |
php bin/console app:weekly:send |
every week (monday morning recommended) |
Apps request /api/status
after each sync. You can place a message there which is then displayed in the app.
For details investigate in ./src/Controller/ApiController.php
the method statusAction
.
you only need to backup the files in the /var/persistent
folder.
Using rsync, do something like this:
rsync -azP ~/www/app.baupen.ch/production/shared/var/persistent/ user@IP:~/backup/
if a user registers & validates its email successfully, its information is pre-filled using files at var/transient/authorization/user_data/*.json
.
for each of the found files, givenName
, familyName
and phone
are prefilled if the email matches.
hence the file should look something like this:
[
{
"email": "[email protected]",
"givenName": "git",
"familyName": "baupen.ch",
"phone": "0991234567"
}
]
you may impersonate another user if you an admin (must be set directly in the database) with
http://example.com/[email protected]
finish impersonation with
http://example.com/somewhere?_switch_user=_exit
mysql -u root
to login as rootCREATE USER 'symfony'@'localhost' IDENTIFIED BY 'password';
to createsymfony
user with passwordpassword
.GRANT ALL PRIVILEGES ON *.* TO 'symfony'@'localhost';
to allowsymfony
use to create databasesFLUSH PRIVILEGES;
to reload privilegesquit
to exit
ssh-copy-id -i ~/.ssh/id_rsa.pub username@domain
to add ssh key
cat ~/.ssh/id_rsa.pub
to query the active ssh key
ssh-keygen -t rsa -b 4096 -C "username@domain" && eval $(ssh-agent -s) && ssh-add ~/.ssh/id_rsa
generate a new key & add it to ssh