Simple alternative to the Meta server written in PHP for easy hosting on LAMP shared servers
Find a file
Konstantin Pastbin 8503875b23
All checks were successful
Publish to host / Publish to host (push) Successful in 32s
Keep 260504 on more nodes for longer
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2026-06-18 22:27:29 +07:00
.forgejo/workflows
.gitignore
.htaccess
composer.json
composer.lock
CONTRIBUTORS
COPYING
htaccess.txt
index.php Keep 260504 on more nodes for longer 2026-06-18 22:27:29 +07:00
maps.json Add 260617 map version to 2026.04.05 series 2026-06-18 16:17:28 +07:00
README.md

CoMaps Meta Server (PHP)

Copyright (C) 2025 CoMaps Contributors See the end of the file for license conditions.

Description

When the main app in the field checks for map updates, it needs to download the map files from nearby servers that hopefully have the desired files. Also, these servers can change over time, so they shouldn't be hardcoded into the app. So the first step is to ask for this list of CDNs, and the second step is to actually connect to one or more CDN servers to get the map files.

Note that currently our download routine chunks the files and requests multiple chunks at a time from all available servers, so more servers in each list is better. The app will evaluate the health of each server and direct chunk requests accordingly, but won't request multiple chunks from the same server at the same time.

Unlike Organic Maps, features that allowed the metaserver to control donation buttons etc have been removed from CoMaps and are not present in this metaserver.

Currently there is no capability for giving an app newer maps than it was built for. Apps are shipped with a countries.txt file that dictates every possible map and its checksum, which is quite secure, but also limiting. Improvements in this area are being discussed.

Requirements

Setup

  • Copy this meta folder to your wwwroot (like /var/www/html)
  • Copy and rename htaccess.txt to your wwwroot (like /var/www/html/.htaccess)
  • Obtain Composer or composer.phar and run composer install or php composer.phar install in this meta folder.
  • Ensure that Rewrite is enabled on Apache and test that curl -v https://your.example.com/servers results in JSON output, not a redirect
  • For stats, set a crontab: 59 23 * * * /var/www/html/meta/generate-stats.sh

License

You should have received a copy of the GNU Affero General Public License along with meta-php. If not, see https://www.gnu.org/licenses/.

// SPDX-License-Identifier: AGPL-3.0-only