Skip to content

Commit

Permalink
Merge pull request #326 from RockefellerArchiveCenter/issue-319
Browse files Browse the repository at this point in the history
Add API Authentication
  • Loading branch information
p-galligan authored Jan 16, 2025
2 parents 3755af0 + 5fc19a5 commit bfc1abd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion argo/config.py.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ DJANGO_ALLOWED_HOSTS = ${DJANGO_ALLOWED_HOSTS}
ELASTICSEARCH_HOSTS = ${ELASTICSEARCH_HOSTS}
ELASTICSEARCH_INDEX = "${ELASTICSEARCH_INDEX}"
ELASTICSEARCH_CONNECTION = "${ELASTICSEARCH_CONNECTION}"
ELASTICSEARCH_API_KEY = "${ELASTICSEARCH_API_KEY}"
SQL_ENGINE = "${SQL_ENGINE}"
SQL_DATABASE = "${SQL_DATABASE}"
SQL_USER = "${SQL_USER}"
Expand All @@ -15,4 +16,4 @@ USE_X_FORWARDED_HOST = ${USE_X_FORWARDED_HOST}
SECURE_PROXY_SSL_HEADER = ${SECURE_PROXY_SSL_HEADER}
CITATION_REPOSITORY_NAME = "${CITATION_REPOSITORY_NAME}"
CITATION_REPOSITORY_BASEURL = "${CITATION_REPOSITORY_BASEURL}"
CITATION_SEPARATOR = "${CITATION_SEPARATOR}"
CITATION_SEPARATOR = "${CITATION_SEPARATOR}"
3 changes: 2 additions & 1 deletion argo/config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ DJANGO_ALLOWED_HOSTS = ["localhost", "argo-web"] # hosts Argo will respond to (
ELASTICSEARCH_HOSTS = ["elasticsearch:9200"] # hostnames (including ports, if applicable) at which Elasticsearch is available (list of strings)
ELASTICSEARCH_INDEX = "default" # name of Elasticsearch index to target (string)
ELASTICSEARCH_CONNECTION = "default" # name of Elasticsearch connection to use (string)
ELASTICSEARCH_API_KEY = "" # Encoded string API Key provided by Elasticsearch
SQL_ENGINE = "django.db.backends.postgresql" # the database engine used by Argo (string, one of django.db.backends)
SQL_DATABASE = "postgres" # name of the application database (string)
SQL_USER = "postgres" # name of the application database user (string)
Expand All @@ -15,4 +16,4 @@ USE_X_FORWARDED_HOST = False # Set to True if the application is behind a revers
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") # If the application is being a reverse proxy, and if a header value indicates an HTTPS connection proxied over HTTP, name that header and value (tuple)
CITATION_REPOSITORY_NAME = "Rockefeller Archive Center" # name of repository used in citations
CITATION_REPOSITORY_BASEURL = "https://dimes.rockarch.org/" # base url for citation links
CITATION_SEPARATOR = "; " # string to separate different parts of the citation
CITATION_SEPARATOR = "; " # string to separate different parts of the citation
3 changes: 2 additions & 1 deletion argo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
"default": {
"hosts": config.ELASTICSEARCH_HOSTS,
"index": config.ELASTICSEARCH_INDEX,
"connection": config.ELASTICSEARCH_CONNECTION
"connection": config.ELASTICSEARCH_CONNECTION,
"api_key": getattr(config, 'ELASTICSEARCH_API_KEY', None)
}
}

Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
argo-db:
image: postgres:14.4
Expand All @@ -22,7 +20,7 @@ services:
- argo-db

elasticsearch:
image: elasticsearch:7.9.3
image: elasticsearch:7.17.25
environment:
- node.name=elasticsearch
- discovery.seed_hosts=elasticsearch
Expand Down

0 comments on commit bfc1abd

Please sign in to comment.