@@ -25,4 +25,5 @@ deployment/cookbooks |
||
| 25 | 25 |
.ruby-gemset |
| 26 | 26 |
.ruby-version |
| 27 | 27 |
manifest.yml |
| 28 |
-config/unicorn.rb |
|
| 28 |
+config/unicorn.rb |
|
| 29 |
+db/schema.rb |
@@ -160,7 +160,12 @@ on_heroku = ENV['ON_HEROKU'] || |
||
| 160 | 160 |
ENV['HEROKU_POSTGRESQL_GOLD_URL'] || |
| 161 | 161 |
File.read(File.join(File.dirname(__FILE__), 'Procfile')) =~ /intended for Heroku/ |
| 162 | 162 |
|
| 163 |
-ENV['DATABASE_ADAPTER'] ||= 'postgresql' if on_heroku |
|
| 163 |
+ENV['DATABASE_ADAPTER'] ||= |
|
| 164 |
+ if on_heroku |
|
| 165 |
+ 'postgresql' |
|
| 166 |
+ else |
|
| 167 |
+ 'mysql2' |
|
| 168 |
+ end |
|
| 164 | 169 |
|
| 165 | 170 |
if_true(on_heroku) do |
| 166 | 171 |
gem 'rails_12factor', group: :production |
@@ -214,7 +214,7 @@ module Agents |
||
| 214 | 214 |
|
| 215 | 215 |
return [<<-XML, 200, 'text/xml'] |
| 216 | 216 |
<?xml version="1.0" encoding="UTF-8" ?> |
| 217 |
-<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"> |
|
| 217 |
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"> |
|
| 218 | 218 |
<channel> |
| 219 | 219 |
<atom:link href=#{feed_url(secret: params['secret'], format: :xml).encode(xml: :attr)} rel="self" type="application/rss+xml" />
|
| 220 | 220 |
<atom:icon>#{feed_icon.encode(xml: :text)}</atom:icon>
|
@@ -1,188 +0,0 @@ |
||
| 1 |
-# encoding: UTF-8 |
|
| 2 |
-# This file is auto-generated from the current state of the database. Instead |
|
| 3 |
-# of editing this file, please use the migrations feature of Active Record to |
|
| 4 |
-# incrementally modify your database, and then regenerate this schema definition. |
|
| 5 |
-# |
|
| 6 |
-# Note that this schema.rb definition is the authoritative source for your |
|
| 7 |
-# database schema. If you need to create the application database on another |
|
| 8 |
-# system, you should be using db:schema:load, not running all the migrations |
|
| 9 |
-# from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
| 10 |
-# you'll amass, the slower it'll run and the greater likelihood for issues). |
|
| 11 |
-# |
|
| 12 |
-# It's strongly recommended that you check this file into your version control system. |
|
| 13 |
- |
|
| 14 |
-ActiveRecord::Schema.define(version: 20150808115436) do |
|
| 15 |
- |
|
| 16 |
- create_table "agent_logs", force: :cascade do |t| |
|
| 17 |
- t.integer "agent_id", limit: 4, null: false |
|
| 18 |
- t.text "message", limit: 65535, null: false, charset: "utf8mb4", collation: "utf8mb4_bin" |
|
| 19 |
- t.integer "level", limit: 4, default: 3, null: false |
|
| 20 |
- t.integer "inbound_event_id", limit: 4 |
|
| 21 |
- t.integer "outbound_event_id", limit: 4 |
|
| 22 |
- t.datetime "created_at" |
|
| 23 |
- t.datetime "updated_at" |
|
| 24 |
- end |
|
| 25 |
- |
|
| 26 |
- create_table "agents", force: :cascade do |t| |
|
| 27 |
- t.integer "user_id", limit: 4 |
|
| 28 |
- t.text "options", limit: 65535, charset: "utf8mb4", collation: "utf8mb4_bin" |
|
| 29 |
- t.string "type", limit: 255, collation: "utf8_bin" |
|
| 30 |
- t.string "name", limit: 255, charset: "utf8mb4", collation: "utf8mb4_bin" |
|
| 31 |
- t.string "schedule", limit: 255, collation: "utf8_bin" |
|
| 32 |
- t.integer "events_count", limit: 4, default: 0, null: false |
|
| 33 |
- t.datetime "last_check_at" |
|
| 34 |
- t.datetime "last_receive_at" |
|
| 35 |
- t.integer "last_checked_event_id", limit: 4 |
|
| 36 |
- t.datetime "created_at" |
|
| 37 |
- t.datetime "updated_at" |
|
| 38 |
- t.text "memory", limit: 4294967295, charset: "utf8mb4", collation: "utf8mb4_bin" |
|
| 39 |
- t.datetime "last_web_request_at" |
|
| 40 |
- t.integer "keep_events_for", limit: 4, default: 0, null: false |
|
| 41 |
- t.datetime "last_event_at" |
|
| 42 |
- t.datetime "last_error_log_at" |
|
| 43 |
- t.boolean "propagate_immediately", limit: 1, default: false, null: false |
|
| 44 |
- t.boolean "disabled", limit: 1, default: false, null: false |
|
| 45 |
- t.string "guid", limit: 255, null: false, charset: "ascii", collation: "ascii_bin" |
|
| 46 |
- t.integer "service_id", limit: 4 |
|
| 47 |
- end |
|
| 48 |
- |
|
| 49 |
- add_index "agents", ["guid"], name: "index_agents_on_guid", using: :btree |
|
| 50 |
- add_index "agents", ["schedule"], name: "index_agents_on_schedule", using: :btree |
|
| 51 |
- add_index "agents", ["type"], name: "index_agents_on_type", using: :btree |
|
| 52 |
- add_index "agents", ["user_id", "created_at"], name: "index_agents_on_user_id_and_created_at", using: :btree |
|
| 53 |
- |
|
| 54 |
- create_table "control_links", force: :cascade do |t| |
|
| 55 |
- t.integer "controller_id", limit: 4, null: false |
|
| 56 |
- t.integer "control_target_id", limit: 4, null: false |
|
| 57 |
- t.datetime "created_at" |
|
| 58 |
- t.datetime "updated_at" |
|
| 59 |
- end |
|
| 60 |
- |
|
| 61 |
- add_index "control_links", ["control_target_id"], name: "index_control_links_on_control_target_id", using: :btree |
|
| 62 |
- add_index "control_links", ["controller_id", "control_target_id"], name: "index_control_links_on_controller_id_and_control_target_id", unique: true, using: :btree |
|
| 63 |
- |
|
| 64 |
- create_table "delayed_jobs", force: :cascade do |t| |
|
| 65 |
- t.integer "priority", limit: 4, default: 0 |
|
| 66 |
- t.integer "attempts", limit: 4, default: 0 |
|
| 67 |
- t.text "handler", limit: 16777215, charset: "utf8mb4", collation: "utf8mb4_bin" |
|
| 68 |
- t.text "last_error", limit: 65535, charset: "utf8mb4", collation: "utf8mb4_bin" |
|
| 69 |
- t.datetime "run_at" |
|
| 70 |
- t.datetime "locked_at" |
|
| 71 |
- t.datetime "failed_at" |
|
| 72 |
- t.string "locked_by", limit: 255 |
|
| 73 |
- t.string "queue", limit: 255 |
|
| 74 |
- t.datetime "created_at" |
|
| 75 |
- t.datetime "updated_at" |
|
| 76 |
- end |
|
| 77 |
- |
|
| 78 |
- add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree |
|
| 79 |
- |
|
| 80 |
- create_table "events", force: :cascade do |t| |
|
| 81 |
- t.integer "user_id", limit: 4 |
|
| 82 |
- t.integer "agent_id", limit: 4 |
|
| 83 |
- t.decimal "lat", precision: 15, scale: 10 |
|
| 84 |
- t.decimal "lng", precision: 15, scale: 10 |
|
| 85 |
- t.text "payload", limit: 16777215, charset: "utf8mb4", collation: "utf8mb4_bin" |
|
| 86 |
- t.datetime "created_at" |
|
| 87 |
- t.datetime "updated_at" |
|
| 88 |
- t.datetime "expires_at" |
|
| 89 |
- end |
|
| 90 |
- |
|
| 91 |
- add_index "events", ["agent_id", "created_at"], name: "index_events_on_agent_id_and_created_at", using: :btree |
|
| 92 |
- add_index "events", ["expires_at"], name: "index_events_on_expires_at", using: :btree |
|
| 93 |
- add_index "events", ["user_id", "created_at"], name: "index_events_on_user_id_and_created_at", using: :btree |
|
| 94 |
- |
|
| 95 |
- create_table "links", force: :cascade do |t| |
|
| 96 |
- t.integer "source_id", limit: 4 |
|
| 97 |
- t.integer "receiver_id", limit: 4 |
|
| 98 |
- t.datetime "created_at" |
|
| 99 |
- t.datetime "updated_at" |
|
| 100 |
- t.integer "event_id_at_creation", limit: 4, default: 0, null: false |
|
| 101 |
- end |
|
| 102 |
- |
|
| 103 |
- add_index "links", ["receiver_id", "source_id"], name: "index_links_on_receiver_id_and_source_id", using: :btree |
|
| 104 |
- add_index "links", ["source_id", "receiver_id"], name: "index_links_on_source_id_and_receiver_id", using: :btree |
|
| 105 |
- |
|
| 106 |
- create_table "scenario_memberships", force: :cascade do |t| |
|
| 107 |
- t.integer "agent_id", limit: 4, null: false |
|
| 108 |
- t.integer "scenario_id", limit: 4, null: false |
|
| 109 |
- t.datetime "created_at" |
|
| 110 |
- t.datetime "updated_at" |
|
| 111 |
- end |
|
| 112 |
- |
|
| 113 |
- add_index "scenario_memberships", ["agent_id"], name: "index_scenario_memberships_on_agent_id", using: :btree |
|
| 114 |
- add_index "scenario_memberships", ["scenario_id"], name: "index_scenario_memberships_on_scenario_id", using: :btree |
|
| 115 |
- |
|
| 116 |
- create_table "scenarios", force: :cascade do |t| |
|
| 117 |
- t.string "name", limit: 255, null: false, charset: "utf8mb4", collation: "utf8mb4_bin" |
|
| 118 |
- t.integer "user_id", limit: 4, null: false |
|
| 119 |
- t.datetime "created_at" |
|
| 120 |
- t.datetime "updated_at" |
|
| 121 |
- t.text "description", limit: 65535, charset: "utf8mb4", collation: "utf8mb4_bin" |
|
| 122 |
- t.boolean "public", limit: 1, default: false, null: false |
|
| 123 |
- t.string "guid", limit: 255, null: false, charset: "ascii", collation: "ascii_bin" |
|
| 124 |
- t.string "source_url", limit: 255 |
|
| 125 |
- t.string "tag_bg_color", limit: 255 |
|
| 126 |
- t.string "tag_fg_color", limit: 255 |
|
| 127 |
- end |
|
| 128 |
- |
|
| 129 |
- add_index "scenarios", ["user_id", "guid"], name: "index_scenarios_on_user_id_and_guid", unique: true, using: :btree |
|
| 130 |
- |
|
| 131 |
- create_table "services", force: :cascade do |t| |
|
| 132 |
- t.integer "user_id", limit: 4, null: false |
|
| 133 |
- t.string "provider", limit: 255, null: false, collation: "utf8_general_ci" |
|
| 134 |
- t.string "name", limit: 255, null: false, collation: "utf8_general_ci" |
|
| 135 |
- t.text "token", limit: 65535, null: false, collation: "utf8_general_ci" |
|
| 136 |
- t.text "secret", limit: 65535, collation: "utf8_general_ci" |
|
| 137 |
- t.text "refresh_token", limit: 65535, collation: "utf8_general_ci" |
|
| 138 |
- t.datetime "expires_at" |
|
| 139 |
- t.boolean "global", limit: 1, default: false |
|
| 140 |
- t.text "options", limit: 65535, collation: "utf8_general_ci" |
|
| 141 |
- t.datetime "created_at" |
|
| 142 |
- t.datetime "updated_at" |
|
| 143 |
- t.string "uid", limit: 255, collation: "utf8_general_ci" |
|
| 144 |
- end |
|
| 145 |
- |
|
| 146 |
- add_index "services", ["provider"], name: "index_services_on_provider", using: :btree |
|
| 147 |
- add_index "services", ["uid"], name: "index_services_on_uid", using: :btree |
|
| 148 |
- add_index "services", ["user_id", "global"], name: "index_services_on_user_id_and_global", using: :btree |
|
| 149 |
- |
|
| 150 |
- create_table "user_credentials", force: :cascade do |t| |
|
| 151 |
- t.integer "user_id", limit: 4, null: false |
|
| 152 |
- t.string "credential_name", limit: 255, null: false |
|
| 153 |
- t.text "credential_value", limit: 65535, null: false |
|
| 154 |
- t.datetime "created_at" |
|
| 155 |
- t.datetime "updated_at" |
|
| 156 |
- t.string "mode", limit: 255, default: "text", null: false, collation: "utf8_bin" |
|
| 157 |
- end |
|
| 158 |
- |
|
| 159 |
- add_index "user_credentials", ["user_id", "credential_name"], name: "index_user_credentials_on_user_id_and_credential_name", unique: true, using: :btree |
|
| 160 |
- |
|
| 161 |
- create_table "users", force: :cascade do |t| |
|
| 162 |
- t.string "email", limit: 255, default: "", null: false, collation: "utf8_bin" |
|
| 163 |
- t.string "encrypted_password", limit: 255, default: "", null: false, charset: "ascii", collation: "ascii_bin" |
|
| 164 |
- t.string "reset_password_token", limit: 255, collation: "utf8_bin" |
|
| 165 |
- t.datetime "reset_password_sent_at" |
|
| 166 |
- t.datetime "remember_created_at" |
|
| 167 |
- t.integer "sign_in_count", limit: 4, default: 0 |
|
| 168 |
- t.datetime "current_sign_in_at" |
|
| 169 |
- t.datetime "last_sign_in_at" |
|
| 170 |
- t.string "current_sign_in_ip", limit: 255 |
|
| 171 |
- t.string "last_sign_in_ip", limit: 255 |
|
| 172 |
- t.datetime "created_at" |
|
| 173 |
- t.datetime "updated_at" |
|
| 174 |
- t.boolean "admin", limit: 1, default: false, null: false |
|
| 175 |
- t.integer "failed_attempts", limit: 4, default: 0 |
|
| 176 |
- t.string "unlock_token", limit: 255 |
|
| 177 |
- t.datetime "locked_at" |
|
| 178 |
- t.string "username", limit: 191, null: false, charset: "utf8mb4", collation: "utf8mb4_unicode_ci" |
|
| 179 |
- t.string "invitation_code", limit: 255, collation: "utf8_bin" |
|
| 180 |
- t.integer "scenario_count", limit: 4, default: 0, null: false |
|
| 181 |
- end |
|
| 182 |
- |
|
| 183 |
- add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree |
|
| 184 |
- add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree |
|
| 185 |
- add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", unique: true, using: :btree |
|
| 186 |
- add_index "users", ["username"], name: "index_users_on_username", unique: true, using: :btree |
|
| 187 |
- |
|
| 188 |
-end |
@@ -14,7 +14,7 @@ class GemfileHelper |
||
| 14 | 14 |
root = Pathname.new(File.join(File.dirname(__FILE__), '..')) |
| 15 | 15 |
sanity_check Dotenv.load( |
| 16 | 16 |
root.join(".env.local"),
|
| 17 |
- root.join(".env.#{ENV['RAILS_ENV']}"),
|
|
| 17 |
+ root.join(".env.#{ENV['RAILS_ENV'] || 'development'}"),
|
|
| 18 | 18 |
root.join(".env")
|
| 19 | 19 |
) |
| 20 | 20 |
end |
@@ -153,7 +153,7 @@ describe Agents::DataOutputAgent do |
||
| 153 | 153 |
expect(content_type).to eq('text/xml')
|
| 154 | 154 |
expect(content.gsub(/\s+/, '')).to eq Utils.unindent(<<-XML).gsub(/\s+/, '') |
| 155 | 155 |
<?xml version="1.0" encoding="UTF-8" ?> |
| 156 |
- <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"> |
|
| 156 |
+ <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"> |
|
| 157 | 157 |
<channel> |
| 158 | 158 |
<atom:link href="https://yoursite.com/users/#{agent.user.id}/web_requests/#{agent.id}/secret1.xml" rel="self" type="application/rss+xml"/>
|
| 159 | 159 |
<atom:icon>https://yoursite.com/favicon.ico</atom:icon> |
@@ -392,7 +392,7 @@ describe Agents::DataOutputAgent do |
||
| 392 | 392 |
expect(content_type).to eq('text/xml')
|
| 393 | 393 |
expect(content.gsub(/\s+/, '')).to eq Utils.unindent(<<-XML).gsub(/\s+/, '') |
| 394 | 394 |
<?xml version="1.0" encoding="UTF-8" ?> |
| 395 |
- <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"> |
|
| 395 |
+ <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"> |
|
| 396 | 396 |
<channel> |
| 397 | 397 |
<atom:link href="https://yoursite.com/users/#{agent.user.id}/web_requests/#{agent.id}/secret1.xml" rel="self" type="application/rss+xml"/>
|
| 398 | 398 |
<atom:icon>https://yoursite.com/favicon.ico</atom:icon> |