Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b89a313
Roles refactoring: Add new project_member table, update getter/setter…
varmar05 Oct 31, 2024
3bdd3dd
Merge remote-tracking branch 'origin/develop-roles-refactor' into rol…
MarcelGeo Nov 5, 2024
5bdeef7
Fix migration script to work with all deployments
varmar05 Nov 11, 2024
8277055
Fix migration script
varmar05 Nov 13, 2024
d7d7640
Fix downgrade in migration script
varmar05 Nov 14, 2024
3e4ab10
Roles refactor: Fix API responses with new internal db models
varmar05 Nov 15, 2024
e09239e
Merge pull request #319 from MerginMaps/roles-refactor-db-migration
MarcelGeo Nov 18, 2024
106da88
Roles refactor: Fix depracated update project access endpoint
varmar05 Nov 18, 2024
3c8595b
Merge branch 'develop' into develop-roles-refactor
varmar05 Nov 19, 2024
fc8e11d
Merge branch 'develop-roles-refactor' into fix_current_access_api
varmar05 Nov 19, 2024
75deca7
Address comments
varmar05 Nov 20, 2024
5cb1535
Admin Oveview API
harminius Nov 20, 2024
8b164b7
Cleanup
harminius Nov 20, 2024
dcc7b86
More fixes for project access rework
varmar05 Nov 20, 2024
0b00f89
Rewrite pagination query to use subquery instead of join
varmar05 Nov 21, 2024
928fb81
Add Overview page to Admin
harminius Nov 21, 2024
ead9554
Merge pull request #332 from MerginMaps/fix_current_access_api
MarcelGeo Nov 25, 2024
a5e7e1b
Merge branch 'develop' into server_usage_in_admin
harminius Nov 25, 2024
8436f36
add missing UsageCards
harminius Nov 26, 2024
c090a07
black .
harminius Nov 26, 2024
339b67f
Merge pull request #334 from MerginMaps/server_usage_in_admin
MarcelGeo Nov 26, 2024
4d34f5d
Roles refactor: New public API with reworked project roles
varmar05 Nov 29, 2024
3864ce6
Update flask-mail
MarcelGeo Dec 2, 2024
aadf993
Fix: make MAIL_BCC, MAIL_USERNAME, MAIL_PASSWORD as default none to b…
MarcelGeo Dec 2, 2024
99105e2
Introduce docker-compose.dev.yml with maildev configured
MarcelGeo Dec 2, 2024
c700c2e
Refactor of prod.env
MarcelGeo Dec 2, 2024
3cacc81
Introduce server check command for checking main functionalities
MarcelGeo Dec 2, 2024
428ea77
Reintroduce CONTACT_EMAIL variable and send it with stats
MarcelGeo Dec 3, 2024
1b66b14
Create project fix
harminius Dec 6, 2024
4578903
Be safe to have mandatory public attribute
harminius Dec 6, 2024
be604ea
Add test for public argument
harminius Dec 9, 2024
235a421
- Disable celery concurency for production deployments
MarcelGeo Dec 9, 2024
111d7f6
Split sending email to server send-check-email --email {} @varmar05
MarcelGeo Dec 9, 2024
21e9478
Black
MarcelGeo Dec 9, 2024
03e1b02
Added server send-check-email to docs
MarcelGeo Dec 9, 2024
56cd008
Address review comments
varmar05 Dec 9, 2024
dfa0d46
Rename functions to match API naming
varmar05 Dec 9, 2024
744581b
Fix typo
MarcelGeo Dec 9, 2024
1d915d7
Merge pull request #339 from MerginMaps/gh#2536-flask-mail
MarcelGeo Dec 10, 2024
1fbdb12
Merge pull request #337 from MerginMaps/new_members_api
MarcelGeo Dec 10, 2024
8aecc98
Merge branch 'develop' into develop-roles-refactor
varmar05 Dec 11, 2024
c28dc1d
Merge pull request #341 from MerginMaps/develop-roles-refactor
MarcelGeo Dec 11, 2024
b4cef2a
Fix db migration not to include deleted users
varmar05 Dec 16, 2024
6275d97
Fix db migration not to include deleted projects
varmar05 Dec 16, 2024
141baa2
Merge pull request #347 from MerginMaps/fix_alembic_deleted_projects
MarcelGeo Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Environment variables for development docker-compose.dev.yml

FLASK_DEBUG=1

# Mail SMTP connection to maildev

MAIL_SERVER=maildev
MAIL_PORT=1025
MAIL_SUPPRESS_SEND=0
MAIL_USE_TLS=False
MAIL_USE_SSL=False
MAIL_DEFAULT_SENDER=noreply@example.com
79 changes: 48 additions & 31 deletions .prod.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@

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


FLASK_APP=application
GEODIFF_LOGGER_LEVEL=2
CONTACT_EMAIL=fixme

# Required for access of your server
#MERGIN_BASE_URL=http://localhost:5000

#DEBUG=FLASK_DEBUG | False
FLASK_DEBUG=0

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

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

#SECRET_KEY=NODEFAULT
SECRET_KEY=fixme

#SWAGGER_UI=False # to enable swagger UI console (for test only)

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

#TESTING=False

#VERSION=get_version()


Expand Down Expand Up @@ -58,6 +56,9 @@ DB_PORT=5432

# auth related

#SECRET_KEY=NODEFAULT
SECRET_KEY=fixme

#BEARER_TOKEN_EXPIRATION=3600 * 12 # in seconds

#SECURITY_PASSWORD_SALT=NODEFAULT
Expand All @@ -68,29 +69,37 @@ SECURITY_PASSWORD_SALT=fixme
#WTF_CSRF_TIME_LIMIT=3600 * 24 # in seconds


# for flask mail
# Mail configuration

