Skip to content

Commit be8f5a6

Browse files
authored
Merge pull request #345 from MerginMaps/build-2025.1.0
Release 2025.1.0
2 parents 4f2d1dd + 141baa2 commit be8f5a6

Some content is hidden

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

56 files changed

+2564
-1186
lines changed

.dev.env

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Environment variables for development docker-compose.dev.yml
2+
3+
FLASK_DEBUG=1
4+
5+
# Mail SMTP connection to maildev
6+
7+
MAIL_SERVER=maildev
8+
MAIL_PORT=1025
9+
MAIL_SUPPRESS_SEND=0
10+
MAIL_USE_TLS=False
11+
MAIL_USE_SSL=False
12+
MAIL_DEFAULT_SENDER=[email protected]

.prod.env

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,26 @@
22

33
# Mind that any major change to this file MUST BE reflected in docs
44

5+
56
FLASK_APP=application
6-
GEODIFF_LOGGER_LEVEL=2
7-
CONTACT_EMAIL=fixme
7+
8+
# Required for access of your server
9+
#MERGIN_BASE_URL=http://localhost:5000
810

911
#DEBUG=FLASK_DEBUG | False
12+
FLASK_DEBUG=0
1013

1114
#LOCAL_PROJECTS=os.path.join(config_dir, os.pardir, os.pardir, 'projects') # for local storage type
1215
LOCAL_PROJECTS=/data
1316

1417
#MAINTENANCE_FILE=os.path.join(LOCAL_PROJECTS, 'MAINTENANCE') # locking file when backups are created
1518
MAINTENANCE_FILE=/data/MAINTENANCE
1619

17-
#SECRET_KEY=NODEFAULT
18-
SECRET_KEY=fixme
19-
2020
#SWAGGER_UI=False # to enable swagger UI console (for test only)
2121

2222
#TEMP_DIR=gettempdir() # trash dir for temp files being cleaned regularly
2323
TEMP_DIR=/data/tmp
2424

25-
#TESTING=False
26-
2725
#VERSION=get_version()
2826

2927

@@ -58,6 +56,9 @@ DB_PORT=5432
5856

5957
# auth related
6058

59+
#SECRET_KEY=NODEFAULT
60+
SECRET_KEY=fixme
61+
6162
#BEARER_TOKEN_EXPIRATION=3600 * 12 # in seconds
6263

6364
#SECURITY_PASSWORD_SALT=NODEFAULT
@@ -68,29 +69,37 @@ SECURITY_PASSWORD_SALT=fixme
6869
#WTF_CSRF_TIME_LIMIT=3600 * 24 # in seconds
6970

7071

71-
# for flask mail
72+
# Mail configuration
7273

73-
#MAIL_BCC=NODEFAULT
74+
MAIL_SUPPRESS_SEND=0
7475

75-
#MAIL_DEBUG=MAIL_SUPPRESS_SEND | False
76+
# Sender of emails
77+
78+
79+
# SMTP server url address
80+
# MAIL_SERVER=example.smtp.com
81+
82+
# SMTP server port
83+
# MAIL_PORT=587
7684

77-
#MAIL_DEFAULT_SENDER=NODEFAULT
78-
MAIL_DEFAULT_SENDER=fixme
85+
# SMTP server username
86+
# MAIL_USERNAME=
7987

80-
#MAIL_PASSWORD=NODEFAULT
88+
# SMTP server password
89+
# MAIL_PASSWORD=
8190

82-
#MAIL_PORT=587
91+
# Default True
92+
# MAIL_USE_TLS=True
8393

84-
#MAIL_SERVER=localhost
85-
MAIL_SERVER=fixme
94+
# Default False
95+
# MAIL_USE_SSL=False
8696

87-
#MAIL_SUPPRESS_SEND=True
97+
#MAIL_BCC=''
8898

89-
#MAIL_USE_TLS=True
90-
#MAIL_USE_SSL=False
99+
#MERGIN_LOGO_URL= # for link to logo in emails
100+
101+
#MAIL_DEBUG=MAIL_SUPPRESS_SEND | False
91102

92-
#MAIL_USERNAME=NODEFAULT
93-
MAIL_USERNAME=fixme
94103

95104

96105
# data sync
@@ -108,9 +117,12 @@ MAIL_USERNAME=fixme
108117
#USE_X_ACCEL=False # use nginx (in front of gunicorn) to serve files (https://www.nginx.com/resources/wiki/start/topics/examples/x-accel/)
109118
USE_X_ACCEL=1
110119

120+
# geodif related
121+
111122
# where geodiff lib copies working files
112123
#GEODIFF_WORKING_DIR=$LOCAL_PROJECTS/geodiff_tmp
113124
GEODIFF_WORKING_DIR=/data/geodiff
125+
GEODIFF_LOGGER_LEVEL=2
114126

115127
# celery
116128

@@ -123,15 +135,20 @@ BROKER_TRANSPORT_OPTIONS={ 'master_name': 'mymaster' }
123135
#CELERY_RESULT_BACKEND=redis://172.17.0.1:6379/0'
124136
CELERY_RESULT_BACKEND=redis://merginmaps-redis:6379/0
125137

126-
#CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS={} # cast=eval
127-
CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS={ 'master_name': 'mymaster' }
128-
129138
#CELERY_ACKS_LATE=False
139+
#CELERY_ACKS_LATE=True
140+
141+
# set to number of cpu
142+
#CELERYD_CONCURRENCY=2
130143

131-
#CELERY_WORKER_CONCURRENCY=1 # set to number of cpu in case of prefork or to higher number in case of gevent pool
132-
CELERYD_CONCURRENCY=2
144+
# Deprecated from 2024.7.0, use CELERYD_CONCURRENCY instead after 2024.7.0
145+
# CELERY_WORKER_CONCURRENCY=1
133146

134147
#CELERYD_PREFETCH_MULTIPLIER=4
148+
#CELERYD_PREFETCH_MULTIPLIER=4
149+
150+
# Deprecated from 2024.7.0, use CELERYD_PREFETCH_MULTIPLIER instead after 2024.7.0
151+
#CELERY_WORKER_PREFETCH_MULTIPLIER=4
135152

136153
#CELERY_ROUTES={} # split tasks into separate queues
137154

@@ -149,15 +166,15 @@ CLOSED_ACCOUNT_EXPIRATION=1
149166

150167
# for links generated in emails and callbacks
151168

152-
#MERGIN_BASE_URL=http://localhost:5000
153169

154-
#MERGIN_LOGO_URL= # for link to logo in emails
170+
# Statistics related
155171

156172
#COLLECT_STATISTICS True
157173

158174
#SERVICE_ID # should be random uuid
159175

160176
# global workspace related bits
177+
161178
# GLOBAL_WORKSPACE mergin
162179

163180
# GLOBAL_STORAGE 1024 * 1024 * 1024
@@ -172,10 +189,10 @@ GLOBAL_STORAGE=10737418240
172189
# toggle registration form to create new users
173190
#USER_SELF_REGISTRATION=False
174191

175-
# what type of server is running, e.g. community edition or enterprise edition
176-
#SERVER_TYPE=ce
177-
178192
# Gunicorn server socket
179193
PORT=5000
180194

181195
GEVENT_WORKER=True
196+
# Deprecated from 2024.7.0, replacement is to set GEVENT_WORKER=True
197+
NO_MONKEY_PATCH=False
198+

development.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ Watching the type definitions is also useful to pick up any changes to imports o
6060

6161
## Running locally in a docker composition
6262

63+
If you want to run the whole stack locally, you can use the docker. Docker will build the images from yout local files and run the services.
64+
6365
```shell
6466
# Run the docker composition with the current Dockerfiles
6567
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
@@ -72,6 +74,20 @@ docker exec -it merginmaps-server flask init-db
7274
docker exec -it merginmaps-server flask user create admin topsecret --is-admin --email [email protected]
7375
```
7476

77+
To check if application is running, you can use following mand to verify you installation:
78+
79+
```shell
80+
docker exec -it merginmaps-server flask server check
81+
```
82+
83+
To check if emails are sending correctly, you can use following mand to verify you installation:
84+
85+
```shell
86+
docker exec -it merginmaps-server flask server send-check-email --email [email protected]
87+
```
88+
89+
In docker-compose.dev.yml is started maildev/maildev image that can be used to test emails (see [https://github.com/maildev/maildev/](https://github.com/maildev/maildev/)). In localhost:1080 you can see the emails sent by the application in web interface.
90+
7591
## Running tests
7692
To launch the unit tests run:
7793
```shell

docker-compose.dev.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,36 @@ services:
66
build:
77
context: ./server
88
dockerfile: Dockerfile
9+
env_file:
10+
- .prod.env
11+
- .dev.env
912
celery-beat:
1013
image: celery-beat
1114
build:
1215
context: ./server
1316
dockerfile: Dockerfile
17+
env_file:
18+
- .prod.env
19+
- .dev.env
1420
celery-worker:
1521
image: celery-worker
1622
build:
1723
context: ./server
1824
dockerfile: Dockerfile
25+
env_file:
26+
- .prod.env
27+
- .dev.env
1928
web:
2029
image: merginmaps-frontend
2130
build:
2231
context: ./web-app
2332
dockerfile: Dockerfile
33+
maildev:
34+
image: maildev/maildev
35+
container_name: merginmaps-maildev
36+
restart: always
37+
ports:
38+
- 1080:1080
39+
- 1025:1025
40+
networks:
41+
- merginmaps

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ services:
4242
restart: always
4343
env_file:
4444
- .prod.env
45+
environment:
46+
- GEVENT_WORKER=0
47+
- NO_MONKEY_PATCH=1
4548
volumes:
4649
- ./server/entrypoint.sh:/app/entrypoint.sh
4750
depends_on:
@@ -57,6 +60,9 @@ services:
5760
user: 901:999
5861
env_file:
5962
- .prod.env
63+
environment:
64+
- GEVENT_WORKER=0
65+
- NO_MONKEY_PATCH=1
6066
volumes:
6167
- ./projects:/data
6268
- ./server/entrypoint.sh:/app/entrypoint.sh

server/Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ flask-login = "==0.6.2"
2121
bcrypt = "==4.2.0"
2222
wtforms = {extras = ["email"],version = "==3.1.2"}
2323
flask-wtf = "==1.0.1"
24-
flask-mail = "==0.9.1"
24+
flask-mail = "==0.10.0"
2525
safe = "==0.4"
2626
flask-migrate = "==2.6.0" # 3.1.0
2727
wtforms-json = "==0.3.5"

0 commit comments

Comments
 (0)