aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--roles/mediagoblin/defaults/main.yml2
-rw-r--r--roles/mediagoblin/tasks/mediagoblin.yml21
-rw-r--r--roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j224
-rw-r--r--roles/mediagoblin/templates/paste_local.ini.j28
4 files changed, 28 insertions, 27 deletions
diff --git a/roles/mediagoblin/defaults/main.yml b/roles/mediagoblin/defaults/main.yml
index 381e5af..0511f28 100644
--- a/roles/mediagoblin/defaults/main.yml
+++ b/roles/mediagoblin/defaults/main.yml
@@ -3,5 +3,5 @@ mediagoblin_hostname: "{{ ansible_nodename }}"
mediagoblin_basedir: /srv/mediagoblin
mediagoblin_user: mediagoblin
mediagoblin_git_uri: git://git.savannah.gnu.org/mediagoblin.git
-mediagoblin_git_ref: v0.9.0
+mediagoblin_git_ref: 7aa40ebe6fe708db3cb3feb3e32b25269c6d62f7
mediagoblin_email_sender: "mediagoblin@{{ mediagoblin_hostname }}"
diff --git a/roles/mediagoblin/tasks/mediagoblin.yml b/roles/mediagoblin/tasks/mediagoblin.yml
index b7df031..29929c3 100644
--- a/roles/mediagoblin/tasks/mediagoblin.yml
+++ b/roles/mediagoblin/tasks/mediagoblin.yml
@@ -6,6 +6,7 @@
- python3-pil
- python3-virtualenv
- python3-babel
+ - python3-pip
- virtualenv
- automake
- npm # XXX: really? UGH
@@ -46,14 +47,6 @@
state=directory
owner={{ mediagoblin_user }}
-- name: Create virtualenv
- shell:
- virtualenv --python=python3 --system-site-packages .
- chdir="{{mediagoblin_basedir}}/src"
- creates="{{mediagoblin_basedir}}/src/bin/python"
- sudo: yes
- sudo_user: "{{ mediagoblin_user }}"
-
- name: Build mediagoblin
shell:
./bootstrap.sh && ./configure -with-python3 && make
@@ -62,10 +55,10 @@
sudo: yes
sudo_user: "{{ mediagoblin_user }}"
-- name: Install flup in virtualenv
- easy_install:
- name=flup
- virtualenv="{{ mediagoblin_basedir }}"/src
+- name: Install flup6 in virtualenv
+ shell: "{{ mediagoblin_basedir }}/src/bin/pip install flup6"
+ args:
+ chdir="{{ mediagoblin_basedir }}"/src
sudo: yes
sudo_user: "{{ mediagoblin_user }}"
@@ -78,11 +71,11 @@
- name: Copy mediagoblin config
template: src=mediagoblin_local.ini.j2
- dest=/srv/mediagoblin/src/mediagoblin_local.ini
+ dest={{ mediagoblin_basedir}}/src/mediagoblin_local.ini
- name: Copy mediagoblin paste config
template: src=paste_local.ini.j2
- dest=/srv/mediagoblin/src/paste_local.ini
+ dest={{ mediagoblin_basedir }}/src/paste_local.ini
- name: Copy generic mediagoblin nginx site configuration
template: src=etc_nginx_sites-available_mediagoblin.j2
diff --git a/roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j2 b/roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j2
index 817f02c..8705d0f 100644
--- a/roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j2
+++ b/roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j2
@@ -37,14 +37,22 @@ server {
alias /srv/mediagoblin.example.org/mediagoblin/user_dev/plugin_static/;
}
- # Mounting MediaGoblin itself via FastCGI.
+# # Mounting MediaGoblin itself via FastCGI.
+# location / {
+# fastcgi_pass 127.0.0.1:26543;
+# include /etc/nginx/fastcgi_params;
+#
+# # our understanding vs nginx's handling of script_name vs
+# # path_info don't match :)
+# fastcgi_param PATH_INFO $fastcgi_script_name;
+# fastcgi_param SCRIPT_NAME "";
+# }
+
+ # Until FastCGI works, just do a proxy pass
location / {
- fastcgi_pass 127.0.0.1:26543;
- include /etc/nginx/fastcgi_params;
-
- # our understanding vs nginx's handling of script_name vs
- # path_info don't match :)
- fastcgi_param PATH_INFO $fastcgi_script_name;
- fastcgi_param SCRIPT_NAME "";
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_pass http://127.0.0.1:26543;
}
}
diff --git a/roles/mediagoblin/templates/paste_local.ini.j2 b/roles/mediagoblin/templates/paste_local.ini.j2
index fef637e..815140f 100644
--- a/roles/mediagoblin/templates/paste_local.ini.j2
+++ b/roles/mediagoblin/templates/paste_local.ini.j2
@@ -53,7 +53,7 @@ debug = false
[server:main]
use = egg:waitress#main
host = 127.0.0.1
-port = 6543
+port = 26543
# # Gunicorn settings. See http://docs.gunicorn.org/en/19.0/settings.html
# # for more information about configuring Gunicorn
# proc_name = gmg
@@ -66,16 +66,16 @@ port = 6543
# If you are configuring the paste config manually, you can remove
# these.
-# Use this if you want to run on port 6543 and have MediaGoblin be
+# Use this if you want to run on port 26543 and have MediaGoblin be
# viewable externally
[server:broadcast]
use = egg:waitress#main
host = 0.0.0.0
-port = 6543
+port = 26543
# Use this if you want to connect via fastcgi
[server:fcgi]
-use = egg:flup#fcgi_fork
+use = egg:flup6#fcgi_fork
host = %(fcgi_host)s
port = %(fcgi_port)s