Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus committed Mar 1, 2022
2 parents 7feaf43 + eb64112 commit 462f38e
Show file tree
Hide file tree
Showing 80 changed files with 3,617 additions and 1,061 deletions.
42 changes: 33 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
COMPOSE_FILE=docker-compose.yml:docker-compose.override.local.yml

DEBUG=1

QFIELDCLOUD_HOST=localhost
DJANGO_SETTINGS_MODULE=qfieldcloud.settings
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 0.0.0.0

SECRET_KEY=change_me

LETSENCRYPT_EMAIL=info@opengis.ch
LETSENCRYPT_RSA_KEY_SIZE=4096
# Set to 1 if you're testing your setup to avoid hitting request limits
LETSENCRYPT_STAGING=1

STORAGE_ACCESS_KEY_ID=minioadmin
STORAGE_SECRET_ACCESS_KEY=minioadmin
STORAGE_BUCKET_NAME=qfieldcloud-local
STORAGE_REGION_NAME=
# Internal URL to the storage endpoint (from python code)
STORAGE_ENDPOINT_URL=http://s3:9000
# Public URL to the storage endpoint (external storage should be equivalent to STORAGE_ENDPOINT_URL, local development only, no trailing slash)
STORAGE_ENDPOINT_URL_EXTERNAL=http://localhost:80/minio
# Public port to the storage endpoint browser (local development only)
STORAGE_BROWSER_PORT=8010

# URL to the storage endpoint either minio, or external (e.g. S3).
# The URL must be reachable both from within docker and from the host, the default value is the `bridge` docker URL.
# Read more on https://docs.docker.com/network/network-tutorial-standalone/ .
# NOTE: to use minio on windows/mac, change the value to "http://host.docker.internal:8009"
# DEFAULT: http://172.17.0.1:8009
STORAGE_ENDPOINT_URL=http://172.17.0.1:8009

# Public port to the minio API endpoint. It must match the configured port in `STORAGE_ENDPOINT_URL`.
# NOTE: active only when minio is the configured as storage endpoint. Mostly for local development.
# DEFAULT: 8009
MINIO_API_PORT=8009

# Public port to the minio browser endpoint.
# NOTE: active only when minio is the configured as storage endpoint. Mostly for local development.
# DEFAULT: 8010
MINIO_BROWSER_PORT=8010

WEB_HTTP_PORT=80
WEB_HTTPS_PORT=443
Expand All @@ -24,6 +43,8 @@ POSTGRES_PASSWORD=3shJDd2r7Twwkehb
POSTGRES_DB=qfieldcloud_db
POSTGRES_HOST=db
POSTGRES_PORT=5432
# "prefer" OR "require" most of the times
POSTGRES_SSLMODE=prefer
HOST_POSTGRES_PORT=5433

GEODB_HOST=geodb
Expand All @@ -32,9 +53,6 @@ GEODB_USER=postgres
GEODB_PASSWORD=KUAa7h!G&wQEmkS3
GEODB_DB=postgres

CADDY_ACME_CA=https://acme-staging-v02.api.letsencrypt.org/directory
CADDY_IMPORT_GLOB=(*(N))

SENTRY_DSN=

REDIS_PASSWORD=change_me_with_a_very_loooooooooooong_password
Expand All @@ -56,7 +74,13 @@ COMPOSE_PROJECT_NAME=qfieldcloud
QFIELDCLOUD_DEFAULT_NETWORK=qfieldcloud_default
QFIELDCLOUD_ADMIN_URI=admin/

# Timeout in seconds to wait for a job container to finish, otherwise terminate it.
QFIELDCLOUD_WORKER_TIMEOUT_S=60

GUNICORN_TIMEOUT_S=300
GUNICORN_MAX_REQUESTS=300
GUNICORN_WORKERS=3
GUNICORN_THREADS=3

# required for making COMPOSE_FILE above cross-platform (do not change)
COMPOSE_PATH_SEPARATOR=:
4 changes: 2 additions & 2 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
name: Backport
steps:
- name: Backport
uses: m-kuhn/backport@v1.2.3
uses: m-kuhn/backport@v1.2.5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.NYUKI_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- master
- build-containers-with-github-actions
- dispatch_deploy_after_build
tags:
- "v*.*.*"
jobs:
Expand Down Expand Up @@ -44,25 +44,6 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

# Caddy
- name: Docker Test Caddy
id: docker_test_caddy
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./docker-caddy
file: ./docker-caddy/Dockerfile

- name: Docker Build and Push Caddy
id: docker_build_and_push_caddy
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./docker-caddy
file: ./docker-caddy/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: opengisch/qfieldcloud-caddy:${{ steps.prepare.outputs.tag }}

# Application
- name: Docker Test Application
id: docker_test_application
Expand Down Expand Up @@ -119,3 +100,11 @@ jobs:
file: ./docker-qgis/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: opengisch/qfieldcloud-qgis:${{ steps.prepare.outputs.tag }}

- name: Trigger deployment on private repository
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GIT_ACCESS_TOKEN }}
repository: opengisch/qfieldcloud-private
event-type: public_dispatch
client-payload: '{"version": "${{ steps.prepare.outputs.tag }}"}'
20 changes: 20 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 👓 Close stale issues
on:
schedule:
- cron: "30 1 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
with:
repo-token: ${{ secrets.NYUKI_TOKEN }}
stale-issue-message: |
The QFieldCloud project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.
stale-issue-label: 'stale'
only-labels: 'feedback'
days-before-stale: 14
days-before-close: 7
21 changes: 10 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Test
on: push
on:
- push
- pull_request
jobs:
test:
name: Code check and tests
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand All @@ -12,24 +14,21 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: '3.10'
- name: Install pipenv
run: pip install pipenv
- name: Check code formatting
uses: pre-commit/action@v2.0.3
- name: Prepare docker-compose override file
run: |
ln -s docker-compose.override.local.yml docker-compose.override.yml
- name: Check code formatting
run: |
pipenv install pre_commit
pipenv run python -m pre_commit run --all-files
- name: Check environment variables
- name: Check env vars coniguration
run: |
pipenv install pyyaml
pipenv run python .github/check_envvars/check_envvars.py .env.example --docker-compose-dir .
scripts/check_envvars.sh
- name: Export the env variables file
run: |
cp .env.example .env
export $(egrep -v '^#' .env | xargs)
eval $(egrep "^[^#;]" .env | xargs -d'\n' -n1 | sed -E 's/(\w+)=(.*)/export \1='"'"'\2'"'"'/g')
- name: Pull docker containers
run: docker-compose pull
- name: Build and run docker containers
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ __pycache__/
.env
docker-compose.override.yml
client/projects
conf/nginx/certs/*
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:

# Sort imports
- repo: https://github.com/pycqa/isort
rev: "5.7.0"
rev: "5.10.1"
hooks:
- id: isort
args: ["--profile", "black"]
Expand Down
Loading

0 comments on commit 462f38e

Please sign in to comment.