moved to integreat

This commit is contained in:
Bryce Covert
2018-04-10 06:43:44 -07:00
parent 5e7add409f
commit 39fa8a8032
18 changed files with 50 additions and 70 deletions

View File

@@ -5,4 +5,5 @@
:aws-secret-access-key "emIzqz9zW+5WrbJHwc1MI0gSS9IXF5feFFxnQI+7" :aws-secret-access-key "emIzqz9zW+5WrbJHwc1MI0gSS9IXF5feFFxnQI+7"
:aws-region "us-east-1" :aws-region "us-east-1"
:invoice-import-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-mail-prod" :invoice-import-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-mail-prod"
:invoice-email "invoices@mail.app.integreatconsult.com"
} }

View File

@@ -5,4 +5,5 @@
:aws-secret-access-key "Z+AOjQU9M4SwKVU2meYtyNxXtz1Axu/9xohvteXf" :aws-secret-access-key "Z+AOjQU9M4SwKVU2meYtyNxXtz1Axu/9xohvteXf"
:aws-region "us-east-1" :aws-region "us-east-1"
:invoice-import-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-mail-staging" :invoice-import-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-mail-staging"
:invoice-email "invoices-staging@mail.app.integreatconsult.com"
} }

View File

@@ -21,8 +21,8 @@ services:
restart: always restart: always
environment: environment:
config: /usr/local/config/prod.edn config: /usr/local/config/prod.edn
VIRTUAL_HOST: integreat.aws.brycecovertoperations.com VIRTUAL_HOST: app.integreatconsult.com
LETSENCRYPT_HOST: integreat.aws.brycecovertoperations.com LETSENCRYPT_HOST: staging.app.integreatconsult.com,app.integreatconsult.com
LETSENCRYPT_EMAIL: le@brycecovertoperations.com LETSENCRYPT_EMAIL: le@brycecovertoperations.com
database: database:
restart: always restart: always

View File

@@ -1,7 +1,7 @@
version: '3' version: '3'
services: services:
nginx-proxy: nginx-proxy:
restart: always restart: "always"
ports: ports:
- "8080:80" - "8080:80"
- "8443:443" - "8443:443"
@@ -11,7 +11,7 @@ services:
- /opt/integreat/staging/etc/nginx/vhost.d:/etc/nginx/vhost.d - /opt/integreat/staging/etc/nginx/vhost.d:/etc/nginx/vhost.d
- /opt/integreat/staging/usr/share/nginx/html:/usr/share/nginx/html - /opt/integreat/staging/usr/share/nginx/html:/usr/share/nginx/html
letsencrypt: letsencrypt:
restart: always restart: "always"
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro - /var/run/docker.sock:/var/run/docker.sock:ro
- /opt/integreat/staging/certs/:/etc/nginx/certs - /opt/integreat/staging/certs/:/etc/nginx/certs
@@ -21,8 +21,8 @@ services:
restart: always restart: always
environment: environment:
config: /usr/local/config/staging.edn config: /usr/local/config/staging.edn
VIRTUAL_HOST: staging.integreat.aws.brycecovertoperations.com VIRTUAL_HOST: staging.app.integreatconsult.com
LETSENCRYPT_HOST: staging.integreat.aws.brycecovertoperations.com LETSENCRYPT_HOST: staging.app.integreatconsult.com,app.integreatconsult.com
LETSENCRYPT_EMAIL: le@brycecovertoperations.com LETSENCRYPT_EMAIL: le@brycecovertoperations.com
database: database:
restart: always restart: always

View File

