Skip to content

Commit 12bef52

Browse files
authored
Merge pull request #604 from memeLab/develop
Update master to v1.4.1
2 parents b04432e + 65c765b commit 12bef52

File tree

101 files changed

+4040
-3085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+4040
-3085
lines changed

.envs/.example

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
DJANGO_DEBUG=True
44
DEBUG_TOOLBAR=True
55
DJANGO_SECRET_KEY=change_me
6+
DJANGO_ADMIN_URL=jandig-admin/
67
USE_MINIO=True
8+
USE_GUNICORN=True
79

810
# Sentry Variables
9-
DJANGO_ADMIN_URL=jandig-admin/
1011
ENABLE_SENTRY=False
1112
SENTRY_DSN=
13+
SENTRY_ENVIRONMENT="local"
1214
HEALTH_CHECK_URL=api/v1/status/
1315
SENTRY_TRACES_SAMPLE_RATE=0.1
1416

@@ -18,7 +20,6 @@ AWS_SECRET_ACCESS_KEY=minio123
1820
MINIO_ROOT_USER=minio
1921
MINIO_ROOT_PASSWORD=minio123
2022
AWS_STORAGE_BUCKET_NAME=jandig-cdn
21-
AWS_PRIVATE_STORAGE_BUCKET_NAME=jandig-private-cdn
2223
AWS_S3_REGION_NAME=us-east-2
2324
AWS_STATIC_LOCATION=static
2425
MINIO_S3_ENDPOINT_URL=http://storage:9000
@@ -34,7 +35,16 @@ POSTGRES_USER=jandig
3435
POSTGRES_PASSWORD=secret
3536

3637
# Email server variables
37-
SMTP_SERVER=smtp.gmail.com
38-
SMTP_PORT=587
39-
JANDIG_EMAIL=local_jandig@jandig.com
40-
JANDIG_EMAIL_PASSWORD=local_password
38+
SMTP_SERVER=mailpit
39+
SMTP_PORT=1025
40+
SMTP_USE_TLS=False
41+
SMTP_USE_SSL=False
42+
SMTP_USER=
43+
SMTP_PASSWORD=
44+
SMTP_SENDER_MAIL="jandig@memelab.com.br"
45+
46+
# Recaptcha
47+
RECAPTCHA_ENABLED=False
48+
RECAPTCHA_PROJECT_ID=
49+
RECAPTCHA_GCLOUD_API_KEY=
50+
RECAPTCHA_SITE_KEY=

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Repository Policy
2-
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.
2+
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.
33

44
## Coding Style
55
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.

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
steps:
1010
- name: Check out code from Github
1111
uses: actions/checkout@v3
12-
- name: Set up Python 3.10
12+
- name: Set up Python 3.13
1313
uses: actions/setup-python@v4
1414
with:
15-
python-version: "3.10"
15+
python-version: "3.13"
1616
- name: Installing flake8
1717
run: |
1818
python -m pip install --upgrade pip
@@ -57,7 +57,7 @@ jobs:
5757
run: |
5858
cp .envs/.example .envs/.env
5959
docker load -i docker_image_$GITHUB_SHA
60-
docker-compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
60+
docker compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
6161
- name: Test migrations
6262
run: |
6363
docker exec jandigarte_${{ github.sha }}_django_1 sh -c "\
@@ -81,7 +81,7 @@ jobs:
8181
run: |
8282
cp .envs/.example .envs/.env
8383
docker load -i docker_image_$GITHUB_SHA
84-
docker-compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
84+
docker compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
8585
- name: Running users tests
8686
run: |
8787
docker exec jandigarte_${{ github.sha }}_django_1 sh -c "\

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Docker pipeline
33
on:
44
push:
55
branches:
6-
- develop
6+
- master
77

88
# TODO: Change environment and login envs
99
jobs:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ src/ARte/config/__pycache__/
66
*.sqlite3
77

88
build/
9+
static/
10+
media/
911
src/data/certbot/
1012
docker/node_modules/
1113
node_modules/

.venv/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

Dockerfile

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,31 @@
1-
FROM python:3.10-slim-bullseye
21

3-
RUN apt-get update && \
4-
apt-get install -y --no-install-recommends \
5-
gettext \
6-
docutils-common \
7-
curl \
8-
wget
9-
10-
COPY ./pyproject.toml /pyproject.toml
11-
COPY ./poetry.lock /poetry.lock
12-
13-
ENV PATH="$PATH:/root/.local/bin" \
14-
POETRY_NO_INTERACTION=1 \
15-
POETRY_VIRTUALENVS_CREATE=false \
16-
POETRY_CACHE_DIR='/var/cache/pypoetry' \
2+
FROM python:3.13.1-slim-bookworm
3+
COPY --from=ghcr.io/astral-sh/uv:0.5.24 /uv /uvx /bin/
4+
5+
ENV PATH="$PATH:/home/jandig/.local/bin:/jandig/.venv/bin" \
176
TINI_VERSION=v0.19.0 \
18-
# poetry:
19-
POETRY_VERSION=1.3.1
7+
UV_CACHE_DIR=/home/jandig/jandig/cache/uv
208

