1
0
Fork
You've already forked motis
0
forked from cartes/motis
No description
  • Shell 76.4%
  • TypeScript 23.6%
Find a file
2026年04月29日 15:46:29 +00:00
input Dossier input nécessaire ? 2024年01月12日 11:48:18 +01:00
.gitignore Ajout d'éléments dans gitignore / nouveau downloadFrance 2026年04月29日 15:46:29 +00:00
denoSetup.sh Test avec un buildpack deno 2024年01月12日 16:29:00 +01:00
downloadFrance.sh Ajout d'éléments dans gitignore / nouveau downloadFrance 2026年04月29日 15:46:29 +00:00
downloadMotis.sh Externalisation du téléchargement de motis 2024年03月11日 14:41:31 +01:00
downloadOsm.sh Ajout de l'IdF pour les transferts train en vélo à Paris 2024年07月16日 22:22:05 +02:00
downloadOsmEurope.sh MAJ pour motis 2 et zone Europe 2025年10月27日 11:38:51 +01:00
LICENSE Initial commit 2024年01月12日 11:26:21 +01:00
localStart.sh Deux scripts pour local et serveur 2024年03月11日 15:45:44 +01:00
motis.service Oubli de l'instruction pour le service système motis 2024年08月08日 10:42:02 +02:00
package.json Compliqué cette histoire de read_only sur platform.sh 2024年01月12日 21:32:31 +01:00
README.md Oubli de l'instruction pour le service système motis 2024年08月08日 10:42:02 +02:00
server.ts Stratégie Deno 2024年01月12日 16:01:28 +01:00
setup.sh Quelques évolutions, données OSM + 2024年03月11日 15:04:41 +01:00
start.sh MAJ pour motis 2 et zone Europe 2025年10月27日 11:38:51 +01:00

./downloadMotis.sh

Beware, the Scaleway elastic metal needs the motis-linux-amd64-noavx.tar.bz2 build !

If not the first setup time, optionally run this command to start from scratch (will be slower, obviously) :

rm -rf config.ini motis* data/*

Important note : motis config.ini generation and GTFS downloading has been moved to laem/gtfs, fully automatised with the deno buildConfig.ts script :)

About osm files

There should be only one import osm path.

In case you want to include multiple French regions, e.g. run :

./downloadOsm.sh
sudo apt install osmium-tool
cd input
osmium merge bretagne.osm.pbf pays-de-la-loire.osm.pbf -o cartes.osm.pbf

The thing is, it's resource hungry to parse the osrm and ppr motis modules's data. But it's entirely possible to produce them locally then upload them on the server in data/osrm/*.

Just beware to also upload the hashes in import.ini and make sure the x.osm.pbf in input/ is the same as the one you generated your osrm and ppr files from.

Then to just run in one second the server,

./start.sh.

Motis startup should take 1 minute max if no osrm or ppr parsing is done :)

Deploying

I've not yet been able to find an easy to use PaaS platform letting me deploy this.

Scalingo has too small images (1,5Go, we're at 1,9Go on Bretagne). Fly.io has no wget, lol. Platform.sh has a weird read-only build files constraint.

Hence I went with a scaleway VM. Using this guide to get a HTTPS certificate https://devtutorial.io/how-to-install-lets-encrypt-ssl-in-nginx-on-ubuntu-23-04-p3269.html

Also

sudo apt install lbzip2

Your nginx file should look like this

server {
 server_name motis.cartes.app;
 location / {
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header Host $host;
 proxy_pass http://127.0.0.1:3000;
 proxy_http_version 1.1;
 proxy_set_header Upgrade $http_upgrade;
 proxy_set_header Connection "upgrade";
 }
 listen 443 ssl; # managed by Certbot
 ssl_certificate /etc/letsencrypt/live/motis.cartes.app/fullchain.pem; # managed by Certbot
 ssl_certificate_key /etc/letsencrypt/live/motis.cartes.app/privkey.pem; # managed by Certbot
 include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
 ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
 if ($host = motis.cartes.app) {
 return 301 https://$host$request_uri;
 } # managed by Certbot
 listen 80;
 server_name motis.cartes.app;
 return 404; # managed by Certbot

Add Motis as a system service :

sudo cp motis.service /etc/systemd/system/

Run the server with

systemctl start motis.service

Read the last logs with

journalctl -u motis.service -b -e -f