Skip to content

Commit c49382b

Browse files
committed
feat: anonymization using DbToolsBundle
https://www.wrike.com/open.htm?id=1396105243
1 parent 504c92a commit c49382b

File tree

4 files changed

+113
-4
lines changed

4 files changed

+113
-4
lines changed

faros-ng/deploy-pack/1.7/ansible/_variables.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,23 @@ lephare_install_adminer: false
2626
lephare_packagist_com_token: "{{ vault_lephare_packagist_com_token }}"
2727

2828
# (db-pull) Database settings
29-
db_pull_local_database_host: <local_database_host>
29+
db_pull_local_database_host: pgsql_17
3030
db_pull_local_database_name: <local_database_name>
31-
db_pull_local_database_user: <local_database_user>
32-
db_pull_local_database_password: <local_database_password>
33-
db_pull_local_database_port: <local_database_port> # MySQL/MariaDB: 3306, PostgreSQL: 5432
31+
db_pull_local_database_user: postgres
32+
db_pull_local_database_password: root
33+
db_pull_local_database_port: 5432
3434

3535
db_pull_local_backup_path: ../var/database/
3636
db_pull_remote_backup_path: "{{ ansistrano_deploy_to }}/var/database"
3737
db_pull_remote_database_host: localhost
3838
db_pull_remote_database_port: 5432
3939
db_pull_remote_database_password: "{{ vault_database_password }}"
40+
41+
# Requires an additional remote database dedicated to anonymization + installing `makinacorpus/db-tools-bundle`
42+
db_pull_anonymization: true
43+
44+
db_pull_anonymization_remote_database_user: <anonymization_remote_database_user>
45+
db_pull_anonymization_remote_database_host: <anonymization_remote_database_host>
46+
db_pull_anonymization_remote_database_name: <anonymization_remote_database_name>
47+
db_pull_anonymization_remote_database_password: "{{ vault_anonymization_remote_database_password }}"
48+
db_pull_anonymization_remote_database_port: 5432
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
vault_database_password: <remote_database_password>
22
vault_lephare_packagist_com_token: <lephare_packagist_com_token>
3+
vault_anonymization_remote_database_password: <anonymization_remote_database_password>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
faros_user:
2+
firstname: firstname
3+
lastname: lastname
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
db_tools:
2+
# Where to put generated backups.
3+
#storage:
4+
# Root directory of the backup storage manager. Default filename
5+
# strategy will always use this folder as root path.
6+
#root_dir: '%kernel.project_dir%/var/db_tools'
7+
8+
# Filename strategies. You may specify one strategy for each doctrine
9+
# connection. Keys are doctrine connection names. Values are strategy
10+
# names, "default" (or null) or omitting the connection will use the
11+
# default implementation.
12+
# If you created and registered a custom one into the container as a
13+
# service, you may simply set the service identifier. If no service
14+
# exists, and your implementation does not require parameters, simply
15+
# set the class name.
16+
#filename_strategy:
17+
# Backup filename strategy.
18+
# "default" is an alias of "datetime"
19+
#default: default
20+
# "datetime" implementation is "%db_tools.storage.root_dir%/YYYY/MM/<connection-name>-<datestamp>.<ext>"
21+
#other_connection_strategy: datetime
22+
# Example of using a service name:
23+
#yet_another_connection: app.db_tools.filename.custom_strategy
24+
# Or a classe name:
25+
#another_one: App\DbTools\Storage\MyCustomStrategy
26+
27+
# When old backups are considered obsolete
28+
# (Use relative date/time formats : https://www.php.net/manual/en/datetime.formats.relative.php)
29+
#backup_expiration_age: '6 months ago' # default '3 months ago'
30+
31+
# Timeout for backups.
32+
# backup_timeout: 1200 # default 600
33+
34+
# Timeout for restores.
35+
# restore_timeout: 2400 # default 1800
36+
37+
# List here tables (per connection) you don't want in your backups
38+
#excluded_tables:
39+
#default: ['table1', 'table2']
40+
41+
# Specify here paths to binaries, only if the system can't find them by himself
42+
# platform are 'mysql', 'postgresql', 'sqlite'
43+
#backupper_binaries:
44+
#mariadb: '/usr/bin/mariadb-dump' # default 'mariadb-dump'
45+
#mysql: '/usr/bin/mysqldump' # default 'mysqldump'
46+
#postgresql: '/usr/bin/pg_dump' # default 'pg_dump'
47+
#sqlite: '/usr/bin/sqlite3' # default 'sqlite3'
48+
#restorer_binaries:
49+
#mariadb: '/usr/bin/mariadb' # default 'mariadb'
50+
#mysql: '/usr/bin/mysql' # default 'mysql'
51+
#postgresql: '/usr/bin/pg_restore' # default 'pg_restore'
52+
#sqlite: '/usr/bin/sqlite3' # default 'sqlite3'
53+
54+
# Default options to pass to the binary when backing up or restoring
55+
# a database. Those options must be defined per connection.
56+
# If you do not define some default options, here or by using the
57+
# "--extra-options" option when invoking the command, the following
58+
# ones will be used according to the database vendor:
59+
# - When backing up:
60+
# - MariaDB: --no-tablespaces
61+
# - MySQL: --no-tablespaces
62+
# - PostgreSQL: -Z 5 --lock-wait-timeout=120
63+
# - SQLite: -bail
64+
# - When restoring:
65+
# - MariaDB: None
66+
# - MySQL: None
67+
# - PostgreSQL: -j 2 --clean --if-exists --disable-triggers
68+
# - SQLite: None
69+
#backupper_options:
70+
#default: ''
71+
#another_connection: ''
72+
#restorer_options:
73+
#default: ''
74+
#another_connection: ''
75+
76+
# Update this configuration if you want to look for anonymizers in a custom folder.
77+
# These are default paths that will always be registered even if you override
78+
# the setting and don't repeat them:
79+
#anonymizer_paths:
80+
#- '%kernel.project_dir%/vendor/makinacorpus/db-tools-bundle/src/Anonymizer'
81+
#- '%kernel.project_dir%/src/Anonymization/Anonymizer'
82+
83+
# Anonymization configuration.
84+
anonymization:
85+
# If you want to configure anonymization with attributes on
86+
# Doctrine entities, you have nothing to add here: if doctrine/orm
87+
# is available the DbToolsBundle will automatically look for it.
88+
#
89+
# If you want to load configuration from a yaml:
90+
# 1/ If you want to configure anonymization only for the default
91+
# DBAL connection, declare it like this:
92+
yaml: '%kernel.project_dir%/config/anonymizations.yaml'
93+
# 2/ If you use multiple connections, declare each configuration like this:
94+
#yaml:
95+
#- connection_one: '%kernel.project_dir%/config/anonymizations/connection_one.yaml'
96+
#- connection_two: '%kernel.project_dir%/config/anonymizations/connection_two.yaml'

0 commit comments

Comments
 (0)