LOEMIND.txt 810 B

123456789101112131415161718192021222324
  1. # 1. Peata konteiner
  2. docker stop nominatim
  3. # 2. Kopeeri config välja
  4. docker cp nominatim:/etc/postgresql/12/main/pg_hba.conf ./pg_hba.conf.backup
  5. # 3. Loo uus turvalisem fail (üleval näidatud)
  6. nano pg_hba.conf
  7. # 4. Kopeeri tagasi
  8. docker start nominatim
  9. sleep 5
  10. docker cp ./pg_hba.conf nominatim:/etc/postgresql/12/main/pg_hba.conf
  11. docker exec nominatim bash -c "chown postgres:postgres /etc/postgresql/12/main/pg_hba.conf;"
  12. # 5. Reload
  13. docker exec nominatim su - postgres -c "psql -c 'SELECT pg_reload_conf();'"
  14. # 6. Kontrolli
  15. #docker exec nominatim psql -U postgres -c "SELECT * FROM pg_hba_file_rules;"
  16. docker exec nominatim su - postgres -c "psql -c 'SELECT * FROM pg_hba_file_rules;'"
  17. # Kontrolli kas kasutatakse õiget conf faili
  18. docker exec nominatim su - postgres -c "psql -c 'SHOW hba_file;'"