[meta] Set up EC2 for hosting TiddlyWiki

pull/28/head
Alpha Chen 10 years ago
parent 9b6a03a335
commit 0b9af34003

@ -31,5 +31,9 @@ Host home.kejadlen.net
Host chime.prgmr.com
User kejadlen
Host *.amazonaws.com
User ubuntu
IdentityFile ~/.ssh/aws.pem
Host 127.0.0.1
StrictHostKeyChecking no

@ -0,0 +1,17 @@
- hosts: ec2
vars:
user: ubuntu
group: ubuntu
tasks:
- apt: update_cache=yes
sudo: true
- apt: name=nginx state=present
sudo: true
- file: path=/etc/nginx/sites-enabled/default state=absent
sudo: true
notify: reload nginx
- include: tiddlywiki/tasks.yml
handlers:
- name: reload nginx
service: name=nginx state=reloaded
- include: tiddlywiki/handlers.yml

@ -0,0 +1,3 @@
- name: restart tiddlywiki
service: name=tiddlywiki state=restarted
sudo: true

@ -0,0 +1,8 @@
server {
listen 80;
location / {
proxy_pass http://localhost:8080;
proxy_set_header X-Forwarded-Host $host;
}
}

@ -0,0 +1,16 @@
- include_vars: tiddlywiki/vars.yml.private
- apt: name={{ item }} state=present
sudo: true
with_items:
- nodejs
- nodejs-legacy
- npm
- npm: name=tiddlywiki global=yes state=present
sudo: true
- file: path=~/tiddlywiki state=directory
- copy: src=tiddlywiki/nginx.conf dest=/etc/nginx/conf.d/tiddlywiki.conf
sudo: true
notify: reload nginx
- template: src=tiddlywiki/upstart.conf.j2 dest=/etc/init/tiddlywiki.conf
sudo: true
notify: restart tiddlywiki

@ -0,0 +1,12 @@
description "TiddlyWiki"
author "Alpha Chen"
start on started network-services
stop on stopping network-services
setuid {{ user }}
setgid {{ group }}
console log
exec tiddlywiki /home/{{ user }}/tiddlywiki --server 8080 $:/core/save/all text/plain text/html alpha "{{ password }}"
Loading…
Cancel
Save