forked from Spyderzz/Userbot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Paperplane Extended 3.0 sql-extended
- Loading branch information
Avinash Reddy
committed
Jul 21, 2019
1 parent
bf56eaf
commit cab9165
Showing
56 changed files
with
3,108 additions
and
767 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [baalajimaestro, raphielscape, mryacha] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] | ||
patreon: # Replace with a single Patreon username | ||
open_collective: # Replace with a single Open Collective username | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
custom: # Replace with a single custom sponsorship URL |
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,3 @@ | ||
neofetch | ||
chromium-chromedriver | ||
chromium-browser |
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,62 +1,78 @@ | ||
# We're using Alpine Edge | ||
# We're using Alpine stable | ||
FROM alpine:edge | ||
|
||
# | ||
# We have to uncomment Community repo for some packages | ||
# | ||
RUN sed -e 's;^#http\(.*\)/edge/community;http\1/edge/community;g' -i /etc/apk/repositories | ||
RUN sed -e 's;^#http\(.*\)/v3.9/community;http\1/v3.9/community;g' -i /etc/apk/repositories | ||
|
||
# Installing Core Components | ||
# Installing Python | ||
RUN apk add --no-cache --update \ | ||
git \ | ||
bash \ | ||
build-base \ | ||
bzip2-dev \ | ||
chromium \ | ||
chromium-chromedriver \ | ||
curl \ | ||
figlet \ | ||
gcc \ | ||
git \ | ||
jpeg-dev \ | ||
libffi-dev \ | ||
libpq \ | ||
libwebp-dev \ | ||
libxml2 \ | ||
libxml2-dev \ | ||
libxslt-dev \ | ||
linux-headers \ | ||
musl \ | ||
neofetch \ | ||
openssl-dev \ | ||
php-pgsql \ | ||
postgresql \ | ||
postgresql-client \ | ||
postgresql-dev \ | ||
py-lxml \ | ||
py-pillow \ | ||
py-pip \ | ||
py-psycopg2 \ | ||
py-requests \ | ||
py-sqlalchemy \ | ||
py-tz \ | ||
py3-aiohttp \ | ||
python-dev \ | ||
python3 \ | ||
sudo | ||
|
||
RUN python3 -m ensurepip \ | ||
&& pip3 install --upgrade pip setuptools \ | ||
&& rm -r /usr/lib/python*/ensurepip && \ | ||
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \ | ||
if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \ | ||
rm -r /root/.cache | ||
|
||
python3-dev \ | ||
readline-dev \ | ||
sqlite \ | ||
sqlite-dev \ | ||
sudo \ | ||
util-linux \ | ||
zlib-dev | ||
|
||
# | ||
# Install dependencies | ||
# | ||
RUN apk add --no-cache \ | ||
py-pillow py-requests \ | ||
py-sqlalchemy py-psycopg2 \ | ||
libpq curl neofetch \ | ||
musl py-tz py3-aiohttp \ | ||
py-six py-click | ||
RUN pip3 install --upgrade pip setuptools | ||
|
||
RUN apk add --no-cache sqlite figlet | ||
# Copy Python Requirements to /app | ||
|
||
# | ||
# Make user for userbot itself | ||
# | ||
RUN sed -e 's;^# \(%wheel.*NOPASSWD.*\);\1;g' -i /etc/sudoers | ||
RUN adduser userbot --disabled-password --home /home/userbot | ||
RUN adduser userbot wheel | ||
|
||
USER userbot | ||
RUN mkdir /home/userbot/userbot | ||
RUN git clone -b sql-extended https://github.com/AvinashReddy3108/PaperplaneExtended /home/userbot/userbot | ||
WORKDIR /home/userbot/userbot | ||
ADD ./requirements.txt /home/userbot/userbot/requirements.txt | ||
|
||
# | ||
# Install requirements | ||
# Copies session and config(if it exists) | ||
# | ||
COPY ./requirementsDOCKER.txt /home/userbot/userbot | ||
RUN sudo pip3 install -U pip | ||
RUN sudo pip3 install -r requirementsDOCKER.txt | ||
|
||
RUN git clone -b sql-backup https://github.com/baalajimaestro/Telegram-UserBot /home/userbot/userbot | ||
COPY ./sample_config.env ./userbot.session* ./config.env* /home/userbot/userbot/ | ||
|
||
# | ||
# Copies session and config(if it exists) | ||
# Install requirements | ||
# | ||
COPY ./userbot.session ./config.env /home/userbot/userbot/ | ||
|
||
RUN sudo pip3 install -r requirements.txt | ||
ADD . /home/userbot/userbot | ||
RUN sudo chown -R userbot /home/userbot/userbot | ||
RUN sudo chmod -R 777 /home/userbot/userbot | ||
CMD ["python3","-m","userbot"] |
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 @@ | ||
worker: python3 -m userbot |
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"name": "Paperplane Extended - Telegram Userbot", | ||
"description": "A modular Telegram userbot running on Python 3.6+ with an sqlalchemy database.", | ||
"logo": "https://i.imgur.com/ATSG4w3.png", | ||
"keywords": [ | ||
"telegram", | ||
"userbot", | ||
"plugin", | ||
"modular", | ||
"productivity" | ||
], | ||
"repository": "https://github.com/AvinashReddy3108/PaperplaneExtended", | ||
"website": "https://github.com/RaphielGang/Telegram-UserBot/wiki", | ||
"success_url": "https://t.me/userbot_announcements", | ||
"stack": "container", | ||
"env": { | ||
"API_KEY": { | ||
"description": "Get this value from my.telegram.org.", | ||
"value": "" | ||
}, | ||
"API_HASH": { | ||
"description": "Get this value from my.telegram.org.", | ||
"value": "" | ||
}, | ||
"STRING_SESSION": { | ||
"description": "[REQUIRED] Get this value by running python3 string_session.py in app console.", | ||
"required": false | ||
}, | ||
"CHROME_DRIVER": { | ||
"description": "ChromeDriver location.", | ||
"value": "/usr/bin/chromedriver" | ||
}, | ||
"GOOGLE_CHROME_BIN": { | ||
"description": "Google Chrome (or) Chromium binary location.", | ||
"value": "/usr/bin/chromium-browser" | ||
}, | ||
"OPEN_WEATHER_MAP_APPID": { | ||
"description": "Get your own APPID (API key)from https://api.openweathermap.org/data/2.5/weather", | ||
"required": false | ||
}, | ||
"SCREENSHOT_LAYER_ACCESS_KEY": { | ||
"description": "Get your own ACCESS_KEY (API key) from http://api.screenshotlayer.com/api/capture", | ||
"required": false | ||
}, | ||
"BOTLOG": { | ||
"description": "Incase you want to turn off logging, put this to false", | ||
"value": "False" | ||
}, | ||
"BOTLOG_CHATID": { | ||
"description": "ChatID for the Log group", | ||
"value": "0" | ||
}, | ||
"CONSOLE_LOGGER_VERBOSE": { | ||
"description": "If you need Verbosity on the Logging", | ||
"value": "False" | ||
}, | ||
"PM_AUTO_BAN": { | ||
"description": "PM Auto-Ban Feature Switch", | ||
"value": "False" | ||
}, | ||
"YOUTUBE_API_KEY": { | ||
"description": "YouTube Data API Key for .yt command. Get from https://console.cloud.google.com", | ||
"required": false | ||
}, | ||
"DEFAULT_BIO": { | ||
"description": "Set a default bio to be shown when you are not listening on Spotify..", | ||
"required": false | ||
}, | ||
"SPOTIFY_USERNAME": { | ||
"description": "Put your Spotify Username (your Spotify username).", | ||
"required": false | ||
}, | ||
"SPOTIFY_PASS": { | ||
"description": "Put your Spotify Password.", | ||
"required": false | ||
}, | ||
"SPOTIFY_BIO_PREFIX": { | ||
"description": "Put the prefix that you want to show while you listen to music", | ||
"required": false | ||
}, | ||
"WELCOME_MUTE": { | ||
"description": "Mute some known spammer bots after they join.", | ||
"value": "False" | ||
} | ||
}, | ||
"addons": [ | ||
{ | ||
"plan": "heroku-postgresql", | ||
"options": { | ||
"version": "9.5" | ||
} | ||
} | ||
] | ||
} |
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,5 +1,5 @@ | ||
build: | ||
docker: | ||
docker: | ||
worker: Dockerfile | ||
run: | ||
worker: dash init/start.sh | ||
worker: python3 -m userbot |
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 |
---|---|---|
|
@@ -17,11 +17,11 @@ COMMIT_POINT="$(git log --pretty=format:'%h : %s' -1)" | |
COMMIT_HASH="$(git rev-parse --verify HEAD)" | ||
TELEGRAM_TOKEN=${BOT_API_KEY} | ||
export BOT_API_KEY PARSE_BRANCH PARSE_ORIGIN COMMIT_POINT TELEGRAM_TOKEN | ||
|
||
kickstart_pub | ||
|
||
req_install() { | ||
pip3 install -r requirements.txt | ||
pip3 install pep8 autopep8 | ||
} | ||
|
||
get_session() { | ||
|
@@ -46,32 +46,8 @@ tg_senderror() { | |
exit 1 | ||
} | ||
|
||
lint() { | ||
if [ ! -z "$PULL_REQUEST_NUMBER" ]; then | ||
exit 0 | ||
fi | ||
num_errors_before=`find . -name \*.py -exec pycodestyle --ignore=E402 {} + | wc -l` | ||
echo $num_errors_before | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "baalajimaestro" | ||
find . -name \*.py -exec autopep8 --recursive --aggressive --aggressive --in-place {} + | ||
num_errors_after=`find . -name \*.py -exec pycodestyle --ignore=E402 {} + | wc -l` | ||
echo $num_errors_after | ||
if [ "$num_errors_after" -lt "$num_errors_before" ]; then | ||
git add . | ||
git commit -m "[MaestroCI]: Lint" | ||
git remote rm origin | ||
git remote add origin https://baalajimaestro:${GH_PERSONAL_TOKEN}@github.com/raphielgang/telegram-userbot.git | ||
git push --quiet origin $PARSE_BRANCH | ||
tg_sendinfo "<code>Code has been linted and Committed</code>" | ||
else | ||
tg_sendinfo "<code>Auto-Linter didn't lint anything</code>" | ||
fi | ||
tg_sendinfo "<code>$num_errors_after code problems detected, but couldn't be auto-linted</code>" | ||
} | ||
tg_yay() { | ||
tg_sendinfo "<code>Compilation Success! Auto-Linter Starting up!</code>" | ||
lint | ||
tg_sendinfo "<code>Compilation Success!</code>" | ||
} | ||
|
||
# Fin Prober | ||
|
@@ -104,4 +80,4 @@ execute() { | |
} | ||
|
||
get_session | ||
execute | ||
execute |
Oops, something went wrong.