Skip to content

Commit

Permalink
move all conf folders into conf dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Sutton committed Aug 16, 2021
1 parent 6e7359c commit f4eca30
Show file tree
Hide file tree
Showing 38 changed files with 66 additions and 66 deletions.
80 changes: 40 additions & 40 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,31 @@ disable-all-services:
@echo
@echo "------------------------------------------------------------------"
@echo "Disabling services"
@echo "This will remove any symlinks in nginx_conf/locations and nginx_conf/upstreams"
@echo "This will remove any symlinks in conf/nginx_conf/locations and conf/nginx_conf/upstreams"
@echo "effectively disabling all services exposed by nginx"
@echo "------------------------------------------------------------------"
@echo -n "Are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]
@find ./nginx_conf/locations -maxdepth 1 -type l -delete
@find ./nginx_conf/upstreams -maxdepth 1 -type l -delete
@find ./conf/nginx_conf/locations -maxdepth 1 -type l -delete
@find ./conf/nginx_conf/upstreams -maxdepth 1 -type l -delete


prepare-templates:
@echo
@echo "------------------------------------------------------------------"
@echo "Preparing templates"
@echo "This will replace any local configuration changes you have made"
@echo "in .env, nginx_conf/servername.conf"
@echo "in .env, conf/nginx_conf/servername.conf"
@echo "------------------------------------------------------------------"
@echo -n "Are you sure? [y/N] " && read ans && [ $${ans:-N} = y ]
@cp .env.example .env
@cp nginx_conf/servername.conf.example nginx_conf/servername.conf
@cp conf/nginx_conf/servername.conf.example conf/nginx_conf/servername.conf
@echo "Please enter your valid domain name for the site."
@echo "e.g. example.org or subdomain.example.org:"
@read -p "Domain name: " DOMAIN; \
rpl example.org $$DOMAIN nginx_conf/servername.conf .env;
rpl example.org $$DOMAIN conf/nginx_conf/servername.conf .env;
@echo "We are going to set up a self signed certificate now."
@make configure-ssl-self-signed
@cp nginx_conf/ssl/certificates.conf.selfsigned.example nginx_conf/ssl/ssl.conf
@cp conf/nginx_conf/ssl/certificates.conf.selfsigned.example conf/nginx_conf/ssl/ssl.conf
@echo "Afterwards if you want to put the server into production mode"
@echo "please run:"
@echo "make configure-letsencrypt-ssl"
Expand All @@ -73,7 +73,7 @@ configure-letsencrypt-ssl:
rpl example.org $$DOMAIN nginx_certbot_init_conf/nginx.conf init-letsencrypt.sh;
@cp nginx_certbot_init_conf/nginx.conf.example nginx_certbot_init_conf/nginx.conf
@cp init-letsencrypt.sh.example init-letsencrypt.sh
@cp nginx_conf/ssl/ssl.conf.example nginx_conf/ssl/ssl.conf
@cp conf/nginx_conf/ssl/ssl.conf.example conf/nginx_conf/ssl/ssl.conf
@read -p "Valid Contact Person Email Address: " EMAIL; \
rpl [email protected] $$EMAIL init-letsencrypt.sh .env

