Skip to content

Commit

Permalink
Merge pull request #36 from GSA-TTS/fix-using-egress-proxy
Browse files Browse the repository at this point in the history
Just trying stuff at this point
  • Loading branch information
rahearn authored Sep 26, 2024
2 parents 41469ae + c7284b1 commit 98361ea
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion app/models/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ class Document < ApplicationRecord
validate :url_is_https

def contents
@contents ||= Net::HTTP.get(URI.parse(url)).force_encoding("utf-8")
@contents ||= Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |request|
request.get(uri.path).body
end
end

private

def uri
@uri ||= URI(url)
end

def url_is_https
parsed = URI(url)
errors.add(:url, "must begin with https") unless parsed.scheme == "https"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
raw.githubusercontent.com
*.apps.internal
1 change: 1 addition & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ applications:
RAILS_ENV: ((env))
RAILS_LOG_TO_STDOUT: true
RAILS_SERVE_STATIC_FILES: true
SSL_CERT_FILE: "/etc/ssl/certs/ca-certificates.crt"
processes:
- type: worker
instances: ((worker_instances))
Expand Down
3 changes: 1 addition & 2 deletions terraform/staging/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ module "egress_space" {

cf_org_name = local.cf_org_name
cf_space_name = "${local.cf_space_name}-egress"
managers = ["ryan.ahearn@gsa.gov"]
deployers = [var.cf_user]
deployers = ["ryan.ahearn@gsa.gov", var.cf_user]
}

0 comments on commit 98361ea

Please sign in to comment.