-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New app; Etherpad, found better way to include nutcracker
- Loading branch information
Showing
8 changed files
with
144 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{%- set dir = '/srv/webplatform/etherpad' -%} | ||
{%- set salt_master_ip = salt['pillar.get']('infra:hosts_entries:salt') -%} | ||
{%- set upstream_port = salt['pillar.get']('upstream:etherpad:port', 8006) %} | ||
|
||
include: | ||
- users.app-user | ||
|
||
{{ dir }}: | ||
file.directory: | ||
- user: app-user | ||
- group: www-data | ||
- recurse: | ||
- user | ||
- group | ||
|
||
{{ dir }}/docker-compose.yml: | ||
file.managed: | ||
- source: salt://code/files/etherpad/docker-compose.yml.jinja | ||
- template: jinja | ||
- user: app-user | ||
- group: www-data | ||
- mode: 644 | ||
- context: | ||
upstream_port: {{ upstream_port }} | ||
salt_master_ip: {{ salt_master_ip }} | ||
- require: | ||
- file: {{ dir }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## Managed by Salt Stack, please DO NOT TOUCH, or ALL CHANGES WILL be LOST! | ||
## source {{ source }} | ||
|
||
# ref: | ||
# - http://docs.docker.com/compose/ | ||
# - http://docs.docker.com/compose/yml/ | ||
|
||
web: | ||
image: webplatform/etherpad | ||
|
||
restart: always | ||
|
||
ports: | ||
- "{{ upstream_port }}:9001" | ||
|
||
dns: | ||
- 10.10.10.41 | ||
- 8.8.8.8 | ||
|
||
# vim: et ts=2 sw=2 ft=yaml: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
|
||
# | ||
# This is the PUBLIC virtual host for etherpad.{{ tld }} | ||
# | ||
# Note that we call another NGINX virtual host, from the internal network, | ||
# without SSL, and with a different name than the publicly exposed. | ||
# | ||
# Intention is that we can have multiple internal upstreams load-balanced | ||
# by this very virtual host. | ||
# | ||
# =========================================================================== | ||
# | ||
# Managed by Salt Stack. Do NOT edit manually! | ||
# source: {{ source }} | ||
# | ||
|
||
upstream upstream_etherpad { | ||
keepalive 16; | ||
ip_hash; | ||
|
||
{%- for b in upstreams %} | ||
server {{ b }}:{{ upstream_port }}; | ||
{%- endfor %} | ||
} | ||
|
||
server { | ||
listen 80; | ||
server_name etherpad.{{ tld }}; | ||
include common_params; | ||
return 301 https://etherpad.{{ tld }}$request_uri; | ||
} | ||
|
||
server { | ||
listen 443 ssl spdy; | ||
server_name etherpad.{{ tld }}; | ||
|
||
root /var/www/html; | ||
include common_params; | ||
include ssl_params; | ||
|
||
ssl on; | ||
ssl_certificate /etc/ssl/webplatform/public_wildcard_201407.pem; | ||
ssl_certificate_key /etc/ssl/webplatform/201407.key; | ||
|
||
location / { | ||
proxy_pass http://upstream_etherpad; | ||
include proxy_params; | ||
proxy_intercept_errors on; | ||
|
||
# Backend keepalive | ||
# ref: http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive | ||
proxy_http_version 1.1; | ||
proxy_set_header Connection ""; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{%- set tld = salt['pillar.get']('infra:current:tld', 'webplatform.org') -%} | ||
{%- set upstreams = salt['pillar.get']('upstream:etherpad:nodes', ['127.0.0.1']) -%} | ||
{%- set upstream_port = salt['pillar.get']('upstream:etherpad:port', 8006) %} | ||
|
||
include: | ||
- nginx | ||
|
||
# | ||
# This is the PUBLIC virtual host for **etherpad** subdomain proxying requests | ||
# to an internal webserver. | ||
# | ||
# =========================================================================== | ||
# | ||
|
||
/etc/nginx/sites-available/etherpad: | ||
file.managed: | ||
- source: salt://etherpad/files/nginx.frontend.conf.jinja | ||
- template: jinja | ||
- context: | ||
tld: {{ tld }} | ||
upstreams: {{ upstreams }} | ||
upstream_port: {{ upstream_port }} | ||
- require: | ||
- pkg: nginx | ||
|
||
/etc/nginx/sites-enabled/10-etherpad: | ||
file.symlink: | ||
- target: /etc/nginx/sites-available/etherpad | ||
- require: | ||
- file: /etc/nginx/sites-available/etherpad | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ include: | |
- code.discuss | ||
- code.status | ||
- code.publican | ||
- code.etherpad | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters