settings.py: Change deployed check

This is security-critical so we have two checks.

(imported from commit adaa1cefe2d08526cdaac2fb0d8cc02773390224)
This commit is contained in:
Keegan McAllister 2012-10-27 11:11:30 -04:00
parent cbdbc12ab0
commit 92b10e3bc2
3 changed files with 10 additions and 1 deletions

View File

@ -2,7 +2,8 @@
import os
import platform
deployed = (platform.node() == 'humbug-dev')
deployed = (('humbughq.com' in platform.node())
or os.path.exists('/etc/humbug-server'))
DEBUG = not deployed
TEMPLATE_DEBUG = DEBUG

View File

View File

@ -86,6 +86,14 @@ class humbug_base {
source => '/root/humbug/servers/puppet/files/root_authorized_keys',
}
# This is just an empty file. It's used by the app to test if it's running
# in production.
file { '/etc/humbug-server':
ensure => file,
mode => 644,
source => '/root/humbug/servers/puppet/files/humbug-server',
}
file { '/etc/puppet/puppet.conf':
ensure => file,
mode => 640,