diff --git a/servers/host/deploy/pod/pod.localhost.conf b/servers/host/deploy/pod/pod.localhost.conf deleted file mode 100644 index f30a6e4..0000000 --- a/servers/host/deploy/pod/pod.localhost.conf +++ /dev/null @@ -1,49 +0,0 @@ -# -*- mode: apache -*- - - - ServerName pod.localhost - - DocumentRoot /srv/pod/ - - Options +Indexes - Require all granted - - - # Forbid directory browsing of POD images; there are just too many. - - Options -Indexes - - - ErrorLog ${APACHE_LOG_DIR}/error.log - LogLevel warn - CustomLog ${APACHE_LOG_DIR}/access.log combined - - - - - ServerName pod.localhost - - DocumentRoot /srv/pod/ - - Options +Indexes - Require all granted - - - # Forbid directory browsing of POD images; there are just too many. - - Options -Indexes - - - SSLEngine on - SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem - SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key - - ErrorLog ${APACHE_LOG_DIR}/error.log - LogLevel warn - CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined - - BrowserMatch "MSIE [2-6]" \ - nokeepalive ssl-unclean-shutdown \ - downgrade-1.0 force-response-1.0 - BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown - diff --git a/servers/host/deploy/rattail/rattail.conf.template b/servers/host/deploy/rattail/rattail.conf.template index 744b99b..1baf328 100644 --- a/servers/host/deploy/rattail/rattail.conf.template +++ b/servers/host/deploy/rattail/rattail.conf.template @@ -28,7 +28,7 @@ default.to = root@localhost default.subject = [Rattail] Automated email [rattail.pod] -pictures.gtin.root_url = http://pod.localhost/pictures/gtin +pictures.gtin.root_url = http://localhost:9080/pod/pictures/gtin pictures.gtin.root_path = /srv/pod/pictures/gtin diff --git a/servers/host/deploy/rattail/rattail.localhost.conf b/servers/host/deploy/rattail/rattail.localhost.conf index 093a110..2bcfb8d 100644 --- a/servers/host/deploy/rattail/rattail.localhost.conf +++ b/servers/host/deploy/rattail/rattail.localhost.conf @@ -11,6 +11,18 @@ WSGIDaemonProcess rattail user=rattail group=rattail Require all granted + # POD + Alias /pod/ /srv/pod/ + + Options +Indexes + Require all granted + + + # Forbid directory browsing of POD images; there are just too many. + + Options -Indexes + + ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined @@ -25,6 +37,18 @@ WSGIDaemonProcess rattail user=rattail group=rattail Require all granted + # POD + Alias /pod/ /srv/pod/ + + Options +Indexes + Require all granted + + + # Forbid directory browsing of POD images; there are just too many. + + Options -Indexes + + ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined diff --git a/servers/host/fabfile.py b/servers/host/fabfile.py index d7c0f62..ae18a8d 100644 --- a/servers/host/fabfile.py +++ b/servers/host/fabfile.py @@ -17,7 +17,7 @@ from rattail.fablib import make_deploy, mkdir, make_system_user, cdvirtualenv, w from rattail.fablib import apt, pod, postgresql, python -__all__ = ['bootstrap_all', 'bootstrap_system', 'bootstrap_rattail', 'bootstrap_pod'] +__all__ = ['bootstrap_all', 'bootstrap_system', 'bootstrap_rattail'] # Set the 'live' role to the canonical hostname for this server. #env.roledefs = {'live': ['host.example.com']} @@ -29,6 +29,10 @@ try: except ImportError as error: warn("Couldn't import fabenv: {0}".format(error)) +# Set some default env attrs in case fabenv isn't prepped. +if not hasattr(env, 'password_postgresql_rattail'): + setattr(env, 'password_postgresql_rattail', 'password') + @task def bootstrap_all(): @@ -37,7 +41,6 @@ def bootstrap_all(): """ bootstrap_system() bootstrap_rattail() - bootstrap_pod() @task @@ -65,7 +68,7 @@ def bootstrap_system(): sudo('service apache2 restart') # misc - apt.install('git', 'emacs-nox') + apt.install('git', 'emacs-nox', 'emacs-goodies-el') @task @@ -114,23 +117,7 @@ def bootstrap_rattail(): sudo('bin/alembic --config=app/rattail.conf upgrade heads', user='rattail') sudo('bin/rattail --config app/rattail.conf initdb --with-admin', user='rattail') - # website - with cdvirtualenv('rattail', 'app'): - mkdir('sessions', owner='rattail:rattail') - deploy('rattail/web.conf', 'web.conf') - deploy('rattail/rattail.wsgi', 'rattail.wsgi') - append('/etc/hosts', '127.0.0.1 rattail.localhost', use_sudo=True) - deploy('rattail/rattail.localhost.conf', '/etc/apache2/sites-available/rattail.localhost.conf') - sudo('a2ensite rattail.localhost') - sudo('service apache2 restart') - - -@task -def bootstrap_pod(): - """ - Bootstrap the POD images website. - """ - # images + # POD mkdir('/srv/pod') if getattr(env, 'rattail_download_pod', False): pod.install_pod() @@ -138,7 +125,9 @@ def bootstrap_pod(): puts("Skipping POD download, per 'fabenv' settings.") # website - append('/etc/hosts', '127.0.0.1 pod.localhost', use_sudo=True) - deploy('pod/pod.localhost.conf', '/etc/apache2/sites-available/pod.localhost.conf') - sudo('a2ensite pod.localhost') + with cdvirtualenv('rattail', 'app'): + mkdir('sessions', owner='rattail:rattail') + deploy('rattail/web.conf', 'web.conf') + deploy('rattail/rattail.wsgi', 'rattail.wsgi') + deploy('rattail/rattail.localhost.conf', '/etc/apache2/sites-available/000-default.conf') sudo('service apache2 restart')