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
Function Plotter✨

Function-Plotter Build With : Python PyQt5 unittest matplotlib Getting Started This is an list of needed instructions to set up your project locally,

Ahmed Lotfy 3 Jan 06, 2022
pyToledo is a Python library to interact with the common virtual learning environment for the Association KU Leuven (Toledo).

pyToledo pyToledo is a Python library to interact with the common virtual learning environment for the Association KU Leuven a.k.a Toledo. Motivation

Daan Vervacke 5 Jan 03, 2022
Calculate the efficient frontier

关于 代码主要参考Fábio Neves的文章,你可以在他的文章中找到一些细节性的解释

Wyman Lin 104 Nov 11, 2022
Camera track the tip of a pen to use as a drawing tablet

cablet Camera track the tip of a pen to use as a drawing tablet Setup You will need: Writing utensil with a colored tip (preferably blue or green) Bac

14 Feb 20, 2022
The Ultimate Widevine Content Ripper (KEY Extract + Download + Decrypt) is REBORN

NARROWVINE-REBORN ** UPDATE 21.12.01 ** As expected Google patched its ChromeCDM Whitebox exploit by Satsuoni with a force-update on the ChromeCDM. Th

Vank0n 104 Dec 07, 2022
A basic notes app to store your notes.

Notes Webapp A basic notes webapp to keep your notes.You can add, edit and delete notes after signing up. To add a note type your note in the text box

2 Oct 23, 2021
Python script to automate the change of desktop background

wallomator Python script to automate the change of desktop background A python script that automates the process of changing the desktop background. I

Mohammed Haaris Javed 10 Jun 16, 2022
Simplified web browser made in python for a college project

Python browser Simplified web browser made in python for a college project. Web browser has bookmarks, history, multiple tabs, toolbar. It was made on

AmirHossein Mohammadi 9 Jul 25, 2022
Stop python warnings, no matter what!

SHUTUP - Stop python warnings, no matter what! Sometimes you just can't mute python warnings. Use this library to solve this. Installation pip install

80 Jan 04, 2023
Better Giveaways is a bot that will change the experience of using a giveaway bot forever.

Better-Giveaways Better Giveaways is a bot that will change the experience of using a giveaway bot forever. VoxelBotUtils/Novus, latest PyPi releases

Lightning 2 Jan 12, 2022
Use a real time weather API to apply wind to your mouse cursor.

wind-cursor Use a real time weather API to apply wind to your mouse cursor. Requirements PyAutoGUI pyowm Usage This program uses the OpenWeatherMap AP

Andreas Schmid 1 Feb 07, 2022
Random Turkish name generator with realistic probabilities.

trnames Random Turkish name generator with realistic probabilities. Based on Trey Hunner's names package. Installation The package can be installed us

Kaan Öztürk 20 Jan 02, 2023
FBChecker Account using python , package requests and web old facebook

fbcek FBChecker Account using python , package requests and web old facebook using python 3.x apt upgrade -y apt update -y pkg install bash -y pkg ins

XnuxersXploitXen 5 Dec 24, 2022
The Official interpreter for the Pix programming language.

The official interpreter for the Pix programming language. Pix Pix is a programming language dedicated to readable syntax and usability Q) Is Pix the

Pix 6 Sep 25, 2022
CBLang is a programming language aiming to fix most of my problems with Python

CBLang A bad programming language made in Python. CBLang is a programming language aiming to fix most of my problems with Python (this means that you

Chadderbox 43 Dec 22, 2022
Linux Pressure Stall Information (PSI) Status App

Linux Pressure Stall Information (PSI) Status App psistat is a simple python3 program to display the PSIs and to capture/display exception events. psi

Joe D 3 Sep 18, 2022
A minimalist starknet amm adapted from StarkWare's amm.

viscus • A minimalist starknet amm adapted from StarkWare's amm. Directory Structure contracts

Alucard 4 Dec 27, 2021
A collection of some leetcode challenges in python and JavaScript

Python and Javascript Coding Challenges Some leetcode questions I'm currently working on to open up my mind to better ways of problem solving. Impleme

Ted Ngeene 1 Dec 20, 2021
Simple card retirement plugin for Anki

Anki Retirement Addon Allow users to suspend, tag, delete, or move cards that reach a specific retirement interval Supports Anki version 2.1.45 Licens

3 Dec 23, 2022
Runnable Python demo of ArtLine

artline-demo How to run? pip3 install -r requirements.txt python3 app.py How to use? Run the Flask app Open localhost:5000 in browser Select an image(

Jiang Wenjian 134 Jul 29, 2022