kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
feat: implement typesense container
rodzic
6d7905f6a0
commit
2db8c585ad
|
@ -13,7 +13,7 @@ RUN set -eux; \
|
|||
|
||||
COPY pyproject.toml poetry.lock /
|
||||
RUN set -eux; \
|
||||
poetry export --without-hashes > requirements.txt; \
|
||||
poetry export --without-hashes --extras typesense > requirements.txt; \
|
||||
poetry export --without-hashes --with dev > dev-requirements.txt;
|
||||
|
||||
FROM alpine:3.17 as builder
|
||||
|
|
|
@ -1458,3 +1458,21 @@ instead of request header.
|
|||
|
||||
HASHING_ALGORITHM = "sha256"
|
||||
HASHING_CHUNK_SIZE = 1024 * 100
|
||||
|
||||
"""
|
||||
Typenses Settings
|
||||
"""
|
||||
TYPESENSE_API_KEY = env("TYPESENSE_API_KEY", default=None)
|
||||
""" Typesense API key. This need to be defined in the .env file for Typenses to be activated."""
|
||||
TYPESENSE_PORT = env("TYPESENSE_PORT", default="8108")
|
||||
"""Typesense listening port"""
|
||||
TYPESENSE_PROTOCOL = env("TYPESENSE_PROTOCOL", default="http")
|
||||
"""Typesense listening protocol"""
|
||||
TYPESENSE_HOST = env(
|
||||
"TYPESENSE_HOST",
|
||||
default="typesense" if IS_DOCKER_SETUP else "localhost",
|
||||
)
|
||||
"""
|
||||
Typesense hostname. Defaults to `localhost` on non-Docker deployments and to `typesense` on
|
||||
Docker deployments.
|
||||
"""
|
||||
|
|
|
@ -3563,6 +3563,20 @@ all = ["twisted (>=20.3.0)", "zope.interface (>=5.2.0)"]
|
|||
dev = ["pep8 (>=1.6.2)", "pyenchant (>=1.6.6)", "pytest (>=2.6.4)", "pytest-cov (>=1.8.1)", "sphinx (>=1.2.3)", "sphinx-rtd-theme (>=0.1.9)", "sphinxcontrib-spelling (>=2.1.2)", "tox (>=2.1.1)", "tox-gh-actions (>=2.2.0)", "twine (>=1.6.5)", "wheel"]
|
||||
twisted = ["twisted (>=20.3.0)", "zope.interface (>=5.2.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "typesense"
|
||||
version = "0.15.1"
|
||||
description = "Python client for Typesense, an open source and typo tolerant search engine."
|
||||
category = "main"
|
||||
optional = true
|
||||
python-versions = ">=3"
|
||||
files = [
|
||||
{file = "typesense-0.15.1-py2.py3-none-any.whl", hash = "sha256:4e87e66049e863187b5115d4743371edd5db75c80795f35a8ffe632bb407f075"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
requests = "*"
|
||||
|
||||
[[package]]
|
||||
name = "typing-extensions"
|
||||
version = "4.5.0"
|
||||
|
@ -4132,7 +4146,10 @@ docs = ["Sphinx", "repoze.sphinx.autointerface"]
|
|||
test = ["coverage (>=5.0.3)", "zope.event", "zope.testing"]
|
||||
testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"]
|
||||
|
||||
[extras]
|
||||
typesense = ["typesense"]
|
||||
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.8"
|
||||
content-hash = "3725c7f5bebac81c9e7024b4d6c1918cd91fd600634c01b5bd5bc14aa52638ac"
|
||||
content-hash = "21ed086d4caa2b2a8679e8fdfc11b630f9494871aa4c48b66bae2f44cd946180"
|
||||
|
|
|
@ -85,6 +85,9 @@ requests-http-message-signatures = "==0.3.1"
|
|||
sentry-sdk = "==1.19.1"
|
||||
watchdog = "==2.2.1"
|
||||
|
||||
# Typesense
|
||||
typesense = { version = "==0.15.1", optional = true }
|
||||
|
||||
# Dependencies pinning
|
||||
ipython = "==7.34.0"
|
||||
pluralizer = "==1.2.0"
|
||||
|
@ -118,6 +121,9 @@ requests-mock = "==1.10.0"
|
|||
pylint = "==2.17.2"
|
||||
pylint-django = "==2.5.3"
|
||||
|
||||
[tool.poetry.extras]
|
||||
typesense = ["typesense"]
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Adding typesense container and api client (2104)
|
|
@ -92,3 +92,16 @@ services:
|
|||
ports:
|
||||
# override those variables in your .env file if needed
|
||||
- "${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT}:80"
|
||||
|
||||
typesense:
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
image: typesense/typesense:0.24.0
|
||||
networks:
|
||||
- internal
|
||||
volumes:
|
||||
- ./typesense/data:/data
|
||||
command: --data-dir /data --enable-cors
|
||||
profiles:
|
||||
- typesense
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
# Additional options you may want to check:
|
||||
# - MUSIC_DIRECTORY_PATH and MUSIC_DIRECTORY_SERVE_PATH if you plan to use
|
||||
# in-place import
|
||||
# - TYPESENSE_API_KEY if you want to enable typesense to experiment with
|
||||
# the recommendation system set this. You can
|
||||
# generate one using `openssl rand -base64 45`, for example
|
||||
#
|
||||
# Docker only
|
||||
# -----------
|
||||
|
|
13
dev.yml
13
dev.yml
|
@ -175,6 +175,19 @@ services:
|
|||
- "./docs/swagger.yml:/usr/share/nginx/html/swagger.yml"
|
||||
- "./docs/api:/usr/share/nginx/html/api"
|
||||
|
||||
typesense:
|
||||
env_file:
|
||||
- .env.dev
|
||||
- .env
|
||||
image: typesense/typesense:0.24.0
|
||||
networks:
|
||||
- internal
|
||||
volumes:
|
||||
- ./typesense/data:/data
|
||||
command: --data-dir /data --enable-cors
|
||||
profiles:
|
||||
- typesense
|
||||
|
||||
# minio:
|
||||
# image: minio/minio
|
||||
# command: server /data
|
||||
|
|
Ładowanie…
Reference in New Issue