Hostnames shouldn't have underscores

This commit is contained in:
Disassembler 2019-09-24 19:49:02 +02:00
parent 8d42eac029
commit 8171f20309
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
4 changed files with 24 additions and 24 deletions

@ -1 +1 @@
Subproject commit 7591cf2d477c9d97c96e13ee276da0bc0cf2a47e Subproject commit ae2a913d0ca05422a1f070c27c4057119177ab8d

View File

@ -7,7 +7,7 @@ cd $(realpath $(dirname "${0}"))/install
mkdir -p /srv/ckan/postgres_data mkdir -p /srv/ckan/postgres_data
chown -R 105432:105432 /srv/ckan/postgres_data chown -R 105432:105432 /srv/ckan/postgres_data
chmod 700 /srv/ckan/postgres_data chmod 700 /srv/ckan/postgres_data
lxc-execute -n ckan_postgres -- initdb -D /var/lib/postgresql lxc-execute -n ckan-postgres -- initdb -D /var/lib/postgresql
# Configure Postgres # Configure Postgres
cp postgres_data/postgresql.conf /srv/ckan/postgres_data/postgresql.conf cp postgres_data/postgresql.conf /srv/ckan/postgres_data/postgresql.conf
@ -16,28 +16,28 @@ cp postgres_data/pg_hba.conf /srv/ckan/postgres_data/pg_hba.conf
# Create database # Create database
export CKAN_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') export CKAN_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
export CKAN_DS_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') export CKAN_DS_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=')
service ckan_postgres start #TODO: wait? service ckan-postgres start #TODO: wait?
envsubst <createdb.sql | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql envsubst <createdb.sql | lxc-attach -u 5432 -g 5432 ckan-postgres -- psql
# Configure Redis # Configure Redis
mkdir -p /srv/ckan/redis_conf /srv/ckan/redis_data mkdir -p /srv/ckan/redis_conf /srv/ckan/redis_data
cp redis_conf/redis.conf /srv/ckan/redis_conf/redis.conf cp redis_conf/redis.conf /srv/ckan/redis_conf/redis.conf
chown -R 106379:106379 /srv/ckan/redis_data chown -R 106379:106379 /srv/ckan/redis_data
service ckan_redis start service ckan-redis start
# Configure Solr # Configure Solr
mkdir -p /srv/ckan/solr_data mkdir -p /srv/ckan/solr_data
lxc-execute ckan_solr -- cat /opt/solr/server/solr/solr.xml >/srv/ckan/solr_data/solr.xml lxc-execute ckan-solr -- cat /opt/solr/server/solr/solr.xml >/srv/ckan/solr_data/solr.xml
chown -R 108983:108983 /srv/ckan/solr_data chown -R 108983:108983 /srv/ckan/solr_data
service ckan_solr start # TODO: add ready / wait service ckan-solr start # TODO: add ready / wait
# Configure CKAN Solr core # Configure CKAN Solr core
lxc-attach -u 8983 -g 8983 ckan_solr -- solr create -p 8983 -c ckan # TODO: wait to ensure creation? lxc-attach -u 8983 -g 8983 ckan-solr -- solr create -p 8983 -c ckan # TODO: wait to ensure creation?
service ckan_solr stop service ckan-solr stop
cp solr_data/ckan/conf/schema.xml /srv/ckan/solr_data/ckan/conf/schema.xml cp solr_data/ckan/conf/schema.xml /srv/ckan/solr_data/ckan/conf/schema.xml
cp solr_data/ckan/conf/solrconfig.xml /srv/ckan/solr_data/ckan/conf/solrconfig.xml cp solr_data/ckan/conf/solrconfig.xml /srv/ckan/solr_data/ckan/conf/solrconfig.xml
chown 108983:108983 /srv/ckan/solr_data/ckan/conf/schema.xml # TODO: je to potreba? chown 108983:108983 /srv/ckan/solr_data/ckan/conf/schema.xml # TODO: je to potreba?
service ckan_solr start service ckan-solr start
# Configure CKAN DataPusher # Configure CKAN DataPusher
mkdir -p /srv/ckan/datapusher_conf /srv/ckan/datapusher_data mkdir -p /srv/ckan/datapusher_conf /srv/ckan/datapusher_data
@ -56,7 +56,7 @@ chown -R 108080:108080 /srv/ckan/ckan_data
# Populate database # Populate database
lxc-execute ckan -- paster --plugin=ckan db init -c /etc/ckan/ckan.ini lxc-execute ckan -- paster --plugin=ckan db init -c /etc/ckan/ckan.ini
lxc-execute ckan -- paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini lxc-execute ckan -- paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini
lxc-execute ckan -- paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql lxc-execute ckan -- paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | lxc-attach -u 5432 -g 5432 ckan-postgres -- psql
# Create admin account # Create admin account
export CKAN_ADMIN_USER="admin" export CKAN_ADMIN_USER="admin"
@ -65,15 +65,15 @@ export CKAN_ADMIN_APIKEY=$(cat /proc/sys/kernel/random/uuid)
export CKAN_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=') export CKAN_ADMIN_PWD=$(head -c 12 /dev/urandom | base64 | tr -d '+/=')
export CKAN_ADMIN_HASH=$(lxc-execute ckan -- python -c "from passlib.hash import pbkdf2_sha512;print pbkdf2_sha512.encrypt('${CKAN_ADMIN_PWD}')") export CKAN_ADMIN_HASH=$(lxc-execute ckan -- python -c "from passlib.hash import pbkdf2_sha512;print pbkdf2_sha512.encrypt('${CKAN_ADMIN_PWD}')")
export CKAN_ADMIN_EMAIL="admin@example.com" export CKAN_ADMIN_EMAIL="admin@example.com"
envsubst <adminpwd.sql | lxc-attach -u 5432 -g 5432 ckan_postgres -- psql ckan envsubst <adminpwd.sql | lxc-attach -u 5432 -g 5432 ckan-postgres -- psql ckan
# Install config update script # Install config update script
cp update-conf.sh /srv/ckan/update-conf.sh cp update-conf.sh /srv/ckan/update-conf.sh
# Stop services required for setup # Stop services required for setup
service ckan_solr stop service ckan-solr stop
service ckan_postgres stop service ckan-postgres stop
service ckan_redis stop service ckan-redis stop
# Register application # Register application
vmmgr register-app ckan ckan "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}" vmmgr register-app ckan ckan "${CKAN_ADMIN_USER}" "${CKAN_ADMIN_PWD}"

