2020-06-29 19:39:58 +02:00
NODE_WORKERS = ( " worker0 " " worker1 " )
SMTP_GW = " smtpgw "
2019-04-20 23:24:47 +02:00
DOCKER_LIMIT = ( -- pids - limit 256 -- memory 512 M )
2018-12-09 09:22:06 +01:00
2020-06-29 19:39:58 +02:00
export CONTAINERS = ( " $NODE_GUI " " ${ NODE_WORKERS[@] } " " $SMTP_GW " " $SINGLE_SERVER " " piler1 " " syslog.host " )
2018-12-09 09:22:06 +01:00
setup () {
destroy_containers
2020-07-11 11:06:24 +02:00
set - x
2018-12-09 09:22:06 +01:00
launch_containers
2020-07-11 11:06:24 +02:00
set + x
2018-12-09 09:22:06 +01:00
create_rules " piler1 "
2019-07-28 11:56:40 +02:00
add_data_officer " piler1 "
2018-12-09 09:22:06 +01:00
}
2021-08-13 20:48:48 +02:00
cleanup_package () {
local pkg = " $ 1 "
log " Removing ${ PACKAGE_DIR}/${pkg } "
rm - f " ${ PACKAGE_DIR}/${pkg } "
}
2018-12-09 09:22:06 +01:00
launch_containers () {
2023-06-14 07:17:58 +02:00
pushd " ${ WORKSPACE}/${PROJECT_ID } /tests "
2023-06-14 07:10:25 +02:00
echo - e " PACKAGE= $PACKAGE\nPILER_HOST =cust1.acts.hu \n RT= $RT " > . env
log " running docker-compose "
docker - compose up - d
2023-06-14 07:56:31 +02:00
wait_until_container_is_healthy " piler1 "
2023-06-14 07:10:25 +02:00
docker - compose ps
2023-06-14 07:17:58 +02:00
popd
2023-06-14 07:10:25 +02:00
}
launch_containers2 () {
2019-04-20 23:24:47 +02:00
log " starting syslog server "
docker run - d -- net = piler " ${ DOCKER_LIMIT[@] } " -- name syslog . host sutoj / syslog
2020-06-29 19:50:29 +02:00
log " starting piler "
2020-06-29 19:47:33 +02:00
docker run - d -- net = piler " ${ DOCKER_LIMIT[@] } " -- name piler1 \
- e PACKAGE = " $PACKAGE " \
- e PILER_HOST = " cust1.acts.hu " \
2022-06-06 16:15:57 +02:00
- e RT = " $RT " \
2020-10-15 14:43:32 +02:00
- p 127.0 . 0.1 : 80 : 80 - p 25 : 25 \
2020-06-29 19:47:33 +02:00
- v " ${ PACKAGE_DIR } :/data:ro " \
- v " ${ CONFIG_DIR } /11-aaaa.conf:/etc/rsyslog.d/11-aaaa.conf:ro " \
" $docker_image "
2019-04-20 23:34:50 +02:00
2018-12-09 09:22:06 +01:00
wait_for_sleep_cycle_in_container " piler1 "
2021-08-13 20:48:48 +02:00
2023-01-26 13:32:33 +01:00
###cleanup_package "$PACKAGE"
2018-12-09 09:22:06 +01:00
}
create_rules () {
local container = " $ 1 "
2022-03-14 20:31:20 +01:00
echo 'echo "insert into domain (domain, mapped) values(\"fictive.com\",\"fictive.com\"),(\"address.com\",\"address.com\"),(\"acts.hu\",\"acts.hu\"),(\"gtsce.com\",\"gtsce.com\"),(\"datanet.hu\",\"datanet.hu\"),(\"gtsdatanet.hu\",\"gtsdatanet.hu\"),(\"gts.hu\",\"gts.hu\"),(\"aaa.fu\",\"aaa.fu\")"| mysql --defaults-file=/etc/piler/.my.cnf piler' | docker exec - i " $container " sh
2018-12-09 09:22:06 +01:00
2019-11-13 20:33:48 +01:00
echo 'echo "insert into archiving_rule (subject) values (\"Android táblagép\")"| mysql --defaults-file=/etc/piler/.my.cnf piler' | docker exec - i " $container " sh
echo 'echo "insert into archiving_rule (\`from\`) values (\"@gmail.com\")"| mysql --defaults-file=/etc/piler/.my.cnf piler' | docker exec - i " $container " sh
echo 'echo "insert into archiving_rule (\`from\`,attachment_type, _attachment_size, attachment_size) values (\"finderis.co.ua\", \"image\", \">\", 100000)"|mysql --defaults-file=/etc/piler/.my.cnf piler' | docker exec - i " $container " sh
echo 'echo "insert into archiving_rule (\`to\`) values (\"undisclosed-recipients\")"|mysql --defaults-file=/etc/piler/.my.cnf piler' | docker exec - i " $container " sh
2022-04-18 13:07:47 +02:00
echo 'echo "insert into import (\`type\`, username, password, server) values (\"imap-ssl\", \"sanyi@aaa.fu\", \"abcde123\", \"imap.aaa.fu\")"|mysql --defaults-file=/etc/piler/.my.cnf piler' | docker exec - i " $container " sh
2018-12-09 09:22:06 +01:00
2019-11-13 20:33:48 +01:00
echo 'echo "update user set password=\"\$6\$GKL00T\$8jqoFOe3PyAbOCLwKB7JwndwC.IinHrZRkdoQDZUc8vybZ88sA2qomlz5JceNif8fFpkGzZ03ilvQa7tqQx0v1\""| mysql --defaults-file=/etc/piler/.my.cnf piler' | docker exec - i " $container " sh
2018-12-09 09:22:06 +01:00
2019-11-13 20:33:48 +01:00
docker exec " $container " / etc / init . d / rc . piler reload
2018-12-09 09:22:06 +01:00
}
2019-07-28 11:56:40 +02:00
add_data_officer () {
local container = " $ 1 "
2019-07-28 12:04:36 +02:00
echo 'echo "insert into user (uid, username, realname, password, domain, dn, isadmin) values(2, \"dataofficer\", \"Data officer\", \"\$6\$rX285LfP\$ZxhlacbzKuCcqkaizzBu8SAiYb6.f8K4Us08nUHwSpWMQkNhw4o2rmfKXoTfaM4rnBHUYVK1N4IfBsqN8CAtS/\", \"local\", \"*\", 4)"| mysql --defaults-file=/etc/piler/.my.cnf piler' | docker exec - i " $container " sh
2019-07-28 12:12:22 +02:00
echo 'echo "insert into email (uid, email) values(2, \"do@local\")"| mysql --defaults-file=/etc/piler/.my.cnf piler' | docker exec - i " $container " sh
2019-07-28 11:56:40 +02:00
}