Expand All @@ -85,65 +85,65 @@ site-config:
@echo "This will replace any local configuration changes you have made"
@echo "------------------------------------------------------------------"
@echo -n "Are you sure you want to continue? [y/N] " && read ans && [ $${ans:-N} = y ]
@cp ./hugo_conf/config.yaml.example ./hugo_conf/config.yaml
@cp ./conf/hugo_conf/config.yaml.example ./conf/hugo_conf/config.yaml
@echo "Please enter the site domain name (default 'example.com')"
@read -p "Domain name: " result; \
DOMAINNAME=$${result:-"example.com"} && \
rpl -q {{siteDomain}} "$$DOMAINNAME" $(shell pwd)/hugo_conf/config.yaml
rpl -q {{siteDomain}} "$$DOMAINNAME" $(shell pwd)/conf/hugo_conf/config.yaml
@echo "Please enter the title of your website (default 'Geoservices')"
@read -p "Site Title: " result; \
SITETITLE=$${result:-"Geoservices"} && \
rpl -q {{siteTitle}} "$$SITETITLE" $(shell pwd)/hugo_conf/config.yaml
rpl -q {{siteTitle}} "$$SITETITLE" $(shell pwd)/conf/hugo_conf/config.yaml
@echo "Please enter the name of the website owner (default 'Kartoza')"
@read -p "Site Owner: " result; \
SITEOWNER=$${result:-"Kartoza"} && \
rpl -q {{ownerName}} "$$SITEOWNER" $(shell pwd)/hugo_conf/config.yaml
rpl -q {{ownerName}} "$$SITEOWNER" $(shell pwd)/conf/hugo_conf/config.yaml
@echo "Please supply the URL of the site owner (default 'www.kartoza.com')."
@read -p "Owner URL: " result; \
OWNERURL=$${result:-"www.kartoza.com"} && \
rpl -q {{ownerDomain}} "$$OWNERURL" $(shell pwd)/hugo_conf/config.yaml
rpl -q {{ownerDomain}} "$$OWNERURL" $(shell pwd)/conf/hugo_conf/config.yaml
@echo "Please supply a valid public URL to the Website Logo."
@echo "Be sure to include the protocol prefix (e.g. https://)"
@read -p "Logo URL: " result; \
LOGOURL=$${result:-"img/Circle-icons-stack.svg"} && \
rpl -q {{logoURL}} "$$LOGOURL" $(shell pwd)/hugo_conf/config.yaml
rpl -q {{logoURL}} "$$LOGOURL" $(shell pwd)/conf/hugo_conf/config.yaml

enable-hugo:
-@cd nginx_conf/locations; ln -s hugo.conf.available hugo.conf
-@cd conf/nginx_conf/locations; ln -s hugo.conf.available hugo.conf

disable-hugo:
@cd nginx_conf/locations; rm hugo.conf
@cd conf/nginx_conf/locations; rm hugo.conf

enable-docs:
-@cd nginx_conf/locations; ln -s docs.conf.available docs.conf
-@cd conf/nginx_conf/locations; ln -s docs.conf.available docs.conf

disable-docs:
@cd nginx_conf/locations; rm docs.conf
@cd conf/nginx_conf/locations; rm docs.conf

enable-files:
-@cd nginx_conf/locations; ln -s files.conf.available files.conf
-@cd conf/nginx_conf/locations; ln -s files.conf.available files.conf

disable-files:
@cd nginx_conf/locations; rm files.conf
@cd conf/nginx_conf/locations; rm files.conf

enable-geoserver:
-@cd nginx_conf/locations; ln -s geoserver.conf.available geoserver.conf
-@cd conf/nginx_conf/locations; ln -s geoserver.conf.available geoserver.conf

disable-geoserver:
@cd nginx_conf/locations; rm geoserver.conf
@cd conf/nginx_conf/locations; rm geoserver.conf


setup-scp:
@echo "------------------------------------------------------------------"
@echo "Copying .ssh/authorized keys to all scp shares."
@echo "------------------------------------------------------------------"
@cat ~/.ssh/authorized_keys > scp_conf/geoserver_data
@cat ~/.ssh/authorized_keys > scp_conf/qgis_projects
@cat ~/.ssh/authorized_keys > scp_conf/qgis_fonts
@cat ~/.ssh/authorized_keys > scp_conf/qgis_svg
@cat ~/.ssh/authorized_keys > scp_conf/hugo_data
@cat ~/.ssh/authorized_keys > scp_conf/odm_data
@cat ~/.ssh/authorized_keys > scp_conf/general_data
@cat ~/.ssh/authorized_keys > conf/scp_conf/geoserver_data
@cat ~/.ssh/authorized_keys > conf/scp_conf/qgis_projects
@cat ~/.ssh/authorized_keys > conf/scp_conf/qgis_fonts
@cat ~/.ssh/authorized_keys > conf/scp_conf/qgis_svg
@cat ~/.ssh/authorized_keys > conf/scp_conf/hugo_data
@cat ~/.ssh/authorized_keys > conf/scp_conf/odm_data
@cat ~/.ssh/authorized_keys > conf/scp_conf/general_data

