♻️(core) rename drive project in find
Initially the project was named drive and many references are still present. We decided to revamp all the project to only have references to find.
This commit is contained in:
@@ -9,9 +9,9 @@ We primarily use GitHub as an issue tracker. If however you're encountering an i
|
||||
|
||||
---
|
||||
|
||||
Please make sure you have read our [main Readme](https://github.com/numerique-gouv/drive).
|
||||
Please make sure you have read our [main Readme](https://github.com/suitenumerique/find).
|
||||
|
||||
Also make sure it was not already answered in [an open or close issue](https://github.com/numerique-gouv/drive/issues).
|
||||
Also make sure it was not already answered in [an open or close issue](https://github.com/suitenumerique/find/issues).
|
||||
|
||||
If your question was not covered, and you feel like it should be, fire away! We'd love to improve our docs! 👌
|
||||
|
||||
|
||||
+13
-13
@@ -1,4 +1,4 @@
|
||||
# Django drive
|
||||
# Django find
|
||||
|
||||
# ---- base image to inherit from ----
|
||||
FROM python:3.10-slim-bullseye AS base
|
||||
@@ -24,7 +24,7 @@ RUN mkdir /install && \
|
||||
|
||||
# ---- static link collector ----
|
||||
FROM base AS link-collector
|
||||
ARG DRIVE_STATIC_ROOT=/data/static
|
||||
ARG FIND_STATIC_ROOT=/data/static
|
||||
|
||||
# Install libpangocairo & rdfind
|
||||
RUN apt-get update && \
|
||||
@@ -36,7 +36,7 @@ RUN apt-get update && \
|
||||
# Copy installed python dependencies
|
||||
COPY --from=back-builder /install /usr/local
|
||||
|
||||
# Copy drive application (see .dockerignore)
|
||||
# Copy find application (see .dockerignore)
|
||||
COPY ./src/backend /app/
|
||||
|
||||
WORKDIR /app
|
||||
@@ -47,7 +47,7 @@ RUN DJANGO_CONFIGURATION=Build DJANGO_JWT_PRIVATE_SIGNING_KEY=Dummy \
|
||||
|
||||
# Replace duplicated file by a symlink to decrease the overall size of the
|
||||
# final image
|
||||
RUN rdfind -makesymlinks true -followsymlinks true -makeresultsfile false ${DRIVE_STATIC_ROOT}
|
||||
RUN rdfind -makesymlinks true -followsymlinks true -makeresultsfile false ${FIND_STATIC_ROOT}
|
||||
|
||||
# ---- Core application image ----
|
||||
FROM base AS core
|
||||
@@ -77,7 +77,7 @@ RUN chmod g=u /etc/passwd
|
||||
# Copy installed python dependencies
|
||||
COPY --from=back-builder /install /usr/local
|
||||
|
||||
# Copy drive application (see .dockerignore)
|
||||
# Copy find application (see .dockerignore)
|
||||
COPY ./src/backend /app/
|
||||
|
||||
WORKDIR /app
|
||||
@@ -98,9 +98,9 @@ RUN apt-get update && \
|
||||
apt-get install -y postgresql-client && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Uninstall drive and re-install it in editable mode along with development
|
||||
# Uninstall find and re-install it in editable mode along with development
|
||||
# dependencies
|
||||
RUN pip uninstall -y drive
|
||||
RUN pip uninstall -y find
|
||||
RUN pip install -e .[dev]
|
||||
|
||||
# Restore the un-privileged user running the application
|
||||
@@ -118,21 +118,21 @@ CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
|
||||
# ---- Production image ----
|
||||
FROM core AS backend-production
|
||||
|
||||
ARG DRIVE_STATIC_ROOT=/data/static
|
||||
ARG FIND_STATIC_ROOT=/data/static
|
||||
|
||||
# Gunicorn
|
||||
RUN mkdir -p /usr/local/etc/gunicorn
|
||||
COPY docker/files/usr/local/etc/gunicorn/drive.py /usr/local/etc/gunicorn/drive.py
|
||||
COPY docker/files/usr/local/etc/gunicorn/find.py /usr/local/etc/gunicorn/find.py
|
||||
|
||||
# Un-privileged user running the application
|
||||
ARG DOCKER_USER
|
||||
USER ${DOCKER_USER}
|
||||
|
||||
# Copy statics
|
||||
COPY --from=link-collector ${DRIVE_STATIC_ROOT} ${DRIVE_STATIC_ROOT}
|
||||
COPY --from=link-collector ${FIND_STATIC_ROOT} ${FIND_STATIC_ROOT}
|
||||
|
||||
# Copy drive mails
|
||||
# Copy find mails
|
||||
COPY --from=mail-builder /mail/backend/core/templates/mail /app/core/templates/mail
|
||||
|
||||
# The default command runs gunicorn WSGI server in drive's main module
|
||||
CMD ["gunicorn", "-c", "/usr/local/etc/gunicorn/drive.py", "drive.wsgi:application"]
|
||||
# The default command runs gunicorn WSGI server in find's main module
|
||||
CMD ["gunicorn", "-c", "/usr/local/etc/gunicorn/find.py", "find.wsgi:application"]
|
||||
|
||||
@@ -77,6 +77,7 @@ bootstrap: \
|
||||
build \
|
||||
migrate \
|
||||
demo \
|
||||
back-i18n-generate \
|
||||
back-i18n-compile
|
||||
.PHONY: bootstrap
|
||||
|
||||
@@ -151,14 +152,14 @@ test-back-parallel: ## run all back-end tests in parallel
|
||||
bin/pytest -n auto $${args:-${1}}
|
||||
.PHONY: test-back-parallel
|
||||
|
||||
makemigrations: ## run django makemigrations for the drive project.
|
||||
makemigrations: ## run django makemigrations for the find project.
|
||||
@echo "$(BOLD)Running makemigrations$(RESET)"
|
||||
@$(COMPOSE) up -d postgresql
|
||||
@$(WAIT_DB)
|
||||
@$(MANAGE) makemigrations
|
||||
.PHONY: makemigrations
|
||||
|
||||
migrate: ## run django migrations for the drive project.
|
||||
migrate: ## run django migrations for the find project.
|
||||
@echo "$(BOLD)Running migrations$(RESET)"
|
||||
@$(COMPOSE) up -d postgresql
|
||||
@$(WAIT_DB)
|
||||
@@ -197,15 +198,15 @@ resetdb: ## flush database and create a superuser "admin"
|
||||
.PHONY: resetdb
|
||||
|
||||
env.d/development/common:
|
||||
cp -n env.d/development/common.dist env.d/development/common
|
||||
cp --update=none env.d/development/common.dist env.d/development/common
|
||||
|
||||
env.d/development/postgresql:
|
||||
cp -n env.d/development/postgresql.dist env.d/development/postgresql
|
||||
cp --update=none env.d/development/postgresql.dist env.d/development/postgresql
|
||||
|
||||
# -- Internationalization
|
||||
|
||||
env.d/development/crowdin:
|
||||
cp -n env.d/development/crowdin.dist env.d/development/crowdin
|
||||
cp --update=none env.d/development/crowdin.dist env.d/development/crowdin
|
||||
|
||||
crowdin-download: ## Download translated message from crowdin
|
||||
@$(COMPOSE_RUN_CROWDIN) download -c crowdin/config.yml
|
||||
@@ -249,7 +250,7 @@ clean: ## restore repository state as it was freshly cloned
|
||||
.PHONY: clean
|
||||
|
||||
help:
|
||||
@echo "$(BOLD)drive Makefile"
|
||||
@echo "$(BOLD)find Makefile"
|
||||
@echo "Please use 'make $(BOLD)target$(RESET)' where $(BOLD)target$(RESET) is one of:"
|
||||
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "$(GREEN)%-30s$(RESET) %s\n", $$1, $$2}'
|
||||
.PHONY: help
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Drive
|
||||
# Find
|
||||
|
||||
Drive can index documents from several applications sharing a common OIDC federation
|
||||
Find can index documents from several applications sharing a common OIDC federation
|
||||
and allows users to search documents with their access rights accross all applications
|
||||
in the federation.
|
||||
|
||||
Drive is built on top of [Django Rest
|
||||
Find is built on top of [Django Rest
|
||||
Framework](https://www.django-rest-framework.org/).
|
||||
|
||||
## Getting started
|
||||
@@ -16,14 +16,15 @@ Compose](https://docs.docker.com/compose/install) installed on your laptop:
|
||||
|
||||
```bash
|
||||
$ docker -v
|
||||
Docker version 20.10.2, build 2291f61
|
||||
Docker version 27.4.1, build b9d17ea
|
||||
|
||||
$ docker compose -v
|
||||
docker compose version 1.27.4, build 40524192
|
||||
$ docker compose version
|
||||
Docker Compose version v2.32.1
|
||||
```
|
||||
|
||||
> ⚠️ You may need to run the following commands with `sudo` but this can be
|
||||
> avoided by assigning your user to the `docker` group.
|
||||
> avoided by assigning your user to the `docker` group. See docker
|
||||
> [Documentation](https://docs.docker.com/engine/install/linux-postinstall/)
|
||||
|
||||
### Project bootstrap
|
||||
|
||||
|
||||
+12
-11
@@ -1,9 +1,9 @@
|
||||
load('ext://uibutton', 'cmd_button', 'bool_input', 'location')
|
||||
load('ext://namespace', 'namespace_create', 'namespace_inject')
|
||||
namespace_create('drive')
|
||||
namespace_create('find')
|
||||
|
||||
docker_build(
|
||||
'localhost:5001/drive-backend:latest',
|
||||
'localhost:5001/find-backend:latest',
|
||||
context='..',
|
||||
dockerfile='../Dockerfile',
|
||||
only=['./src/backend', './docker'],
|
||||
@@ -18,27 +18,28 @@ docker_build(
|
||||
)
|
||||
|
||||
docker_build(
|
||||
'localhost:5001/drive-frontend:latest',
|
||||
'localhost:5001/find-frontend:latest',
|
||||
context='..',
|
||||
dockerfile='../src/frontend/Dockerfile',
|
||||
only=['./src/frontend', './docker', './.dockerignore'],
|
||||
target = 'drive',
|
||||
target = 'find',
|
||||
live_update=[
|
||||
sync('../src/frontend', '/home/frontend'),
|
||||
]
|
||||
)
|
||||
|
||||
k8s_yaml(local('cd ../src/helm && helmfile -n drive -e dev template .'))
|
||||
|
||||
k8s_yaml(local('cd ../src/helm && helmfile -n find -e dev template .'))
|
||||
|
||||
migration = '''
|
||||
set -eu
|
||||
# get k8s pod name from tilt resource name
|
||||
POD_NAME="$(tilt get kubernetesdiscovery drive-backend -ojsonpath='{.status.pods[0].name}')"
|
||||
kubectl -n drive exec "$POD_NAME" -- python manage.py makemigrations
|
||||
POD_NAME="$(tilt get kubernetesdiscovery find-backend -ojsonpath='{.status.pods[0].name}')"
|
||||
kubectl -n find exec "$POD_NAME" -- python manage.py makemigrations
|
||||
'''
|
||||
cmd_button('Make migration',
|
||||
argv=['sh', '-c', migration],
|
||||
resource='drive-backend',
|
||||
resource='find-backend',
|
||||
icon_name='developer_board',
|
||||
text='Run makemigration',
|
||||
)
|
||||
@@ -46,12 +47,12 @@ cmd_button('Make migration',
|
||||
pod_migrate = '''
|
||||
set -eu
|
||||
# get k8s pod name from tilt resource name
|
||||
POD_NAME="$(tilt get kubernetesdiscovery drive-backend -ojsonpath='{.status.pods[0].name}')"
|
||||
kubectl -n drive exec "$POD_NAME" -- python manage.py migrate --no-input
|
||||
POD_NAME="$(tilt get kubernetesdiscovery find-backend -ojsonpath='{.status.pods[0].name}')"
|
||||
kubectl -n find exec "$POD_NAME" -- python manage.py migrate --no-input
|
||||
'''
|
||||
cmd_button('Migrate db',
|
||||
argv=['sh', '-c', pod_migrate],
|
||||
resource='drive-backend',
|
||||
resource='find-backend',
|
||||
icon_name='developer_board',
|
||||
text='Run database migration',
|
||||
)
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ REPO_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd)"
|
||||
UNSET_USER=0
|
||||
|
||||
COMPOSE_FILE="${REPO_DIR}/docker-compose.yml"
|
||||
COMPOSE_PROJECT="drive"
|
||||
COMPOSE_PROJECT="find"
|
||||
|
||||
|
||||
# _set_user: set (or unset) default user id used to run docker commands
|
||||
|
||||
@@ -7,6 +7,6 @@ _dc_run \
|
||||
app \
|
||||
python manage.py spectacular \
|
||||
--api-version 'v1.0' \
|
||||
--urlconf 'drive.api_urls' \
|
||||
--urlconf 'find.api_urls' \
|
||||
--format openapi-json \
|
||||
--file /app/core/tests/swagger/swagger.json
|
||||
|
||||
+4
-4
@@ -17,13 +17,13 @@ preserve_hierarchy: true
|
||||
files: [
|
||||
{
|
||||
source : "/backend/locale/django.pot",
|
||||
dest: "/backend-drive.pot",
|
||||
dest: "/backend-find.pot",
|
||||
translation : "/backend/locale/%locale_with_underscore%/LC_MESSAGES/django.po"
|
||||
},
|
||||
{
|
||||
source: "/frontend/packages/i18n/locales/drive/translations-crowdin.json",
|
||||
dest: "/frontend-drive.json",
|
||||
translation: "/frontend/packages/i18n/locales/drive/%two_letters_code%/translations.json",
|
||||
source: "/frontend/packages/i18n/locales/find/translations-crowdin.json",
|
||||
dest: "/frontend-find.json",
|
||||
translation: "/frontend/packages/i18n/locales/find/%two_letters_code%/translations.json",
|
||||
skip_untranslated_strings: true,
|
||||
},
|
||||
]
|
||||
|
||||
+4
-4
@@ -12,7 +12,7 @@ services:
|
||||
- discovery.type=single-node
|
||||
- plugins.security.disabled=true
|
||||
- plugins.security.ssl.http.enabled=false
|
||||
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=drive.PASS123
|
||||
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=find.PASS123
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
@@ -43,7 +43,7 @@ services:
|
||||
args:
|
||||
DOCKER_USER: ${DOCKER_USER:-1000}
|
||||
user: ${DOCKER_USER:-1000}
|
||||
image: drive:backend-development
|
||||
image: find:backend-development
|
||||
environment:
|
||||
- PYLINTHOME=/app/.pylint.d
|
||||
- DJANGO_CONFIGURATION=Development
|
||||
@@ -62,8 +62,8 @@ services:
|
||||
|
||||
celery:
|
||||
user: ${DOCKER_USER:-1000}
|
||||
image: drive:backend-development
|
||||
command: ["celery", "-A", "drive.celery_app", "worker", "-l", "DEBUG"]
|
||||
image: find:backend-development
|
||||
command: ["celery", "-A", "find.celery_app", "worker", "-l", "DEBUG"]
|
||||
environment:
|
||||
- DJANGO_CONFIGURATION=Development
|
||||
env_file:
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#
|
||||
# To pass environment variables, you can either use the -e option of the docker run command:
|
||||
#
|
||||
# docker run --rm -e USER_NAME=foo -e HOME='/home/foo' drive:latest python manage.py migrate
|
||||
# docker run --rm -e USER_NAME=foo -e HOME='/home/foo' find:latest python manage.py migrate
|
||||
#
|
||||
# or define new variables in an environment file to use with docker or docker compose:
|
||||
#
|
||||
@@ -21,7 +21,7 @@
|
||||
# USER_NAME=foo
|
||||
# HOME=/home/foo
|
||||
#
|
||||
# docker run --rm --env-file env.d/production drive:latest python manage.py migrate
|
||||
# docker run --rm --env-file env.d/production find:latest python manage.py migrate
|
||||
#
|
||||
|
||||
echo "🐳(entrypoint) creating user running in the container..."
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# Gunicorn-django settings
|
||||
bind = ["0.0.0.0:8000"]
|
||||
name = "drive"
|
||||
name = "find"
|
||||
python_path = "/app"
|
||||
|
||||
# Run
|
||||
@@ -1,28 +1,28 @@
|
||||
# Django
|
||||
DJANGO_ALLOWED_HOSTS=*
|
||||
DJANGO_SECRET_KEY=ThisIsAnExampleKeyForDevPurposeOnly
|
||||
DJANGO_SETTINGS_MODULE=drive.settings
|
||||
DJANGO_SETTINGS_MODULE=find.settings
|
||||
DJANGO_SUPERUSER_PASSWORD=admin
|
||||
|
||||
# Python
|
||||
PYTHONPATH=/app
|
||||
|
||||
# drive settings
|
||||
# find settings
|
||||
|
||||
# Backend url
|
||||
DRIVE_BASE_URL="http://localhost:8072"
|
||||
FIND_BASE_URL="http://localhost:8072"
|
||||
|
||||
# Opensearch
|
||||
OPENSEARCH_PASSWORD=drive.PASS123
|
||||
OPENSEARCH_PASSWORD=find.PASS123
|
||||
OPENSEARCH_USE_SSL=false
|
||||
|
||||
# OIDC
|
||||
OIDC_OP_JWKS_ENDPOINT=http://nginx:8083/realms/drive/protocol/openid-connect/certs
|
||||
OIDC_OP_AUTHORIZATION_ENDPOINT=http://localhost:8083/realms/drive/protocol/openid-connect/auth
|
||||
OIDC_OP_TOKEN_ENDPOINT=http://nginx:8083/realms/drive/protocol/openid-connect/token
|
||||
OIDC_OP_USER_ENDPOINT=http://nginx:8083/realms/drive/protocol/openid-connect/userinfo
|
||||
OIDC_OP_JWKS_ENDPOINT=http://nginx:8083/realms/find/protocol/openid-connect/certs
|
||||
OIDC_OP_AUTHORIZATION_ENDPOINT=http://localhost:8083/realms/find/protocol/openid-connect/auth
|
||||
OIDC_OP_TOKEN_ENDPOINT=http://nginx:8083/realms/find/protocol/openid-connect/token
|
||||
OIDC_OP_USER_ENDPOINT=http://nginx:8083/realms/find/protocol/openid-connect/userinfo
|
||||
|
||||
OIDC_RP_CLIENT_ID=drive
|
||||
OIDC_RP_CLIENT_ID=find
|
||||
OIDC_RP_CLIENT_SECRET=ThisIsAnExampleKeyForDevPurposeOnly
|
||||
OIDC_RP_SIGN_ALGO=RS256
|
||||
OIDC_RP_SCOPES="openid email"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# Postgresql db container configuration
|
||||
POSTGRES_DB=drive
|
||||
POSTGRES_DB=find
|
||||
POSTGRES_USER=dinum
|
||||
POSTGRES_PASSWORD=pass
|
||||
|
||||
# App database configuration
|
||||
DB_HOST=postgresql
|
||||
DB_NAME=drive
|
||||
DB_NAME=find
|
||||
DB_USER=dinum
|
||||
DB_PASSWORD=pass
|
||||
DB_PORT=5432
|
||||
DB_PORT=5432
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
include LICENSE
|
||||
include README.md
|
||||
recursive-include src/backend/drive *.html *.png *.gif *.css *.ico *.jpg *.jpeg *.po *.mo *.eot *.svg *.ttf *.woff *.woff2
|
||||
recursive-include src/backend/find *.html *.png *.gif *.css *.ico *.jpg *.jpeg *.po *.mo *.eot *.svg *.ttf *.woff *.woff2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Admin config for drive's core app"""
|
||||
"""Admin config for find's core app"""
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import Service
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Enums for drive's core app."""
|
||||
"""Enums for find's core app."""
|
||||
|
||||
RELEVANCE = "relevance"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Factories for the drive's core app"""
|
||||
"""Factories for the find's core app"""
|
||||
|
||||
from uuid import uuid4
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class Migration(migrations.Migration):
|
||||
options={
|
||||
'verbose_name': 'service',
|
||||
'verbose_name_plural': 'services',
|
||||
'db_table': 'drive_service',
|
||||
'db_table': 'find_service',
|
||||
'ordering': ['-is_active', '-created_at'],
|
||||
},
|
||||
),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Models for drive's core app"""
|
||||
"""Models for find's core app"""
|
||||
import secrets
|
||||
import string
|
||||
|
||||
@@ -13,11 +13,11 @@ TOKEN_LENGTH = 50
|
||||
|
||||
|
||||
class User(AbstractUser):
|
||||
"""User for the drive application"""
|
||||
"""User for the find application"""
|
||||
|
||||
|
||||
class Service(models.Model):
|
||||
"""Service registered to index its documents to our drive"""
|
||||
"""Service registered to index its documents to our find"""
|
||||
|
||||
name = models.SlugField(max_length=20, unique=True)
|
||||
token = models.CharField(max_length=TOKEN_LENGTH)
|
||||
@@ -25,7 +25,7 @@ class Service(models.Model):
|
||||
is_active = models.BooleanField(default=True)
|
||||
|
||||
class Meta:
|
||||
db_table = "drive_service"
|
||||
db_table = "find_service"
|
||||
verbose_name = _("service")
|
||||
verbose_name_plural = _("services")
|
||||
ordering = ["-is_active", "-created_at"]
|
||||
@@ -55,4 +55,4 @@ class Service(models.Model):
|
||||
@property
|
||||
def index_name(self):
|
||||
"""Compute index name from service name"""
|
||||
return f"drive-{self.name:s}"
|
||||
return f"find-{self.name:s}"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Permission classes for drive's core app"""
|
||||
"""Permission classes for find's core app"""
|
||||
|
||||
from rest_framework import permissions
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Tests Service model for drive's core app."""
|
||||
"""Tests Service model for find's core app."""
|
||||
|
||||
from django.db import DataError, IntegrityError
|
||||
|
||||
@@ -26,7 +26,7 @@ def test_models_services_name_slugified():
|
||||
def test_models_services_index_name():
|
||||
"""The index name should be computed as a property from the service name."""
|
||||
service = factories.ServiceFactory(name="My service name")
|
||||
assert service.index_name == "drive-my-service-name"
|
||||
assert service.index_name == "find-my-service-name"
|
||||
|
||||
|
||||
def test_models_services_token_50_characters_exact():
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""URL configuration for drive's core app."""
|
||||
"""URL configuration for find's core app."""
|
||||
from django.urls import path
|
||||
|
||||
from .views import DocumentView
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Views for drive's core app."""
|
||||
"""Views for find's core app."""
|
||||
from pydantic import ValidationError as PydanticValidationError
|
||||
from rest_framework import status, views
|
||||
from rest_framework.response import Response
|
||||
@@ -35,7 +35,7 @@ class DocumentView(views.APIView):
|
||||
@property
|
||||
def index_name(self):
|
||||
"""Compute index name from the service name extracted during authentication"""
|
||||
return f"drive-{self.request.auth}"
|
||||
return f"find-{self.request.auth}"
|
||||
|
||||
# pylint: disable=too-many-locals
|
||||
def post(self, request, *args, **kwargs):
|
||||
@@ -46,7 +46,7 @@ class DocumentView(views.APIView):
|
||||
the following scenarios based on the type of request data:
|
||||
|
||||
1. **Single Document Indexing**: If the request contains a single document (as a
|
||||
dictionary), it will be indexed into an OpenSearch index named `drive-{auth_token}`.
|
||||
dictionary), it will be indexed into an OpenSearch index named `find-{auth_token}`.
|
||||
On success, the indexed document is returned with a `201 Created` status. If an
|
||||
error occurs, a `400 Bad Request` response with an error message is returned.
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ from demo import defaults
|
||||
|
||||
fake = Faker()
|
||||
|
||||
logger = logging.getLogger("drive.commands.demo.create_demo")
|
||||
logger = logging.getLogger("find.commands.demo.create_demo")
|
||||
|
||||
|
||||
class BulkIndexing:
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
"""Drive celery configuration file."""
|
||||
"""find celery configuration file."""
|
||||
import os
|
||||
|
||||
from celery import Celery
|
||||
from configurations.importer import install
|
||||
|
||||
# Set the default Django settings module for the 'celery' program.
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "drive.settings")
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "find.settings")
|
||||
os.environ.setdefault("DJANGO_CONFIGURATION", "Development")
|
||||
|
||||
install(check_options=True)
|
||||
|
||||
app = Celery("drive")
|
||||
app = Celery("find")
|
||||
|
||||
# Using a string here means the worker doesn't have to serialize
|
||||
# the configuration object to child processes.
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Django settings for drive project.
|
||||
Django settings for find project.
|
||||
|
||||
Generated by 'django-admin startproject' using Django 3.1.5.
|
||||
|
||||
@@ -72,8 +72,8 @@ class Base(Configuration):
|
||||
SECRET_KEY = values.Value(None)
|
||||
|
||||
# Application definition
|
||||
ROOT_URLCONF = "drive.urls"
|
||||
WSGI_APPLICATION = "drive.wsgi.application"
|
||||
ROOT_URLCONF = "find.urls"
|
||||
WSGI_APPLICATION = "find.wsgi.application"
|
||||
|
||||
# Database
|
||||
DATABASES = {
|
||||
@@ -83,7 +83,7 @@ class Base(Configuration):
|
||||
environ_name="DB_ENGINE",
|
||||
environ_prefix=None,
|
||||
),
|
||||
"NAME": values.Value("drive", environ_name="DB_NAME", environ_prefix=None),
|
||||
"NAME": values.Value("find", environ_name="DB_NAME", environ_prefix=None),
|
||||
"USER": values.Value("dinum", environ_name="DB_USER", environ_prefix=None),
|
||||
"PASSWORD": values.Value(
|
||||
"pass", environ_name="DB_PASSWORD", environ_prefix=None
|
||||
@@ -181,7 +181,7 @@ class Base(Configuration):
|
||||
|
||||
# Django applications from the highest priority to the lowest
|
||||
INSTALLED_APPS = [
|
||||
# drive
|
||||
# find
|
||||
"core",
|
||||
"demo",
|
||||
# Third party apps
|
||||
@@ -242,8 +242,8 @@ class Base(Configuration):
|
||||
)
|
||||
|
||||
SPECTACULAR_SETTINGS = {
|
||||
"TITLE": "Drive API",
|
||||
"DESCRIPTION": "This is the drive API schema.",
|
||||
"TITLE": "Find API",
|
||||
"DESCRIPTION": "This is the find API schema.",
|
||||
"VERSION": "0.1.0",
|
||||
"SERVE_INCLUDE_SCHEMA": False,
|
||||
"ENABLE_DJANGO_DEPLOY_CHECK": values.BooleanValue(
|
||||
@@ -286,7 +286,7 @@ class Base(Configuration):
|
||||
"RS256", environ_name="OIDC_RP_SIGN_ALGO", environ_prefix=None
|
||||
)
|
||||
OIDC_RP_CLIENT_ID = values.Value(
|
||||
"drive", environ_name="OIDC_RP_CLIENT_ID", environ_prefix=None
|
||||
"find", environ_name="OIDC_RP_CLIENT_ID", environ_prefix=None
|
||||
)
|
||||
OIDC_RP_CLIENT_SECRET = values.Value(
|
||||
None,
|
||||
@@ -408,7 +408,7 @@ class Development(Base):
|
||||
CSRF_TRUSTED_ORIGINS = ["http://localhost:8072", "http://localhost:3000"]
|
||||
DEBUG = True
|
||||
|
||||
SESSION_COOKIE_NAME = "drive_sessionid"
|
||||
SESSION_COOKIE_NAME = "find_sessionid"
|
||||
|
||||
USE_SWAGGER = True
|
||||
|
||||
@@ -430,7 +430,7 @@ class Test(Base):
|
||||
},
|
||||
},
|
||||
"loggers": {
|
||||
"drive": {
|
||||
"find": {
|
||||
"handlers": ["console"],
|
||||
"level": "DEBUG",
|
||||
},
|
||||
@@ -1,4 +1,4 @@
|
||||
"""URL configuration for the drive project"""
|
||||
"""URL configuration for the find project"""
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
WSGI config for the drive project.
|
||||
WSGI config for the find project.
|
||||
|
||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
||||
|
||||
@@ -11,7 +11,7 @@ import os
|
||||
|
||||
from configurations.wsgi import get_wsgi_application
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "drive.settings")
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "find.settings")
|
||||
os.environ.setdefault("DJANGO_CONFIGURATION", "Development")
|
||||
|
||||
application = get_wsgi_application()
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
drive's sandbox management script.
|
||||
find's sandbox management script.
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "drive.settings")
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "find.settings")
|
||||
os.environ.setdefault("DJANGO_CONFIGURATION", "Development")
|
||||
|
||||
from configurations.management import execute_from_command_line
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#
|
||||
# drive package
|
||||
# find package
|
||||
#
|
||||
[build-system]
|
||||
requires = ["setuptools"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "drive"
|
||||
name = "find"
|
||||
version = "1.1.0"
|
||||
authors = [{ "name" = "DINUM", "email" = "dev@mail.numerique.gouv.fr" }]
|
||||
classifiers = [
|
||||
@@ -48,10 +48,10 @@ dependencies = [
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
"Bug Tracker" = "https://github.com/numerique-gouv/drive/issues/new"
|
||||
"Changelog" = "https://github.com/numerique-gouv/drive/blob/main/CHANGELOG.md"
|
||||
"Homepage" = "https://github.com/numerique-gouv/drive"
|
||||
"Repository" = "https://github.com/numerique-gouv/drive"
|
||||
"Bug Tracker" = "https://github.com/suitenumerique/find/issues/new"
|
||||
"Changelog" = "https://github.com/suitenumerique/find/blob/main/CHANGELOG.md"
|
||||
"Homepage" = "https://github.com/suitenumerique/find"
|
||||
"Repository" = "https://github.com/suitenumerique/find"
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
@@ -112,8 +112,8 @@ select = [
|
||||
]
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
section-order = ["future","standard-library","django","third-party","drive","first-party","local-folder"]
|
||||
sections = { drive=["core"], django=["django"] }
|
||||
section-order = ["future","standard-library","django","third-party","find","first-party","local-folder"]
|
||||
sections = { find=["core"], django=["django"] }
|
||||
|
||||
[tool.ruff.per-file-ignores]
|
||||
"**/tests/*" = ["S", "SLF"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
"""Setup file for the drive module. All configuration stands in the setup.cfg file."""
|
||||
"""Setup file for the find module. All configuration stands in the setup.cfg file."""
|
||||
# coding: utf-8
|
||||
|
||||
from setuptools import setup
|
||||
|
||||
+16
-16
@@ -1,16 +1,16 @@
|
||||
image:
|
||||
repository: localhost:5001/drive-backend
|
||||
repository: localhost:5001/find-backend
|
||||
pullPolicy: Always
|
||||
tag: "latest"
|
||||
|
||||
backend:
|
||||
replicas: 1
|
||||
envVars:
|
||||
DJANGO_CSRF_TRUSTED_ORIGINS: https://drive.127.0.0.1.nip.io,http://drive.127.0.0.1.nip.io
|
||||
DJANGO_CSRF_TRUSTED_ORIGINS: https://find.127.0.0.1.nip.io,http://find.127.0.0.1.nip.io
|
||||
DJANGO_CONFIGURATION: Production
|
||||
DJANGO_ALLOWED_HOSTS: "*"
|
||||
DJANGO_SECRET_KEY: {{ .Values.djangoSecretKey }}
|
||||
DJANGO_SETTINGS_MODULE: drive.settings
|
||||
DJANGO_SETTINGS_MODULE: find.settings
|
||||
DJANGO_SUPERUSER_PASSWORD: admin
|
||||
DJANGO_EMAIL_HOST: "mailcatcher"
|
||||
DJANGO_EMAIL_PORT: 1025
|
||||
@@ -24,17 +24,17 @@ backend:
|
||||
OIDC_RP_CLIENT_SECRET: {{ .Values.oidc.clientSecret }}
|
||||
OIDC_RP_SIGN_ALGO: RS256
|
||||
OIDC_RP_SCOPES: "openid email"
|
||||
OIDC_REDIRECT_ALLOWED_HOSTS: https://drive.127.0.0.1.nip.io
|
||||
OIDC_REDIRECT_ALLOWED_HOSTS: https://find.127.0.0.1.nip.io
|
||||
OIDC_AUTH_REQUEST_EXTRA_PARAMS: "{'acr_values': 'eidas1'}"
|
||||
LOGIN_REDIRECT_URL: https://drive.127.0.0.1.nip.io
|
||||
LOGIN_REDIRECT_URL_FAILURE: https://drive.127.0.0.1.nip.io
|
||||
LOGOUT_REDIRECT_URL: https://drive.127.0.0.1.nip.io
|
||||
LOGIN_REDIRECT_URL: https://find.127.0.0.1.nip.io
|
||||
LOGIN_REDIRECT_URL_FAILURE: https://find.127.0.0.1.nip.io
|
||||
LOGOUT_REDIRECT_URL: https://find.127.0.0.1.nip.io
|
||||
DB_HOST: postgres-postgresql
|
||||
DB_NAME: drive
|
||||
DB_NAME: find
|
||||
DB_USER: dinum
|
||||
DB_PASSWORD: pass
|
||||
DB_PORT: 5432
|
||||
POSTGRES_DB: drive
|
||||
POSTGRES_DB: find
|
||||
POSTGRES_USER: dinum
|
||||
POSTGRES_PASSWORD: pass
|
||||
REDIS_URL: redis://default:pass@redis-master:6379/1
|
||||
@@ -52,8 +52,8 @@ backend:
|
||||
command:
|
||||
- "gunicorn"
|
||||
- "-c"
|
||||
- "/usr/local/etc/gunicorn/drive.py"
|
||||
- "drive.wsgi:application"
|
||||
- "/usr/local/etc/gunicorn/find.py"
|
||||
- "find.wsgi:application"
|
||||
- "--reload"
|
||||
|
||||
createsuperuser:
|
||||
@@ -67,8 +67,8 @@ backend:
|
||||
frontend:
|
||||
envVars:
|
||||
PORT: 8080
|
||||
NEXT_PUBLIC_API_ORIGIN: https://drive.127.0.0.1.nip.io
|
||||
NEXT_PUBLIC_SIGNALING_URL: wss://drive.127.0.0.1.nip.io/ws
|
||||
NEXT_PUBLIC_API_ORIGIN: https://find.127.0.0.1.nip.io
|
||||
NEXT_PUBLIC_SIGNALING_URL: wss://find.127.0.0.1.nip.io/ws
|
||||
|
||||
replicas: 1
|
||||
command:
|
||||
@@ -76,14 +76,14 @@ frontend:
|
||||
- dev
|
||||
|
||||
image:
|
||||
repository: localhost:5001/drive-frontend
|
||||
repository: localhost:5001/find-frontend
|
||||
pullPolicy: Always
|
||||
tag: "latest"
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
host: drive.127.0.0.1.nip.io
|
||||
host: find.127.0.0.1.nip.io
|
||||
|
||||
ingressAdmin:
|
||||
enabled: true
|
||||
host: drive.127.0.0.1.nip.io
|
||||
host: find.127.0.0.1.nip.io
|
||||
+14
-14
@@ -1,5 +1,5 @@
|
||||
image:
|
||||
repository: lasuite/drive-backend
|
||||
repository: lasuite/find-backend
|
||||
pullPolicy: Always
|
||||
tag: "v1.1.0"
|
||||
|
||||
@@ -8,7 +8,7 @@ backend:
|
||||
argocd.argoproj.io/hook: PreSync
|
||||
argocd.argoproj.io/hook-delete-policy: HookSucceeded
|
||||
envVars:
|
||||
DJANGO_CSRF_TRUSTED_ORIGINS: http://drive-preprod.beta.numerique.gouv.fr,https://drive-preprod.beta.numerique.gouv.fr
|
||||
DJANGO_CSRF_TRUSTED_ORIGINS: http://find-preprod.beta.numerique.gouv.fr,https://find-preprod.beta.numerique.gouv.fr
|
||||
DJANGO_CONFIGURATION: Production
|
||||
DJANGO_ALLOWED_HOSTS: "*"
|
||||
DJANGO_SUPERUSER_EMAIL:
|
||||
@@ -19,7 +19,7 @@ backend:
|
||||
secretKeyRef:
|
||||
name: backend
|
||||
key: DJANGO_SECRET_KEY
|
||||
DJANGO_SETTINGS_MODULE: drive.settings
|
||||
DJANGO_SETTINGS_MODULE: find.settings
|
||||
DJANGO_SUPERUSER_PASSWORD:
|
||||
secretKeyRef:
|
||||
name: backend
|
||||
@@ -43,11 +43,11 @@ backend:
|
||||
key: OIDC_RP_CLIENT_SECRET
|
||||
OIDC_RP_SIGN_ALGO: RS256
|
||||
OIDC_RP_SCOPES: "openid email"
|
||||
OIDC_REDIRECT_ALLOWED_HOSTS: https://drive-preprod.beta.numerique.gouv.fr
|
||||
OIDC_REDIRECT_ALLOWED_HOSTS: https://find-preprod.beta.numerique.gouv.fr
|
||||
OIDC_AUTH_REQUEST_EXTRA_PARAMS: "{'acr_values': 'eidas1'}"
|
||||
LOGIN_REDIRECT_URL: https://drive-preprod.beta.numerique.gouv.fr
|
||||
LOGIN_REDIRECT_URL_FAILURE: https://drive-preprod.beta.numerique.gouv.fr
|
||||
LOGOUT_REDIRECT_URL: https://drive-preprod.beta.numerique.gouv.fr
|
||||
LOGIN_REDIRECT_URL: https://find-preprod.beta.numerique.gouv.fr
|
||||
LOGIN_REDIRECT_URL_FAILURE: https://find-preprod.beta.numerique.gouv.fr
|
||||
LOGOUT_REDIRECT_URL: https://find-preprod.beta.numerique.gouv.fr
|
||||
DB_HOST:
|
||||
secretKeyRef:
|
||||
name: postgresql.postgres.libre.sh
|
||||
@@ -86,19 +86,19 @@ backend:
|
||||
key: url
|
||||
AWS_S3_ENDPOINT_URL:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: url
|
||||
AWS_S3_ACCESS_KEY_ID:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: accessKey
|
||||
AWS_S3_SECRET_ACCESS_KEY:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: secretKey
|
||||
AWS_STORAGE_BUCKET_NAME:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: bucket
|
||||
AWS_S3_REGION_NAME: local
|
||||
STORAGES_STATICFILES_BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage
|
||||
@@ -113,13 +113,13 @@ backend:
|
||||
|
||||
frontend:
|
||||
image:
|
||||
repository: lasuite/drive-frontend
|
||||
repository: lasuite/find-frontend
|
||||
pullPolicy: Always
|
||||
tag: "v1.1.0"
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
host: drive-preprod.beta.numerique.gouv.fr
|
||||
host: find-preprod.beta.numerique.gouv.fr
|
||||
className: nginx
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
@@ -129,7 +129,7 @@ ingress:
|
||||
|
||||
ingressAdmin:
|
||||
enabled: true
|
||||
host: drive-preprod.beta.numerique.gouv.fr
|
||||
host: find-preprod.beta.numerique.gouv.fr
|
||||
className: nginx
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
+7
-7
@@ -1,5 +1,5 @@
|
||||
image:
|
||||
repository: lasuite/drive-backend
|
||||
repository: lasuite/find-backend
|
||||
pullPolicy: Always
|
||||
tag: "v1.1.0"
|
||||
|
||||
@@ -15,7 +15,7 @@ backend:
|
||||
secretKeyRef:
|
||||
name: backend
|
||||
key: DJANGO_SECRET_KEY
|
||||
DJANGO_SETTINGS_MODULE: drive.settings
|
||||
DJANGO_SETTINGS_MODULE: find.settings
|
||||
DJANGO_SUPERUSER_EMAIL:
|
||||
secretKeyRef:
|
||||
name: backend
|
||||
@@ -86,19 +86,19 @@ backend:
|
||||
key: url
|
||||
AWS_S3_ENDPOINT_URL:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: url
|
||||
AWS_S3_ACCESS_KEY_ID:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: accessKey
|
||||
AWS_S3_SECRET_ACCESS_KEY:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: secretKey
|
||||
AWS_STORAGE_BUCKET_NAME:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: bucket
|
||||
AWS_S3_REGION_NAME: local
|
||||
STORAGES_STATICFILES_BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage
|
||||
@@ -113,7 +113,7 @@ backend:
|
||||
|
||||
frontend:
|
||||
image:
|
||||
repository: lasuite/drive-frontend
|
||||
repository: lasuite/find-frontend
|
||||
pullPolicy: Always
|
||||
tag: "v1.1.0"
|
||||
|
||||
+14
-14
@@ -1,5 +1,5 @@
|
||||
image:
|
||||
repository: lasuite/drive-backend
|
||||
repository: lasuite/find-backend
|
||||
pullPolicy: Always
|
||||
tag: "main"
|
||||
|
||||
@@ -8,14 +8,14 @@ backend:
|
||||
argocd.argoproj.io/hook: PreSync
|
||||
argocd.argoproj.io/hook-delete-policy: HookSucceeded
|
||||
envVars:
|
||||
DJANGO_CSRF_TRUSTED_ORIGINS: http://drive-staging.beta.numerique.gouv.fr,https://drive-staging.beta.numerique.gouv.fr
|
||||
DJANGO_CSRF_TRUSTED_ORIGINS: http://find-staging.beta.numerique.gouv.fr,https://find-staging.beta.numerique.gouv.fr
|
||||
DJANGO_CONFIGURATION: Production
|
||||
DJANGO_ALLOWED_HOSTS: "*"
|
||||
DJANGO_SECRET_KEY:
|
||||
secretKeyRef:
|
||||
name: backend
|
||||
key: DJANGO_SECRET_KEY
|
||||
DJANGO_SETTINGS_MODULE: drive.settings
|
||||
DJANGO_SETTINGS_MODULE: find.settings
|
||||
DJANGO_SUPERUSER_EMAIL:
|
||||
secretKeyRef:
|
||||
name: backend
|
||||
@@ -43,11 +43,11 @@ backend:
|
||||
key: OIDC_RP_CLIENT_SECRET
|
||||
OIDC_RP_SIGN_ALGO: RS256
|
||||
OIDC_RP_SCOPES: "openid email"
|
||||
OIDC_REDIRECT_ALLOWED_HOSTS: https://drive-staging.beta.numerique.gouv.fr
|
||||
OIDC_REDIRECT_ALLOWED_HOSTS: https://find-staging.beta.numerique.gouv.fr
|
||||
OIDC_AUTH_REQUEST_EXTRA_PARAMS: "{'acr_values': 'eidas1'}"
|
||||
LOGIN_REDIRECT_URL: https://drive-staging.beta.numerique.gouv.fr
|
||||
LOGIN_REDIRECT_URL_FAILURE: https://drive-staging.beta.numerique.gouv.fr
|
||||
LOGOUT_REDIRECT_URL: https://drive-staging.beta.numerique.gouv.fr
|
||||
LOGIN_REDIRECT_URL: https://find-staging.beta.numerique.gouv.fr
|
||||
LOGIN_REDIRECT_URL_FAILURE: https://find-staging.beta.numerique.gouv.fr
|
||||
LOGOUT_REDIRECT_URL: https://find-staging.beta.numerique.gouv.fr
|
||||
DB_HOST:
|
||||
secretKeyRef:
|
||||
name: postgresql.postgres.libre.sh
|
||||
@@ -86,19 +86,19 @@ backend:
|
||||
key: url
|
||||
AWS_S3_ENDPOINT_URL:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: url
|
||||
AWS_S3_ACCESS_KEY_ID:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: accessKey
|
||||
AWS_S3_SECRET_ACCESS_KEY:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: secretKey
|
||||
AWS_STORAGE_BUCKET_NAME:
|
||||
secretKeyRef:
|
||||
name: drive-media-storage.bucket.libre.sh
|
||||
name: find-media-storage.bucket.libre.sh
|
||||
key: bucket
|
||||
AWS_S3_REGION_NAME: local
|
||||
STORAGES_STATICFILES_BACKEND: django.contrib.staticfiles.storage.StaticFilesStorage
|
||||
@@ -113,20 +113,20 @@ backend:
|
||||
|
||||
frontend:
|
||||
image:
|
||||
repository: lasuite/drive-frontend
|
||||
repository: lasuite/find-frontend
|
||||
pullPolicy: Always
|
||||
tag: "main"
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
host: drive-staging.beta.numerique.gouv.fr
|
||||
host: find-staging.beta.numerique.gouv.fr
|
||||
className: nginx
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
|
||||
ingressAdmin:
|
||||
enabled: true
|
||||
host: drive-staging.beta.numerique.gouv.fr
|
||||
host: find-staging.beta.numerique.gouv.fr
|
||||
className: nginx
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-prod
|
||||
@@ -1,5 +1,5 @@
|
||||
apiVersion: v2
|
||||
name: extra
|
||||
description: A Helm chart to add some manifests to drive
|
||||
description: A Helm chart to add some manifests to find
|
||||
type: application
|
||||
version: 0.1.0
|
||||
|
||||
@@ -4,4 +4,4 @@ metadata:
|
||||
name: postgresql
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
database: drive
|
||||
database: find
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
apiVersion: core.libre.sh/v1alpha1
|
||||
kind: Bucket
|
||||
metadata:
|
||||
name: drive-media-storage
|
||||
name: find-media-storage
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
spec:
|
||||
provider: data
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
apiVersion: v2
|
||||
type: application
|
||||
name: drive
|
||||
name: find
|
||||
version: 0.0.1
|
||||
@@ -1,4 +1,4 @@
|
||||
# Drive helm chart
|
||||
# Find helm chart
|
||||
|
||||
## Parameters
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------------------------------ | ---------------------------------------------------- | ------------------------ |
|
||||
| `image.repository` | Repository to use to pull drive's container image | `lasuite/drive-backend` |
|
||||
| `image.tag` | drive's container tag | `latest` |
|
||||
| `image.repository` | Repository to use to pull find's container image | `lasuite/find-backend` |
|
||||
| `image.tag` | find's container tag | `latest` |
|
||||
| `image.pullPolicy` | Container image pull policy | `IfNotPresent` |
|
||||
| `image.credentials.username` | Username for container registry authentication | |
|
||||
| `image.credentials.password` | Password for container registry authentication | |
|
||||
@@ -17,7 +17,7 @@
|
||||
| `fullnameOverride` | Override the full application name | `""` |
|
||||
| `ingress.enabled` | whether to enable the Ingress or not | `false` |
|
||||
| `ingress.className` | IngressClass to use for the Ingress | `nil` |
|
||||
| `ingress.host` | Host for the Ingress | `drive.example.com` |
|
||||
| `ingress.host` | Host for the Ingress | `find.example.com` |
|
||||
| `ingress.path` | Path to use for the Ingress | `/` |
|
||||
| `ingress.hosts` | Additional host to configure for the Ingress | `[]` |
|
||||
| `ingress.tls.enabled` | Weather to enable TLS for the Ingress | `true` |
|
||||
@@ -26,7 +26,7 @@
|
||||
| `ingress.customBackends` | Add custom backends to ingress | `[]` |
|
||||
| `ingressAdmin.enabled` | whether to enable the Ingress or not | `false` |
|
||||
| `ingressAdmin.className` | IngressClass to use for the Ingress | `nil` |
|
||||
| `ingressAdmin.host` | Host for the Ingress | `drive.example.com` |
|
||||
| `ingressAdmin.host` | Host for the Ingress | `find.example.com` |
|
||||
| `ingressAdmin.path` | Path to use for the Ingress | `/admin` |
|
||||
| `ingressAdmin.hosts` | Additional host to configure for the Ingress | `[]` |
|
||||
| `ingressAdmin.tls.enabled` | Weather to enable TLS for the Ingress | `true` |
|
||||
@@ -83,8 +83,8 @@
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------------------------------------------ | ----------------------------------------------------------------------------------- | ------------------------- |
|
||||
| `frontend.image.repository` | Repository to use to pull drive's frontend container image | `lasuite/drive-frontend` |
|
||||
| `frontend.image.tag` | drive's frontend container tag | `latest` |
|
||||
| `frontend.image.repository` | Repository to use to pull find's frontend container image | `lasuite/find-frontend` |
|
||||
| `frontend.image.tag` | find's frontend container tag | `latest` |
|
||||
| `frontend.image.pullPolicy` | frontend container image pull policy | `IfNotPresent` |
|
||||
| `frontend.command` | Override the frontend container command | `[]` |
|
||||
| `frontend.args` | Override the frontend container args | `[]` |
|
||||
@@ -1,7 +1,7 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "drive.name" -}}
|
||||
{{- define "find.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
@@ -10,7 +10,7 @@ Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "drive.fullname" -}}
|
||||
{{- define "find.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
@@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "drive.chart" -}}
|
||||
{{- define "find.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
drive.labels
|
||||
find.labels
|
||||
*/}}
|
||||
{{- define "drive.labels" -}}
|
||||
helm.sh/chart: {{ include "drive.chart" . }}
|
||||
{{ include "drive.selectorLabels" . }}
|
||||
{{- define "find.labels" -}}
|
||||
helm.sh/chart: {{ include "find.chart" . }}
|
||||
{{ include "find.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
@@ -45,14 +45,14 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "drive.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "drive.name" . }}
|
||||
{{- define "find.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "find.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
transform dictionnary of environment variables
|
||||
Usage : {{ include "drive.env.transformDict" .Values.envVars }}
|
||||
Usage : {{ include "find.env.transformDict" .Values.envVars }}
|
||||
|
||||
Example:
|
||||
envVars:
|
||||
@@ -69,7 +69,7 @@ envVars:
|
||||
name: secret-name
|
||||
key: "key_in_secret"
|
||||
*/}}
|
||||
{{- define "drive.env.transformDict" -}}
|
||||
{{- define "find.env.transformDict" -}}
|
||||
{{- range $key, $value := . }}
|
||||
- name: {{ $key | quote }}
|
||||
{{- if $value | kindIs "map" }}
|
||||
@@ -82,12 +82,12 @@ envVars:
|
||||
|
||||
|
||||
{{/*
|
||||
drive env vars
|
||||
find env vars
|
||||
*/}}
|
||||
{{- define "drive.common.env" -}}
|
||||
{{- define "find.common.env" -}}
|
||||
{{- $topLevelScope := index . 0 -}}
|
||||
{{- $workerScope := index . 1 -}}
|
||||
{{- include "drive.env.transformDict" $workerScope.envVars -}}
|
||||
{{- include "find.env.transformDict" $workerScope.envVars -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
@@ -95,10 +95,10 @@ Common labels
|
||||
|
||||
Requires array with top level scope and component name
|
||||
*/}}
|
||||
{{- define "drive.common.labels" -}}
|
||||
{{- define "find.common.labels" -}}
|
||||
{{- $topLevelScope := index . 0 -}}
|
||||
{{- $component := index . 1 -}}
|
||||
{{- include "drive.labels" $topLevelScope }}
|
||||
{{- include "find.labels" $topLevelScope }}
|
||||
app.kubernetes.io/component: {{ $component }}
|
||||
{{- end }}
|
||||
|
||||
@@ -107,14 +107,14 @@ Common selector labels
|
||||
|
||||
Requires array with top level scope and component name
|
||||
*/}}
|
||||
{{- define "drive.common.selectorLabels" -}}
|
||||
{{- define "find.common.selectorLabels" -}}
|
||||
{{- $topLevelScope := index . 0 -}}
|
||||
{{- $component := index . 1 -}}
|
||||
{{- include "drive.selectorLabels" $topLevelScope }}
|
||||
{{- include "find.selectorLabels" $topLevelScope }}
|
||||
app.kubernetes.io/component: {{ $component }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "drive.probes.abstract" -}}
|
||||
{{- define "find.probes.abstract" -}}
|
||||
{{- if .exec -}}
|
||||
exec:
|
||||
{{- toYaml .exec | nindent 2 }}
|
||||
@@ -135,8 +135,8 @@ Full name for the backend
|
||||
|
||||
Requires top level scope
|
||||
*/}}
|
||||
{{- define "drive.backend.fullname" -}}
|
||||
{{ include "drive.fullname" . }}-backend
|
||||
{{- define "find.backend.fullname" -}}
|
||||
{{ include "find.fullname" . }}-backend
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
@@ -144,8 +144,8 @@ Full name for the frontend
|
||||
|
||||
Requires top level scope
|
||||
*/}}
|
||||
{{- define "drive.frontend.fullname" -}}
|
||||
{{ include "drive.fullname" . }}-frontend
|
||||
{{- define "find.frontend.fullname" -}}
|
||||
{{ include "find.fullname" . }}-frontend
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
@@ -153,32 +153,32 @@ Full name for the webrtc
|
||||
|
||||
Requires top level scope
|
||||
*/}}
|
||||
{{- define "drive.webrtc.fullname" -}}
|
||||
{{ include "drive.fullname" . }}-webrtc
|
||||
{{- define "find.webrtc.fullname" -}}
|
||||
{{ include "find.fullname" . }}-webrtc
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Usage : {{ include "drive.secret.dockerconfigjson.name" (dict "fullname" (include "drive.fullname" .) "imageCredentials" .Values.path.to.the.image1) }}
|
||||
Usage : {{ include "find.secret.dockerconfigjson.name" (dict "fullname" (include "find.fullname" .) "imageCredentials" .Values.path.to.the.image1) }}
|
||||
*/}}
|
||||
{{- define "drive.secret.dockerconfigjson.name" }}
|
||||
{{- define "find.secret.dockerconfigjson.name" }}
|
||||
{{- if (default (dict) .imageCredentials).name }}{{ .imageCredentials.name }}{{ else }}{{ .fullname | trunc 63 | trimSuffix "-" }}-dockerconfig{{ end -}}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Usage : {{ include "drive.secret.dockerconfigjson" (dict "fullname" (include "drive.fullname" .) "imageCredentials" .Values.path.to.the.image1) }}
|
||||
Usage : {{ include "find.secret.dockerconfigjson" (dict "fullname" (include "find.fullname" .) "imageCredentials" .Values.path.to.the.image1) }}
|
||||
*/}}
|
||||
{{- define "drive.secret.dockerconfigjson" }}
|
||||
{{- define "find.secret.dockerconfigjson" }}
|
||||
{{- if .imageCredentials -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "drive.secret.dockerconfigjson.name" (dict "fullname" .fullname "imageCredentials" .imageCredentials) }}
|
||||
name: {{ template "find.secret.dockerconfigjson.name" (dict "fullname" .fullname "imageCredentials" .imageCredentials) }}
|
||||
annotations:
|
||||
"helm.sh/hook": pre-install,pre-upgrade
|
||||
"helm.sh/hook-weight": "-5"
|
||||
"helm.sh/hook-delete-policy": before-hook-creation
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
data:
|
||||
.dockerconfigjson: {{ template "drive.secret.dockerconfigjson.data" .imageCredentials }}
|
||||
.dockerconfigjson: {{ template "find.secret.dockerconfigjson.data" .imageCredentials }}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
{{- $envVars := include "drive.common.env" (list . .Values.backend) -}}
|
||||
{{- $fullName := include "drive.backend.fullname" . -}}
|
||||
{{- $envVars := include "find.common.env" (list . .Values.backend) -}}
|
||||
{{- $fullName := include "find.backend.fullname" . -}}
|
||||
{{- $component := "backend" -}}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@@ -7,12 +7,12 @@ metadata:
|
||||
name: {{ $fullName }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
{{- include "drive.common.labels" (list . $component) | nindent 4 }}
|
||||
{{- include "find.common.labels" (list . $component) | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.backend.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "drive.common.selectorLabels" (list . $component) | nindent 6 }}
|
||||
{{- include "find.common.selectorLabels" (list . $component) | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
@@ -20,11 +20,11 @@ spec:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "drive.common.selectorLabels" (list . $component) | nindent 8 }}
|
||||
{{- include "find.common.selectorLabels" (list . $component) | nindent 8 }}
|
||||
spec:
|
||||
{{- if $.Values.image.credentials }}
|
||||
imagePullSecrets:
|
||||
- name: {{ include "drive.secret.dockerconfigjson.name" (dict "fullname" (include "drive.fullname" .) "imageCredentials" $.Values.image.credentials) }}
|
||||
- name: {{ include "find.secret.dockerconfigjson.name" (dict "fullname" (include "find.fullname" .) "imageCredentials" $.Values.image.credentials) }}
|
||||
{{- end}}
|
||||
shareProcessNamespace: {{ .Values.backend.shareProcessNamespace }}
|
||||
containers:
|
||||
@@ -56,15 +56,15 @@ spec:
|
||||
protocol: TCP
|
||||
{{- if .Values.backend.probes.liveness }}
|
||||
livenessProbe:
|
||||
{{- include "drive.probes.abstract" (merge .Values.backend.probes.liveness (dict "targetPort" .Values.backend.service.targetPort )) | nindent 12 }}
|
||||
{{- include "find.probes.abstract" (merge .Values.backend.probes.liveness (dict "targetPort" .Values.backend.service.targetPort )) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.backend.probes.readiness }}
|
||||
readinessProbe:
|
||||
{{- include "drive.probes.abstract" (merge .Values.backend.probes.readiness (dict "targetPort" .Values.backend.service.targetPort )) | nindent 12 }}
|
||||
{{- include "find.probes.abstract" (merge .Values.backend.probes.readiness (dict "targetPort" .Values.backend.service.targetPort )) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.backend.probes.startup }}
|
||||
startupProbe:
|
||||
{{- include "drive.probes.abstract" (merge .Values.backend.probes.startup (dict "targetPort" .Values.backend.service.targetPort )) | nindent 12 }}
|
||||
{{- include "find.probes.abstract" (merge .Values.backend.probes.startup (dict "targetPort" .Values.backend.service.targetPort )) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.backend.resources }}
|
||||
resources:
|
||||
@@ -102,7 +102,7 @@ spec:
|
||||
{{- range $index, $value := .Values.mountFiles }}
|
||||
- name: "files-{{ $index }}"
|
||||
configMap:
|
||||
name: "{{ include "drive.fullname" $ }}-files-{{ $index }}"
|
||||
name: "{{ include "find.fullname" $ }}-files-{{ $index }}"
|
||||
{{- end }}
|
||||
{{- range $name, $volume := .Values.backend.persistence }}
|
||||
- name: "{{ $name }}"
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
{{- $envVars := include "drive.common.env" (list . .Values.backend) -}}
|
||||
{{- $fullName := include "drive.backend.fullname" . -}}
|
||||
{{- $envVars := include "find.common.env" (list . .Values.backend) -}}
|
||||
{{- $fullName := include "find.backend.fullname" . -}}
|
||||
{{- $component := "backend" -}}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
@@ -11,7 +11,7 @@ metadata:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "drive.common.labels" (list . $component) | nindent 4 }}
|
||||
{{- include "find.common.labels" (list . $component) | nindent 4 }}
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
@@ -20,11 +20,11 @@ spec:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "drive.common.selectorLabels" (list . $component) | nindent 8 }}
|
||||
{{- include "find.common.selectorLabels" (list . $component) | nindent 8 }}
|
||||
spec:
|
||||
{{- if $.Values.image.credentials }}
|
||||
imagePullSecrets:
|
||||
- name: {{ include "drive.secret.dockerconfigjson.name" (dict "fullname" (include "drive.fullname" .) "imageCredentials" $.Values.image.credentials) }}
|
||||
- name: {{ include "find.secret.dockerconfigjson.name" (dict "fullname" (include "find.fullname" .) "imageCredentials" $.Values.image.credentials) }}
|
||||
{{- end}}
|
||||
shareProcessNamespace: {{ .Values.backend.shareProcessNamespace }}
|
||||
containers:
|
||||
@@ -87,7 +87,7 @@ spec:
|
||||
{{- range $index, $value := .Values.mountFiles }}
|
||||
- name: "files-{{ $index }}"
|
||||
configMap:
|
||||
name: "{{ include "drive.fullname" $ }}-files-{{ $index }}"
|
||||
name: "{{ include "find.fullname" $ }}-files-{{ $index }}"
|
||||
{{- end }}
|
||||
{{- range $name, $volume := .Values.backend.persistence }}
|
||||
- name: "{{ $name }}"
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
{{- $envVars := include "drive.common.env" (list . .Values.backend) -}}
|
||||
{{- $fullName := include "drive.backend.fullname" . -}}
|
||||
{{- $envVars := include "find.common.env" (list . .Values.backend) -}}
|
||||
{{- $fullName := include "find.backend.fullname" . -}}
|
||||
{{- $component := "backend" -}}
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
@@ -11,7 +11,7 @@ metadata:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "drive.common.labels" (list . $component) | nindent 4 }}
|
||||
{{- include "find.common.labels" (list . $component) | nindent 4 }}
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
@@ -20,11 +20,11 @@ spec:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "drive.common.selectorLabels" (list . $component) | nindent 8 }}
|
||||
{{- include "find.common.selectorLabels" (list . $component) | nindent 8 }}
|
||||
spec:
|
||||
{{- if $.Values.image.credentials }}
|
||||
imagePullSecrets:
|
||||
- name: {{ include "drive.secret.dockerconfigjson.name" (dict "fullname" (include "drive.fullname" .) "imageCredentials" $.Values.image.credentials) }}
|
||||
- name: {{ include "find.secret.dockerconfigjson.name" (dict "fullname" (include "find.fullname" .) "imageCredentials" $.Values.image.credentials) }}
|
||||
{{- end}}
|
||||
shareProcessNamespace: {{ .Values.backend.shareProcessNamespace }}
|
||||
containers:
|
||||
@@ -87,7 +87,7 @@ spec:
|
||||
{{- range $index, $value := .Values.mountFiles }}
|
||||
- name: "files-{{ $index }}"
|
||||
configMap:
|
||||
name: "{{ include "drive.fullname" $ }}-files-{{ $index }}"
|
||||
name: "{{ include "find.fullname" $ }}-files-{{ $index }}"
|
||||
{{- end }}
|
||||
{{- range $name, $volume := .Values.backend.persistence }}
|
||||
- name: "{{ $name }}"
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
{{- $envVars := include "drive.common.env" (list . .Values.backend) -}}
|
||||
{{- $fullName := include "drive.backend.fullname" . -}}
|
||||
{{- $envVars := include "find.common.env" (list . .Values.backend) -}}
|
||||
{{- $fullName := include "find.backend.fullname" . -}}
|
||||
{{- $component := "backend" -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
@@ -7,7 +7,7 @@ metadata:
|
||||
name: {{ $fullName }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
{{- include "drive.common.labels" (list . $component) | nindent 4 }}
|
||||
{{- include "find.common.labels" (list . $component) | nindent 4 }}
|
||||
annotations:
|
||||
{{- toYaml $.Values.backend.service.annotations | nindent 4 }}
|
||||
spec:
|
||||
@@ -18,4 +18,4 @@ spec:
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "drive.common.selectorLabels" (list . $component) | nindent 4 }}
|
||||
{{- include "find.common.selectorLabels" (list . $component) | nindent 4 }}
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
{{- $envVars := include "drive.common.env" (list . .Values.frontend) -}}
|
||||
{{- $fullName := include "drive.frontend.fullname" . -}}
|
||||
{{- $envVars := include "find.common.env" (list . .Values.frontend) -}}
|
||||
{{- $fullName := include "find.frontend.fullname" . -}}
|
||||
{{- $component := "frontend" -}}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@@ -7,12 +7,12 @@ metadata:
|
||||
name: {{ $fullName }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
{{- include "drive.common.labels" (list . $component) | nindent 4 }}
|
||||
{{- include "find.common.labels" (list . $component) | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.frontend.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "drive.common.selectorLabels" (list . $component) | nindent 6 }}
|
||||
{{- include "find.common.selectorLabels" (list . $component) | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
@@ -20,11 +20,11 @@ spec:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "drive.common.selectorLabels" (list . $component) | nindent 8 }}
|
||||
{{- include "find.common.selectorLabels" (list . $component) | nindent 8 }}
|
||||
spec:
|
||||
{{- if $.Values.image.credentials }}
|
||||
imagePullSecrets:
|
||||
- name: {{ include "drive.secret.dockerconfigjson.name" (dict "fullname" (include "drive.fullname" .) "imageCredentials" $.Values.image.credentials) }}
|
||||
- name: {{ include "find.secret.dockerconfigjson.name" (dict "fullname" (include "find.fullname" .) "imageCredentials" $.Values.image.credentials) }}
|
||||
{{- end}}
|
||||
shareProcessNamespace: {{ .Values.frontend.shareProcessNamespace }}
|
||||
containers:
|
||||
@@ -56,15 +56,15 @@ spec:
|
||||
protocol: TCP
|
||||
{{- if .Values.frontend.probes.liveness }}
|
||||
livenessProbe:
|
||||
{{- include "drive.probes.abstract" (merge .Values.frontend.probes.liveness (dict "targetPort" .Values.frontend.service.targetPort )) | nindent 12 }}
|
||||
{{- include "find.probes.abstract" (merge .Values.frontend.probes.liveness (dict "targetPort" .Values.frontend.service.targetPort )) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.frontend.probes.readiness }}
|
||||
readinessProbe:
|
||||
{{- include "drive.probes.abstract" (merge .Values.frontend.probes.readiness (dict "targetPort" .Values.frontend.service.targetPort )) | nindent 12 }}
|
||||
{{- include "find.probes.abstract" (merge .Values.frontend.probes.readiness (dict "targetPort" .Values.frontend.service.targetPort )) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.frontend.probes.startup }}
|
||||
startupProbe:
|
||||
{{- include "drive.probes.abstract" (merge .Values.frontend.probes.startup (dict "targetPort" .Values.frontend.service.targetPort )) | nindent 12 }}
|
||||
{{- include "find.probes.abstract" (merge .Values.frontend.probes.startup (dict "targetPort" .Values.frontend.service.targetPort )) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.frontend.resources }}
|
||||
resources:
|
||||
@@ -102,7 +102,7 @@ spec:
|
||||
{{- range $index, $value := .Values.mountFiles }}
|
||||
- name: "files-{{ $index }}"
|
||||
configMap:
|
||||
name: "{{ include "drive.fullname" $ }}-files-{{ $index }}"
|
||||
name: "{{ include "find.fullname" $ }}-files-{{ $index }}"
|
||||
{{- end }}
|
||||
{{- range $name, $volume := .Values.frontend.persistence }}
|
||||
- name: "{{ $name }}"
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
{{- $envVars := include "drive.common.env" (list . .Values.frontend) -}}
|
||||
{{- $fullName := include "drive.frontend.fullname" . -}}
|
||||
{{- $envVars := include "find.common.env" (list . .Values.frontend) -}}
|
||||
{{- $fullName := include "find.frontend.fullname" . -}}
|
||||
{{- $component := "frontend" -}}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
@@ -7,7 +7,7 @@ metadata:
|
||||
name: {{ $fullName }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
{{- include "drive.common.labels" (list . $component) | nindent 4 }}
|
||||
{{- include "find.common.labels" (list . $component) | nindent 4 }}
|
||||
annotations:
|
||||
{{- toYaml $.Values.frontend.service.annotations | nindent 4 }}
|
||||
spec:
|
||||
@@ -18,4 +18,4 @@ spec:
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "drive.common.selectorLabels" (list . $component) | nindent 4 }}
|
||||
{{- include "find.common.selectorLabels" (list . $component) | nindent 4 }}
|
||||
@@ -1,5 +1,5 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "drive.fullname" . -}}
|
||||
{{- $fullName := include "find.fullname" . -}}
|
||||
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
||||
@@ -17,7 +17,7 @@ metadata:
|
||||
name: {{ $fullName }}
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
{{- include "drive.labels" . | nindent 4 }}
|
||||
{{- include "find.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
@@ -53,11 +53,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "drive.frontend.fullname" . }}
|
||||
name: {{ include "find.frontend.fullname" . }}
|
||||
port:
|
||||
number: {{ .Values.frontend.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "drive.frontend.fullname" . }}
|
||||
serviceName: {{ include "find.frontend.fullname" . }}
|
||||
servicePort: {{ .Values.frontend.service.port }}
|
||||
{{- end }}
|
||||
- path: /api
|
||||
@@ -67,11 +67,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "drive.backend.fullname" . }}
|
||||
name: {{ include "find.backend.fullname" . }}
|
||||
port:
|
||||
number: {{ .Values.backend.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "drive.backend.fullname" . }}
|
||||
serviceName: {{ include "find.backend.fullname" . }}
|
||||
servicePort: {{ .Values.backend.service.port }}
|
||||
{{- end }}
|
||||
{{- with .Values.ingress.customBackends }}
|
||||
@@ -89,11 +89,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "drive.frontend.fullname" $ }}
|
||||
name: {{ include "find.frontend.fullname" $ }}
|
||||
port:
|
||||
number: {{ $.Values.frontend.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "drive.frontend.fullname" $ }}
|
||||
serviceName: {{ include "find.frontend.fullname" $ }}
|
||||
servicePort: {{ $.Values.frontend.service.port }}
|
||||
{{- end }}
|
||||
- path: /api
|
||||
@@ -103,11 +103,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "drive.backend.fullname" $ }}
|
||||
name: {{ include "find.backend.fullname" $ }}
|
||||
port:
|
||||
number: {{ $.Values.backend.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "drive.backend.fullname" $ }}
|
||||
serviceName: {{ include "find.backend.fullname" $ }}
|
||||
servicePort: {{ $.Values.backend.service.port }}
|
||||
{{- end }}
|
||||
{{- with $.Values.ingress.customBackends }}
|
||||
+8
-8
@@ -1,5 +1,5 @@
|
||||
{{- if .Values.ingressAdmin.enabled -}}
|
||||
{{- $fullName := include "drive.fullname" . -}}
|
||||
{{- $fullName := include "find.fullname" . -}}
|
||||
{{- if and .Values.ingressAdmin.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingressAdmin.annotations "kubernetes.io/ingress.class") }}
|
||||
{{- $_ := set .Values.ingressAdmin.annotations "kubernetes.io/ingress.class" .Values.ingressAdmin.className}}
|
||||
@@ -17,7 +17,7 @@ metadata:
|
||||
name: {{ $fullName }}-admin
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
{{- include "drive.labels" . | nindent 4 }}
|
||||
{{- include "find.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingressAdmin.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
@@ -53,11 +53,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "drive.backend.fullname" . }}
|
||||
name: {{ include "find.backend.fullname" . }}
|
||||
port:
|
||||
number: {{ .Values.backend.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "drive.backend.fullname" . }}
|
||||
serviceName: {{ include "find.backend.fullname" . }}
|
||||
servicePort: {{ .Values.backend.service.port }}
|
||||
{{- end }}
|
||||
- path: /static
|
||||
@@ -67,11 +67,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "drive.backend.fullname" . }}
|
||||
name: {{ include "find.backend.fullname" . }}
|
||||
port:
|
||||
number: {{ .Values.backend.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "drive.backend.fullname" . }}
|
||||
serviceName: {{ include "find.backend.fullname" . }}
|
||||
servicePort: {{ .Values.backend.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -86,11 +86,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "drive.backend.fullname" $ }}
|
||||
name: {{ include "find.backend.fullname" $ }}
|
||||
port:
|
||||
number: {{ $.Values.backend.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "drive.backend.fullname" $ }}
|
||||
serviceName: {{ include "find.backend.fullname" $ }}
|
||||
servicePort: {{ $.Values.backend.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
{{- if .Values.ingressMedia.enabled -}}
|
||||
{{- $fullName := include "drive.fullname" . -}}
|
||||
{{- $fullName := include "find.fullname" . -}}
|
||||
{{- if and .Values.ingressMedia.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||
{{- if not (hasKey .Values.ingressMedia.annotations "kubernetes.io/ingress.class") }}
|
||||
{{- $_ := set .Values.ingressMedia.annotations "kubernetes.io/ingress.class" .Values.ingressMedia.className}}
|
||||
@@ -17,7 +17,7 @@ metadata:
|
||||
name: {{ $fullName }}-media
|
||||
namespace: {{ .Release.Namespace | quote }}
|
||||
labels:
|
||||
{{- include "drive.labels" . | nindent 4 }}
|
||||
{{- include "find.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingressMedia.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
@@ -53,11 +53,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "drive.backend.fullname" . }}
|
||||
name: {{ include "find.backend.fullname" . }}
|
||||
port:
|
||||
number: {{ .Values.backend.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "drive.backend.fullname" . }}
|
||||
serviceName: {{ include "find.backend.fullname" . }}
|
||||
servicePort: {{ .Values.backend.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -72,11 +72,11 @@ spec:
|
||||
backend:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||
service:
|
||||
name: {{ include "drive.backend.fullname" $ }}
|
||||
name: {{ include "find.backend.fullname" $ }}
|
||||
port:
|
||||
number: {{ $.Values.backend.service.port }}
|
||||
{{- else }}
|
||||
serviceName: {{ include "drive.backend.fullname" $ }}
|
||||
serviceName: {{ include "find.backend.fullname" $ }}
|
||||
servicePort: {{ $.Values.backend.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -1,18 +1,18 @@
|
||||
# Default values for drive.
|
||||
# Default values for find.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
## @section General configuration
|
||||
|
||||
## @param image.repository Repository to use to pull drive's container image
|
||||
## @param image.tag drive's container tag
|
||||
## @param image.repository Repository to use to pull find's container image
|
||||
## @param image.tag find's container tag
|
||||
## @param image.pullPolicy Container image pull policy
|
||||
## @extra image.credentials.username Username for container registry authentication
|
||||
## @extra image.credentials.password Password for container registry authentication
|
||||
## @extra image.credentials.registry Registry url for which the credentials are specified
|
||||
## @extra image.credentials.name Name of the generated secret for imagePullSecrets
|
||||
image:
|
||||
repository: lasuite/drive-backend
|
||||
repository: lasuite/find-backend
|
||||
pullPolicy: IfNotPresent
|
||||
tag: "latest"
|
||||
|
||||
@@ -32,7 +32,7 @@ commonEnvVars: &commonEnvVars
|
||||
ingress:
|
||||
enabled: false
|
||||
className: null
|
||||
host: drive.example.com
|
||||
host: find.example.com
|
||||
path: /
|
||||
## @param ingress.hosts Additional host to configure for the Ingress
|
||||
hosts: []
|
||||
@@ -56,7 +56,7 @@ ingress:
|
||||
ingressAdmin:
|
||||
enabled: false
|
||||
className: null
|
||||
host: drive.example.com
|
||||
host: find.example.com
|
||||
path: /admin
|
||||
## @param ingressAdmin.hosts Additional host to configure for the Ingress
|
||||
hosts: [ ]
|
||||
@@ -176,11 +176,11 @@ backend:
|
||||
## @section frontend
|
||||
|
||||
frontend:
|
||||
## @param frontend.image.repository Repository to use to pull drive's frontend container image
|
||||
## @param frontend.image.tag drive's frontend container tag
|
||||
## @param frontend.image.repository Repository to use to pull find's frontend container image
|
||||
## @param frontend.image.tag find's frontend container tag
|
||||
## @param frontend.image.pullPolicy frontend container image pull policy
|
||||
image:
|
||||
repository: lasuite/drive-frontend
|
||||
repository: lasuite/find-frontend
|
||||
pullPolicy: IfNotPresent
|
||||
tag: "latest"
|
||||
|
||||
@@ -13,7 +13,7 @@ releases:
|
||||
- auth:
|
||||
username: dinum
|
||||
password: pass
|
||||
database: drive
|
||||
database: find
|
||||
- tls:
|
||||
enabled: true
|
||||
autoGenerated: true
|
||||
@@ -35,12 +35,12 @@ releases:
|
||||
secrets:
|
||||
- env.d/{{ .Environment.Name }}/secrets.enc.yaml
|
||||
|
||||
- name: drive
|
||||
- name: find
|
||||
version: {{ .Values.version }}
|
||||
namespace: {{ .Namespace }}
|
||||
chart: ./drive
|
||||
chart: ./find
|
||||
values:
|
||||
- env.d/{{ .Environment.Name }}/values.drive.yaml.gotmpl
|
||||
- env.d/{{ .Environment.Name }}/values.find.yaml.gotmpl
|
||||
secrets:
|
||||
- env.d/{{ .Environment.Name }}/secrets.enc.yaml
|
||||
|
||||
|
||||
Reference in New Issue
Block a user