Web service which feeds Navitia with real-time disruptions

Overview

Chaos

Chaos is the web service which can feed Navitia with real-time disruptions. It can work together with Kirin which can feed Navitia with real-time delays.

chaos schema global

API Documentation

OpenAPI

Published on https://canaltp.github.io/Chaos

How to contribute?

The documentation is maintained in OpenAPI format in documentation/swagger.yml. To test the website which will be published on GitHub pages, use the tool Act and run

act -W .github/workflows/publish_documentation.yml

The last step (publication to GitHub) will fail as intended since it is a local test. The website has been built during previous steps. Browse the documentation by opening the file documentation/slate/build/index.html.

FAQ

For french users, you can see this FAQ

Installation

The hard way

Clone the Chaos repository

git clone [email protected]:CanalTP/Chaos.git
cd Chaos

Requirements

  • PostgreSQL 9.6 sudo apt-get install postgresql-9.6 postgresql-server-dev-9.6 libpq-dev
  • RabbitMQ
Python
  • Install Python2.7 sudo apt-get install python2.7 python2.7-dev

    or sudo apt install python2 python2-dev on recent linux release

  • Install pip

  • Install virtualenv

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Install & build protobuf

  • Install protobuf

You can use sudo apt-get install protobuf-compiler if you're sure it won't install version 3.x.x (incompatible).

Or install protoc building it from source : protobuf v2.6.1. After download, from inside the unziped folder :

./configure
make
make install
ldconfig
make clean

Check your version

protoc --version
  • Build protobuf, back into Chaos project folder
git submodule init
git submodule update
./setup.py build_pbf

Create the database

sudo -i -u postgres
# Create a user
createuser -P navitia
(password "navitia")

# Create database
createdb -O navitia chaos

# Create database for tests
createdb -O navitia chaos_testing
ctrl + d

Cache configuration

To improve its performance Chaos can use Redis.

Install Redis

Installing Redis

Using Chaos without Redis

You can deactivate Redis usage in default_settings.py by changing 'CACHE_TYPE' to 'simple'

Using Chaos without cache

For development purpose you can deactivate cache usage in default_settings.py by forcing 'CACHE_TYPE' to 'null'

Run Chaos with honcho (optional)

Install honcho

You can use honcho for managing Procfile-based applications.

pip install honcho
Upgrade database
honcho run ./manage.py db upgrade
RabbitMQ (optional)

RabbitMQ is optional and you can deactivate it if you don't want to send disruptions to a queue.

# chaos/default_settings.py
ENABLE_RABBITMQ = False
Run Chaos
honcho start

The easy way (with Docker)

git clone [email protected]:CanalTP/Chaos.git
cd Chaos
git submodule init
git submodule update
docker-compose up -d

To watch logs output:

docker-compose logs -f

Chaos will be accessible on http://chaos_ws_1.docker if you are using the docker-gen-hosts tool, it will also be accessible on http://chaos-ws.local.canaltp.fr The database will be accessible at 'chaos_database_1.docker' and default RabbitMQ interface at 'http://chaos_rabbitmq_1.docker:15672'.

Security (optional)

If you want to add more security, you can add a file chaos/clients_tokens.json with the client code and navitia tokens like:

{
   "client_code": [
     "navitia_token1",
     "navitia_token2"
   ]
 }

client_code should be the same as the value of X-Customer-Id header in HTTP request and token should be the same as the value of Authorization header in HTTP request If the file doesn't exist, the security will be disabled.

You can add a 'master' key in the file. It will allow you to access all resources for all clients.

Tests

Unit tests

cd tests
honcho run nosetests

Functional tests

cd tests
honcho run lettuce

To stop directly on faulty test

cd tests
honcho run lettuce --failfast

With docker

docker-compose -f docker-compose.test.yml build --pull
docker-compose -f docker-compose.test.yml up -d
docker-compose -f docker-compose.test.yml exec -T chaos /bin/sh ./docker/tests.sh
docker-compose -f docker-compose.test.yml down --remove-orphans

Copyright

Copyright © since 2001, Kisio Digital and/or its affiliates. All rights reserved. This project is part of Navitia surround, the sprawling API to build cool stuff with public transport.

Hope you'll enjoy and contribute to this project, powered by Kisio Digital (www.kisio.com).

Help us simplify mobility and open public transport: a non ending quest to the responsive locomotion way of traveling !

Licence

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Stay tuned

Twitter @navitia

Tchat channel #navitia on riot

Forum Navitia on googlegroups

www.navitia.io

You might also like...
Simple web application, which has a single endpoint, dedicated to annotation parsing and convertion.

Simple web application, which has a single endpoint, dedicated to annotation parsing and conversion.

A "multiclipboards" script for an efficient way to improve the original clipboards which are only able to save one string at a time

