{"id":13557919,"url":"https://github.com/Gandi/baobab","last_synced_at":"2025-04-03T12:31:22.994Z","repository":{"id":33947691,"uuid":"37673925","full_name":"Gandi/baobab","owner":"Gandi","description":"DEPRECATED - The application that powers Gandi's Status website (status.gandi.net).","archived":true,"fork":false,"pushed_at":"2020-03-10T10:55:28.000Z","size":1657,"stargazers_count":99,"open_issues_count":9,"forks_count":10,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-11-04T08:36:52.575Z","etag":null,"topics":["deprecated","gandi","obsolete"],"latest_commit_sha":null,"homepage":"https://status.gandi.net","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"alphagov/digitalmarketplace-admin-frontend","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gandi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-18T17:23:04.000Z","updated_at":"2024-10-23T07:45:51.000Z","dependencies_parsed_at":"2022-07-13T18:20:42.688Z","dependency_job_id":null,"html_url":"https://github.com/Gandi/baobab","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fbaobab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fbaobab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fbaobab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gandi%2Fbaobab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gandi","download_url":"https://codeload.github.com/Gandi/baobab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247002315,"owners_count":20867443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deprecated","gandi","obsolete"],"created_at":"2024-08-01T12:04:37.318Z","updated_at":"2025-04-03T12:31:20.370Z","avatar_url":"https://github.com/Gandi.png","language":"Python","funding_links":[],"categories":["Python","others"],"sub_categories":[],"readme":"# DEPRECATED.\n\nThis project is deprecated and will not receive new features or fixes. Use it at your own risks.\n\n\n# Gandi Baobab\n\nThe application that powers Gandi's Status website ([status.gandi.net](https://status.gandi.net)).\n\n## OVERVIEW\n\nBaobab is a Python and web application divided into 3 parts:\n - a Django-powered back-end (`./baobab/backoffice` and `./baobab/translate`)\n - a REST API (`./baobab/apirest`)\n - a web client that uses the REST API (`./baobab.front`)\n\nIt has 5 app namespaces that allow you to work (test, migrate, etc.) on specific parts: `backoffice`, `apirest`, `rss`, `translate` and `socialnetwork`.\n\nBaobab requires a database and supports SQLite, PostgreSQL or MySQL. \n\nNode.js and npm are required to build the web client app.\n\nCron jobs are used to publish Tweets and close events on a schedule.\n\n## DEVELOPMENT\n\n### INSTALLATION\n\nClone the repository and enter the local directory that was just created.\n\nWe recommend using [virtualenv](https://virtualenv.pypa.io/en/latest/) to manage local python environments.\n\n    $ virtualenv /some/directory/virtual\n    $ source /some/directory/virtual/bin/activate\n    $ python setup.py install\n\nA `$ baobab` command should be available after install. Otherwise, please try to use it from the installation directory:\n  \n    $ cd /some/directory/virtual/lib/python2.7/dist-packages/baobab/bin\n    $ ./cmd_baobab.py \u003c...\u003e\n  \nThis can be caused by an error in `django-tastypie`'s `setup.py` distributed in the Debian package.\n\n**Note for Gnome users**: A \"baobab\" command can already exist in your system (Disk Usage Analyzer), so make sure you use virtualenv as recommended.\n\n### APPLICATION SETTINGS\n\nThe settings file is located in `./baobab/settings.py`. **Make sure you edit this file to setup your installation**.\n\nIn it, you can define some default data such user and admin accounts, as well as important options such as the `SECRET_KEY`, default time zones or to change `DEBUG=False` when not in development.\n\nFor production (actually, whenever `DEBUG is not True`) you need to authorize your hosts by editing `ALLOWED_HOSTS = []`.\n\nMore information on Django settings can be found [in the docs](https://docs.djangoproject.com/en/1.4/ref/settings).\n\n#### Using a custom settings file\n\nFor example, create a Python package at `/etc/baobab/__init__.py` and your settings module file at `/etc/baobab/settings.py`.\n\nYou can make sure your package will be in your Python's path by exporting it\n\n    $ export PYTHONPATH=/etc\n    \nThen you can use the `--settings` flag, like so:\n\n    $ baobab \u003ccommand\u003e --settings baobab.settings\n    \nAlternatively, you can set Django's buit-in environment variable\n\n    $ export DJANGO_SETTINGS_MODULE=baobab.settings\n    $ baobab \u003ccommand\u003e\n\n### BUILD THE WEB CLIENT\n\nInstall the web client's dependencies and build the app\n\n    $ npm install\n    $ npm run dev\n\n### SETUP THE DATABASE\n\nLoad the schema and create the default data\n\n    $ baobab setup-dev\n\nBy default, a SQLite database file will be created at `./baobab/default.db` if it doesn't exist.\n\n### LAUNCH THE SERVER\n\nTo launch the web server with the admin interface and REST API :\n\n    $ baobab runserver\n\nOr  `$ ./baobab/bin/cmd_baobab.py runserver` if you've built the debian package.\n\nOpen your browser at `http://localhost:8000/` to see the website. The admin page is accessible at `http://localhost:8000/admin`.\n\n### API USAGE\n\nIn addition to the web client, Baobab is also usable via a REST API that delivers content in JSON format. \n\nThe API is self-described, so you can start exploring it by making a simple request to the main endpoint.\n\nExample:\n\n    $ curl http://localhost:8000/api | python -m json.tools\n\n    {\n        \"events\": {\n            \"list_endpoint\": \"/api/events\",\n            \"schema\": \"/api/events/schema\"\n        },\n        \"services\": {\n            \"list_endpoint\": \"/api/services\",\n            \"schema\": \"/api/services/schema\"\n        },\n        \"status\": {\n            \"list_endpoint\": \"/api/status\",\n            \"schema\": \"/api/status/schema\"\n        }\n    }\n\n\n### UPDATING THE DATABASE MODEL\n\nFollow this simple process to modify the database structure. Migrations are managed with [South](http://south.aeracode.org/).\n\n1. Modify the application's models\n2. Create schema migration files\n3. Create data migration files if necessary\n4. Apply the migrations\n\n#### Changing the model\n\nUpdate `models.py` in the appropriate app folder to add / remove fields and/or tables (for example `./baobab/backoffice/models.py`).\n\n#### Creating a schema migration\n\n    $ baobab schemamigration \u003cnamespace\u003e --auto\n\n**Tip**: Remember to use `db.rename_column` in a migration script to rename a field.\n\n#### Creating a data migration \n\n    $ baobab datamigration \u003cnamespace\u003e \u003cdata_migration_name\u003e\n\n#### Running migrations\n\n    $ baobab migrate  \n\n**Tip**: when switching branches, you might forget to rollback or apply relevant migrations. You can avoid that by adding a git hook. See some examples in`./misc/hooks/*`.\n\n### OVERRIDING THE DEFAULT USER\n\nYou can override the default user login credentials by setting the `DEFAULT_USER_LOGIN` and `DEFAULT_USER_PASSWORD` variables.\n\nIf these variables are not set when the setup scripts are run, you will be prompted to create a default user.\n\n### Social network integrations: Twitter, IRC, etc.\n\n#### Custom integrations\n\nAt the moment baobab can publish status updates to Twitter and IRC, but you can easily add your own integrations.\nYou only need to create a new class in the `socialnetwork` app and inherit from the `SocialNetworkBase` class.\n\nEach social network has its own configuration. Please take a look at the `settings.py` file for more information.\n\nUpon the creation of an `Event`, a status update will be immediately published to each configured integration.\n\n#### Maintenance\n\nWhen the event is of the `Maintenance` type, baobab can publish a status update automatically at the estimated start date.\nSimply create a cron task to execute `$ baobad social_network` to achieve this.\n\n### TRANSLATIONS\n \nYou can easily translate content published with Baobab and retrieve translated content via the API.\n\nSpecial user permissions can be granted for translators (add them into the \"translate\" group), and the translation interface is available in the backoffice at http://localhost:8000/admin/translate.`\n\n**Note**: The \"translate\" group might be missing the real permissions: just add all the permissions about the \"translate\" app.\n\nYou can then retrieve translated content by adding the \"Accept-Language\" header to your API requests. If you don't, Baobab automatically falls back to English (the default language).\n\nFor example:\n\n    curl -H \"Accept-Language: fr\" http://localhost:8000/api/events\n\nPlease note that while the web client can consume translated content (browsers will automatically send the `Accept-Language` header according to the user's language), the web interface itself is not localised (nor localisable in the current state of the implementation).\n\n### TESTING\n\nYou can run unit tests on specific namespaces or the whole app. No configuration is necessary for this.\n\n    $ baobab test \u003cnamespace\u003e\n\nNote the `translate` namespace has no dedicated testing suite. The translation features are tested within the `apirest` namespace.\n\n## PRODUCTION USAGE\n\nIn a production environment, you'll want to use different settings and technologies to better serve your app securily at scale.\n\nWe use Gunicorn as the app server, along with Nginx to proxy HTTP requests, instead of just running Django's webserver.\n\nAn example Gunicorn config for Baobab could look like this:\n\n```\nCONFIG = {\n    'working_dir': '/srv/baobab',\n    'environment': {\n        'DJANGO_SETTINGS_MODULE': 'myown.settings',\n        'PYTHONPATH': '/etc/'\n    },\n    'args': (\n        '--bind=127.0.0.1:8008',\n        '--workers=4',\n        '--timeout=10',\n        'baobab.wsgi:application',\n    ),\n}\n\n```\n\nYour production-ready settings file would then reside in `/etc/myown/settings.py`, along with the Python package file `/etc/myown/__init__.py`.\n\nAlso check the `nginx/sites-available/` folder for our sample Nginx configuration files.\n\nYou could also use MySQL or PostgreSQL as database backends instead of SQLite, for example.\n\n### Manual deploy\n\nAfter copying the application files to the server, install the web client's dependencies and build it for release (repeat whenever these assets change)\n\n    $ npm install\n    $ NODE_ENV=production npm run release\n\nThen, setup the database and run migrations (repeat whenever the model changes)\n\n    $ baobab syncdb\n    \nNow you can start or restart your chosen webserver solution.\n\n### Debian package\n\nBaobab can also be built into a Debian package, which is useful for production deployments on compatible systems. Gandi's own packaging details can be found in the `debian/` folder.\n\nTo build the package:\n\n    $ debuild -us -uc -b || dpkg-buildpackage -us -uc -b\n\nYou can then place it on a Production server and install it. All scripts will be automatically launched. You can then start or restart the app and web servers.\n\n## CONTRIBUTING\n\n### Create issues\n\nAny major changes should be documented as [a GitHub issue](#) before you start working on it.\n\n### Proposing your changes\n\nDon't hesitate -- we appreciate every contribution, no matter how small.\n\nCreate a git branch with your new feature or bugfix and either (in order of preference):\n\n* open a Pull Request on GitHub\n* mail the patch to feedback@gandi.net,\n* send the URL for your branch and we will review/merge it if correct\n\nWe'll check your pull requests in the timeliest manner possible. If we can't accept your PR for some reason,\nwe'll give you feedback and you're encouraged to try again!\n\n### Submission conventions\n\nFork the repository and make changes on your fork in a feature branch:\n\n- If it's a bug fix branch, name it XXXX-something where XXXX is the number of the issue.\n- If it's a feature branch, create an enhancement issue to announce your intentions, and name it XXXX-something where XXXX is the number of the issue.\n\n#### Tests\n\nSubmit unit tests for your changes. Run the full test suite on your branch before submitting a pull request.\n\n#### Documentation\n\nUpdate the documentation when creating or modifying features.\n\n## Code status\n\n[![Build Status](https://travis-ci.org/Gandi/baobab.svg?branch=master)](https://travis-ci.org/Gandi/baobab)\n[![Coverage Status](https://coveralls.io/repos/Gandi/baobab/badge.svg?branch=master)](https://coveralls.io/r/Gandi/baobab?branch=master)\n\n## LICENSE\n\nPlease see the `LICENSE` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGandi%2Fbaobab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGandi%2Fbaobab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGandi%2Fbaobab/lists"}