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
<?php | |
ini_set('display_errors', 0); | |
// reset challenge environment hourly | |
if (!file_exists('../hourly') || (time() - filemtime('../hourly')) > 60*60) { | |
// remove uploaded files | |
foreach (glob('../files/*') as $f) { | |
unlink("../files/$f"); | |
} |
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
variable "aws_access_key" {} | |
variable "aws_secret_key" {} | |
variable "aws_db_username" {} | |
variable "aws_db_password" {} | |
resource "aws_key_pair" "calendar-ssh" { | |
key_name = "xxxxxxxxxxx-key" | |
public_key = "${var.aws_pub_key}" | |
} |
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
libraries = %w[mysql56 mysql-community-client mysql-community-devel] | |
execute "sudo yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm -y" | |
libraries.each do |l| | |
package l do | |
action :install | |
end | |
end |
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
include_recipe "../../environments/default.rb" | |
include_recipe "rbenv::system" | |
remote_file "/etc/profile.d/rbenv.sh" do | |
action :create | |
mode "664" | |
owner "root" | |
group "root" | |
source "./etc/profile.d/rbenv.sh" | |
end |
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
USER_NAME = "mycalendar".freeze | |
node.reverse_merge!( | |
root: { | |
name: "root", | |
owner: "root", | |
group: "root", | |
}, | |
user: { | |
name: USER_NAME.to_s, |
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
USER_NAME = node[:user][:name] | |
HOME_DIR = "/home/#{USER_NAME}".freeze | |
group USER_NAME.to_s do | |
action :create | |
gid 502 | |
end | |
user USER_NAME.to_s do | |
action :create |
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
image_magic_dep = %w[libpng-devel libjpeg-devel libtiff-devel] | |
image_magic_dep.each do |i| | |
package i do | |
action :install | |
end | |
end | |
directory "create Download directory" do | |
action :create | |
path "/tmp/Download" |
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
include_recipe "../../environments/default.rb" | |
dependencies = %w[git gcc gcc-c++ wget] | |
execute "yum update" do | |
command "yum update -y" | |
end | |
dependencies.each do |p| | |
package p do |
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
include_recipe "../cookbooks/dependencies/default.rb" | |
include_recipe "../cookbooks/users/default.rb" | |
include_recipe "../cookbooks/ruby/default.rb" | |
include_recipe "../cookbooks/mysql/default.rb" | |
include_recipe "../cookbooks/nginx/default.rb" | |
include_recipe "../cookbooks/nodejs/default.rb" | |
include_recipe "../cookbooks/rails/default.rb" |
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
default: &default | |
adapter: mysql2 | |
encoding: utf8 | |
database: mycalendar_development | |
pool: 5 | |
username: <%= Settings.database[:user_name] %> | |
password: <%= Settings.database[:password] %> | |
socket: /var/lib/mysql/mysql.sock | |
reconnect: false | |
host: calendar-dbinstance.xxxx.xxxxx.rds.amazonaws.com |