Skip to content

Commit

Permalink
Merge tag 'v1.0' into main
Browse files Browse the repository at this point in the history
Conflicts:
	argo/config.py.example
	argo/settings.py
  • Loading branch information
kcloud committed Feb 27, 2023
2 parents 30233cd + 8e27c8a commit 95916f0
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 37 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ jobs:
with:
ref: development

- uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: pip
- run: |
pip install pip-tools
pip-compile --upgrade

- name: Install pre-commit and pip-tools
run: pip install pre-commit pip-tools

- name: Run pre-commit autoupdate
run: pre-commit autoupdate

- name: Run pip-compile
run: pip-compile --upgrade

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
repos:
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v1.6.0
rev: v2.0.1
hooks:
- id: autopep8
args:
- --in-place
- --aggressive
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.11.4
hooks:
- id: isort
- repo: https://github.com/jazzband/pip-tools
rev: 6.5.1
rev: 6.12.1
hooks:
- id: pip-compile
2 changes: 1 addition & 1 deletion api_formatter/templates/rest_framework/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<li class="nav-item"><a class="nav-link text-light" href="{% url 'agent-list' %}">Agents</a></li>
<li class="nav-item"><a class="nav-link text-light" href="{% url 'collection-list' %}">Collections</a></li>
<li class="nav-item"><a class="nav-link text-light" href="{% url 'object-list' %}">Objects</a></li>
<li class="nav-item"><a class="nav-link text-light" href="https://docs.rockarch.org/argo">Documentation</a></li>
<li class="nav-item"><a class="nav-link text-light" href="https://docs.rockarch.org/argo-docs">Documentation</a></li>
</ul>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions api_formatter/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.urls import include, re_path
from django.urls import include, path, re_path
from rest_framework.schemas import get_schema_view

from .routers import RACRouter
Expand All @@ -21,6 +21,6 @@

urlpatterns = [
re_path(r'^', include(router.urls)),
re_path(r'facets', FacetView.as_view({'get': 'retrieve'}), name='facets'),
re_path(r'^schema', schema_view, name='schema'),
path(r'facets', FacetView.as_view({'get': 'retrieve'}), name='facets'),
path(r'schema', schema_view, name='schema'),
]
4 changes: 2 additions & 2 deletions argo/config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ SQL_USER = "postgres" # name of the application database user (string)
SQL_PASSWORD = "postgres" # password for the application database (string)
SQL_HOST = "argo-db" # host for the application database (string)
SQL_PORT = 5432 # port on which the application database can be reached (integer)
USE_X_FORWARDED_HOST = False # True if the application is behind a reverse proxy
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
USE_X_FORWARDED_HOST = False # Set to True if the application is behind a reverse proxy (boolean)
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)
7 changes: 6 additions & 1 deletion argo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
USE_X_FORWARDED_HOST = config.USE_X_FORWARDED_HOST
SECURE_PROXY_SSL_HEADER = config.SECURE_PROXY_SSL_HEADER


# Application definition

INSTALLED_APPS = [
Expand All @@ -57,6 +56,7 @@
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'csp.middleware.CSPMiddleware',
]

ROOT_URLCONF = 'argo.urls'
Expand Down Expand Up @@ -157,3 +157,8 @@
CORS_ORIGIN_ALLOW_ALL = True

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

# Content Security Policy
CSP_IMG_SRC = ("'self'")
CSP_STYLE_SRC = ("'self'", "'unsafe-inline'")
CSP_SCRIPT_SRC = ("'self'", "'unsafe-inline'", 'https://cdnjs.cloudflare.com/')
2 changes: 1 addition & 1 deletion argo/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from api_formatter.views import MyListView

urlpatterns = [
path('admin/', admin.site.urls),
path('admin', admin.site.urls),
path('mylist', MyListView.as_view(), name='mylist'),
path('', include('api_formatter.urls'))

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
- argo-db

elasticsearch:
image: elasticsearch:7.0.0
image: elasticsearch:7.9.3
environment:
- node.name=elasticsearch
- discovery.seed_hosts=elasticsearch
Expand Down
7 changes: 4 additions & 3 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Django~=4.0
Django~=4.0.9
django-cors-headers~=3.13
django-csp~=3.7
django-elasticsearch-dsl~=7.2
django-elasticsearch-dsl-drf~=0.22
djangorestframework~=3.13
elasticsearch~=7.17
elasticsearch-dsl~=7.4
jsonschema~=4.7
psycopg2-binary~=2.9
psycopg2~=2.9
PyYAML~=6.0
./rac-schemas
rac_es~=1.0
shortuuid~=1.0
uritemplate~=4.1
uritemplate~=4.1
39 changes: 22 additions & 17 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile requirements.in
#
asgiref==3.5.2
asgiref==3.6.0
# via django
attrs==22.1.0
attrs==22.2.0
# via jsonschema
certifi==2022.6.15
certifi==2022.12.7
# via elasticsearch
django==4.0.6
django==4.0.9
# via
# -r requirements.in
# django-cors-headers
# django-csp
# django-nine
# djangorestframework
django-cors-headers==3.13.0
# via -r requirements.in
django-elasticsearch-dsl==7.2.2
django-csp==3.7
# via -r requirements.in
django-elasticsearch-dsl==7.3
# via
# -r requirements.in
# django-elasticsearch-dsl-drf
django-elasticsearch-dsl-drf==0.22.5
# via -r requirements.in
django-nine==0.2.5
django-nine==0.2.7
# via django-elasticsearch-dsl-drf
djangorestframework==3.13.1
djangorestframework==3.14.0
# via
# -r requirements.in
# django-elasticsearch-dsl-drf
elasticsearch==7.17.4
elasticsearch==7.17.9
# via
# -r requirements.in
# django-elasticsearch-dsl-drf
Expand All @@ -42,35 +45,37 @@ elasticsearch-dsl==7.4.0
# django-elasticsearch-dsl
# django-elasticsearch-dsl-drf
# rac-es
jsonschema==4.9.0
jsonschema==4.17.3
# via
# -r requirements.in
# rac-schemas
psycopg2-binary==2.9.3
packaging==23.0
# via django-nine
psycopg2==2.9.5
# via -r requirements.in
pyrsistent==0.18.1
pyrsistent==0.19.3
# via jsonschema
python-dateutil==2.8.2
# via elasticsearch-dsl
pytz==2022.1
pytz==2022.7.1
# via djangorestframework
pyyaml==6.0
# via -r requirements.in
rac-es==1.0.0
# via -r requirements.in
./rac-schemas
# via -r requirements.in
shortuuid==1.0.9
shortuuid==1.0.11
# via -r requirements.in
six==1.16.0
# via
# django-elasticsearch-dsl
# django-elasticsearch-dsl-drf
# elasticsearch-dsl
# python-dateutil
sqlparse==0.4.2
sqlparse==0.4.3
# via django
uritemplate==4.1.1
# via -r requirements.in
urllib3==1.26.11
urllib3==1.26.14
# via elasticsearch

0 comments on commit 95916f0

Please sign in to comment.