21-
# Installing `poetry` package manager:
22-
# https://github.com/python-poetry/poetry
23-
RUN curl -sSL https://install.python-poetry.org | python3 - \
24-
&& poetry --version
9+
RUN apt-get update && \
10+
apt-get install -y --no-install-recommends \
11+
gettext \
12+
docutils-common \
13+
curl \
14+
wget
2515

26-
RUN pip install --upgrade pip
27-
RUN poetry install
2816

2917
RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
3018
&& wget "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${dpkgArch}" -O /usr/local/bin/tini \
3119
&& chmod +x /usr/local/bin/tini && tini --version
3220

3321

34-
RUN mkdir -p /jandig/src /jandig/locale /jandig/docs /jandig/static /jandig/build
22+
RUN mkdir -p /jandig/src /jandig/locale /jandig/docs /jandig/.venv /jandig/static /jandig/build /home/jandig/jandig/cache/uv
3523

3624
WORKDIR /jandig
3725

26+
COPY ./pyproject.toml /jandig/pyproject.toml
27+
COPY ./uv.lock /jandig/uv.lock
28+
3829
COPY ./src/ /jandig/src/
3930
COPY ./docs/ /jandig/docs/
4031
COPY ./locale/ /jandig/locale/
@@ -43,7 +34,19 @@ COPY ./run.sh /jandig/run.sh
4334
COPY ./etc/ /jandig/etc/
4435

4536

37+
# Create group and user
38+
RUN groupadd -g 1000 jandig && useradd -u 1000 -g 1000 -r -m -d /home/jandig jandig
39+
40+
# Change ownership of the directories to the new user and group
41+
RUN chown -R jandig:jandig /jandig /home/jandig
42+
RUN chmod 2775 /jandig /home/jandig
43+
44+
# Switch to the new user
45+
USER jandig
46+
4647
RUN find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
4748

49+
RUN uv sync --frozen --no-dev
50+
ENTRYPOINT ["tini", "--"]
4851

49-
ENTRYPOINT ["tini", "--"]
52+
CMD [ "/jandig/run.sh" ]

Makefile

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,33 @@ RUNNING_CONTAINER := $(shell docker compose ps --services --filter "status=runni
22

33
test:
44
@if [[ -n "${RUNNING_CONTAINER}" ]]; then \
5-
docker compose exec django poetry run pytest src/core src/users; \
5+
docker compose exec django uv run pytest src/core src/users src/blog; \
66
else \
7-
docker compose run --rm django poetry run pytest src/core src/users;\
7+
docker compose run --rm django uv run pytest src/core src/users src/blog;\
88
fi
99

1010
test-ui:
1111
docker compose up -d
12-
poetry run pytest src/tests
12+
uv run pytest src/tests
1313

1414
lint:
15-
poetry run black --line-length=200 src
16-
poetry run isort src
17-
flake8:
18-
poetry run flake8 --max-line-length=200 --exclude=*/migrations src
15+
uv run ruff format src
16+
uv run ruff check --fix src
17+
18+
check:
19+
uv run ruff check
1920

2021
migrations:
21-
poetry run python src/manage.py makemigrations
22+
uv run python src/manage.py makemigrations
2223

2324
migrate:
24-
poetry run python src/manage.py migrate
25+
uv run python src/manage.py migrate
2526

2627
gen:
27-
poetry run playwright codegen -b chromium --target python-pytest localhost:8000
28+
uv run playwright codegen -b chromium --target python-pytest localhost:8000
2829

2930
translate_es:
30-
poetry run inv i18n -l es_ES
31+
docker compose exec django uv run inv i18n -l es_ES
32+
33+
translate_pt:
34+
docker compose exec django uv run inv i18n -l pt_BR

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Jandig ARte
22
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.
33

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

66
## How it works
77
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.
88

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

11-
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.
11+
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.
1212

1313
### People
1414
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:
@@ -38,7 +38,7 @@ We are looking for artists (both illustrators and animators) to create great con
3838
You can find interviews and references to Jandig in the press [here](http://memelab.com.br/jandig/clipping/).
3939

4040
## Get Started
41-
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!
41+
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!
4242

4343
### Prerequisites
4444
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/).
@@ -110,4 +110,8 @@ vim /etc/resolv.conf
110110
```
111111
nameserver 172.21.176.1
112112
```
113-
- Access the localhost using this IP (e.g.: 172.21.176.1:8000)
113+
- Access the localhost using this IP (e.g.: 172.21.176.1:8000)
114+
115+
### Prototype
116+
117+
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).

docker-compose.ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ services:
5252
until (/usr/bin/mc config host add myminio $${MINIO_S3_ENDPOINT_URL} $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD}) do echo '...waiting...' && sleep 1; done;
5353
/usr/bin/mc mb myminio/$${AWS_STORAGE_BUCKET_NAME};
5454
/usr/bin/mc policy set download myminio/$${AWS_STORAGE_BUCKET_NAME};
55-
/usr/bin/mc mb myminio/$${AWS_PRIVATE_STORAGE_BUCKET_NAME};
5655
/usr/bin/mc admin user add myminio $${MINIO_USER_ACCESS_KEY} $${MINIO_USER_SECRET_KEY};
5756
/usr/bin/mc admin policy set myminio readwrite user=$${MINIO_USER_ACCESS_KEY};
5857
exit 0;

0 commit comments

Comments
 (0)