@@ -3,7 +3,7 @@ services:
nginx-proxy: nginx-proxy:
image: jwilder/nginx-proxy:alpine image: jwilder/nginx-proxy:alpine
labels: labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true" - com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true
volumes: volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro - /var/run/docker.sock:/tmp/docker.sock:ro
- ./data/certs/:/etc/nginx/certs:ro - ./data/certs/:/etc/nginx/certs:ro
@@ -24,7 +24,7 @@ services:
- database - database
environment: environment:
config: /usr/local/config/local.edn config: /usr/local/config/local.edn
VIRTUAL_HOST: local.integreat.aws.brycecovertoperations.com VIRTUAL_HOST: local.app.integreatconsult.com
database: database:
image: postgres:9-alpine image: postgres:9-alpine
environment: environment:

View File

@@ -1,5 +1,6 @@
(ns auto-ap.db.companies (ns auto-ap.db.companies
(:require [auto-ap.db.utils :refer [clj->db db->clj get-conn assign-namespace]] (:require [auto-ap.db.utils :refer [assign-namespace clj->db db->clj
get-conn]]
[auto-ap.entities.companies :as entity] [auto-ap.entities.companies :as entity]
[clojure.edn :as edn] [clojure.edn :as edn]
[clojure.java.jdbc :as j])) [clojure.java.jdbc :as j]))

View File

