Skip to content

Commit

Permalink
Merge branch 'develop' into 289-warning-wrong-file-format
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodiegoss committed Feb 16, 2025
2 parents e294bff + 4b96755 commit d9ef617
Show file tree
Hide file tree
Showing 133 changed files with 5,739 additions and 2,848 deletions.
29 changes: 19 additions & 10 deletions .envs/.example
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

Expand All @@ -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
Expand All @@ -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=
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Repository Policy
All contributions to ARte must be tracked by an issue and at least one pull request. To start working on an issue you must fork ARte repository, create or pick an issue. Also check that there is no issue that already adheres to what you intend to post. To create your branch, follow the pattern: `feature/issueID-issue-title`. When you have did your first commit on your fork you have to create a pull request to ARte devel branch so we can see your work in progress. The pull request name must follow this pattern: `{STATE} {ISSUE NUMBER} - {ISSUE NAME}`. Where {STATE} is the state of the pull request, all pull requests must be created with [WIP] tag and when you think you resolved the issue change to [REVIEW]. Example of pull request name: [WIP] 435 - Refactor create method.
All contributions to ARte must be tracked by an issue and at least one pull request. To start working on an issue you must fork ARte repository and create or pick an issue. You should also check that there are no issues that already adheres to what you intend to post. To create your branch, follow the pattern: `feature/issueID-issue-title`. When you have done your first commit on your fork you have to create a pull request to ARte devel branch so we can see your work in progress. The pull request name must follow this pattern: `{STATE} {ISSUE NUMBER} - {ISSUE NAME}`, where {STATE} is the state of the pull request. All pull requests must be created with [WIP] tag, and when you think you resolved the issue, change to [REVIEW]. Example of pull request name: [WIP] 435 - Refactor create method.

## Coding Style
Make sure you are following our code style when submiting a pull request, following the style you make the process of reviewing your pull request better.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
steps:
- name: Check out code from Github
uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.13"
- name: Installing flake8
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
run: |
cp .envs/.example .envs/.env
docker load -i docker_image_$GITHUB_SHA
docker-compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
docker compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
- name: Test migrations
run: |
docker exec jandigarte_${{ github.sha }}_django_1 sh -c "\
Expand All @@ -81,7 +81,7 @@ jobs:
run: |
cp .envs/.example .envs/.env
docker load -i docker_image_$GITHUB_SHA
docker-compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
docker compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
- name: Running users tests
run: |
docker exec jandigarte_${{ github.sha }}_django_1 sh -c "\
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker pipeline
on:
push:
branches:
- develop
- master

# TODO: Change environment and login envs
jobs:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ src/ARte/config/__pycache__/
*.sqlite3

build/
static/
media/
src/data/certbot/
docker/node_modules/
node_modules/
Expand Down
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ stages:
- docker:dind
script:
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASS
- docker build . -f docker/Dockerfile -t jandigarte/django:$DOCKER_TAG --cache-from jandigarte/django:$DOCKER_TAG
- docker build . -t jandigarte/django:$DOCKER_TAG --cache-from jandigarte/django:$DOCKER_TAG
- docker push jandigarte/django:$DOCKER_TAG
tags:
- docker
- gitlab-org-docker

build develop:
extends: .build
Expand All @@ -32,7 +32,7 @@ build tag:
environment: production
script:
- docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASS
- "docker build . -f docker/Dockerfile
- "docker build .
-t jandigarte/django:$CI_COMMIT_TAG
-t jandigarte/django:$DOCKER_TAG
-t jandigarte/django:latest"
Expand Down
1 change: 1 addition & 0 deletions .venv/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
63 changes: 36 additions & 27 deletions Dockerfile
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" ]
34 changes: 27 additions & 7 deletions Makefile
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
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Jandig ARte
ARte is a Progressive Web App for augmented reality artworks. Our goal is to give a way for artists share their artworks in a simple and free way.

You can see galleries with pictures of [exhibitions](http://memelab.com.br/jandig/exposicoes/) created with Jandig.
You can see these galleries filled with pictures of [exhibitions](http://memelab.com.br/jandig/exposicoes/) created with Jandig.

## How it works
Jandig ARte uses image pattern detection to detect [augmented reality markers](https://www.kudan.eu/kudan-news/augmented-reality-fundamentals-markers/) through the camera of a device and render a content (currently a GIF) on the device screen, giving the impression that your device is like a virtual window that you are looking at.

![usage](https://user-images.githubusercontent.com/12930004/46251341-770de200-c426-11e8-9671-d870d1b9bd5d.jpg)

Jandig ARte is a Progressive Web App, which means you can open in every device with a browser and a camera. Also you can add Jandig ARte to your homescreen and it will run like a native app on your device.
Jandig ARte is a Progressive Web App, which means you can open in any device with a browser and a camera. You can also add Jandig ARte to your homescreen and it will run like a native app on your device.

### People
We are a small team based in Brazil :D talk to us on [Telegram](https://t.me/joinchat/HES_ShA6TMPP-aiHxH7thQ). Here's a list of some of the contributors for the development:
Expand Down Expand Up @@ -38,7 +38,7 @@ We are looking for artists (both illustrators and animators) to create great con
You can find interviews and references to Jandig in the press [here](http://memelab.com.br/jandig/clipping/).

## Get Started
To contribute to Jandig ARte it would be awesome if you read [Contributing](https://github.com/memeLab/ARte/blob/master/.github/CONTRIBUTING.md) and our [Code of conduct](https://github.com/memeLab/ARte/blob/master/.github/CODE_OF_CONDUCT.md). After a good read you are ready to move foward!
To contribute to Jandig ARte, it would be awesome if you read [Contributing](https://github.com/memeLab/ARte/blob/master/.github/CONTRIBUTING.md) and our [Code of conduct](https://github.com/memeLab/ARte/blob/master/.github/CODE_OF_CONDUCT.md). After a good read you are ready to move foward!

### Prerequisites
We use docker and docker-compose to ensure a consistent development environment and to make the deploy process as painless as possible, so all you need on your development tools to run Jandig ARte is [Docker](https://www.docker.com/) and [Docker-Compose](https://docs.docker.com/compose/overview/).
Expand Down Expand Up @@ -110,4 +110,8 @@ vim /etc/resolv.conf
```
nameserver 172.21.176.1
```
- Access the localhost using this IP (e.g.: 172.21.176.1:8000)
- Access the localhost using this IP (e.g.: 172.21.176.1:8000)

### Prototype

The Jandig platform count with a High-Fidelity Prototype which aims the development and documentation of improvements related to usability. To acess and contribute with the prototype, follow the instructions in [Prototype Documentation](/docs/prototype.md).
1 change: 0 additions & 1 deletion docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ services:
until (/usr/bin/mc config host add myminio $${MINIO_S3_ENDPOINT_URL} $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD}) do echo '...waiting...' && sleep 1; done;
/usr/bin/mc mb myminio/$${AWS_STORAGE_BUCKET_NAME};
/usr/bin/mc policy set download myminio/$${AWS_STORAGE_BUCKET_NAME};
/usr/bin/mc mb myminio/$${AWS_PRIVATE_STORAGE_BUCKET_NAME};
/usr/bin/mc admin user add myminio $${MINIO_USER_ACCESS_KEY} $${MINIO_USER_SECRET_KEY};
/usr/bin/mc admin policy set myminio readwrite user=$${MINIO_USER_ACCESS_KEY};
exit 0;
Expand Down
Loading

0 comments on commit d9ef617

Please sign in to comment.