deploy:
@echo
Expand All @@ -161,9 +161,9 @@ configure-htpasswd:
@echo "------------------------------------------------------------------"
# bcrypt encrypted pwd, be sure to usie nginx:alpine nginx image
@export PASSWD=$$(pwgen 20 1); \
htpasswd -cbB nginx_conf/htpasswd web $$PASSWD; \
htpasswd -cbB conf/nginx_conf/htpasswd web $$PASSWD; \
echo "#User account for protected areas of the site using httpauth" >> .env; \
echo "#You can add more accounts to nginx_conf/htpasswd using the htpasswd tool" >> .env; \
echo "#You can add more accounts to conf/nginx_conf/htpasswd using the htpasswd tool" >> .env; \
echo $$PASSWD >> .env; \
echo "Files sharing htpasswd set to $$PASSWD"
@make enable-files
Expand All @@ -181,7 +181,7 @@ site-reset:
@echo "This will replace any local configuration changes you have made"
@echo "------------------------------------------------------------------"
@echo -n "Are you sure you want to continue? [y/N] " && read ans && [ $${ans:-N} = y ]
@cp ./hugo_conf/config.yaml.example ./hugo_conf/config.yaml
@cp ./conf/hugo_conf/config.yaml.example ./conf/hugo_conf/config.yaml



