Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #976

Merged
merged 6 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copilot/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
repository: export-opportunities
builder:
name: paketobuildpacks/builder-jammy-full
version: 0.3.397
version: 0.3.397
2 changes: 2 additions & 0 deletions .copilot/image_build_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ set -e

rm ./config/application.yml

cp -r /workspace/db/ /workspace/db-copy/

rm -rf /workspace/tmp
rm -rf /workspace/db
rm -rf /workspace/log
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: bundle exec rake cf:on_first_instance db:migrate && bundle exec puma -p ${PORT:-3000}
app: bundle exec rake cf:on_first_instance db:migrate && bundle exec rails assets:precompile && bundle exec puma -p ${PORT:-3000}
app: cp -r /workspace/db-copy/* /workspace/db/ && bundle exec rake cf:on_first_instance db:migrate && bundle exec rails assets:precompile && bundle exec puma -p ${PORT:-3000}
worker: bin/start-stunnel bundle exec sidekiq -C config/sidekiq.yml
12 changes: 7 additions & 5 deletions app/controllers/api/activity_stream_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,13 @@ def to_search_after(object, method)
end

def authenticate(request)
remote_ips = request.headers['X-Forwarded-For'].gsub(/\s+/, '').split(',')
return [false, 'Connecting from unauthorized IP'] unless remote_ips.length >= 2

authorized_ip_addresses = Figaro.env.ACTIVITY_STREAM_IP_WHITELIST.split(',')
return [false, 'Connecting from unauthorized IP'] unless authorized_ip_addresses.include?(remote_ips[-2])
unless ENV['COPILOT_ENVIRONMENT_NAME'] # DBT Platform
remote_ips = request.headers['X-Forwarded-For'].gsub(/\s+/, '').split(',')
return [false, 'Connecting from unauthorized IP'] unless remote_ips.length >= 2

authorized_ip_addresses = Figaro.env.ACTIVITY_STREAM_IP_WHITELIST.split(',')
return [false, 'Connecting from unauthorized IP'] unless authorized_ip_addresses.include?(remote_ips[-2])
end

return [false, 'Authorization header is missing'] unless request.headers.key?('Authorization')

Expand Down
Loading