@@ -214,6 +214,8 @@ chown -R $USER:$USER tak
214214cp ./scripts/configureInDocker1.sh ./tak/db-utils/configureInDocker.sh
215215cp ./postgresql1.conf ./tak/postgresql.conf
216216cp ./scripts/takserver-setup-db-1.sh ./tak/db-utils/takserver-setup-db.sh
217+
218+ # This config uses a docker alias of postgresql://tak-database:5432/
217219cp ./CoreConfig.xml ./tak/CoreConfig.xml
218220
219221# # Set admin username and password and ensure it meets validation criteria
@@ -231,8 +233,18 @@ IP=$(ip addr show $NIC | grep -m 1 "inet " | awk '{print $2}' | cut -d "/" -f1)
231233
232234printf $info " \nProceeding with IP address: $IP \n"
233235sed -i " s/password=\" .*\" /password=\" ${pgpassword} \" /" tak/CoreConfig.xml
236+ # Replaces HOSTIP for rate limiter and Fed server. Database URL is a docker alias of tak-database
234237sed -i " s/HOSTIP/$IP /g" tak/CoreConfig.xml
235238
239+ # Replaces takserver.jks with $IP.jks
240+ sed -i " s/takserver.jks/$IP .jks/g" tak/CoreConfig.xml
241+
242+ # Better memory allocation:
243+ # By default TAK server allocates memory based upon the *total* on a machine.
244+ # In the real world, people not on a gov budget use a server for more than one thing.
245+ # Instead we allocate memory based upon the available memory so this still scales, but you can run it on a smaller budget
246+ sed -i " s/MemTotal/MemFree/g" tak/setenv.sh
247+
236248# # Set variables for generating CA and client certs
237249printf $warning " SSL setup. Hit enter (x3) to accept the defaults:\n"
238250read -p " State (for cert generation). Default [state] :" state
@@ -276,10 +288,10 @@ while :
276288do
277289 sleep 10 # let the PG stderr messages conclude...
278290 printf $warning " ------------CERTIFICATE GENERATION--------------\n"
279- $DOCKER_COMPOSE exec tak bash -c " cd /opt/tak/certs && ./makeRootCa.sh --ca-name LOL "
291+ $DOCKER_COMPOSE exec tak bash -c " cd /opt/tak/certs && ./makeRootCa.sh --ca-name CRFtakserver "
280292 if [ $? -eq 0 ];
281293 then
282- $DOCKER_COMPOSE exec tak bash -c " cd /opt/tak/certs && ./makeCert.sh server takserver "
294+ $DOCKER_COMPOSE exec tak bash -c " cd /opt/tak/certs && ./makeCert.sh server $IP "
283295 if [ $? -eq 0 ];
284296 then
285297 $DOCKER_COMPOSE exec tak bash -c " cd /opt/tak/certs && ./makeCert.sh client $user "
@@ -305,6 +317,7 @@ cd tak/certs
305317./makeCert.sh client user1
306318./makeCert.sh client user2
307319
320+
308321# Make 2 data packages
309322cd ../../
310323./scripts/certDP.sh $IP user1
0 commit comments