-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into feat-ConfigFile
- Loading branch information
Showing
109 changed files
with
260,172 additions
and
1,845 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,6 +1,7 @@ | ||
### copy to .env and set variables | ||
|
||
### ODK Central ### | ||
ODK_CENTRAL_VERSION=v2023.2.1 | ||
ODK_CENTRAL_URL=https://central-proxy | ||
ODK_CENTRAL_USER=[email protected] | ||
ODK_CENTRAL_PASSWD=fmtm | ||
|
@@ -16,12 +17,12 @@ FRONTEND_MAP_URL=127.0.0.1:8081 | |
# API_PREFIX=/api | ||
|
||
### OSM ### | ||
OSM_CLIENT_ID= | ||
OSM_CLIENT_SECRET= | ||
OSM_CLIENT_ID=xxx | ||
OSM_CLIENT_SECRET=xxx | ||
OSM_URL=https://www.openstreetmap.org | ||
OSM_SCOPE=read_prefs | ||
OSM_LOGIN_REDIRECT_URI=http://127.0.0.1:8080/osmauth/ | ||
OSM_SECRET_KEY= | ||
OSM_SECRET_KEY=xxx | ||
|
||
### Database (optional) ### | ||
CENTRAL_DB_HOST=central-db | ||
|
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,57 @@ | ||
name: Build CI Img | ||
|
||
on: | ||
# Push includes PR merge | ||
push: | ||
branches: | ||
- main | ||
- staging | ||
- development | ||
paths: | ||
# Workflow is triggered only if deps change | ||
- "src/backend/pyproject.toml" | ||
- "src/backend/Dockerfile" | ||
# Allow manual trigger | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
GIT_BRANCH: ${{ github.ref_name }} | ||
|
||
jobs: | ||
build-and-push-images: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: ${{ github.ref_name }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract api version | ||
id: extract_api_version | ||
run: | | ||
cd src/backend | ||
echo "API_VERSION=$(python -c 'from app.__version__ import __version__; print(__version__)')" >> $GITHUB_ENV | ||
- name: Build image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: src/backend | ||
target: ci | ||
push: true | ||
tags: | | ||
"ghcr.io/hotosm/fmtm/backend:${{ env.API_VERSION }}-ci-${{ github.ref_name }}" | ||
"ghcr.io/hotosm/fmtm/backend:ci-${{ github.ref_name }}" | ||
build-args: | | ||
API_VERSION=${{ env.API_VERSION }} |
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,99 @@ | ||
name: Publish Docs | ||
|
||
on: | ||
push: | ||
paths: | ||
- docs/** | ||
- src/** | ||
- mkdocs.yml | ||
branches: [main] | ||
# Allow manual trigger (workflow_dispatch) | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build_doxygen: | ||
name: Build Doxygen Docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Doxygen | ||
run: sudo apt-get update && sudo apt-get install -y doxygen | ||
|
||
- name: Write cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
.cache | ||
docs/apidocs | ||
docs/openapi.json | ||
key: doc-build-${{ env.cache_id }} | ||
|
||
- name: Build Doxygen Docs | ||
run: | | ||
cd docs | ||
doxygen | ||
build_openapi_json: | ||
name: Build OpenAPI | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/hotosm/fmtm/backend:ci-main | ||
options: --user root | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Read cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
.cache | ||
docs/apidocs | ||
docs/openapi.json | ||
key: doc-build-${{ env.cache_id }} | ||
restore-keys: | | ||
doc-build- | ||
- name: Build OpenAPi JSON | ||
run: | | ||
chmod -R 777 . | ||
gosu appuser python scripts/gen_openapi_json.py -o docs/openapi.json | ||
publish_docs: | ||
name: Publish Docs | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/hotosm/fmtm/backend:ci-main | ||
options: --user root | ||
needs: [build_doxygen, build_openapi_json] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Read cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
.cache | ||
docs/apidocs | ||
docs/openapi.json | ||
key: doc-build-${{ env.cache_id }} | ||
restore-keys: | | ||
doc-build- | ||
- name: Install Git | ||
run: | | ||
apt-get update | ||
apt-get install -y git --no-install-recommends | ||
- name: Publish | ||
run: | | ||
chmod -R 777 . | ||
gosu appuser mkdocs gh-deploy --force |
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 |
---|---|---|
|
@@ -21,23 +21,19 @@ jobs: | |
test: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: ${{ github.ref_name }} | ||
name: test | ||
|
||
container: | ||
image: ghcr.io/hotosm/fmtm/backend:ci | ||
image: ghcr.io/hotosm/fmtm/backend:ci-${{ github.base_ref || github.ref_name }} | ||
env: | ||
ODK_CENTRAL_URL: https://central-proxy | ||
ODK_CENTRAL_USER: [email protected] | ||
ODK_CENTRAL_PASSWD: odk | ||
OSM_CLIENT_ID: test | ||
OSM_CLIENT_SECRET: test | ||
OSM_SECRET_KEY: test | ||
# Fix why env. vars not working below | ||
# OSM_CLIENT_ID: ${{ env.OSM_TEST_CLIENT_ID }} | ||
# OSM_CLIENT_SECRET: ${{ env.OSM_TEST_CLIENT_SECRET }} | ||
# OSM_SECRET_KEY: ${{ env.OSM_TEST_SECRET_KEY }} | ||
# FRONTEND_MAIN_URL: "ui-main:8080" | ||
# FRONTEND_MAP_URL: "ui-map:8081" | ||
ODK_CENTRAL_URL: ${{ vars.ODK_CENTRAL_URL }} | ||
ODK_CENTRAL_USER: ${{ vars.ODK_CENTRAL_USER }} | ||
ODK_CENTRAL_PASSWD: ${{ vars.ODK_CENTRAL_PASSWD }} | ||
OSM_CLIENT_ID: ${{ vars.OSM_CLIENT_ID }} | ||
OSM_CLIENT_SECRET: ${{ vars.OSM_CLIENT_SECRET }} | ||
OSM_SECRET_KEY: ${{ vars.OSM_SECRET_KEY }} | ||
FRONTEND_MAIN_URL: ${{ vars.FRONTEND_MAIN_URL }} | ||
FRONTEND_MAP_URL: ${{ vars.FRONTEND_MAP_URL }} | ||
options: --user root | ||
|
||
services: | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -72,4 +72,6 @@ src/frontend/node_modules | |
|
||
# pdm | ||
**/.pdm.toml | ||
**/pdm.toml | ||
**/.pdm-python | ||
**/__pypackages__ |
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,4 +1,4 @@ | ||
# Code of conduct | ||
# 📜 Code of conduct | ||
|
||
(The latest version can be found at <https://www.hotosm.org/code-of-conduct>) | ||
|
||
|
@@ -80,4 +80,4 @@ As a first measure, it is preferable to work out issues directly with the people | |
|
||
- Contact the HOT Community Partnerships Manager. | ||
|
||
When these informal processes fail, or when a situation warrants an immediate response by HOT, you can evoke the **HOT Policy and Code of Conduct Complaint Handling Process**. This process was adopted by HOT Voting Members in 2016 to provide a more formal means of enforcement for our community standards. You start it by emailing [[email protected]](mailto:[email protected]) with a description of your complaint, your name, and the name of the offending party. All complaints will be considered confidential. The full process is described [here](https://docs.google.com/document/d/1xb-SPADtSbgwl6mAgglHMPHpknt-E7lKRoIcSbW431A/edit) | ||
When these informal processes fail, or when a situation warrants an immediate response by HOT, you can evoke the **HOT Policy and Code of Conduct Complaint Handling Process**. This process was adopted by HOT Voting Members in 2016 to provide a more formal means of enforcement for our community standards. You start it by emailing [[email protected]](mailto:[email protected]) with a description of your complaint, your name, and the name of the offending party. All complaints will be considered confidential. The full process is described [here](https://docs.google.com/document/d/1xb-SPADtSbgwl6mAgglHMPHpknt-E7lKRoIcSbW431A/edit) . |
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,60 @@ | ||
# Copyright (c) 2020, 2021 Humanitarian OpenStreetMap Team | ||
# | ||
# This file is part of FMTM. | ||
# | ||
# FMTM is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# FMTM is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with FMTM. If not, see <https:#www.gnu.org/licenses/>. | ||
# | ||
|
||
# All python source files | ||
# MDS := $(wildcard ./docs/*.md) | ||
MDS := \ | ||
docs/DEV-1.-Getting-Started.md \ | ||
docs/DEV-2.-Backend.md \ | ||
docs/DEV-3.-Frontend.md \ | ||
docs/DEV-4.-Database-Tips.md \ | ||
docs/DEV-5.-Docker-Tips.md \ | ||
docs/DEV-6.-Production-Deployment.md \ | ||
docs/User-Manual-For-Project-Managers.md | ||
|
||
PDFS := $(MDS:.md=.pdf) | ||
|
||
all: | ||
@echo "Targets are:" | ||
@echo " clean - remove generated files" | ||
@echo " apidoc - generate Doxygen API docs" | ||
@echo " check - run the tests" | ||
@echo " uml - generate UML diagrams" | ||
|
||
clean: | ||
@rm -fr docs/{apidocs,html,docbook,man} docs/packages.png docs/classes.png | ||
|
||
uml: | ||
cd docs && pyreverse -o png ../src/backend/app | ||
|
||
apidoc: force | ||
cd docs && doxygen | ||
|
||
# Strip any unicode out of the markdown file before converting to PDF | ||
pdf: $(PDFS) | ||
%.pdf: %.md | ||
@echo "Converting $< to a PDF" | ||
@new=$(notdir $(basename $<)); \ | ||
iconv -f utf-8 -t US $< -c | \ | ||
pandoc $< -f markdown -t pdf -s -o /tmp/$$new.pdf | ||
|
||
.SUFFIXES: .md .pdf | ||
|
||
.PHONY: apidoc | ||
|
||
force: |
Oops, something went wrong.