Skip to content
Snippets Groups Projects
Commit c8ad6e4c authored by smayer's avatar smayer
Browse files

Add environment variable queries for action_cable_url, redirect_url,...

Add environment variable queries for action_cable_url, redirect_url, private_key (for authentication) and removed old credentials file
parent 69997ee2
No related branches found
No related tags found
1 merge request!2Merging development into onb as preparation for Annolyzer release
......@@ -41,8 +41,7 @@ module Authentication
end
def decrypt_header(token)
# TODO: store private key somewhere
private_key = "OFE_GQ8Ri8MX-0rH_T0e9ZFIhy-q0n2VxBWPoOyJ1I0="
private_key = ENV['NEP_AUTH_PRIVATE_KEY'] || "OFE_GQ8Ri8MX-0rH_T0e9ZFIhy-q0n2VxBWPoOyJ1I0="
unpacked_key = Base64.urlsafe_decode64(private_key)
signing_key = unpacked_key[0..15]
encryption_key = unpacked_key[16..32]
......
......@@ -156,11 +156,11 @@ class DatasetController < ApplicationController
def remove_selected_documents
@nb_removed_docs = params[:documents_ids].size
# puts "Remove selected documents called, session has working dataset with id " + String(session[:working_dataset])
dataset = Dataset.find(session[:working_dataset])
dataset.remove_documents params[:documents_ids]
# puts request.host, request.port, request.url, request.original_fullpath
redirect_to "http://127.0.0.1:8001/en/tool/newspapers-platform/dataset/#{dataset.id}", id: dataset.id
redirect_url = ENV['NEP_REDIRECT_URL'] || 'http://127.0.0.1:8001/en/tool/newspapers-platform'
puts redirect_url
redirect_to redirect_url + "/dataset/#{dataset.id}", id: dataset.id
end
def add_all_documents
......
GuFP+gXR5rvGVfgEYis0v/Rw/zXs4gnzV7WbFKql5Aau62F+BA/erMRTlm5iqNkcOW9WP4TNQiVraHKtVoGny9FAt7mcSI5h9oBz+TmV7WYJdm0aGv+D1MPxUZo9vXG/QQ3ESophQwXKUeMmw4WBtIt6v6zcCAVXTTWAZmLlYHRNxtoqM/ivDrWRT/CJugJMGjkzVNqfqgnSOQy5rC/SzStpthYm5YST+nR2+zedzir6XEiWyrQMy/0dMjxl+Mw7+vtXLGupdfpnJUdWu00YgoHJuHhs0opsUmLUA8lX2qTyDfIZfHgPoOhO86XXuzxlSNBJCh6NCg64DhCVdwZxks1ZUBqN/n/h7z46Wfjbc+mXE57LLRtQdW52wLZPNvfuxlaJOj3E1jhHzWBcrNwsOvBhOfLxhy9rFEZH--NwDMcOhk+Fv/AUWL--x0Lb5Ut4UAJoQ8K6rPDVbg==
\ No newline at end of file
......@@ -74,7 +74,7 @@ Rails.application.configure do
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Allow Action Cable access from any origin.
config.action_cable.url = "http://127.0.0.1:3000/cable"
config.action_cable.url = ENV['NEP_CABLE_URL'] || "http://127.0.0.1:3000/cable"
config.action_cable.disable_request_forgery_protection = true
# Allow XHR/Ajax requests from different origin
config.action_controller.forgery_protection_origin_check = false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment