Skip to content

Commit 855359d

Browse files
authored
Merge pull request #238 from mapswipe/dev
WIP: New Release 2.1.5
2 parents 4eff081 + 2787665 commit 855359d

File tree

17 files changed

+557
-399
lines changed

17 files changed

+557
-399
lines changed

docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ services:
7272
build:
7373
context: postgres/
7474
environment:
75-
POSTGERS_PASSWORD: '${POSTGRES_PASSWORD}'
75+
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
7676
POSTGRES_USER: 'mapswipe_workers'
7777
POSTGRES_DB: 'mapswipe'
7878
PGDATA: '/var/lib/postgresql/mapswipe'
@@ -81,7 +81,7 @@ services:
8181
# Set options for WAL-G (backup tool)
8282
command: postgres -c archive_mode=on -c archive_timeout=60 -c archive_command="/archive_command.sh %p"
8383
volumes:
84-
- ./postgres-data:/var/lib/postgresql/mapswipe
84+
- ./postgres-data:/var/lib/postgresql/mapswipe
8585
restart: unless-stopped
8686
ports:
8787
- "5432:5432"

docs/source/backup.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ The WAL-G backup setup is integrated into the Postgres Docker image. It will do
1414
WAL-G is installed alongside Postgres. See the Dockerfile of Postgres (`postgres/Dockerfile`) for details. In the docker-compose postgres command (`docker-compose.yml`) archive parameter of postgres are set needed to make archives.
1515

1616

17-
## Restore setup
17+
### Configuration
1818

19-
The WAL-G restore setup is realized in a dedicated Docker image (`postgres/Dockerfile-restore_backup`). It will create a new Postgres database cluster, fetch latest backup using `wal-g backup-fetch` and create a `recovery.conf` file in the new cluster during Docker build. `recovery.conf` is used by Postgres during first start to get the `restore_command`. Again the exact commands are to be found in `postgres/wal-g/restore_command.sh`. During first start Postgres will get WALs from backup server and restore the database.
19+
To store backups in Google Cloud Storage, WAL-G requires that this variable is set: `WALG_GS_PREFIX` to specify where to store backups (eg. `gs://x4m-test-bucket/walg-folder`).
20+
Please add this to the `.env` file at the root of MapSwipe Back-end (See `.example-env` for environment variables which have to be set)
2021