#MAIL_BCC=NODEFAULT
MAIL_SUPPRESS_SEND=0

#MAIL_DEBUG=MAIL_SUPPRESS_SEND | False
# Sender of emails
# MAIL_DEFAULT_SENDER=fixme@example.com

# SMTP server url address
# MAIL_SERVER=example.smtp.com

# SMTP server port
# MAIL_PORT=587

#MAIL_DEFAULT_SENDER=NODEFAULT
MAIL_DEFAULT_SENDER=fixme
# SMTP server username
# MAIL_USERNAME=

#MAIL_PASSWORD=NODEFAULT
# SMTP server password
# MAIL_PASSWORD=

#MAIL_PORT=587
# Default True
# MAIL_USE_TLS=True

#MAIL_SERVER=localhost
MAIL_SERVER=fixme
# Default False
# MAIL_USE_SSL=False

#MAIL_SUPPRESS_SEND=True
#MAIL_BCC=''

#MAIL_USE_TLS=True
#MAIL_USE_SSL=False
#MERGIN_LOGO_URL= # for link to logo in emails

#MAIL_DEBUG=MAIL_SUPPRESS_SEND | False

#MAIL_USERNAME=NODEFAULT
MAIL_USERNAME=fixme


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

# geodif related

# where geodiff lib copies working files
#GEODIFF_WORKING_DIR=$LOCAL_PROJECTS/geodiff_tmp
GEODIFF_WORKING_DIR=/data/geodiff
GEODIFF_LOGGER_LEVEL=2

# celery

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

#CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS={} # cast=eval
CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS={ 'master_name': 'mymaster' }

#CELERY_ACKS_LATE=False
#CELERY_ACKS_LATE=True

# set to number of cpu
#CELERYD_CONCURRENCY=2

#CELERY_WORKER_CONCURRENCY=1 # set to number of cpu in case of prefork or to higher number in case of gevent pool
CELERYD_CONCURRENCY=2
# Deprecated from 2024.7.0, use CELERYD_CONCURRENCY instead after 2024.7.0
# CELERY_WORKER_CONCURRENCY=1

#CELERYD_PREFETCH_MULTIPLIER=4
#CELERYD_PREFETCH_MULTIPLIER=4

# Deprecated from 2024.7.0, use CELERYD_PREFETCH_MULTIPLIER instead after 2024.7.0
#CELERY_WORKER_PREFETCH_MULTIPLIER=4

#CELERY_ROUTES={} # split tasks into separate queues

Expand All @@ -149,15 +166,15 @@ CLOSED_ACCOUNT_EXPIRATION=1

# for links generated in emails and callbacks

#MERGIN_BASE_URL=http://localhost:5000

#MERGIN_LOGO_URL= # for link to logo in emails
# Statistics related

#COLLECT_STATISTICS True

#SERVICE_ID # should be random uuid

# global workspace related bits

# GLOBAL_WORKSPACE mergin

# GLOBAL_STORAGE 1024 * 1024 * 1024
Expand All @@ -172,10 +189,10 @@ GLOBAL_STORAGE=10737418240
# toggle registration form to create new users
#USER_SELF_REGISTRATION=False

# what type of server is running, e.g. community edition or enterprise edition
#SERVER_TYPE=ce

# Gunicorn server socket
PORT=5000

GEVENT_WORKER=True
# Deprecated from 2024.7.0, replacement is to set GEVENT_WORKER=True
NO_MONKEY_PATCH=False

16 changes: 16 additions & 0 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Watching the type definitions is also useful to pick up any changes to imports o

## Running locally in a docker composition

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.

```shell
# Run the docker composition with the current Dockerfiles
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
Expand All @@ -72,6 +74,20 @@ docker exec -it merginmaps-server flask init-db
docker exec -it merginmaps-server flask user create admin topsecret --is-admin --email admin@example.com
```

To check if application is running, you can use following mand to verify you installation:

```shell
docker exec -it merginmaps-server flask server check
```

To check if emails are sending correctly, you can use following mand to verify you installation:

```shell
docker exec -it merginmaps-server flask server send-check-email --email admin@example.com
```

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.

## Running tests
To launch the unit tests run:
```shell
Expand Down
18 changes: 18 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,36 @@ services:
build:
context: ./server
dockerfile: Dockerfile
env_file:
- .prod.env
- .dev.env
celery-beat:
image: celery-beat
build:
context: ./server
dockerfile: Dockerfile
env_file:
- .prod.env
- .dev.env
celery-worker:
image: celery-worker
build:
context: ./server
dockerfile: Dockerfile
env_file:
- .prod.env
- .dev.env
web:
image: merginmaps-frontend
build:
context: ./web-app
dockerfile: Dockerfile
maildev:
image: maildev/maildev
container_name: merginmaps-maildev
restart: always
ports:
- 1080:1080
- 1025:1025
networks:
- merginmaps
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ services:
restart: always
env_file:
- .prod.env
environment:
- GEVENT_WORKER=0
- NO_MONKEY_PATCH=1
volumes:
- ./server/entrypoint.sh:/app/entrypoint.sh
depends_on:
Expand All @@ -57,6 +60,9 @@ services:
user: 901:999
env_file:
- .prod.env
environment:
- GEVENT_WORKER=0
- NO_MONKEY_PATCH=1
volumes:
- ./projects:/data
- ./server/entrypoint.sh:/app/entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion server/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ flask-login = "==0.6.2"
bcrypt = "==4.2.0"
wtforms = {extras = ["email"],version = "==3.1.2"}
flask-wtf = "==1.0.1"
flask-mail = "==0.9.1"
flask-mail = "==0.10.0"
safe = "==0.4"
flask-migrate = "==2.6.0" # 3.1.0
wtforms-json = "==0.3.5"
Expand Down
Loading