汪汪Bot是一个Telegram Bot,用于帮助你管理一台服务器上的Docker

Overview

WangWangBot

汪汪Bot是一个Telegram Bot,用于帮助你管理一台服务器上的Docker运行的Bot。这是使用视频:

bot_use

部署说明

安装运行

准备 local.env

普通版本

BOT_TOKEN=你的BOT_TOKEN
ADMINS=使用,分隔的管理员ID列表

如果你使用doppler,则是

DOPPLER_TOKEN=

创建并运行容器

docker run -d --name=wangwangbot --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v `pwd`:/data --env-file local.env hdcola/wangwangbot

这里的 pwd 目录默认是包含有 docker-compose.yml 及它会使用到的资源的目录(你也可以指定到别的目录去)。有关docker-compose相关信息,请参考 docker-compose文档

升级

停止、移除容器

docker stop wangwangbot
docker rm wangwangbot

更新image

docker pull hdcola/wangwangbot

之后再运行一遍创建并运行容易即可。

开发者调试

运行状态下使用交互模式进入容器

docker exec -it wangwangbot bash

非运行状态下使用交互模式启动一次性容器

docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock -v `pwd`:/data hdcola/wangwangbot bash

测试doppler环境

docker run --rm -it --init \
   -e "DOPPLER_TOKEN=$(doppler configure get token --plain)" \
   -e "DOPPLER_PROJECT=$(doppler configure get project --plain)" \
   -e "DOPPLER_CONFIG=$(doppler configure get config --plain)" \
   hdcola/wangwangbot
You might also like...
A Telegram bot for remotely managing Binance Trade Bot
A Telegram bot for remotely managing Binance Trade Bot

Binance Trade Bot Manager Telegram A Telegram bot for remotely managing Binance Trade Bot. If you have feature requests please open an issue on this r

An Open-Source Discord bot created to provide basic functionality which should be in every discord guild. We use this same bot with additional configurations for our guilds.

A Discord bot completely written to be taken from the source and built according to your own custom needs. This bot supports some core features and is

This is telegram bot to generate string session for using user bots. You can see live bot in https://telegram.dog/string_session_Nsbot

TG String Session Generate Pyrogram String Session Using this bot. Demo Bot: Configs: API_HASH Get from Here. API_ID Get from Here. BOT_TOKEN Telegram

A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.
A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.

Maintenance Bot A Telegram Repo For Devs To Controll The Bots Under Maintenance About This Bot This Bot Is For Developers, If Your Bot Is Down, Use Th

A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.
A Telegram Repo For Devs To Controll The Bots Under Maintenance.This Bot Is For Developers, If Your Bot Is Down, Use This Repo To Give Your Dear Subscribers Some Support By Providing Them Response.

Maintenance Bot A Telegram Repo For Devs To Controll The Bots Under Maintenance About This Bot This Bot Is For Developers, If Your Bot Is Down, Use Th

A telegram bot which can show you the status of telegram bot

BotStatus-Ts-Bot An open source telegram Bot Status bot For demo you can check here The status is updated in every 1 hour About Bot This is a Bot stat

Benachrichtigungs-Bot für das niedersächische Impfportal / Notification bot for the lower saxony vaccination portal

Ein kleines Wochenend-Projekt von mir. Der Bot überwacht die REST-API des niedersächsischen Impfportals auf freie Impfslots und sendet eine Benachrichtigung mit deinem bevorzugtem Service. Ab da gilt leider: der Schnellste gewinnt. Bitte missbraucht den Bot nicht und verwendet moderate Intervalle.

Telegram Bot to Filter posts in Bot Inline search

Inline-Filter-Bot A Telegram Bot for filter in Inline Features Unlimited Filters Supports all type of filters Supports Alert Button Using Common Marku

Telegram PHub Bot using ARQ Api and Pyrogram. This Bot can Download and Send PHub HQ videos in Telegram using ARQ API.

Tg_PHub_Bot Telegram PHub Bot using ARQ Api and Pyrogram. This Bot can Download and Send PHub HQ videos in Telegram using ARQ API. OS Support All linu

Comments
  • 使用docker运行bot出错

    使用docker运行bot出错

    使用的docker命令: docker run -d --name=wangwangbot --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /root/wangwangbot/data:/data --env-file local.env hdcola/wangwangbot

    /root/wangwangbot/local.env文件内容如下: BOT_TOKEN=我的bot token ADMINS=我的id

    对bot发送/admin发现没有反应,但是发送/start和/help有回应

    使用tail /root/wangwangbot/logs/wangwangbot.log 查到以下内容

    日志错误信息如下: compose.config.errors.ComposeFileNotFound: Can't find a suitable configuration file in this directory or any parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml, compose.yml, compose.yaml
    

    2021-08-22 01:10:56.357 | ERROR | aiogram.utils.executor:start_polling:323 - Task exception was never retrieved future: <Task finished name='Task-24' coro=<Dispatcher._process_polling_updates() done, defined at /usr/local/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py:409> exception=ComposeFileNotFound(['docker-compose.yml', 'docker-compose.yaml', 'compose.yml', 'compose.yaml'])> Traceback (most recent call last):

    File "/usr/local/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 417, in _process_polling_updates for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)): │ │ │ │ │ │ └ True │ │ │ │ │ └ [<aiogram.types.update.Update object at 0x7f6922d849a0>] │ │ │ │ └ <function Dispatcher.process_updates at 0x7f692165d160> │ │ │ └ <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f6920e70c70> │ │ └ <method 'from_iterable' of 'itertools.chain' objects> │ └ <class 'itertools.chain'> └ <module 'itertools' (built-in)> File "/usr/local/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 238, in process_updates return await asyncio.gather(*tasks) │ │ └ [<coroutine object Handler.notify at 0x7f691f8b5d40>] │ └ <function gather at 0x7f69232258b0> └ <module 'asyncio' from '/usr/local/lib/python3.9/asyncio/init.py'> File "/usr/local/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify response = await handler_obj.handler(*args, **partial_data) │ │ │ └ {} │ │ └ (<aiogram.types.update.Update object at 0x7f6922d849a0>,) │ └ <bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f6920e70c70>> └ Handler.HandlerObj(handler=<bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7... File "/usr/local/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 259, in process_update return await self.message_handlers.notify(update.message) │ │ │ │ └ <aiogram.types.fields.Field object at 0x7f692177aac0> │ │ │ └ <aiogram.types.update.Update object at 0x7f6922d849a0> │ │ └ <function Handler.notify at 0x7f692169ea60> │ └ <aiogram.dispatcher.handler.Handler object at 0x7f6920e705e0> └ <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f6920e70c70> File "/usr/local/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify response = await handler_obj.handler(*args, **partial_data) │ │ │ └ {} │ │ └ (<aiogram.types.message.Message object at 0x7f6922d84190>,) │ └ <function admin_command at 0x7f691f8cab80> └ Handler.HandlerObj(handler=<function admin_command at 0x7f691f8cab80>, spec=FullArgSpec(args=['message'], varargs=None, varkw...

    File "/WangWangBot/WangWangBot/handlers/users/admin.py", line 23, in admin_command msg, reply_markup = get_top_services_msg() └ <function get_top_services_msg at 0x7f6922de93a0>

    File "/WangWangBot/WangWangBot/handlers/users/admin.py", line 13, in get_top_services_msg services = docker.check_dir_service_list(Config.DOCKER_COMPOSE_DIR) │ │ │ └ '/data/' │ │ └ <class 'WangWangBot.config.Config'> │ └ <function check_dir_service_list at 0x7f691f8ca550> └ <module 'WangWangBot.utils.docker' from '/WangWangBot/WangWangBot/utils/docker.py'>

    File "/WangWangBot/WangWangBot/utils/docker.py", line 101, in check_dir_service_list project = get_project( └ <function get_project at 0x7f691f8c6ca0>

    File "/usr/local/lib/python3.9/site-packages/compose/cli/command.py", line 144, in get_project config_details = config.find(project_dir, config_path, environment, override_dir) │ │ │ │ │ └ None │ │ │ │ └ {'PATH': '/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOSTNAME': 'f7410364dcb6', 'BOT_TOKE... │ │ │ └ None │ │ └ '/data' │ └ <function find at 0x7f691ff6a4c0> └ <module 'compose.config' from '/usr/local/lib/python3.9/site-packages/compose/config/init.py'> File "/usr/local/lib/python3.9/site-packages/compose/config/config.py", line 320, in find raise ComposeFileNotFound(SUPPORTED_FILENAMES) │ └ ['docker-compose.yml', 'docker-compose.yaml', 'compose.yml', 'compose.yaml'] └ <class 'compose.config.errors.ComposeFileNotFound'>

    compose.config.errors.ComposeFileNotFound: Can't find a suitable configuration file in this directory or any parent. Are you in the right directory?

        Supported filenames: docker-compose.yml, docker-compose.yaml, compose.yml, compose.yaml
    

    Snipaste_2021-08-22_09-37-37

    help wanted 
    opened by TheEnd233 1
  • 如果服务器上的Docker没有启动会报错

    如果服务器上的Docker没有启动会报错

    File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 417, in _process_polling_updates for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)): │ │ │ │ │ │ └ True │ │ │ │ │ └ [<aiogram.types.update.Update object at 0x7f82a949adf0>] │ │ │ │ └ <function Dispatcher.process_updates at 0x7f82a839a5e0> │ │ │ └ <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f82a87ddee0> │ │ └ <method 'from_iterable' of 'itertools.chain' objects> │ └ <class 'itertools.chain'> └ <module 'itertools' (built-in)> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 238, in process_updates return await asyncio.gather(*tasks) │ │ └ [<coroutine object Handler.notify at 0x7f82a963c640>] │ └ <function gather at 0x7f82a6a11700> └ <module 'asyncio' from '/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/asyncio/init.py'> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify response = await handler_obj.handler(*args, **partial_data) │ │ │ └ {} │ │ └ (<aiogram.types.update.Update object at 0x7f82a949adf0>,) │ └ <bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f82a87ddee0>> └ Handler.HandlerObj(handler=<bound method Dispatcher.process_update of <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7... File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 259, in process_update return await self.message_handlers.notify(update.message) │ │ │ │ └ <aiogram.types.fields.Field object at 0x7f82a82bf340> │ │ │ └ <aiogram.types.update.Update object at 0x7f82a949adf0> │ │ └ <function Handler.notify at 0x7f82a836e160> │ └ <aiogram.dispatcher.handler.Handler object at 0x7f82a88094f0> └ <aiogram.dispatcher.dispatcher.Dispatcher object at 0x7f82a87ddee0> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify response = await handler_obj.handler(*args, **partial_data) │ │ │ └ {} │ │ └ (<aiogram.types.message.Message object at 0x7f82a96588e0>,) │ └ <function admin_command at 0x7f82a96411f0> └ Handler.HandlerObj(handler=<function admin_command at 0x7f82a96411f0>, spec=FullArgSpec(args=['message'], varargs=None, varkw...

    File "/Users/hd/work/WangWangBot/WangWangBot/handlers/users/admin.py", line 25, in admin_command msg, reply_markup = get_top_services_msg() └ <function get_top_services_msg at 0x7f82a8b75550>

    File "/Users/hd/work/WangWangBot/WangWangBot/handlers/users/admin.py", line 14, in get_top_services_msg services = docker.check_dir_service_list(Config.DOCKER_COMPOSE_DIR) │ │ │ └ '/Users/hd/work/WangWangBot/' │ │ └ <class 'WangWangBot.config.Config'> │ └ <function check_dir_service_list at 0x7f82a963aa60> └ <module 'WangWangBot.utils.docker' from '/Users/hd/work/WangWangBot/WangWangBot/utils/docker.py'>

    File "/Users/hd/work/WangWangBot/WangWangBot/utils/docker.py", line 101, in check_dir_service_list project = get_project( └ <function get_project at 0x7f82a963a1f0>

    File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/compose/cli/command.py", line 152, in get_project client = get_client( └ <function get_client at 0x7f82a9634ca0> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/compose/cli/docker_client.py", line 41, in get_client client = docker_client( └ <function docker_client at 0x7f82a9634e50> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/compose/cli/docker_client.py", line 170, in docker_client client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs) │ │ └ {'base_url': 'unix:///var/run/docker.sock', 'timeout': 60, 'user_agent': 'docker-compose/1.29.2 docker-py/5.0.0 Darwin/20.6.0'} │ └ 0 └ <class 'docker.api.client.APIClient'> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/docker/api/client.py", line 197, in init self._version = self._retrieve_server_version() │ │ └ <function APIClient._retrieve_server_version at 0x7f82a9298940> │ └ <docker.api.client.APIClient object at 0x7f82a9658b80> └ <docker.api.client.APIClient object at 0x7f82a9658b80> File "/usr/local/Caskroom/miniconda/base/envs/aio/lib/python3.9/site-packages/docker/api/client.py", line 221, in _retrieve_server_version raise DockerException( └ <class 'docker.errors.DockerException'>

    docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

    bug 
    opened by hdcola 0
Releases(1.0.2)
Owner
老房东的代码练习册
老房东的代码练习册
This program is an automated trading bot that uses TDAmeritrades Thinkorswim trading platform's scanners and alerts system.

Python Trading Bot w/ Thinkorswim Description This program is an automated trading bot that uses TDAmeritrades Thinkorswim trading platform's scanners

Trey Thomas 201 Jan 03, 2023
An anime themed telegram group management bot based on sqlalchemy database running on python3.

Kazuko Robot A Telegram Python bot running on python3 forked with saitama and DiasyX with a sqlalchemy database and an entirely themed persona to make

heyaaman 22 Dec 07, 2022
Rhythm bot clone for discord written in Python and uses YouTube to get media files.

Tunebot About Rhythm bot clone for discord written in Python and uses YouTube to get media files. Usage You need a .env file within the same directory

1 Oct 21, 2021
Instagram-follower-bot - An Instagram follower bot written in Python

Instagram Follower Bot An Instagram follower bot written in Python. The bot follows the follower of which account you want. e.g. (You want to follow @

Aytaç Kaşoğlu 1 Dec 31, 2021
A python script to extract information from a Microsoft Remote Desktop Web Access (RDWA) application

This python script allow to extract various information from a Microsoft Remote Desktop Web Access (RDWA) application, such as the FQDN of the remote server, the internal AD domain name (from the FQD

Podalirius 60 Dec 09, 2022
Herramienta para transferir eventos de Sucuri WAF hacia Azure Blob Storage.

Transfiere eventos de Sucuri hacia Azure Blob Storage Script para transferir eventos del Sucuri Web Application Firewall (WAF) hacia Azure Blob Storag

CSIRT-RD 1 Dec 22, 2021
arweave-nft-uploader is a Python tool to improve the experience of uploading NFTs to the Arweave storage for use with the Metaplex Candy Machine.

arweave-nft-uploader arweave-nft-uploader is a Python tool to improve the experience of uploading NFTs to the Arweave storage for use with the Metaple

0xEnrico 84 Dec 26, 2022
Wonderful Phoenix-Bot

Phoenix Bot Discord Phoenix Bot is inspired by Natewong1313's Bird Bot project yet due to lack of activity by their team. We have decided to revive th

Senior Developer 0 Aug 12, 2021
Prometheus exporter for CNMC API

CNMC Prometheus exporter It needs a Prometheus Pushgateway Install requirements via pip install -r requirements.txt Export the following environment v

GISCE-TI 1 Oct 20, 2021
42-event-notifier - 42 Event notifier using 42API and Github Actions

42 Event Notifier 42서울 Agenda에 새로운 이벤트가 등록되면 알려드립니다! 현재는 Github Issue로 등록되므로 상단

6 May 16, 2022
A full-featured Python wrapper for the Onfleet API.

UPDATE: Please use Onfleet's wrapper instead. This repository is not maintained. https://github.com/onfleet/pyonfleet --- Python-Onfleet   python-onfl

Lionheart Software 11 Jan 13, 2022
This Is A Python Program To Showcase Two Modules (Gratient And Fade)

Hellooo, It's PndaBoi Here! This Is A Python Program To Showcase Two Modules (Gratient And Fade). I Really Like Both Of These Modules So I Decided To

PndaBoi! 6 May 31, 2022
Open Source API and interchange format for editorial timeline information.

OpenTimelineIO is currently in Public Beta. That means that it may be missing some essential features and there are large changes planned. During this phase we actively encourage you to provide feedb

Pixar Animation Studios 1.2k Jan 01, 2023
A simple url uploader bot with permenent thumbnail support

URL-Uploader A simple url uploader bot with permenent thumbnail support Scrapped some code from @SpEcHIDe's AnyDLBot Repository Please fork this repos

Fayas Noushad 40 Nov 29, 2021
Is the CoWin website updated for registration?

CoWin-Update Is the CoWin website updated for registration? This is a very hacky PYTHON3 script to lookup the CoWin portal if they re-deployed their J

Yash Jakhotiya 5 May 10, 2021
A quick and dirty script to scan the network, find default credentials on services and post a message to a Slack channel with the results.

A quick and dirty script to scan the network, find default credentials on services and post a message to a Slack channel with the results.

Security Weekly 11 Jun 03, 2022
Simple Self-Bot for Discord

KeunoBot 🐼 -Simple Self-Bot for Discord KEUNOBOT 🐼 - Run KeunoBot : /* - Install KeunoBot - Extract it - Run setup.bat - Set token and prefi

Bidouffe 2 Mar 10, 2022
VC-Music , Playing music without bot.

VC-Userbot A Telegram Userbot to play or streaming Audio and Video songs / files in Telegram Voice Chats. It's made with PyTgCalls and Pyrogram Requir

RioProjectX 8 Aug 04, 2022
A MassDM selfbot which is working in 2021

mass-dm-discord - Little preview of the Logger and the Spammer Features Logging User IDS Sending DMs to the logged IDs Blacklist IDs (add the ID of th

karma.meme 88 Dec 26, 2022
Spotify Web API client for Python 3

Welcome to the GitHub repository of Tekore! We provide a client for the Spotify Web API for Python, complete with all available endpoints and authenti

Felix Hildén 186 Dec 22, 2022