22+
WAL-G determines Google Cloud credentials using application-default credentials like other GCP tools. Get a Service Account Key file (`serviceAccountKey.json`) for your Google Cloud Storage (See [Google Cloud Docs](https://cloud.google.com/iam/docs/creating-managing-service-account-keys)) and save it to `postgres/serviceAccountKey.json`.
2123

22-
## Configuration
2324

24-
To store backups in Google Cloud Storage, WAL-G requires that this variable be set: `WALG_GS_PREFIX` to specify where to store backups (eg. `gs://x4m-test-bucket/walg-folder`).
25-
Please add this to your `.env` file at the root of MapSwipe Back-end (See `.example-env` for environment variables wich needs to be set)
25+
## Restore setup
2626

27-
WAL-G determines Google Cloud credentials using application-default credentials like other GCP tools. Get a Service Account Key file (`serviceAccountKey.json`) for your Google Cloud Storage (See [Google Cloud Docs](https://cloud.google.com/iam/docs/creating-managing-service-account-keys)) and save it to `postgres/serviceAccountKey.json`.
27+
The WAL-G restore setup is realized in a dedicated Docker image (`postgres/recovery/Dockerfile`). The entrypoint is the `ini_recovery.sh` srcipt. This script will create a new Postgres database cluster, fetch latest backup using `wal-g backup-fetch` and create a `recovery.conf` file in the new cluster. `recovery.conf` is used by Postgres during first start to get the `restore_command`. Again the exact commands are to be found in `postgres/recovery/restore_command.sh`. During first start Postgres will get WALs from backup server and restore the database.
28+
29+
30+
### Configuration
31+
32+
> The same configuration as for the backup setup is requiered. Except the Service Account Key has to be stored at `postgres/recovery/serviceAccountKey`.

docs/source/contributing.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,49 @@
11
# Contributing
22

3-
This document is a work progress. It should describe how to contribute (code or issues) to the MapSwipe back-end.
43

5-
To contribute to the MapSwipe back-end please create dedicated feature branches.
4+
## Clone from GitHub
65

76
```bash
7+
git clone https://github.com/mapswipe/python-mapswipe-workers.git
8+
cd python-mapswipe-workers
9+
git checkout dev
10+
```
11+
12+
13+
## Install MapSwipe Workers
14+
15+
Create a Python virtual environment and activate it. Install MapSwipe Workers using pip:
16+
17+
```bash
18+
python -m venv venv
19+
source venv/bin/activate
20+
pip install --editable .
21+
```
22+
23+
24+
## Feature Branch
25+
26+
To contribute to the MapSwipe back-end please create dedicated feature branches from dev:
27+
28+
```bash
29+
git checkout dev
830
git checkout -b featureA
931
git commit -am 'add new project type'
1032
git push -u origin featureA
11-
git request-pull origin/master featureA
33+
git request-pull origin/dev featureA
34+
```
35+
36+
> Note: If a bug in production (master branch) needs fixing before a new versions of MapSwipe Workers gets released (merging dev into master branch), a hotfix branch should be created. In the hotfix branch the bug should be fixed and then merged back with master and also dev.
37+
38+
39+
## Style Guide
40+
41+
This project uses [black](https://github.com/psf/black) and [flake8](https://gitlab.com/pycqa/flake8) to achieve a unified style.
42+
43+
Use [pre-commit](https://pre-commit.com/) to run `black` and `flake8` prior to any git commit. `pre-commit`, `black` and `flake8` should already be installed in your virtual environment since they are listed in `requirements.txt`. To setup pre-commit simply run:
44+
1245
```
46+
pre-commit install
47+
```
48+
49+
From now on `black` and `flake8` should run automatically whenever `git commit` is executed.

manager_dashboard/manager_dashboard/create.html

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,31 @@
1414
<meta name="twitter:card" content="summary">
1515
<meta name="viewport" content="width=device-width, initial-scale=1">
1616

17+
<!-- add firebase -->
1718
<script src="https://cdn.firebase.com/libs/firebaseui/4.0.0/firebaseui.js"></script>
1819
<link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/4.0.0/firebaseui.css" />
1920

20-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
21-
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
21+
<!-- add jquery, ajax -->
22+
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2223
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
23-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
24+
25+
<!-- Add Bootstrap -->
26+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
27+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
28+
29+
<!-- Add Data Tables -->
30+
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap.min.css">
31+
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
32+
33+
<!-- add mapswipe styles -->
2434
<link type="text/css" rel="stylesheet" href="css/mapswipe.css" />
25-
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
26-
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ=="
27-
crossorigin=""/>
28-
<!-- Make sure you put this AFTER Leaflet's CSS -->
29-
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
30-
integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og=="
31-
crossorigin=""></script>
35+
36+
<!-- add leaflet and turf.js -->
37+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" crossorigin=""/>
38+
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==" crossorigin=""></script>
3239
<script src='https://npmcdn.com/@turf/turf/turf.min.js'></script>
3340

41+
<!-- add sentry -->
3442
<script
3543
src="https://browser.sentry-cdn.com/5.7.1/bundle.min.js"
3644
integrity="sha384-KMv6bBTABABhv0NI+rVWly6PIRvdippFEgjpKyxUcpEmDWZTkDOiueL5xW+cztZZ"

manager_dashboard/manager_dashboard/css/mapswipe.css

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,4 +134,31 @@
134134
}
135135

136136
#geometryMap { height: 300px; width: 100%}
137-
#geometryChangeDetectionMap { height: 300px; width: 100%}
137+
#geometryChangeDetectionMap { height: 300px; width: 100%}
138+
139+
div.project-data {
140+
padding-bottom: 50px !important;
141+
padding-top: 25px !important;
142+
}
143+
144+
145+
/* adjust data tables styles */
146+
.table {
147+
border-spacing: 0px !important;
148+
}
149+
150+
th.sorting::after{
151+
content: "\2195" !important;
152+
}
153+
154+
th.sorting_asc::after{
155+
content: "\2193" !important;
156+
}
157+
158+
th.sorting_desc::after{
159+
content: "\2191" !important;
160+
}
161+
162+
.paginate_button {
163+
padding: 2.5px !important;
164+
}

manager_dashboard/manager_dashboard/index.html

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,31 @@
1414
<meta name="twitter:card" content="summary">
1515
<meta name="viewport" content="width=device-width, initial-scale=1">
1616

17+
<!-- add firebase -->
1718
<script src="https://cdn.firebase.com/libs/firebaseui/4.0.0/firebaseui.js"></script>
1819
<link type="text/css" rel="stylesheet" href="https://cdn.firebase.com/libs/firebaseui/4.0.0/firebaseui.css" />
1920

20-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
21-
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
21+
<!-- add jquery, ajax -->
22+
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
2223
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
23-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
2424

25+
<!-- Add Bootstrap -->
26+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
27+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
28+
29+
<!-- Add Data Tables -->
30+
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap.min.css">
31+
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
32+
33+
<!-- add mapswipe styles -->
34+
<link type="text/css" rel="stylesheet" href="css/mapswipe.css" />
35+
36+
<!-- add leaflet and turf.js -->
37+
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" crossorigin=""/>
38+
<script src="https://unpkg.com/[email protected]/dist/leaflet.js" integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==" crossorigin=""></script>
39+
<script src='https://npmcdn.com/@turf/turf/turf.min.js'></script>
40+
41+
<!-- add sentry -->
2542
<script
2643
src="https://browser.sentry-cdn.com/5.7.1/bundle.min.js"
2744
integrity="sha384-KMv6bBTABABhv0NI+rVWly6PIRvdippFEgjpKyxUcpEmDWZTkDOiueL5xW+cztZZ"

manager_dashboard/manager_dashboard/js/bootstrap.min.js

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)