|
Konstantin Pastbin
49348e1c2b
All checks were successful
Publish to host / Publish to host (push) Successful in 32s
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com> |
||
|---|---|---|
| .forgejo/workflows | Fix job syntax errors | |
| .gitignore | Add gitignore | |
| .htaccess | Prohibit browsing .git folder | |
| composer.json | Initial commit | |
| composer.lock | Initial commit | |
| CONTRIBUTORS | Add cloud.ru S3 storage | |
| COPYING | Relicense as AGPL | |
| htaccess.txt | Initial commit | |
| index.php | Add 260106 map version | |
| README.md | Relicense as AGPL | |
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
- Assumes Apache and PHP
- Get a GeoLite2-Country.mmdb file from here: https://www.maxmind.com/en/geolite-free-ip-geolocation-data
- Download it to a non-public path on your webserver
- Adjust the appropriate line in index.php to point to the full path of the file
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.pharand runcomposer installorphp composer.phar installin this meta folder. - Ensure that Rewrite is enabled on Apache and test that
curl -v https://your.example.com/serversresults 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