View File

@ -45,10 +45,10 @@ who.log_file = %(cache_dir)s/who_log.ini
# who.timeout = 86400 # who.timeout = 86400
## Database Settings ## Database Settings
sqlalchemy.url = postgresql://ckan:${CKAN_PWD}@postgres/ckan sqlalchemy.url = postgresql://ckan:${CKAN_PWD}@ckan-postgres/ckan
ckan.datastore.write_url = postgresql://ckan:${CKAN_PWD}@postgres/ckan_datastore ckan.datastore.write_url = postgresql://ckan:${CKAN_PWD}@ckan-postgres/ckan_datastore
ckan.datastore.read_url = postgresql://ckan_datastore:${CKAN_DS_PWD}@postgres/ckan_datastore ckan.datastore.read_url = postgresql://ckan_datastore:${CKAN_DS_PWD}@ckan-postgres/ckan_datastore
# PostgreSQL' full-text search parameters # PostgreSQL' full-text search parameters
ckan.datastore.default_fts_lang = english ckan.datastore.default_fts_lang = english
@ -76,13 +76,13 @@ ckan.auth.roles_that_cascade_to_sub_groups = admin
## Search Settings ## Search Settings
ckan.site_id = default ckan.site_id = default
solr_url = http://solr:8983/solr/ckan solr_url = http://ckan-solr:8983/solr/ckan
## Redis Settings ## Redis Settings
# URL to your Redis instance, including the database to be used. # URL to your Redis instance, including the database to be used.
ckan.redis.url = redis://redis:6379/0 ckan.redis.url = redis://ckan-redis:6379/0
## CORS Settings ## CORS Settings

View File

@ -21,7 +21,7 @@
["DIR", "/srv/ckan/ckan_data", "/srv/ckan/storage"] ["DIR", "/srv/ckan/ckan_data", "/srv/ckan/storage"]
] ]
}, },
"ckan_datapusher": { "ckan-datapusher": {
"image": "ckan-datapusher_0.0.13-190620", "image": "ckan-datapusher_0.0.13-190620",
"mounts": [ "mounts": [
["FILE", "/etc/ssl/services.pem", "/etc/ssl/services.pem"], ["FILE", "/etc/ssl/services.pem", "/etc/ssl/services.pem"],
@ -29,20 +29,20 @@
["DIR", "/srv/ckan/datapusher_data", "/srv/ckan-datapusher/data"] ["DIR", "/srv/ckan/datapusher_data", "/srv/ckan-datapusher/data"]
] ]
}, },
"ckan_redis": { "ckan-redis": {
"image": "redis_4.0.12-190620", "image": "redis_4.0.12-190620",
"mounts": [ "mounts": [
["FILE", "/srv/ckan/redis_conf/redis.conf", "/etc/redis.conf"], ["FILE", "/srv/ckan/redis_conf/redis.conf", "/etc/redis.conf"],
["DIR", "/srv/ckan/redis_data", "/var/lib/redis"] ["DIR", "/srv/ckan/redis_data", "/var/lib/redis"]
] ]
}, },
"ckan_solr": { "ckan-solr": {
"image": "solr6_6.5.1-190620", "image": "solr6_6.5.1-190620",
"mounts": [ "mounts": [
["DIR", "/srv/ckan/solr_data", "/var/lib/solr"] ["DIR", "/srv/ckan/solr_data", "/var/lib/solr"]
] ]
}, },
"ckan_postgres": { "ckan-postgres": {
"image": "postgis_11.3.0-190620", "image": "postgis_11.3.0-190620",
"mounts": [ "mounts": [
["DIR", "/srv/ckan/postgres_data", "/var/lib/postgresql"] ["DIR", "/srv/ckan/postgres_data", "/var/lib/postgresql"]