Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3537d7d
Merge pull request #79 from MerginMaps/develop
varmar05 May 26, 2023
937e6fc
Merge pull request #88 from MerginMaps/develop
varmar05 Jun 13, 2023
ae0c164
Merge pull request #100 from MerginMaps/develop
varmar05 Jul 27, 2023
989d24b
Merge pull request #110 from MerginMaps/develop
varmar05 Sep 6, 2023
d0a7633
update branding
PeterPetrik Sep 28, 2023
5425965
update branding
PeterPetrik Sep 28, 2023
e3dd535
Merge pull request #115 from MerginMaps/develop
varmar05 Oct 4, 2023
96e3777
new logo in README
PeterPetrik Oct 6, 2023
523c013
Merge pull request #122 from MerginMaps/develop
varmar05 Oct 16, 2023
dd0b652
Merge pull request #126 from MerginMaps/develop
varmar05 Oct 25, 2023
e6cae6b
Defer loading project files
varmar05 Oct 31, 2023
5424e97
Optimize file download: Move file location lookup to db instead of py…
varmar05 Oct 31, 2023
d737d2b
Merge pull request #127 from MerginMaps/fix_project_download
varmar05 Nov 2, 2023
5e02c9f
rename Mergin to server (#129)
PeterPetrik Nov 8, 2023
ae22882
Change PWD to "." in docker-compose.yml
alhirzel Nov 25, 2023
23eeb03
Merge pull request #141 from MerginMaps/develop
varmar05 Dec 13, 2023
124a295
update versions to 2023.6.1
tomasMizera Dec 20, 2023
606f82b
Update env variables so the the server works on the first run
tomasMizera Dec 20, 2023
28b2d65
Sign CLA as an individual (#146)
alhirzel Dec 22, 2023
5559e78
Merge pull request #132 from alhirzel/patch-1
tomasMizera Dec 22, 2023
10dcbde
Merge pull request #144 from MerginMaps/prepare-2023-6-1-release
varmar05 Jan 8, 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
11 changes: 5 additions & 6 deletions .prod.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ CONTACT_EMAIL=fixme

#DEBUG=FLASK_DEBUG | False

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

#MAINTENANCE_FILE=os.path.join(LOCAL_PROJECTS, 'MAINTENANCE') # locking file when backups are created
MAINTENANCE_FILE=/data/MAINTENANCE
Expand All @@ -23,8 +23,8 @@ 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
#TEMP_DIR=/data/tmp
TEMP_DIR=gettempdir() # trash dir for temp files being cleaned regularly

#TESTING=False

Expand Down Expand Up @@ -154,8 +154,7 @@ CLOSED_ACCOUNT_EXPIRATION=1
# GLOBAL_STORAGE 1024 * 1024 * 1024
GLOBAL_STORAGE=10737418240

# GLOBAL_READ False
GLOBAL_READ=1
# GLOBAL_READ False - Everyone will be "guest", you need to share projects with them explicitly

# GLOBAL_WRITE False

Expand Down
2 changes: 1 addition & 1 deletion LICENSES/CLA-signed-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Please add your GitHub username and date to the lists below to sign that:

A/ You have read and agree to the individual CLA: https://merginmaps.com/licenses/individual-cla

* `your_name_here`
* `alhirzel`, 20th December 2023

B/ I have read and agree with entity CLA for my company: https://merginmaps.com/licenses/entity-cla

Expand Down
47 changes: 19 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
<picture>
<source media="(prefers-color-scheme: dark)" width=350 srcset="https://raw.githubusercontent.com/MerginMaps/.github/main/images/MM_logo_HORIZ_COLOR_INVERSE_VECTOR.svg">
<img width=350 src="https://raw.githubusercontent.com/MerginMaps/.github/main/images/MM_logo_HORIZ_COLOR_VECTOR.svg">
</picture>

<p align="center">
<a href="https://merginmaps.com/" target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./doc/mm_logo_bgnd_neg.png" width=350>
<source media="(prefers-color-scheme: light)" srcset="./doc/mm_logo_bgnd_pos.jpg" width=350>
<img alt="Mergin Maps logo" src="./doc/mm_logo_bgnd_pos.jpg" width=350>
</picture>
</a>
</p>

<p align="center">
<b>Store and track changes to your geo-data</b> <br />
<img src="https://img.shields.io/badge/License-Dual AGPL3 and MM Commercial licence-blue">
</p>
<img src="https://img.shields.io/badge/License-Dual AGPL3 and MM Commercial licence-blue">

[![Code Layout](https://github.com/MerginMaps/mergin/actions/workflows/code_style.yml/badge.svg)](https://github.com/MerginMaps/mergin/actions/workflows/code_style.yml)
[![Auto Tests](https://github.com/MerginMaps/mergin/actions/workflows/auto_tests.yml/badge.svg)](https://github.com/MerginMaps/mergin/actions/workflows/auto_tests.yml)
[![Code Layout](https://github.com/MerginMaps/server/actions/workflows/code_style.yml/badge.svg)](https://github.com/MerginMaps/server/actions/workflows/code_style.yml)
[![Auto Tests](https://github.com/MerginMaps/server/actions/workflows/auto_tests.yml/badge.svg)](https://github.com/MerginMaps/server/actions/workflows/auto_tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/MerginMaps/mergin/badge.svg)](https://coveralls.io/github/MerginMaps/mergin)

## About
Expand All @@ -36,7 +27,7 @@ The platform is especially useful when you need:
- **No coding required.** Everything can be set up with no knowledge of programming.

Mergin Maps organises all data in projects. A project in Mergin Maps is a directory containing various data files - GeoPackages,
QGIS project files, documents, pictures and more. As soon as a project is uploaded to Mergin Maps, it can be easily accessed directly from the web, from QGIS or from iOS/Android via our [mobile app](https://merginmaps.com/start-for-free).
QGIS project files, documents, pictures and more. As soon as a project is uploaded to Mergin Maps, it can be easily accessed directly from the web, from QGIS or from iOS/Android via our [mobile app](https://merginmaps.com/).

You are currently browsing repository for Mergin Maps web server and web client. Our mobile app, QGIS plugin and integrations have standalone GitHub repositories, you can [find them here](https://github.com/MerginMaps).

Expand Down Expand Up @@ -77,19 +68,19 @@ You are currently browsing repository for Mergin Maps web server and web client.
## Features

- 🌍 **Store data** - GeoPackages, QGIS project files, GeoTIFFs, pictures or any other data easily
- 📱 **Mobile devices** - Great for working on field surveys, thanks to our mobile app based on QGIS, for [iOS and Android](https://github.com/lutraconsulting/input)
- 🌟 **QGIS integration** - [Mergin Maps plugin](https://github.com/lutraconsulting/qgis-mergin-plugin) is available to help with project setup and seamless syncing within QGIS
- 📱 **Mobile devices** - Great for working on field surveys, thanks to our mobile app based on QGIS, for [iOS and Android](https://github.com/merginmaps/input)
- 🌟 **QGIS integration** - [Mergin Maps plugin](https://github.com/merginmaps/qgis-mergin-plugin) is available to help with project setup and seamless syncing within QGIS
- 👥 **Multi-user editing** - Changes to vector/attribute data from multiple users are automatically merged
- 📖 **Data versioning** - Keeping history of all changes, allowing to go back if needed
- 🔌 **Offline editing** - Clients do not need to be online all the time - only when syncing changes
- 🌱 **Sharing with collaborators** - Projects can be shared with other team members
- 🏰 **Permission system** - Decide who can read, write or manage projects
- 🌈 **Web interface** - Simple user interface to view and manage projects
- ⚡️ **Fast** - Efficient sync protocol transfering data between clients and server
- 🧑‍💻 **Developer friendly** - Mergin Maps is open platform. CLI tools and client libraries are available for [Python](https://github.com/lutraconsulting/mergin-py-client) and [C++](https://github.com/lutraconsulting/mergin-cpp-client)
- :camera: **Sync images** - Supporting sync of photos with common cloud storage using [mergin-media-sync](https://github.com/lutraconsulting/mergin-media-sync) tool
- 💽 **Sync with database** - Supporting two-way sync of data with PostGIS using [mergin-db-sync](https://github.com/lutraconsulting/mergin-db-sync) tool
- 👷‍♀️ **Work packages** - Split main database to smaller chunks for teams using [mergin-work-packages](https://github.com/lutraconsulting/mergin-work-packages) tool
- 🧑‍💻 **Developer friendly** - Mergin Maps is open platform. CLI tools and client libraries are available for [Python](https://github.com/MerginMaps/python-api-client) and [C++](https://github.com/MerginMaps/cpp-api-client)
- :camera: **Sync images** - Supporting sync of photos with common cloud storage using [mergin-media-sync](https://github.com/MerginMaps/media-sync) tool
- 💽 **Sync with database** - Supporting two-way sync of data with PostGIS using [mergin-db-sync](https://github.com/MerginMaps/db-sync) tool
- 👷‍♀️ **Work packages** - Split main database to smaller chunks for teams using [mergin-work-packages](https://github.com/MerginMaps/work-packages) tool

Mergin Maps offers a unique combination of features that other tools do not provide out of the box:

Expand Down Expand Up @@ -134,14 +125,14 @@ Contributions are welcome!
More information for developers can be found in the dedicated [development](development.md) page.

Client side modules:
- [Python](https://github.com/lutraconsulting/mergin-py-client) client library + CLI
- [C++](https://github.com/lutraconsulting/mergin-cpp-client) client library + CLI
- [Python](https://github.com/MerginMaps/python-api-client) client library + CLI
- [C++](https://github.com/MerginMaps/cpp-api-client) client library + CLI

More related tools:
- [mergin-db-sync](https://github.com/lutraconsulting/mergin-db-sync) - set up two-way sync between Mergin Maps and PostGIS database
- [mergin-work-packages](https://github.com/lutraconsulting/mergin-work-packages) - split data for teams to work packages
- [mergin-db-sync](https://github.com/MerginMaps/db-sync) - set up two-way sync between Mergin Maps and PostGIS database
- [mergin-work-packages](https://github.com/MerginMaps/work-packages) - split data for teams to work packages

Learn more about [geodiff](https://github.com/lutraconsulting/geodiff) - the low-level library providing seamless merging of changes from multiple sources.
Learn more about [geodiff](https://github.com/merginmaps/geodiff) - the low-level library providing seamless merging of changes from multiple sources.

## License

Expand Down
Binary file removed doc/mm_logo_bgnd_neg.png
Binary file not shown.
Binary file removed doc/mm_logo_bgnd_pos.jpg
Binary file not shown.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
networks:
- merginmaps
server:
image: lutraconsulting/merginmaps-backend:2023.2.0
image: lutraconsulting/merginmaps-backend:2023.6.1
container_name: merginmaps-server
restart: always
user: 901:999
Expand All @@ -35,7 +35,7 @@ services:
networks:
- merginmaps
web:
image: lutraconsulting/merginmaps-frontend:2023.2.0
image: lutraconsulting/merginmaps-frontend:2023.6.1
container_name: merginmaps-web
restart: always
depends_on:
Expand All @@ -52,6 +52,6 @@ services:
- "8080:80"
volumes:
- ./projects:/data # map data dir to host
- ${PWD}/nginx.conf:/etc/nginx/conf.d/default.conf
- ./nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- merginmaps
2 changes: 1 addition & 1 deletion server/mergin/sync/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Project(db.Model):
)
updated = db.Column(db.DateTime, onupdate=datetime.utcnow)
# metadata for project files (see also FileInfoSchema)
files = db.Column(JSONB, default=[])
files = db.deferred(db.Column(JSONB, default=[]))
tags = db.Column(ARRAY(String), server_default="{}")
disk_usage = db.Column(BIGINT, nullable=False, default=0)
latest_version = db.Column(db.String, index=True)
Expand Down
47 changes: 31 additions & 16 deletions server/mergin/sync/public_api_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,26 +311,41 @@ def download_project_file(
:rtype: file
"""
project = require_project(namespace, project_name, ProjectPermissions.Read)
files = _project_version_files(project, version)
file_path = None
if diff and not version:
abort(400, f"Changeset must be requested for particular file version")

lookup_version = version or project.latest_version
sql = text(
"""
SELECT
expanded.files ->> 'location' AS location,
(expanded.files ->> 'diff')::jsonb ->> 'location' as diff_location
FROM
(
SELECT jsonb_array_elements(pv.files::jsonb) AS files
FROM project_version pv
WHERE pv.name = :version AND project_id = :project_id
) AS expanded
WHERE
expanded.files @> :json;
"""
)
params = {
"version": lookup_version,
"project_id": project.id,
"json": '{"path": "' + file + '"}',
}
result = db.session.execute(sql, params).fetchone()
if not result:
abort(404, f"File {file} not found")

if diff and version:
# get specific version of geodiff file modified in requested version
file_obj = next(
(f for f in files if f["location"] == os.path.join(version, file)), None
)
if not file_obj:
abort(404, file)
if "diff" not in file_obj:
if not result["diff_location"]:
abort(404, f"No diff in particular file {file} version")
file_path = file_obj["diff"]["location"]
elif diff:
abort(400, f"Changeset must be requested for particular file version")
file_path = result["diff_location"]
else:
# get latest version of file
file_path = next((f["location"] for f in files if f["path"] == file), None)

if not file_path:
abort(404, file)
file_path = result["location"]

if version and not diff:
project.storage.restore_versioned_file(file, version)
Expand Down
2 changes: 1 addition & 1 deletion server/mergin/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@


def get_version():
return "2023.3.0"
return "2023.6.1"
2 changes: 1 addition & 1 deletion server/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="mergin",
version="2023.3.0",
version="2023.6.1",
url="https://github.com/MerginMaps/mergin",
license="AGPL-3.0-only",
author="Lutra Consulting Limited",
Expand Down