Skip to content

Commit

Permalink
LIBAVALON-263. Changed IP Manage Server URL environment variable
Browse files Browse the repository at this point in the history
Changed "IP_MANAGER_SERVER" environment variable to
"IP_MANAGER_SERVER_URL" to have consistency with the
"UMD_HANDLE_SERVER_URL" environment variable.

Updated the "env_template" to include the "IP_MANAGER_SERVER", and
updated the "UMD-README.md" documentation.

https://issues.umd.edu/browse/LIBAVALON-263
  • Loading branch information
dsteelma-umd committed Jun 9, 2022
1 parent 0dc909e commit 29470fd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
25 changes: 17 additions & 8 deletions UMD-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,37 @@ Edit the "/etc/hosts" file and add
cp env_template .env
```

Determine the values for the "SAML_SP_PRIVATE_KEY" and "SAML_SP_CERTIFICATE"
variables:
3) Edit the '.env" file:
```bash
kubectl -n test get secret avalon-common-env-secret -o jsonpath='{.data.SAML_SP_PRIVATE_KEY}' | base64 --decode
kubectl -n test get secret avalon-common-env-secret -o jsonpath='{.data.SAML_SP_CERTIFICATE}' | base64 --decode
vi .env
```
Edit the '.env" file:
4) (Required) Determine the values for the "SAML_SP_PRIVATE_KEY" and
"SAML_SP_CERTIFICATE" variables:
```bash
vi .env
kubectl -n test get secret avalon-common-env-secret -o jsonpath='{.data.SAML_SP_PRIVATE_KEY}' | base64 --decode
kubectl -n test get secret avalon-common-env-secret -o jsonpath='{.data.SAML_SP_CERTIFICATE}' | base64 --decode
```
and set the parameters:
and set the parameters in the .env file:
| Parameter | Value |
| ---------------------- | ------------------------------------ |
| SAML_SP_PRIVATE_KEY | (Output from first kubectl command) |
| SAML_SP_CERTIFICATE | (Output from second kubectl command) |
3) Start the server
5) (Optional) In the .env file, also set the following parameters:
* UMD_HANDLE_SERVER_URL - URL of the Handle server (i.e.,
<https://handle-test.lib.umd.edu/>)
* UMD_HANDLE_JWT_TOKEN - JWT Token for accessing the Handle server. See
<https://github.com/umd-lib/umd-handle#jwt-tokens> for more information.
* IP_MANAGER_SERVER_URL - URL of the IP Manager server (i.e.,
<https://ipmanager-test.lib.umd.edu>)
6) Start the server
```bash
docker-compose pull
Expand Down
2 changes: 1 addition & 1 deletion app/services/umd_ip_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def check_ip(group_base_key:, ip_address:)

class API
def initialize
@connection = Faraday.new(ENV['IP_MANAGER_SERVER']) do |connection|
@connection = Faraday.new(ENV['IP_MANAGER_SERVER_URL']) do |connection|
connection.response :json
connection.adapter :net_http
end
Expand Down
4 changes: 3 additions & 1 deletion env_template
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ SAML_SP_CERTIFICATE="-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----"


# Handle Configuration
UMD_HANDLE_SERVER_URL=
UMD_HANDLE_JWT_TOKEN=

# IP Manager Configuration
IP_MANAGER_SERVER_URL=
2 changes: 1 addition & 1 deletion spec/services/umd_ip_manager_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def stub_ip_check_request_error(ip_address:, group:)

describe UmdIPManager do
let(:ip_manager) {
ENV['IP_MANAGER_SERVER'] = 'http://ipmanager-local:3001'
ENV['IP_MANAGER_SERVER_URL'] = 'http://ipmanager-local:3001'
described_class.new
}

Expand Down

0 comments on commit 29470fd

Please sign in to comment.