### Install Dependencies and Start Development Server
Source: https://github.com/public-transport/transitous/blob/main/website/README.md
Installs project dependencies and starts the Hugo development server for live preview. Requires Git, Hugo Extended, and npm.
```sh
git submodule update --init --checkout
npm install
npm run start
```
--------------------------------
### Install gtfsclean Locally
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Downloads and installs the gtfsclean executable to ~/.local/bin. This tool is used for preprocessing GTFS feeds.
```bash
wget -P ~/.local/bin https://github.com/public-transport/gtfsclean/releases/latest/download/gtfsclean
chmod +x ~/.local/bin/gtfsclean
```
--------------------------------
### Import Data and Start MOTIS Server
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Commands to be run inside the 'out' directory after configuration. Imports data and starts the MOTIS server, making the web interface accessible.
```bash
cd out
motis import
motis server
```
--------------------------------
### Minimal Transitous Widget Embedding Example
Source: https://github.com/public-transport/transitous/wiki/Transitous-Widget
This HTML snippet demonstrates the basic setup for embedding the Transitous widget. It includes linking to necessary CSS and JavaScript files and initializing the widget with a destination.
```html
```
--------------------------------
### GTFS-RT Fetcher Example
Source: https://github.com/public-transport/transitous/wiki/MOTIS-Notes
Using the built-in GTFS-RT fetcher from nigiri is a straightforward way to handle real-time updates without extra tooling.
```plaintext
https://github.com/motis-project/motis/wiki/Real-Time-Updates
```
--------------------------------
### Run Transitous Container
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Starts a local Transitous instance within a container, mapping port 8080 and mounting the current directory for persistent data.
```bash
podman run -it -p 8080:8080 -v $PWD:/transitous:Z --userns=keep-id -w /transitous transitous
```
--------------------------------
### Start MOTIS Feed Update Timer
Source: https://github.com/public-transport/transitous/wiki/Server-Maintainance
Manually starts the timer for the MOTIS feed update service. This ensures feeds are updated automatically.
```bash
systemctl start motis-update-feeds.timer
```
--------------------------------
### Manually Import OSM Data
Source: https://github.com/public-transport/transitous/wiki/Server-Maintainance
Manually imports OpenStreetMap data within a Docker container. Ensure woodpecker-agent is stopped before and started after this operation.
```bash
docker run -it -v /var/cache/transitous/:/var/cache/transitous/ ghcr.io/public-transport/transitous/import
```
--------------------------------
### Applying GPL to New Programs
Source: https://github.com/public-transport/transitous/blob/main/LICENSES/GPL-3.0-or-later.txt
This is a template for applying the GNU General Public License to your new software. It includes copyright information, license terms, and warranty disclaimers.
```text
Copyright (C)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see .
```
--------------------------------
### Create Release Build
Source: https://github.com/public-transport/transitous/blob/main/website/README.md
Generates a production-ready release build of the website. The output is placed in the 'public/' directory. Requires npm.
```sh
npm run release
```
--------------------------------
### Start MOTIS Feed Update Service Manually
Source: https://github.com/public-transport/transitous/wiki/Server-Maintainance
Manually starts the MOTIS feed update service. This is used to trigger feed updates outside the scheduled cron job.
```bash
systemctl start motis-update-feeds
```
--------------------------------
### Build and Push MOTIS Import Container Image
Source: https://github.com/public-transport/transitous/wiki/Server-Maintainance
Builds the MOTIS import container image locally and pushes it to the registry. This is a prerequisite for updating MOTIS.
```bash
podman build -t ghcr.io/public-transport/transitous/import:latest .
podman push ghcr.io/public-transport/transitous/import:latest
```
--------------------------------
### Start MOTIS Feed Update Service
Source: https://github.com/public-transport/transitous/wiki/Server-Maintainance
Manually triggers a data update for MOTIS feeds. This service is typically run automatically each night.
```bash
systemctl start motis-update-feeds.service
```
--------------------------------
### GPL Notice for Interactive Programs
Source: https://github.com/public-transport/transitous/blob/main/LICENSES/GPL-3.0-or-later.txt
This is a template for a short notice to be displayed by interactive programs licensed under the GPL. It informs users about warranty and redistribution conditions.
```text
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
```
--------------------------------
### Generate Python Client from OpenAPI
Source: https://github.com/public-transport/transitous/wiki/Transitous-Hack-Weekend-Berlin,-July-2025
Use openapi-python-client to generate a Python client library from an OpenAPI specification file. Specify the path to the OpenAPI file, the desired output directory, and meta options.
```bash
openapi-python-client generate --path openapi.yaml --output-path motis_api_client --meta none
```
--------------------------------
### Encrypt API Key using age and base64
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
This bash command shows how to encrypt a private API key using 'age' and then base64 encode it for secure use in Transitous configurations. The output can be prepended with 'AGE-ENCRYPTED:'.
```bash
echo AGE-ENCRYPTED:$(echo -n "my-api-key" | age -r age1xpexzyk4k608tsccev20d7uakptkmgxr4nc8s0azzywkgtz86aaqsdryr4 | base64 -w0)
```
--------------------------------
### Download All Processed Feeds
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Downloads all post-processed feed files (zip, lua, config) from the Transitous server using wget. This is an alternative to processing feeds locally.
```bash
mkdir -p out && cd out && wget --limit-rate=30m --mirror -l 2 --no-parent --cut-dirs=1 --no-host-directories --include-directories=gtfs,gtfs/scripts --accept .zip --accept .lua --accept config.yml -e robots=off https://api.transitous.org/gtfs/
```
--------------------------------
### Sync Transitous Data via HTTP
Source: https://github.com/public-transport/transitous/wiki/Using-Transitous-data
Use wget to download the GTFS dataset and associated scripts. This command mirrors the directory structure, limits download speed, and accepts specific file types.
```bash
wget --limit-rate=30m --mirror -l 2 --no-parent --cut-dirs=1 --no-host-directories --include-directories=gtfs,gtfs/scripts --accept .zip --accept .lua --accept config.yml -e robots=off https://api.transitous.org/gtfs/
```
--------------------------------
### HTTP/FTP Static Feed Configuration
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Configures a static GTFS feed using HTTP or FTP. Includes optional license information and a 'fix' attribute to attempt automatic error correction.
```json
{
"name": "",
"type": "http",
"url": "https://",
"license": {
"spdx-identifier": "",
"url": "< url as source for the license if available >"
}
}
```
--------------------------------
### Decode GTFS-RT Feed using protoc
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
This bash command demonstrates how to fetch a GTFS-RT feed from a URL, decode its Protocol Buffers content using 'protoc' with the 'gtfs-realtime.proto' schema, and pipe the output to 'less' for viewing.
```bash
curl https://the.feed.url | protoc gtfs-realtime.proto --decode=transit_realtime.FeedMessage | less
```
--------------------------------
### Generate MOTIS Configuration
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Generates a base configuration file for the MOTIS server, skipping feeds that are missing local files.
```bash
./src/generate-motis-config.py --skip-missing-files
```
--------------------------------
### Fetch Feeds Locally
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Processes all feeds locally using a script. This is an alternative to downloading pre-processed files from the Transitous server.
```bash
./ci/fetch-feeds.py timer
```
--------------------------------
### Static GTFS Feed Configuration for Realtime Updates
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Configures a static GTFS feed that will later have real-time updates applied. The 'name' is used to link the static and real-time feeds.
```json
{
"name": "lviv",
"type": "http",
"url": "https://track.ua-gis.com/gtfs/lviv/static.zip"
}
```
--------------------------------
### Deploy MOTIS using Ansible
Source: https://github.com/public-transport/transitous/wiki/Server-Maintainance
Deploys the MOTIS service using Ansible playbooks. This command should be run from the ansible directory.
```bash
ansible-playbook -i hosts motis.yml
```
--------------------------------
### Build Transitous Container
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Builds the Docker container image for Transitous using the provided Containerfile. This image is used for fetching and importing data.
```bash
podman build . -t transitous -f ci/container/Containerfile
```
--------------------------------
### Download OSM Map Data
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Downloads a specific OpenStreetMap PBF file (e.g., Berlin, Germany) from Geofabrik for use with the MOTIS server.
```bash
wget https://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf -P out
```
--------------------------------
### Update Git Submodule
Source: https://github.com/public-transport/transitous/blob/main/docs/docs/index.md
Fetches the latest version of the transitland-atlas submodule. Ensure you have a local copy before running.
```bash
git submodule update --remote --checkout --init
```