@@ -33,7 +33,7 @@
(insert-multi! (insert-multi!
(for [{:keys [total date invoice-number customer-identifier vendor] :as row} parsed-invoices] (for [{:keys [total date invoice-number customer-identifier vendor] :as row} parsed-invoices]
(do (do
(println row)
(assoc row (assoc row
:company-id (::company/id (parse/best-match companies customer-identifier)) :company-id (::company/id (parse/best-match companies customer-identifier))
:imported false :imported false

View File

@@ -1,5 +1,6 @@
(ns auto-ap.db.vendors (ns auto-ap.db.vendors
(:require [auto-ap.db.utils :refer [clj->db db->clj get-conn assign-namespace]] (:require [auto-ap.db.utils :refer [assign-namespace clj->db db->clj
get-conn]]
[auto-ap.entities.vendors :as entities] [auto-ap.entities.vendors :as entities]
[clojure.edn :as edn] [clojure.edn :as edn]
[clojure.java.jdbc :as j])) [clojure.java.jdbc :as j]))

View File

@@ -2,7 +2,6 @@
(:require [auto-ap.db.companies :as companies] (:require [auto-ap.db.companies :as companies]
[auto-ap.routes.utils :refer [wrap-secure wrap-spec]] [auto-ap.routes.utils :refer [wrap-secure wrap-spec]]
[auto-ap.entities.companies :as entity] [auto-ap.entities.companies :as entity]
[clojure.spec.alpha :as s]
[compojure.core :refer [GET PUT context defroutes [compojure.core :refer [GET PUT context defroutes
wrap-routes]])) wrap-routes]]))

View File

@@ -3,6 +3,7 @@
[auto-ap.db.reminders :as reminders] [auto-ap.db.reminders :as reminders]
[auto-ap.db.vendors :as vendors] [auto-ap.db.vendors :as vendors]
[auto-ap.routes.utils :refer [wrap-secure]] [auto-ap.routes.utils :refer [wrap-secure]]
[config.core :refer [env]]
[clj-http.client :as http] [clj-http.client :as http]
[clj-time.coerce :as c] [clj-time.coerce :as c]
[clj-time.core :as time] [clj-time.core :as time]
@@ -42,7 +43,7 @@
(doseq [{:keys [vendor-name email id]} reminders] (doseq [{:keys [vendor-name email id]} reminders]
(println "Sending email to" email) (println "Sending email to" email)
(ses/send-email :destination {:to-addresses [email]} (ses/send-email :destination {:to-addresses [email]}
:source "invoices@mail.integreat.aws.brycecovertoperations.com" :source (:invoice-email env)
:message {:subject "Reminder to send invoices" :message {:subject "Reminder to send invoices"
:body {:html (str "<h1>Hello " vendor-name ",</h1><p>This is a reminder to send this week's invoices to us. You can just reply to this email.</p> <p> - Integreat. </p>") :body {:html (str "<h1>Hello " vendor-name ",</h1><p>This is a reminder to send this week's invoices to us. You can just reply to this email.</p> <p> - Integreat. </p>")
:text (str "Hello " vendor-name ",\r\nThis is a reminder to send this week's invoices to us. You can just reply to this email.\r\n - Integreat.")}}) :text (str "Hello " vendor-name ",\r\nThis is a reminder to send this week's invoices to us. You can just reply to this email.\r\n - Integreat.")}})

View File

@@ -1,6 +1,6 @@
(ns auto-ap.routes.utils (ns auto-ap.routes.utils
(:require [clojure.spec.alpha :as s] (:require [buddy.auth :refer [authenticated?]]
[buddy.auth :refer [authenticated?]])) [clojure.spec.alpha :as s]))
(defn wrap-secure [handler] (defn wrap-secure [handler]
(fn [request] (fn [request]

View File

@@ -1,8 +1,7 @@
(ns auto-ap.routes.vendors (ns auto-ap.routes.vendors
(:require [auto-ap.db.vendors :as vendors] (:require [auto-ap.db.vendors :as vendors]
[auto-ap.routes.utils :refer [wrap-secure wrap-spec]]
[auto-ap.entities.vendors :as entity] [auto-ap.entities.vendors :as entity]
[clojure.spec.alpha :as s] [auto-ap.routes.utils :refer [wrap-secure wrap-spec]]
[compojure.core :refer [GET POST PUT context defroutes [compojure.core :refer [GET POST PUT context defroutes
wrap-routes]])) wrap-routes]]))

View File

@@ -1,6 +1,6 @@
aws_access_key_id="AKIAINHACMVQJ6NYD26A" aws_access_key_id="AKIAINHACMVQJ6NYD26A"
aws_secret_access_key="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" aws_secret_access_key="FwdL4TbIC/5H/4mwhQy4iSI/eSewyPgfS1EEt6tL"
domain="integreat.aws.brycecovertoperations.com" domain="app.integreatconsult.com"
invoice_address="invoices@mail.integreat.aws.brycecovertoperations.com" invoice_address="invoices@mail.app.integreatconsult.com"
base_url="https://integreat.aws.brycecovertoperations.com" base_url="https://app.integreatconsult.com"
stage="prod" stage="prod"

View File

@@ -1,6 +1,6 @@
aws_access_key_id="AKIAINHACMVQJ6NYD26A" aws_access_key_id="AKIAINHACMVQJ6NYD26A"
aws_secret_access_key="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" aws_secret_access_key="FwdL4TbIC/5H/4mwhQy4iSI/eSewyPgfS1EEt6tL"
domain="staging.integreat.aws.brycecovertoperations.com" domain="staging.app.integreatconsult.com"
invoice_address="invoices-staging@mail.integreat.aws.brycecovertoperations.com" invoice_address="invoices-staging@mail.app.integreatconsult.com"
base_url="https://staging.integreat.aws.brycecovertoperations.com:8443" base_url="https://staging.app.integreatconsult.com:8443"
stage="staging" stage="staging"

View File

@@ -1,7 +1,7 @@
{ {
"version": 3, "version": 3,
"terraform_version": "0.11.5", "terraform_version": "0.11.5",
"serial": 24, "serial": 26,
"lineage": "9b630886-8cee-a57d-c7a2-4f19f13f9c51", "lineage": "9b630886-8cee-a57d-c7a2-4f19f13f9c51",
"modules": [ "modules": [
{ {
@@ -249,7 +249,7 @@
"lambda_action.#": "0", "lambda_action.#": "0",
"name": "store-prod", "name": "store-prod",
"recipients.#": "1", "recipients.#": "1",
"recipients.2059710502": "invoices@mail.integreat.aws.brycecovertoperations.com", "recipients.1936553836": "invoices@mail.app.integreatconsult.com",
"rule_set_name": "default-rule-set", "rule_set_name": "default-rule-set",
"s3_action.#": "1", "s3_action.#": "1",
"s3_action.4268582484.bucket_name": "integreat-mail-prod", "s3_action.4268582484.bucket_name": "integreat-mail-prod",
@@ -321,13 +321,13 @@
"aws_sns_topic.reminder_topic" "aws_sns_topic.reminder_topic"
], ],
"primary": { "primary": {
"id": "arn:aws:sns:us-east-1:679918342773:reminders-prod:760fbd12-3e50-43e1-859e-fefdc0751c34", "id": "arn:aws:sns:us-east-1:679918342773:reminders-prod:d55e8a84-a979-4bc2-9822-afc2dd047a35",
"attributes": { "attributes": {
"arn": "arn:aws:sns:us-east-1:679918342773:reminders-prod:760fbd12-3e50-43e1-859e-fefdc0751c34", "arn": "arn:aws:sns:us-east-1:679918342773:reminders-prod:d55e8a84-a979-4bc2-9822-afc2dd047a35",
"confirmation_timeout_in_minutes": "1", "confirmation_timeout_in_minutes": "1",
"endpoint": "https://integreat.aws.brycecovertoperations.com/api/reminders/send", "endpoint": "https://app.integreatconsult.com/api/reminders/send",
"endpoint_auto_confirms": "true", "endpoint_auto_confirms": "true",
"id": "arn:aws:sns:us-east-1:679918342773:reminders-prod:760fbd12-3e50-43e1-859e-fefdc0751c34", "id": "arn:aws:sns:us-east-1:679918342773:reminders-prod:d55e8a84-a979-4bc2-9822-afc2dd047a35",
"protocol": "https", "protocol": "https",
"raw_message_delivery": "false", "raw_message_delivery": "false",
"topic_arn": "arn:aws:sns:us-east-1:679918342773:reminders-prod" "topic_arn": "arn:aws:sns:us-east-1:679918342773:reminders-prod"
@@ -369,11 +369,11 @@
"type": "aws_caller_identity", "type": "aws_caller_identity",
"depends_on": [], "depends_on": [],
"primary": { "primary": {
"id": "2018-04-08 23:28:03.708287838 +0000 UTC", "id": "2018-04-10 06:39:11.533275039 +0000 UTC",
"attributes": { "attributes": {
"account_id": "679918342773", "account_id": "679918342773",
"arn": "arn:aws:iam::679918342773:user/bryce", "arn": "arn:aws:iam::679918342773:user/bryce",
"id": "2018-04-08 23:28:03.708287838 +0000 UTC", "id": "2018-04-10 06:39:11.533275039 +0000 UTC",
"user_id": "AIDAJPUJFTOKO4IRADMV4" "user_id": "AIDAJPUJFTOKO4IRADMV4"
}, },
"meta": {}, "meta": {},

View File

@@ -1,7 +1,7 @@
{ {
"version": 3, "version": 3,
"terraform_version": "0.11.5", "terraform_version": "0.11.5",
"serial": 24, "serial": 26,
"lineage": "9b630886-8cee-a57d-c7a2-4f19f13f9c51", "lineage": "9b630886-8cee-a57d-c7a2-4f19f13f9c51",
"modules": [ "modules": [
{ {
@@ -249,7 +249,7 @@
"lambda_action.#": "0", "lambda_action.#": "0",
"name": "store-prod", "name": "store-prod",
"recipients.#": "1", "recipients.#": "1",
"recipients.2059710502": "invoices@mail.integreat.aws.brycecovertoperations.com", "recipients.1936553836": "invoices@mail.app.integreatconsult.com",
"rule_set_name": "default-rule-set", "rule_set_name": "default-rule-set",
"s3_action.#": "1", "s3_action.#": "1",
"s3_action.4268582484.bucket_name": "integreat-mail-prod", "s3_action.4268582484.bucket_name": "integreat-mail-prod",
@@ -315,29 +315,6 @@
"deposed": [], "deposed": [],
"provider": "provider.aws" "provider": "provider.aws"
}, },
"aws_sns_topic_subscription.send_reminders_to_service": {
"type": "aws_sns_topic_subscription",
"depends_on": [
"aws_sns_topic.reminder_topic"
],
"primary": {
"id": "arn:aws:sns:us-east-1:679918342773:reminders-prod:760fbd12-3e50-43e1-859e-fefdc0751c34",
"attributes": {
"arn": "arn:aws:sns:us-east-1:679918342773:reminders-prod:760fbd12-3e50-43e1-859e-fefdc0751c34",
"confirmation_timeout_in_minutes": "1",
"endpoint": "https://integreat.aws.brycecovertoperations.com/api/reminders/send",
"endpoint_auto_confirms": "true",
"id": "arn:aws:sns:us-east-1:679918342773:reminders-prod:760fbd12-3e50-43e1-859e-fefdc0751c34",
"protocol": "https",
"raw_message_delivery": "false",
"topic_arn": "arn:aws:sns:us-east-1:679918342773:reminders-prod"
},
"meta": {},
"tainted": false
},
"deposed": [],
"provider": "provider.aws"
},
"aws_sqs_queue.integreat-mail": { "aws_sqs_queue.integreat-mail": {
"type": "aws_sqs_queue", "type": "aws_sqs_queue",
"depends_on": [ "depends_on": [
@@ -369,11 +346,11 @@
"type": "aws_caller_identity", "type": "aws_caller_identity",
"depends_on": [], "depends_on": [],
"primary": { "primary": {
"id": "2018-04-08 21:28:57.063150249 +0000 UTC", "id": "2018-04-10 06:21:49.828482761 +0000 UTC",
"attributes": { "attributes": {
"account_id": "679918342773", "account_id": "679918342773",
"arn": "arn:aws:iam::679918342773:user/bryce", "arn": "arn:aws:iam::679918342773:user/bryce",
"id": "2018-04-08 21:28:57.063150249 +0000 UTC", "id": "2018-04-10 06:21:49.828482761 +0000 UTC",
"user_id": "AIDAJPUJFTOKO4IRADMV4" "user_id": "AIDAJPUJFTOKO4IRADMV4"
}, },
"meta": {}, "meta": {},

View File

@@ -1,7 +1,7 @@
{ {
"version": 3, "version": 3,
"terraform_version": "0.11.5", "terraform_version": "0.11.5",
"serial": 4, "serial": 6,
"lineage": "91d10fe0-8033-8778-c202-78d5a81632e8", "lineage": "91d10fe0-8033-8778-c202-78d5a81632e8",
"modules": [ "modules": [
{ {
@@ -249,7 +249,7 @@
"lambda_action.#": "0", "lambda_action.#": "0",
"name": "store-staging", "name": "store-staging",
"recipients.#": "1", "recipients.#": "1",
"recipients.392613647": "invoices-staging@mail.integreat.aws.brycecovertoperations.com", "recipients.3424326602": "invoices-staging@mail.app.integreatconsult.com",
"rule_set_name": "default-rule-set", "rule_set_name": "default-rule-set",
"s3_action.#": "1", "s3_action.#": "1",
"s3_action.2918620842.bucket_name": "integreat-mail-staging", "s3_action.2918620842.bucket_name": "integreat-mail-staging",
@@ -321,13 +321,13 @@
"aws_sns_topic.reminder_topic" "aws_sns_topic.reminder_topic"
], ],
"primary": { "primary": {
"id": "arn:aws:sns:us-east-1:679918342773:reminders-staging:ad5d6da5-c68e-4897-919e-77019cb115dc", "id": "arn:aws:sns:us-east-1:679918342773:reminders-staging:f21bb21a-f5e9-4bce-afa5-7fa5b1ec8581",
"attributes": { "attributes": {
"arn": "arn:aws:sns:us-east-1:679918342773:reminders-staging:ad5d6da5-c68e-4897-919e-77019cb115dc", "arn": "arn:aws:sns:us-east-1:679918342773:reminders-staging:f21bb21a-f5e9-4bce-afa5-7fa5b1ec8581",
"confirmation_timeout_in_minutes": "1", "confirmation_timeout_in_minutes": "1",
"endpoint": "https://staging.integreat.aws.brycecovertoperations.com:8443/api/reminders/send", "endpoint": "https://staging.app.integreatconsult.com:8443/api/reminders/send",
"endpoint_auto_confirms": "true", "endpoint_auto_confirms": "true",
"id": "arn:aws:sns:us-east-1:679918342773:reminders-staging:ad5d6da5-c68e-4897-919e-77019cb115dc", "id": "arn:aws:sns:us-east-1:679918342773:reminders-staging:f21bb21a-f5e9-4bce-afa5-7fa5b1ec8581",
"protocol": "https", "protocol": "https",
"raw_message_delivery": "false", "raw_message_delivery": "false",
"topic_arn": "arn:aws:sns:us-east-1:679918342773:reminders-staging" "topic_arn": "arn:aws:sns:us-east-1:679918342773:reminders-staging"
@@ -369,11 +369,11 @@
"type": "aws_caller_identity", "type": "aws_caller_identity",
"depends_on": [], "depends_on": [],
"primary": { "primary": {
"id": "2018-04-08 23:24:51.436371727 +0000 UTC", "id": "2018-04-10 06:20:31.972433424 +0000 UTC",
"attributes": { "attributes": {
"account_id": "679918342773", "account_id": "679918342773",
"arn": "arn:aws:iam::679918342773:user/bryce", "arn": "arn:aws:iam::679918342773:user/bryce",
"id": "2018-04-08 23:24:51.436371727 +0000 UTC", "id": "2018-04-10 06:20:31.972433424 +0000 UTC",
"user_id": "AIDAJPUJFTOKO4IRADMV4" "user_id": "AIDAJPUJFTOKO4IRADMV4"
}, },
"meta": {}, "meta": {},

View File

@@ -1,7 +1,7 @@
{ {
"version": 3, "version": 3,
"terraform_version": "0.11.5", "terraform_version": "0.11.5",
"serial": 4, "serial": 6,
"lineage": "91d10fe0-8033-8778-c202-78d5a81632e8", "lineage": "91d10fe0-8033-8778-c202-78d5a81632e8",
"modules": [ "modules": [
{ {
@@ -249,7 +249,7 @@
"lambda_action.#": "0", "lambda_action.#": "0",
"name": "store-staging", "name": "store-staging",
"recipients.#": "1", "recipients.#": "1",
"recipients.392613647": "invoices-staging@mail.integreat.aws.brycecovertoperations.com", "recipients.3424326602": "invoices-staging@mail.app.integreatconsult.com",
"rule_set_name": "default-rule-set", "rule_set_name": "default-rule-set",
"s3_action.#": "1", "s3_action.#": "1",
"s3_action.2918620842.bucket_name": "integreat-mail-staging", "s3_action.2918620842.bucket_name": "integreat-mail-staging",
@@ -346,11 +346,11 @@
"type": "aws_caller_identity", "type": "aws_caller_identity",
"depends_on": [], "depends_on": [],
"primary": { "primary": {
"id": "2018-04-08 22:13:07.617577412 +0000 UTC", "id": "2018-04-10 05:26:29.468970177 +0000 UTC",
"attributes": { "attributes": {
"account_id": "679918342773", "account_id": "679918342773",
"arn": "arn:aws:iam::679918342773:user/bryce", "arn": "arn:aws:iam::679918342773:user/bryce",
"id": "2018-04-08 22:13:07.617577412 +0000 UTC", "id": "2018-04-10 05:26:29.468970177 +0000 UTC",
"user_id": "AIDAJPUJFTOKO4IRADMV4" "user_id": "AIDAJPUJFTOKO4IRADMV4"
}, },
"meta": {}, "meta": {},