A "multiclipboards" script for an efficient way to improve the original clipboards which are only able to save one string at a time. Works on both Windows and Linux.

Flask-built web application that simulates a time and cost calculator for charging Electric Vehicles.

ev_charging_calculator Flask-built web application that simulates a time and cost calculator for charging Electric Vehicles. The project aims to simul

OnTime is a small python that you set a time and on that time, app will send you notification and also play an alarm.

OnTime Always be OnTime! What is OnTime? OnTime is a small python that you set a time and on that time, app will send you notification and also play a

Shutdown Time - A pretty much useless application that allows you to shut your computer down in x time with a GUI.
Shutdown Time - A pretty much useless application that allows you to shut your computer down in x time with a GUI.

A pretty much useless application that allows you to shut your computer down in x time with a GUI. Should eventually support Windows (all versions), Linux (v2.0+), MacOS (probably with Linux, idk)

A simple service that allows you to run commands on the server using text

Server Text A simple flask service that allows you to run commands on the server/computer over sms. Think of it as a shell where you run commands over

VirtualBox Power Driver for MAAS (Metal as a Service)
VirtualBox Power Driver for MAAS (Metal as a Service)

vboxpower VirtualBox Power Driver for MAAS (Metal as a Service) A way to manage the power of VirtualBox virtual machines via the MAAS webhook driver.

An alternative site to emplea.do due to inconsistent service of the app.

feline a agile and fast alternative to emplea.do License: MIT Settings Moved to settings. Basic Commands Setting Up Your Users To create a normal user

Simple Denial of Service Program yang di bikin menggunakan bahasa pemograman Python,

Peringatan Tujuan kami share code Indo-DoS hanya untuk bertujuan edukasi / pembelajaran! Dilarang memperjual belikan source ini / memperjual-belikan s