Expand Down Expand Up @@ -235,10 +235,10 @@ configure-mapproxy:
@echo "=========================:"
@echo "Mapproxy specific updates:"
@echo "=========================:"
@cp mapproxy_conf/mapproxy.yaml.example mapproxy_conf/mapproxy.yaml
@cp mapproxy_conf/seed.yaml.example mapproxy_conf/seed.yaml
@cp conf/mapproxy_conf/mapproxy.yaml.example conf/mapproxy_conf/mapproxy.yaml
@cp conf/mapproxy_conf/seed.yaml.example conf/mapproxy_conf/seed.yaml
@echo "We have created template mapproxy.yaml and seed.yaml"
@echo "configuration files in mapproxy_conf."
@echo "configuration files in conf/mapproxy_conf."
@echo "You will need to hand edit those files and then "
@echo "restart mapproxy for those edits to take effect."
@echo "see: make reinitialise-mapproxy"
Expand All @@ -263,7 +263,7 @@ configure-osm-mirror:
@echo "OSM Mirror specific updates:"
@echo "=========================:"
@echo "I have prepared my clip area (optional) and"
@echo "saved it as osm_config/clip.geojson."
@echo "saved it as conf/osm_config/clip.geojson."
@echo "You can easily create such a clip document"
@echo "at https://geojson.io or by using QGIS"
@read -p "Press enter to continue" CONFIRM;
Expand Down Expand Up @@ -357,7 +357,7 @@ reinitialise-mapproxy:
@echo "------------------------------------------------------------------"
@docker-compose kill mapproxy
@docker-compose rm mapproxy
@rm -rf mapproxy_conf/cache_data/*
@rm -rf conf/mapproxy_conf/cache_data/*
@docker-compose up -d mapproxy
@docker-compose logs -f mapproxy

Expand Down Expand Up @@ -399,9 +399,9 @@ kill-osm:
@docker-compose rm osmupdate
@docker-compose rm osmenrich
# Next commands have - in front as they as non compulsory to succeed
-@sudo rm osm_conf/timestamp.txt
-@sudo rm osm_conf/last.state.txt
-@sudo rm osm_conf/importer.lock
-@sudo rm conf/osm_conf/timestamp.txt
-@sudo rm conf/osm_conf/last.state.txt
-@sudo rm conf/osm_conf/importer.lock
-@docker-compose exec -u postgres db psql -c "drop schema osm cascade;" gis
-@docker-compose exec -u postgres db psql -c "drop schema osm_backup cascade;" gis
-@docker-compose exec -u postgres db psql -c "drop schema osm_import cascade;" gis
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 26 additions & 26 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,17 @@ services:
nginx:
image: *nginx-image
volumes:
- ./nginx_conf/nginx.conf:/etc/nginx/nginx.conf
- ./conf/nginx_conf/nginx.conf:/etc/nginx/nginx.conf
# You must manually create this file before running
# by running either
# make configure-ssl-self-signed
# or
# make configure-letsencrypt-ssl
- ./nginx_conf/servername.conf:/etc/nginx/servername.conf
- ./nginx_conf/upstreams:/etc/nginx/upstreams
- ./nginx_conf/ssl:/etc/nginx/ssl
- ./nginx_conf/locations:/etc/nginx/locations
- ./nginx_conf/htpasswd:/etc/nginx/.htpasswd
- ./conf/nginx_conf/servername.conf:/etc/nginx/servername.conf
- ./conf/nginx_conf/upstreams:/etc/nginx/upstreams
- ./conf/nginx_conf/ssl:/etc/nginx/ssl
- ./conf/nginx_conf/locations:/etc/nginx/locations
- ./conf/nginx_conf/htpasswd:/etc/nginx/.htpasswd
# If you are running with a self signed certificate
# then make sure the following folder contains these files
# nginx-selfsigned.crt
Expand Down Expand Up @@ -203,7 +203,7 @@ services:
# Only raw markdown should be put in here
- scp_hugo_data:/src/content
# config from host mounted volume
- ./hugo_conf/config.yaml:/src/config.yaml
- ./conf/hugo_conf/config.yaml:/src/config.yaml

############################################################
# END OF DEFAULT SERVICES - everything after this
Expand Down Expand Up @@ -409,8 +409,8 @@ services:
# run when container is started.
- scp_qgis_fonts:/usr/share/fonts
- scp_qgis_svg:/var/lib/qgis/.local/share/QGIS/QGIS3/profiles/default/svg
- ./qgis_conf/qgis-auth.db:/tmp/qgis-auth.db
- ./qgis_conf/qgis-auth-pwd.txt:/tmp/qgis-auth-pwd.txt
- ./conf/qgis_conf/qgis-auth.db:/tmp/qgis-auth.db
- ./conf/qgis_conf/qgis-auth-pwd.txt:/tmp/qgis-auth-pwd.txt
# Working path for the pg_service file if using
# openquake/qgis-server:stable
# See https://github.com/gem/oq-qgis-server/issues/54
Expand All @@ -423,12 +423,12 @@ services:
# no user/pass data and
# instead we fetch those credentials from the qgis
# authdb
- ./pg_conf/pg_service.conf:/etc/postgresql-common/pg_service.conf:ro
- ./conf/pg_conf/pg_service.conf:/etc/postgresql-common/pg_service.conf:ro
# As per the oq QGIS Server docs at
# https://github.com/gem/oq-qgis-server/blob/master/README.md#postgresql-connection-service-file-optional
# but wrong!
#This works instead for the openquake/qgis-server:3 image
#- ./pg_conf/pg_service.conf:/etc/pg_service.conf:ro
#- ./conf/pg_conf/pg_service.conf:/etc/pg_service.conf:ro

# Mount the mergin db sync data into nginx so we can access
# images etc.
Expand Down Expand Up @@ -456,10 +456,10 @@ services:
user: "1000:1000"
volumes:
- mapproxy_data:/mapproxy/
- ./mapproxy_conf/app.py:/mapproxy/app.py
- ./mapproxy_conf/seed.yaml:/mapproxy/seed.yaml
- ./mapproxy_conf/mapproxy.yaml:/mapproxy/mapproxy.yaml
- ./mapproxy_conf/clip:/mapproxy/clip
- ./conf/mapproxy_conf/app.py:/mapproxy/app.py
- ./conf/mapproxy_conf/seed.yaml:/mapproxy/seed.yaml
- ./conf/mapproxy_conf/mapproxy.yaml:/mapproxy/mapproxy.yaml
- ./conf/mapproxy_conf/clip:/mapproxy/clip
networks:
- os-gis-stack

Expand All @@ -483,10 +483,10 @@ services:
user: "1000:1000"
volumes:
- mapproxy_data:/mapproxy/
- ./mapproxy_conf/app.py:/mapproxy/app.py
- ./mapproxy_conf/seed.yaml:/mapproxy/seed.yaml
- ./mapproxy_conf/mapproxy.yaml:/mapproxy/mapproxy.yaml
- ./mapproxy_conf/clip:/mapproxy/clip
- ./conf/mapproxy_conf/app.py:/mapproxy/app.py
- ./conf/mapproxy_conf/seed.yaml:/mapproxy/seed.yaml
- ./conf/mapproxy_conf/mapproxy.yaml:/mapproxy/mapproxy.yaml
- ./conf/mapproxy_conf/clip:/mapproxy/clip
networks:
- os-gis-stack

Expand Down Expand Up @@ -528,7 +528,7 @@ services:
ports:
- "8080"
volumes:
- ./swagger_conf/swagger.json:/swagger.json
- ./conf/swagger_conf/swagger.json:/swagger.json
env_file: .env
environment:
SWAGGER_JSON: /swagger.json
Expand Down Expand Up @@ -557,7 +557,7 @@ services:
# data files for geoserver etc.
- "2222:22"
volumes:
# Host mounted volumes./mapproxy_conf/mapproxy.yml
# Host mounted volumes./conf/mapproxy_conf/mapproxy.yml
# We need to persist the /etc/ssh folder so that
# Docker restart don't create a new host key each time
# because clients connecting will error out with host
Expand All @@ -566,7 +566,7 @@ services:
# One file per user, each file containing list
# of ssh keys allowed to upload to the data dir
# Files should be given same name as user
- ./scp_conf:/conf
- ./conf/scp_conf:/conf
# Mounted in SCP and to geoserver for serving geoserver data
# store
- scp_geoserver_data:/data/geoserver_data
Expand Down Expand Up @@ -671,7 +671,7 @@ services:
entrypoint: /bin/cp
command: "/settings/country.pbf /home/settings/country.pbf"
volumes:
- ./osm_conf:/home/settings
- ./conf/osm_conf:/home/settings

imposm:
image: *imposm-image
Expand All @@ -681,7 +681,7 @@ services:
- dev
volumes:
# These are sharable to other containers
- ./osm_conf:/home/settings
- ./conf/osm_conf:/home/settings
- osm_import_done:/home/import_done
- osm_import_queue:/home/import_queue
- osm_cache:/home/cache
Expand Down Expand Up @@ -733,7 +733,7 @@ services:

volumes:
# These are sharable to other containers
- ./osm_conf:/home/settings
- ./conf/osm_conf:/home/settings
- osm_import_done:/home/import_done
- osm_import_queue:/home/import_queue
- osm_cache:/home/cache
Expand Down Expand Up @@ -777,7 +777,7 @@ services:
- dev
volumes:
# These are sharable to other containers
- ./osm_conf:/home/settings
- ./conf/osm_conf:/home/settings
- osm_import_done:/home/import_done
- osm_import_queue:/home/import_queue
- osm_cache:/home/cache
Expand Down

0 comments on commit f4eca30

Please sign in to comment.