From 3cb3d9c4ce000647c7969d8be531aa18daedd1e9 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 27 Jun 2014 14:14:53 +1000 Subject: [PATCH] BUGFIX: ensure a locale is set correctly --- launcher | 3 ++- samples/data.yml | 4 ++++ samples/redis.yml | 3 +++ samples/standalone.yml | 1 + samples/web_only.yml | 2 ++ templates/postgres.template.yml | 2 +- 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/launcher b/launcher index f17fc7c..0006413 100755 --- a/launcher +++ b/launcher @@ -182,7 +182,8 @@ set_template_info() { require 'yaml' input=STDIN.readlines.join - env = {} + # default to UTF-8 for the dbs sake + env = {'LANG' => 'en_US.UTF-8'} input.split('_FILE_SEPERATOR_').each do |yml| yml.strip! begin diff --git a/samples/data.yml b/samples/data.yml index ebcdf34..38ccdd4 100644 --- a/samples/data.yml +++ b/samples/data.yml @@ -11,6 +11,10 @@ expose: - "6379:6379" - "2221:22" +env: + # ensure locale exists in container, you may need to install it + LANG: en_US.UTF-8 + # amend SOME_SECRET to a password for the discourse user hooks: after_postgres: diff --git a/samples/redis.yml b/samples/redis.yml index 76105ae..84b006e 100644 --- a/samples/redis.yml +++ b/samples/redis.yml @@ -2,6 +2,9 @@ templates: - "templates/redis.template.yml" - "templates/sshd.template.yml" +env: + LANG: en_US.UTF-8 + expose: - "6379:6379" - "2221:22" diff --git a/samples/standalone.yml b/samples/standalone.yml index 243414c..a8d1e2a 100644 --- a/samples/standalone.yml +++ b/samples/standalone.yml @@ -23,6 +23,7 @@ params: version: HEAD env: + LANG: en_US.UTF-8 ## How many concurrent web requests are supported? ## With 2GB we recommend 3-4 workers, with 1GB only 2 # UNICORN_WORKERS: 3 diff --git a/samples/web_only.yml b/samples/web_only.yml index 08fafcb..296ceab 100644 --- a/samples/web_only.yml +++ b/samples/web_only.yml @@ -15,6 +15,8 @@ params: # developer emails allow you to fast track account creation on the site env: # add emails here + LANG: en_US.UTF-8 + DISCOURSE_DEVELOPER_EMAILS: '' DISCOURSE_DB_SOCKET: '' DISCOURSE_DB_PASSWORD: SOME_SECRET diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml index 7da5621..abed0f4 100644 --- a/templates/postgres.template.yml +++ b/templates/postgres.template.yml @@ -102,7 +102,7 @@ run: - exec: cmd: - chown -R root /var/lib/postgresql/9.3/main - - "[ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -u postgres /usr/lib/postgresql/9.3/bin/initdb -D /shared/postgres_data || exit 0" + - "[ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/9.3/bin/initdb -D /shared/postgres_data || exit 0" - chown -R postgres:postgres /shared/postgres_data - chown -R postgres:postgres /var/run/postgresql -- 2.25.1