Merge branch 'master' of github.com:tus/tusd

This commit is contained in:
Marius 2016-09-29 21:22:02 +02:00
commit 216c45287a
2 changed files with 16 additions and 18 deletions

View File

@ -33,15 +33,9 @@ infra variable {
} }
infra output { infra output {
public_address { public_address { value = "${aws_instance.tusd.0.public_dns}" }
value = "${aws_instance.tusd.0.public_dns}" public_addresses { value = "${join("\n", aws_instance.tusd.*.public_dns)}" }
} endpoint { value = "http://${aws_route53_record.www.name}:80/" }
public_addresses {
value = "${join("\n", aws_instance.tusd.*.public_dns)}"
}
endpoint {
value = "http://${aws_route53_record.www.name}:80/"
}
} }
infra resource aws_instance tusd { infra resource aws_instance tusd {
@ -53,13 +47,11 @@ infra resource aws_instance tusd {
key_file = "{{{config.global.ssh.privatekey_file}}}" key_file = "{{{config.global.ssh.privatekey_file}}}"
user = "{{{config.global.ssh.user}}}" user = "{{{config.global.ssh.user}}}"
} }
tags { tags { Name = "master.tus.io" }
"Name" = "${var.FREY_DOMAIN}"
}
} }
infra resource "aws_route53_record" www { infra resource "aws_route53_record" www {
name = "${var.FREY_DOMAIN}" name = "master.tus.io"
records = ["${aws_instance.tusd.public_dns}"] records = ["${aws_instance.tusd.public_dns}"]
ttl = "300" ttl = "300"
type = "CNAME" type = "CNAME"
@ -110,7 +102,7 @@ install {
} }
tasks { tasks {
name = "Common | Set motd" name = "Common | Set motd"
copy = "content='Welcome to {{lookup('env', 'FREY_DOMAIN')}}' dest=/etc/motd owner=root group=root mode=0644 backup=yes" copy = "content='Welcome to master.tus.io' dest=/etc/motd owner=root group=root mode=0644 backup=yes"
} }
tasks { tasks {
name = "Common | Set timezone variables" name = "Common | Set timezone variables"
@ -151,12 +143,20 @@ setup {
} }
roles { roles {
role = "{{{init.paths.roles_dir}}}/fqdn/v1.0.0" role = "{{{init.paths.roles_dir}}}/fqdn/v1.0.0"
fqdn = "{{lookup('env', 'FREY_DOMAIN')}}" fqdn = "master.tus.io"
} }
tasks { tasks {
file = "path=/mnt/tusd-data state=directory owner=www-data group=www-data mode=0755 recurse=yes" file = "path=/mnt/tusd-data state=directory owner=www-data group=ubuntu mode=ug+rwX,o= recurse=yes"
name = "tusd | Create tusd data dir" name = "tusd | Create tusd data dir"
} }
tasks {
name = "tusd | Create purger crontab (clean up >24h (1400minutes) files)"
cron {
name = "purger"
special_time = "hourly"
job = "find /mnt/tusd-data -type f -mmin +1440 -print0 | xargs -n 200 -r -0 rm || true"
}
}
} }
} }

View File

@ -2,9 +2,7 @@
# So suitable for adding secret keys and such # So suitable for adding secret keys and such
# export DEBUG="frey:*" # export DEBUG="frey:*"
# export FREY_DOMAIN="master.tus.io"
# export FREY_ENCRYPTION_SECRET="***" # export FREY_ENCRYPTION_SECRET="***"
# source env.sh # source env.sh
# travis encrypt --add env.global "FREY_DOMAIN=${FREY_DOMAIN}"
# travis encrypt --add env.global "FREY_ENCRYPTION_SECRET=${FREY_ENCRYPTION_SECRET}" # travis encrypt --add env.global "FREY_ENCRYPTION_SECRET=${FREY_ENCRYPTION_SECRET}"