Skip to content

Commit

Permalink
Feature/0.2.0 (#59)
Browse files Browse the repository at this point in the history
* Completely redesigned bot architecture

* Added CI for this branch. Branch: [feature/2.0.0](https://github.com/orenlab/pytmbot/tree/feature/2.0.0)

* Added CI for this branch. Branch: [feature/2.0.0](https://github.com/orenlab/pytmbot/tree/feature/2.0.0)

* Update docs

* Bump version

* Fix some methods request

* Minor change in build process.

* I'm starting to add in-line handlers. I'll start with the swap_info function.

* Deleted the unnecessary import of the docker package

* Make StateFabric class private

* Added update_info inline handler

* Encapsulated critical methods

* Completed the transfer of inline handlers to the new architecture.

* Debugging techniques for container management

* Fix link in docs

* Added buttons to switch to the requested function after successful authentication. There are also some cosmetic improvements.

* Update Dockerfile

* Added docstring

* Fix some errors and bump the version number to Alpha 2.

* Update docs for 0.2.0

* The bot configuration has been converted to the YAML format.

* Delete pytmbot.yaml

* Delete outline.yaml

* An information security incident has occurred. All tokens have been canceled.

* Added support for generating "salt" for the bot config

* Added support for generating "salt" for the bot config

* Launching the bot now using ENTRYPOINT.SH

* Launching the bot now using ENTRYPOINT.SH

* Update ENTRYPOINT.SH

* Update docs for 0.2.0

* Update docs for 0.2.0

* Fix version number

* Updating idna (3.7 -> 3.8)

* The first plugin has prepared basic methods for working with the Outline Server API.

* Added loging and type annotation

* Rename branch and fix actions

* Fix AttributeError: 'list' object has no attribute 'get_secret_value'

* Continue to optimize the code

* Continue to optimize the code

* Update Dockerfile

* Code refactoring

* Added support for bot plugins

* Remove dev code

* refactor: update code in session_manager.py

* refactor: added __all__

* docs: update docker.md and github_registry_install.md

* refactor: --salt arg not needed value

* refactor: remove unused module

* refactor: rewrote and optimized the methods

* refactor: optimization of methods and classes (I have corrected several errors along the way).

* refactor: optimization of methods and classes (I have corrected several errors along the way).

* refactor: _parser.py code optimization

* refactor: global refactoring

* refactor: global refactoring

* refactor: global refactoring

* docs: update all docs

* docs: update README.md and added PLUGINS.md.md

* docs: update docker.md

* feat: monitor plugin added

* feat: monitor plugin added

* feat: update pytmbot.yaml.sample to use latest version of pytmbot

* refactor: change in CI pipeline

* refactor: change in CI pipeline

* deps: pydantic version up and fix app version and description

* chore: fix Dockerfile

* chore: fix Dockerfile

* chore: fix Dockerfile

* chore: fix Dockerfile

* chore: fix Dockerfile

* chore: update CI

* style: Code style improvements

* docs: Update docs

* dep: update dep

* style: Code style improvements

* feat: docker images check update added

* style: Code style improvements

* deps: update dependencies

* feat: update updater module

* style: fix some issues

* fix: some plugins errors fixed

* feat: added more debug information

* style: fix some issues

* deps: update dependencies

* feat: added more debug information

* feat: outline plugin for pytmbot

* dep: update dep

* dep: clean dep list

* style: fix formatting

* feat: Add plugin management system

- Implemented a new system for managing plugins.
- Added methods for registering plugins, fetching plugin names, and descriptions.
- Updated template rendering to display plugin details dynamically.

* feat: Improve plugin handling in handle_plugins function

* chore: Enhance PluginManager with comprehensive documentation

- Added detailed docstrings for PluginManager class and its methods.
- Documented the purpose and usage of each method and attribute.
- Improved error handling descriptions in docstrings.
- Updated _PluginInfo dataclass with attribute descriptions.

* fix: errors in handlers fixed

* docs: update all docs

* docs: update all docs

* docs: added security.md

* chore: code refactoring

* chore: bump version to v0.2.0-rc.1

* chore: reformat code

* docs: update all docs

* docs: update README.md

* chore: remove unused code

* feat: added custom Jinja2 filter

* dep: update emoji (2.12.1 -> 2.13.0) and pytelegrambotapi (4.22.1 -> 4.23.0)

* feat: added emoji in outline plugin

* feat: Added recognition of how the bot is running in a Docker container or not.

* chore: reformat templates

* chore: reformat templates

* chore: added validation into updates.py module

* chore: added expired session cleanup job and Lock in all methods (for security reason)

* docs: update auth_control.md and security.md

* style: fix some errors

* feat: bump version to 0.2.0-rc1
  • Loading branch information
orenlab authored Sep 22, 2024
1 parent 9dab409 commit c0c6a3f
Show file tree
Hide file tree
Showing 197 changed files with 9,943 additions and 7,457 deletions.
53 changes: 35 additions & 18 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,31 @@
#######################################

#######################################
# All envirmoment files
# Environment Files
# Exclude environment directories and configuration files
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
outline.yaml
pytmbot.yaml.sample

#######################################
# All md and DS_Store files
# Documentation and Metadata
# Exclude markdown, DS_Store, and other metadata files
*.md
**/.DS_Store

#######################################
### Python template
# Byte-compiled / optimized / DLL files
# Python Files
# Exclude compiled Python files and packaging artifacts
__pycache__/
**/__pycache__
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
Expand All @@ -45,34 +49,47 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
# Setup requirements
setup_req.txt

#######################################
### IDE
# Cash dir
# IDE and Editor Configurations
# Exclude IDE-specific files and directories
.idea
# Runners configs
.run

#######################################
### Github
# Runners config
# Git and GitHub
# Exclude Git-related files and configuration
.github
# Git
.gitignore
.git

#######################################
### Docker
# .dockerignore
# Docker
# Exclude Docker-related files
.dockerignore
docker-compose.yml
Dockerfile

#######################################
### pyTMbot
# app dir
bot_cli
# pyTMbot Specific
# Exclude application-specific files and directories
cli
docs
README.md
SECURITY.md
setup_bot.py
tests

#######################################
# Poetry
# Exclude Poetry configuration files
poetry.lock
pyproject.toml

#######################################
# Logs and Temporary Files
# Exclude logs and temporary files
*.log
tmp/

19 changes: 16 additions & 3 deletions .github/workflows/0.1.1_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,33 @@ jobs:
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: https://github.com/orenlab/pytmbot.git#v0.1.1
target: prod
sbom: True
provenance: True
sbom: true
provenance: true
file: Dockerfile
push: true
tags: orenlab/pytmbot:0.1.1
tags: orenlab/pytmbot:0.1.1
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
42 changes: 42 additions & 0 deletions .github/workflows/0.2.0-dev-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Push Alpine Dev Image for 0.2.0

on:
push:
branches:
- 'feature/0.2.0'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
target: production
sbom: true
provenance: true
file: Dockerfile
push: true
tags: orenlab/pytmbot:0.2.0-alpine-dev
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
19 changes: 16 additions & 3 deletions .github/workflows/latest_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,33 @@ jobs:
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: https://github.com/orenlab/pytmbot.git#v0.1.1
target: prod
sbom: True
provenance: True
sbom: true
provenance: true
file: Dockerfile
push: true
tags: orenlab/pytmbot:latest
tags: orenlab/pytmbot:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
25 changes: 21 additions & 4 deletions .github/workflows/release-to-docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,46 @@ jobs:
packages: write
contents: read
attestations: write

steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@v4
with:
images: ${{ github.repository }}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@v5
with:
context: .
target: production
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
Loading

0 comments on commit c0c6a3f

Please sign in to comment.