Skip to content

Commit 8cf2ca5

Browse files
Merge pull request #54 from charslab/ptb-async
Upgrade to PTB V21.10
2 parents 0b515fe + 4334fbd commit 8cf2ca5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1467
-771
lines changed

.github/workflows/build_image.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: DockerBuildAndPush
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- developement
8+
- ptb-async
9+
10+
env:
11+
IMAGE_NAME: transcriberbot
12+
13+
jobs:
14+
push:
15+
runs-on: ubuntu-latest
16+
if: github.event_name == 'push'
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Login to ghcr registry
22+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
23+
24+
- name: Build image
25+
run: docker build . --file Dockerfile --tag $IMAGE_NAME
26+
27+
- name: Push image
28+
run: |
29+
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
30+
# Change all uppercase to lowercase
31+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
32+
# Strip git ref prefix from version
33+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
34+
# Strip "v" prefix from tag name
35+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
36+
# Use Docker `latest` tag convention
37+
[ "$VERSION" == "master" ] && VERSION=latest
38+
echo IMAGE_ID=$IMAGE_ID
39+
echo VERSION=$VERSION
40+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
41+
docker push $IMAGE_ID:$VERSION

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# TranscriberBot-specific ignores
2-
config/
32
media/
43

54
# Generic data-related ignores

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
transcriber-bot-wonda

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-slim
1+
FROM python:3.12.0-slim
22

33
# Set global configs
44
WORKDIR /
File renamed without changes.

config/app.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,24 @@
4949
"webm"
5050
],
5151

52+
"ocr": {
53+
"tesseract_path": "/usr/share/tesseract-ocr/5/tessdata/"
54+
},
55+
5256
"antiflood": {
5357
"age_threshold": 10,
5458
"flood_ratio": 2,
5559
"max_flood_ratio": 6,
5660
"time_threshold_warning": 4,
5761
"time_threshold_flood": 5,
5862
"timeout": 10
63+
},
64+
65+
"whisper": {
66+
"api_endpoint": "http://127.0.0.1:8000"
67+
},
68+
69+
"logging": {
70+
"level": "APP"
5971
}
6072
}

config/sentry.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"dsn": "xxx"
3+
}

dockerRun.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
python-telegram-bot==12.3.0
1+
python-telegram-bot
22
coloredlogs
33
pillow
44
watchdog
55
tesserocr
66
pydub
77
zbarlight
88
requests
9+
sentry-sdk

run.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh
2+
3+
docker pull ghcr.io/charslab/transcriberbot:ptb-async
4+
docker run \
5+
-e LC_ALL=C \
6+
-d --restart unless-stopped \
7+
--name "transcriberbot-async" \
8+
-v "$(pwd)"/data:/data \
9+
-v "$(pwd)"/config:/config \
10+
-v "$(pwd)"/values:/values \
11+
-v "$(pwd)"/media:/media \
12+
--cpus=4.0 \
13+
--memory=3000m \
14+
-u "$(id -u):1337" \
15+
ghcr.io/charslab/transcriberbot:ptb-async

0 commit comments

Comments
 (0)