Git Product home page Git Product logo

utilities's Introduction

Goals

Main idea that project to create simple utility scripts to used them in routine jobs.

How to install

local dev environment

If you want just test utilities or run it in your machine without docker containers you can just install local dev environment

> sudo apt install python3.10
> sudo apt install python3.10-venv
> python3.10 -m venv .dev-3.10
> source .dev-3.10/bin/activate
> python -m pip install -r setup/requirements_dev.txt

Build docker container

> docker build -f setup/notify.Dockerfile -t notify_changed_ip:latest .

List of utilities and how to run them

Notify changed IP

Environment variables used in .env file

We use pydantic approach for parsing .env file. Supported parameters:

Currently we support only PostgreDB. Parameters for setting connect to database:

DB_SETTINGS__HOST = "127.0.0.1"
DB_SETTINGS__PORT = 5432
DB_SETTINGS__DB = "notifier"
DB_SETTINGS__USER = "user"
DB_SETTINGS__PASSWORD = "passowrd"

Parameters for setting email notification:

EMAIL_SETTINGS__SMTP_INSTANCE = "smtp.gmail.com"
EMAIL_SETTINGS__SMTP_PORT = 587
EMAIL_SETTINGS__SENDER_ADDRESS = "[email protected]"
EMAIL_SETTINGS__SENDER_PASSWORD = "sender_password"
EMAIL_SETTINGS__TARGET_ADDRESS = "[email protected]"

Using command line

> python src/notify_changed_ip/app.py

Using docker-compose

This utility used like as job. So it's pass only once. Before run you also should create .env file with your parameters and place it next to docker-compose.yml

> docker-compose -f setup/docker-compose/docker-compose.yml up

Using kubernetes

This utility used like as job. So it's pass only once by crone. First of all you need to create .env file with your parameters and place it next to kubernetes yamls

Then if you try to use in local machine then Before run kubernates yamls you need to start minikube

> minikube start

After that you can go to k8s falder start kubernetes by bash script

> cd setup/k8s
> ./start.sh

utilities's People

Contributors

sokol88-dap avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.