Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

API to control your devices on your network and make all your automation scripts available at one place

License

Notifications You must be signed in to change notification settings

JeffLabonte/ideal-octo-telegram

Repository files navigation

CI codecov

ideal-octo-telegram

API to control your devices on your network and make all your automation scripts available at one place

Requirements:

  • Docker
  • Docker-Compose
    • Version >= 1.28
      • sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
  • Ansible:
    • To Deploy on your own servers
  • Python 3.9
  • Postgresql
  • Poetry

Getting Started:

  • Install some postgresql dependencies to compile the code:
    • On Linux:
      • Ubuntu/Debian: sudo apt install libpq-devel python3-dev
      • Fedora 34: sudo dnf install libpq-devel python-devel
    • On macOS:
      • brew install postgresql
  • Before running make install

Stuff to Know:

  • You can register a user on /api/auth/registration
  • Prod build run on port80
  • You can build images by running docker-compose build

How to run API Docs locally:

This project uses django-spectacular to generate its doc.

You can generate the API docs by running the following command:

make generate_docs

then you need to run a server to host this doc, I am using the container proposed in the django-spectacular documentation.

You can run the local server by running this command:

make run_docs

Deployment with Ansible:

If you are here, I consider that you have docker and docker-compose installed on your server

You need to copy the hosts.yml.example. You can do that my running the following command:

make copy_new_config

The hosts.yml can take that form:

webservers:
  hosts:
    server_a:
      ansible_connection: ssh
      ansible_host: "<the IP address or hostname>"
      ansible_user: "<User to use>"
      ansible_password: "<User's password>"
      ansible_become_password: "<sudo password>"

Note: You can use ansible-vault to encrypt your hosts.yml Run the playbook:

# If deploy/hosts.yml is encrypted with ansible-vault
ansible-playbook -i deploy/hosts.yml deploy/deploy_code.yml --ask-vault-pass

# If deploy/hosts.yml is not encrypted with ansible-vault
ansible-playbook -i deploy/hosts.yml deploy/deploy_code.yml -e "DATABASE_USER=a_database_username" -e "DATABASE_PASSWORD=a_long_password" -e
"DATABASE_NAME=ideal-octo-telegram"

About

API to control your devices on your network and make all your automation scripts available at one place

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published