Releases(v1.4.1)
  • v1.4.1(Mar 25, 2022)

    What's Changed

    • Proto share message notification false by @dvdn in https://github.com/CanalTP/Chaos/pull/522

    Full Changelog: https://github.com/CanalTP/Chaos/compare/v1.4.0...v1.4.1

    Source code(tar.gz)
    Source code(zip)
  • v1.4.0(Mar 23, 2022)

    What's Changed

    • Add sorting feature on disruptions/_search API by @tchevily in https://github.com/CanalTP/Chaos/pull/504
    • [DOC] Message notification_date addition by @dvdn in https://github.com/CanalTP/Chaos/pull/505
    • DOC: "status" removed from PUT and POST /disruptions. by @Msaglier in https://github.com/CanalTP/Chaos/pull/507
    • [Notification Date] manage notification_date by message by @dvdn in https://github.com/CanalTP/Chaos/pull/506
    • Swagger doc version++ by @Msaglier in https://github.com/CanalTP/Chaos/pull/509
    • Feature notification_date by Message by @dvdn in https://github.com/CanalTP/Chaos/pull/508
    • [Feature] multi messages on same channel by @dvdn in https://github.com/CanalTP/Chaos/pull/510
    • Filter impacts with severities by @tchevily in https://github.com/CanalTP/Chaos/pull/515
    • Bump protobuf from 2.6.0 to 3.15.0 by @dependabot in https://github.com/CanalTP/Chaos/pull/513
    • chaos proto update by @dvdn in https://github.com/CanalTP/Chaos/pull/514
    • Protobuff downgrade by @Msaglier in https://github.com/CanalTP/Chaos/pull/518
    • Add id field to impact messages by @tchevily in https://github.com/CanalTP/Chaos/pull/516
    • Add read only by @pthegner in https://github.com/CanalTP/Chaos/pull/519
    • Now send_notification accept null value by @Fahmus in https://github.com/CanalTP/Chaos/pull/520

    Full Changelog: https://github.com/CanalTP/Chaos/compare/v1.3.5...v1.4.0

    Source code(tar.gz)
    Source code(zip)
  • v1.3.5(Dec 27, 2021)

    What's Changed

    • Redoc integration by @martinraynov in https://github.com/CanalTP/Chaos/pull/489
    • Add Navitia Logo in the swagger file by @martinraynov in https://github.com/CanalTP/Chaos/pull/490
    • Documentation generation GitHub action by @martinraynov in https://github.com/CanalTP/Chaos/pull/491
    • Push to gh-pages by @martinraynov in https://github.com/CanalTP/Chaos/pull/492
    • Fix sonarcloud errors by @Fahmus in https://github.com/CanalTP/Chaos/pull/493
    • [documentation] use slate engine by @pascal-vs in https://github.com/CanalTP/Chaos/pull/495
    • Update test.jenkinsfile by @pthegner in https://github.com/CanalTP/Chaos/pull/496
    • Add drafts API by @pthegner in https://github.com/CanalTP/Chaos/pull/503

    New Contributors

    • @martinraynov made their first contribution in https://github.com/CanalTP/Chaos/pull/489
    • @pascal-vs made their first contribution in https://github.com/CanalTP/Chaos/pull/495

    Full Changelog: https://github.com/CanalTP/Chaos/compare/v1.3.4...v1.3.5

    Source code(tar.gz)
    Source code(zip)
  • v1.3.4(Sep 13, 2021)

  • v1.3.3(Sep 7, 2021)

  • v1.3.2(Aug 19, 2021)

    Fix order severity and updated impact #486

    :exclamation: Note : this release includes a data migration on Severity. From now-on default value is '0'. All existing 'NULL' values in this table is transformed into '0'.

    Source code(tar.gz)
    Source code(zip)
  • v1.3.1(Aug 16, 2021)

  • v1.3.0(Jun 17, 2021)

  • v1.2.33(Jun 17, 2021)

    #472 : Disable the requirement of line_section id #473 : Update documentation on install protobuff #477 : Add index that improve some performance #483 : Add new disruption type "unexpected" (use only for filter / display)

    Source code(tar.gz)
    Source code(zip)
  • v1.2.32(Mar 23, 2021)

  • v1.2.31(Feb 8, 2021)

    Persist 'timezone' information into 'pattern' #460 Chaos: Publish application period period pattern if present #454

    [exports api] order for export list #452

    [Tests auto] new JDR data #451 [Tests auto] Refs #BOT-2230 Now we use test.jenkinsfile for test #449

    Return error from authorization navitia #450 Doc: application_periods required for impact creation #453

    Clean line_section (step 3/3) update chaos-proto (#444)

    Source code(tar.gz)
    Source code(zip)
  • v1.2.30(Aug 25, 2020)

    #443 : Clean line section with migrate file #442 : Fix empty pt object filter on impacts/_search API #439 : [docker] patch UWSGI to allow http 'chunked' #438 : DOC: x-contributors and x-customer-id update. #437 : [Doc] Install on recent linux distro #436 : Doc explaining Client Contributor

    Source code(tar.gz)
    Source code(zip)
  • v1.2.29(Apr 6, 2020)

  • v1.2.28(Mar 16, 2020)

  • v1.2.27(Feb 19, 2020)

  • v1.2.26(Feb 3, 2020)

  • v1.2.25(Jan 21, 2020)

    https://github.com/CanalTP/Chaos/pull/429 Newrelic update https://github.com/CanalTP/Chaos/pull/428 Add single quote in ptobject not found error message https://github.com/CanalTP/Chaos/pull/430 #BOT-1795 - Bugfix when we post or put a disruption with invalid cause id

    Source code(tar.gz)
    Source code(zip)
  • v1.2.24(Dec 17, 2019)

    new route POST contributor (#427)

    Channels required resolution (#426) Add single quote in ptobject not found error message (#428) Bugfix when we POST or PUT disruption with cause of another client (#425)

    Source code(tar.gz)
    Source code(zip)
  • v1.2.23(Nov 25, 2019)

    #420 GET [Disruptions] native SQL requests

    #424 [Disruptions] Display 20 impacts by default instead of 10 #422 [Disruptions] Display all impacts but non archived #423 Patch some comments copyrights

    Source code(tar.gz)
    Source code(zip)
  • v1.2.22(Nov 15, 2019)

  • v1.2.21(Nov 13, 2019)

    #419 feature-bot-1652-delete-cause

    #413 #418 Update swagger 2 to openapi 3

    #411 feature-BOT-1306-simplify-export CSV

    #414 Add line_section validation entry #417 patch-wording-resol

    Source code(tar.gz)
    Source code(zip)
  • v1.2.20(Oct 25, 2019)

  • v1.2.18(Sep 23, 2019)

    https://github.com/CanalTP/Chaos/pull/404 Update the key cache ptobject navitia search https://github.com/CanalTP/Chaos/pull/405 Return ptobject error on stoparea of line_section

    Source code(tar.gz)
    Source code(zip)
  • v1.2.17(Sep 9, 2019)

  • v1.2.16(Aug 22, 2019)

  • v1.2.15(Jul 23, 2019)

  • v1.2.14(Jun 18, 2019)

  • v1.2.13(Jun 7, 2019)

  • v1.2.12(Jun 6, 2019)

  • v1.2.11(May 29, 2019)

Owner
KISIO Digital
Captain of Navitia
KISIO Digital
Driving lessons made simpler. Custom scheduling API built with Python.

NOTE This is a mirror of a GitLab repository. Dryvo Dryvo is a unique solution for the driving lessons industry. Our aim is to save the teacher’s time

Adam Goldschmidt 595 Dec 05, 2022
GWAS summary statistics files QC tool

SSrehab dependencies: python 3.8+ a GNU/Linux with bash v4 or 5. python packages in requirements.txt bcftools (only for prepare_dbSNPs) gz-sort (only

21 Nov 02, 2022
Expense Tracker is a very good tool to keep track of your expenseditures and the total money you saved.

Expense Tracker is a very good tool to keep track of your expenseditures and the total money you saved.

Shreejan Dolai 9 Dec 31, 2022
A simple Python script for generating a variety of hashes from safe urandom entropy.

Hashgen A simple Python script for generating a variety of hashes from safe urandom entropy. For whenever you need a random hash (e.g. generating an a

Xanspie 1 Feb 17, 2022
A middle-to-high level algorithm book designed with coding interview at heart!

Hands-on Algorithmic Problem Solving A one-stop coding interview prep book! About this book In short, this is a middle-to-high level algorithm book de

Li Yin 1.8k Jan 02, 2023
Weakly-Divisable - Takes an interger and seee if it is weakly divisible by seven

Weakly Divisble Project by Diana Arce-Hernandez, Ryan McAlpine, and Rommel Ravan

Diana Arce-Hernandez 1 Jan 12, 2022
A Desktop application for the signalum python library

Signalum Desktop A Desktop application on the Signalum Python Library/CLI Tool. The Signalum Desktop application is an attempt to develop a single too

BISOHNS 35 Feb 15, 2021
All solutions for the 2021 Advent of Code event.

Advent of Code 2021 Solutions All solutions for the 2021 Advent of Code event. Setup Create a file called .session. Go to adventofcode.com and copy th

Bruce Berrios 6 Dec 26, 2021
This project recreates the R-based RCy3 Cytoscape Automation library as a Python package.

Python library for calling Cytoscape Automation via CyREST

Cytoscape Consortium 40 Dec 22, 2022
LiteX-Acorn-Baseboard is a baseboard developed around the SQRL's Acorn board (or Nite/LiteFury) expanding their possibilities

LiteX-Acorn-Baseboard is a baseboard developed around the SQRL's Acorn board (or Nite/LiteFury) expanding their possibilities

33 Nov 26, 2022
A QGIS integration plugin for Kart repositories

QGIS Kart Plugin A plugin to work with Kart repositories Installation The Kart plugin is available in the QGIS Plugins server. To install the latest v

Koordinates 27 Jan 04, 2023
A collection of tips for using MISP.

MISP Tip of the Week A collection of tips for using MISP. Published via BelgoMISP (todo) and this repository. Available in MD and JSON. Do you want to

Koen Van Impe 52 Jan 07, 2023
The bidirectional mapping library for Python.

bidict The bidirectional mapping library for Python. Status bidict: has been used for many years by several teams at Google, Venmo, CERN, Bank of Amer

Joshua Bronson 1.2k Dec 31, 2022
Originally used during Marketplace.tf's open period, this program was used to get the profit of items bought with keys and sold for dollars.

Originally used during Marketplace.tf's open period, this program was used to get the profit of items bought with keys and sold for dollars. Practically useless for me now, but can be used as an exam

BoggoTV 1 Dec 11, 2021
This is a database of 180.000+ symbols containing Equities, ETFs, Funds, Indices, Futures, Options, Currencies, Cryptocurrencies and Money Markets.

Finance Database As a private investor, the sheer amount of information that can be found on the internet is rather daunting.

Jeroen Bouma 1.4k Dec 31, 2022
Cross-platform .NET Core pre-commit hooks

dotnet-core-pre-commit Cross-platform .NET Core pre-commit hooks How to use Add this to your .pre-commit-config.yaml - repo: https://github.com/juan

Juan Odicio 5 Jul 20, 2021
🌌A Python library to exhaustively enumerate a combinatorial space represented by a function

exhaust A Python library to exhaustively enumerate a combinatorial space represented by a function. The API is modelled after Python's random module a

Maik Riechert 1 Dec 05, 2021
Weblate is a copylefted libre software web-based continuous localization system

Weblate is a copylefted libre software web-based continuous localization system, used by over 2500 libre projects and companies in more than 165 count

Weblate 7 Dec 15, 2022
Check bookings for TUM libraries.

TUM Library Checker Only for educational purposes This repository contains a crawler to save bookings for TUM libraries in a CSV file. Sample data fro

Leon Blumenthal 3 Jan 27, 2022
An addin for Autodesk Fusion 360 that lets you view your design in a Looking Glass Portrait 3D display

An addin for Autodesk Fusion 360 that lets you view your design in a Looking Glass Portrait 3D display

Brian Peiris 12 Nov 02, 2022