#!/bin/bash # Copyright 2016 - 2020 Crunchy Data Solutions, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. docker compose -p "nominatim" -f docker-compose.yml up -d docker exec -u root nominatim bash -c " echo 'ssl = off' >> /etc/postgresql/12/main/postgresql.conf && \ chown -R postgres:postgres /etc/postgresql/12/main/ && \ # PostgreSQL andmed chown -R postgres:postgres /var/lib/postgresql/12/main && \ chmod 700 /var/lib/postgresql/12/main && \ # PostgreSQL konfiguratsioon chown -R postgres:postgres /etc/postgresql/12/main && \ # Logikataloog mkdir -p /var/log/postgresql && \ chown -R postgres:postgres /var/log/postgresql && \ # SSL võti chgrp ssl-cert /etc/ssl/private/ssl-cert-snakeoil.key && \ chmod 640 /etc/ssl/private/ssl-cert-snakeoil.key && \ # Run mkdir -p /var/run/postgresql/12-main.pg_stat_tmp && \ chown -R postgres:postgres /var/run/postgresql && \ chmod -R 775 /var/run/postgresql " # Kopeeri tagasi docker cp conf/pg_hba.conf nominatim:/etc/postgresql/12/main/pg_hba.conf docker exec nominatim bash -c "chown postgres:postgres /etc/postgresql/12/main/pg_hba.conf;" docker restart nominatim sleep 5 # 5. Reload docker exec nominatim su - postgres -c "psql -c 'SELECT pg_reload_conf();'" # 6. Kontrolli docker exec nominatim su - postgres -c "psql -c 'SELECT * FROM pg_hba_file_rules;'" # Kontrolli kas kasutatakse õiget conf faili docker exec nominatim su - postgres -c "psql -c 'SHOW hba_file;'" #docker restart nominatim exit 0