-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 289-warning-wrong-file-format
- Loading branch information
Showing
133 changed files
with
5,739 additions
and
2,848 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
# Use this file to create a .env with filled variables | ||
# Django Variables | ||
DJANGO_DEBUG=True | ||
DEV_DB=False | ||
DEBUG_TOOLBAR=True | ||
DJANGO_SECRET_KEY=change_me | ||
DJANGO_ADMIN_URL=jandig-admin/ | ||
USE_MINIO=True | ||
USE_GUNICORN=True | ||
|
||
# Sentry Variables | ||
DJANGO_ADMIN_URL=jandig-admin/ | ||
ENABLE_SENTRY=False | ||
SENTRY_DSN= | ||
SENTRY_ENVIRONMENT="local" | ||
HEALTH_CHECK_URL=api/v1/status/ | ||
SENTRY_TRACES_SAMPLE_RATE=0.1 | ||
|
||
|
@@ -19,7 +20,6 @@ AWS_SECRET_ACCESS_KEY=minio123 | |
MINIO_ROOT_USER=minio | ||
MINIO_ROOT_PASSWORD=minio123 | ||
AWS_STORAGE_BUCKET_NAME=jandig-cdn | ||
AWS_PRIVATE_STORAGE_BUCKET_NAME=jandig-private-cdn | ||
AWS_S3_REGION_NAME=us-east-2 | ||
AWS_STATIC_LOCATION=static | ||
MINIO_S3_ENDPOINT_URL=http://storage:9000 | ||
|
@@ -30,12 +30,21 @@ MINIO_USER_SECRET_KEY=minio-secret-key | |
## Postgres variables | ||
POSTGRES_HOST=postgres | ||
POSTGRES_PORT=5432 | ||
POSTGRES_DB=goldpenny | ||
POSTGRES_USER=goldpenny | ||
POSTGRES_PASSWORD=goldpenny123 | ||
POSTGRES_DB=jandig | ||
POSTGRES_USER=jandig | ||
POSTGRES_PASSWORD=secret | ||
|
||
# Email server variables | ||
SMTP_SERVER=smtp.gmail.com | ||
SMTP_PORT=587 | ||
[email protected] | ||
JANDIG_EMAIL_PASSWORD=local_password | ||
SMTP_SERVER=mailpit | ||
SMTP_PORT=1025 | ||
SMTP_USE_TLS=False | ||
SMTP_USE_SSL=False | ||
SMTP_USER= | ||
SMTP_PASSWORD= | ||
SMTP_SENDER_MAIL="[email protected]" | ||
|
||
# Recaptcha | ||
RECAPTCHA_ENABLED=False | ||
RECAPTCHA_PROJECT_ID= | ||
RECAPTCHA_GCLOUD_API_KEY= | ||
RECAPTCHA_SITE_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,52 @@ | ||
FROM python:3.10-slim-bullseye | ||
|
||
FROM python:3.13.1-slim-bookworm | ||
COPY --from=ghcr.io/astral-sh/uv:0.5.24 /uv /uvx /bin/ | ||
|
||
ENV PATH="$PATH:/home/jandig/.local/bin:/jandig/.venv/bin" \ | ||
TINI_VERSION=v0.19.0 \ | ||
UV_CACHE_DIR=/home/jandig/jandig/cache/uv | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
gettext \ | ||
docutils-common \ | ||
curl \ | ||
wget | ||
gettext \ | ||
docutils-common \ | ||
curl \ | ||
wget | ||
|
||
|
||
RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ | ||
&& wget "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${dpkgArch}" -O /usr/local/bin/tini \ | ||
&& chmod +x /usr/local/bin/tini && tini --version | ||
|
||
|
||
COPY ./pyproject.toml /pyproject.toml | ||
COPY ./poetry.lock /poetry.lock | ||
RUN mkdir -p /jandig/src /jandig/locale /jandig/docs /jandig/.venv /jandig/static /jandig/build /home/jandig/jandig/cache/uv | ||
|
||
WORKDIR /jandig | ||
|
||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
COPY ./pyproject.toml /jandig/pyproject.toml | ||
COPY ./uv.lock /jandig/uv.lock | ||
|
||
ENV PATH="$PATH:/root/.local/bin" \ | ||
POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_CREATE=false \ | ||
POETRY_CACHE_DIR='/var/cache/pypoetry' \ | ||
TINI_VERSION=v0.19.0 | ||
COPY ./src/ /jandig/src/ | ||
COPY ./docs/ /jandig/docs/ | ||
COPY ./locale/ /jandig/locale/ | ||
COPY ./tasks.py /jandig/tasks.py | ||
COPY ./run.sh /jandig/run.sh | ||
COPY ./etc/ /jandig/etc/ | ||
|
||
RUN poetry install | ||
|
||
RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ | ||
&& wget "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${dpkgArch}" -O /usr/local/bin/tini \ | ||
&& chmod +x /usr/local/bin/tini && tini --version | ||
# Create group and user | ||
RUN groupadd -g 1000 jandig && useradd -u 1000 -g 1000 -r -m -d /home/jandig jandig | ||
|
||
RUN mkdir -p /src | ||
WORKDIR /src | ||
COPY ./src/ /src/ | ||
COPY ./docs/ /src/docs/ | ||
COPY ./locale/ /src/locale/ | ||
COPY ./tasks.py /src/tasks.py | ||
COPY ./run.sh /src/run.sh | ||
COPY ./etc/ /src/etc/ | ||
# Change ownership of the directories to the new user and group | ||
RUN chown -R jandig:jandig /jandig /home/jandig | ||
RUN chmod 2775 /jandig /home/jandig | ||
|
||
RUN pip install --upgrade pip | ||
# Switch to the new user | ||
USER jandig | ||
|
||
RUN find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf | ||
|
||
RUN uv sync --frozen --no-dev | ||
ENTRYPOINT ["tini", "--"] | ||
|
||
ENTRYPOINT ["tini", "--"] | ||
CMD [ "/jandig/run.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,34 @@ | ||
RUNNING_CONTAINER := $(shell docker compose ps --services --filter "status=running" | grep django ) | ||
|
||
test: | ||
poetry run pytest src | ||
@if [[ -n "${RUNNING_CONTAINER}" ]]; then \ | ||
docker compose exec django uv run pytest src/core src/users src/blog; \ | ||
else \ | ||
docker compose run --rm django uv run pytest src/core src/users src/blog;\ | ||
fi | ||
|
||
test-ui: | ||
docker compose up -d | ||
uv run pytest src/tests | ||
|
||
lint: | ||
poetry run black --line-length=200 src | ||
poetry run isort src | ||
flake8: | ||
poetry run flake8 --max-line-length=200 --exclude=*/migrations src | ||
uv run ruff format src | ||
uv run ruff check --fix src | ||
|
||
check: | ||
uv run ruff check | ||
|
||
migrations: | ||
poetry run python src/manage.py makemigrations | ||
uv run python src/manage.py makemigrations | ||
|
||
migrate: | ||
poetry run python src/manage.py migrate | ||
uv run python src/manage.py migrate | ||
|
||
gen: | ||
uv run playwright codegen -b chromium --target python-pytest localhost:8000 | ||
|
||
translate_es: | ||
docker compose exec django uv run inv i18n -l es_ES | ||
|
||
translate_pt: | ||
docker compose exec django uv run inv i18n -l pt_BR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.