-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-37: Release/v2.1.0: add
database
, additional user attributes
, …
…`rate limits`, `queue` and code refactoring (#37) ## v2.1.0 - 2024-05-28 ### What's Changed **Full Changelog**: v2.0.0...v2.1.0 by @obervinov in #37 #### 🐛 Bug Fixes * #23 #### 📚 Documentation * #26 * Update repository issues template #### 💥 Breaking Changes * Add `PostgreSQL` support to the bot stack instead of `Vault`. All bot data except `configurations` and `user data` is now stored in the database. * Remove outdated method for processing full account data per link of `user profile`. * Move all configuration of components form `environment variables` to the `Vault`. #### 🚀 Features * #54 * #32 * #30 * #28 * #14 * #20 * #27 * #24
- Loading branch information
obervinov
authored
May 28, 2024
1 parent
2e8f284
commit 999b9e6
Showing
51 changed files
with
3,783 additions
and
1,260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[flake8] | ||
max-line-length=100 | ||
max-line-length=150 | ||
exclude = .git,__pycache__ | ||
extend-ignore = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,25 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
about: Create a bug report to help us improve | ||
title: 'Bug: <describe>' | ||
labels: 'bug' | ||
assignees: 'obervinov' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
Not working <describe> functionality | ||
Error message: <error message> | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
**Additional context** | ||
Information about where the bug is happening: | ||
1. Functionality 1 in module 1 not working as expected | ||
2. Functionality 2 in module 2 not working as expected | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
**Possible correction** | ||
If you have a possible solution to the bug, please describe it. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
|
||
**Smartphone (please complete the following information):** | ||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- Browser [e.g. stock browser, safari] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. | ||
**Check list after fixing the bug** | ||
- [ ] Fix 1 in module 1 tested and working |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
# PR-1: NAME | ||
**Full Changelog**: https://github.com/obervinov/pyinstabot-downloader/compare/1...2 by @obervinov in https://github.com/obervinov/pyinstabot-downloader/pull/1 | ||
## VERSION - YYYY-MM-DD | ||
--- | ||
name: 'Pull request' | ||
about: Create a release to help us improve | ||
title: 'Release <version>: <description>' | ||
labels: '' | ||
assignees: 'obervinov' | ||
|
||
--- | ||
## <version> - <YYYY-MM-DD> | ||
### What's Changed | ||
**Full Changelog**: https://github.com/obervinov/pyinstabot-downloader/compare/1...2 by @obervinov in https://github.com/obervinov/pyinstabot-downloader/pull/1 | ||
#### 🐛 Bug Fixes | ||
* | ||
* | ||
#### 📚 Documentation | ||
* | ||
* | ||
#### 💥 Breaking Changes | ||
* | ||
* | ||
#### 🚀 Features | ||
* | ||
* | ||
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: PR | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
- '*/*' | ||
- '**' | ||
- '!main' | ||
|
||
jobs: | ||
changelog: | ||
uses: obervinov/_templates/.github/workflows/changelog.yaml@v1.2.2 | ||
|
||
pylint: | ||
uses: obervinov/_templates/.github/workflows/pylint.yaml@v1.2.2 | ||
|
||
pytest: | ||
uses: obervinov/_templates/.github/workflows/pytest-with-vault.yaml@v1.2.2 | ||
|
||
pyproject: | ||
uses: obervinov/_templates/.github/workflows/pyproject.yaml@v1.2.2 | ||
|
||
pr: | ||
uses: obervinov/_templates/.github/workflows/pr.yaml@v1.2.2 | ||
|
||
build-pr-image: | ||
uses: obervinov/_templates/.github/workflows/docker.yaml@v1.2.2 | ||
needs: [changelog, pylint, pytest, pyproject] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- closed | ||
|
||
jobs: | ||
changelog: | ||
uses: obervinov/_templates/.github/workflows/changelog.yaml@v1.2.2 | ||
|
||
pylint: | ||
uses: obervinov/_templates/.github/workflows/pylint.yaml@v1.2.2 | ||
|
||
pytest: | ||
uses: obervinov/_templates/.github/workflows/pytest-with-vault.yaml@v1.2.2 | ||
|
||
pyproject: | ||
uses: obervinov/_templates/.github/workflows/pyproject.yaml@v1.2.2 | ||
|
||
build-release-image: | ||
uses: obervinov/_templates/.github/workflows/docker.yaml@v1.2.2 | ||
needs: [changelog, pylint, pytest, pyproject] | ||
|
||
create-release: | ||
uses: obervinov/_templates/.github/workflows/release.yaml@v1.2.2 | ||
needs: [changelog, pylint, pytest, pyproject, build-release-image] | ||
|
||
# milestone: | ||
# uses: obervinov/_templates/.github/workflows/milestone.yaml@v1.2.2 | ||
# needs: [create-release, build-release-image] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.vscode/* | ||
.vscode | ||
.DS_Store | ||
*.tmp | ||
vault/data/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,56 @@ | ||
FROM python:3.10.7-alpine3.16 | ||
FROM python:3.9.15-alpine3.16 | ||
|
||
### External argumetns ### | ||
ARG PROJECT_NAME | ||
ARG PROJECT_DESCRIPTION | ||
ARG PROJECT_NAME | ||
ARG PROJECT_VERSION | ||
|
||
### Labels ### | ||
LABEL org.opencontainers.image.source https://github.com/obervinov/${PROJECT_NAME} | ||
LABEL org.opencontainers.image.description $PROJECT_DESCRIPTION | ||
LABEL org.opencontainers.image.title "Telegram bot: pyinstabot-downloader" | ||
LABEL org.opencontainers.image.version $PROJECT_VERSION | ||
LABEL org.opencontainers.image.description ${PROJECT_DESCRIPTION} | ||
LABEL org.opencontainers.image.version ${PROJECT_VERSION} | ||
LABEL org.opencontainers.image.authors github.obervinov@proton.me | ||
LABEL org.opencontainers.image.licenses https://github.com/obervinov/pyinstabot-downloader/blob/$PROJECT_VERSION/LICENSE | ||
LABEL org.opencontainers.image.documentation https://github.com/obervinov/pyinstabot-downloader/blob/$PROJECT_VERSION/README.md | ||
LABEL org.opencontainers.image.source https://github.com/obervinov/pyinstabot-downloader/blob/$PROJECT_VERSION | ||
LABEL org.opencontainers.image.licenses https://github.com/obervinov/${PROJECT_NAME}/blob/${PROJECT_VERSION}/LICENSE | ||
LABEL org.opencontainers.image.documentation https://github.com/obervinov/${PROJECT_NAME}/blob/${PROJECT_VERSION}/README.md | ||
LABEL org.opencontainers.image.source https://github.com/obervinov/${PROJECT_NAME}/blob/${PROJECT_VERSION} | ||
|
||
### Environment variables ### | ||
ENV PATH=/home/${PROJECT_NAME}/.local/bin:$PATH | ||
ENV PIP_NO_CACHE_DIR=off | ||
ENV PIP_DISABLE_PIP_VERSION_CHECK=on | ||
ENV POETRY_VIRTUALENVS_IN_PROJECT=true | ||
ENV POETRY_NO_INTERACTION=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV VENV_PATH=/home/${PROJECT_NAME}/app/.venv | ||
ENV PATH=/home/${PROJECT_NAME}/.local/bin:$VENV_PATH/bin:$PATH | ||
|
||
|
||
### Preparing user and dirs ### | ||
### Preparing user and directories ### | ||
RUN adduser -D -h /home/${PROJECT_NAME} -s /bin/sh ${PROJECT_NAME} && \ | ||
mkdir -p /home/${PROJECT_NAME} && \ | ||
mkdir -p /home/${PROJECT_NAME}/app && \ | ||
mkdir -p /home/${PROJECT_NAME}/tmp && \ | ||
mkdir -p /home/${PROJECT_NAME}/tmp && \ | ||
chown ${PROJECT_NAME}. /home/${PROJECT_NAME} -R | ||
|
||
### Prepare git | ||
RUN apk add git | ||
### Prepare tools and fix vulnerabilities ### | ||
RUN apk upgrade --no-cache && apk add --no-cache git curl | ||
|
||
### Switching context ### | ||
USER ${PROJECT_NAME} | ||
WORKDIR /home/${PROJECT_NAME}/app | ||
|
||
### Copy source code ### | ||
COPY requirements.txt ./ | ||
COPY src/ ./ | ||
|
||
### Installing a python dependeces - requirements.txt ### | ||
RUN pip3 install -r requirements.txt | ||
|
||
CMD [ "python3", "bot.py" ] | ||
COPY src/ src/ | ||
COPY tests/ tests/ | ||
COPY pyproject.toml . | ||
COPY poetry.lock . | ||
COPY *.md ./ | ||
COPY LICENSE ./ | ||
|
||
### Installing poetry and python dependeces ### | ||
RUN curl -sSL https://install.python-poetry.org | python - | ||
RUN poetry install | ||
ENV PYTHONPATH=/home/${PROJECT_NAME}/app/src:/home/${PROJECT_NAME}/app/.venv/lib/python3.10/site-packages | ||
|
||
### Entrypoint ### | ||
CMD [ "python3", "src/bot.py" ] |
Oops, something went wrong.