Git Product home page Git Product logo

clonebot_heroku's Introduction

✪ CloneBot - Heroku/Railway/Qovery/Clever-Cloud/Scalingo/Okteto Version ❅


CloneBot is a telegram bot that allows you to copy folder/team drive to team drives. One of the main advantage of this bot is that you can host it to Heroku for free.


✅ Advantages

❌ Drawbacks

  • Does not support files upload (only copy)
  • You cannot copy the data to My Drive

Note : there are hidden features, check at the source code of the bot to find them 🙃


⚠ You need service accounts (sa) to use the bot



💠 Host the bot on your computer

--> https://github.com/MsGsuite/CloneBot

📱 Run the bot on your phone using termux

--> https://telegra.ph/Clone-Bot-Termux-04-30

⚛️ Deploying on Heroku

𝙈𝙚𝙩𝙝𝙤𝙙 - 1 : ᴠɪᴀ ɢɪᴛʜᴜʙ ᴀᴄᴛɪᴏɴ𝙨

Deploy

𝙈𝙚𝙩𝙝𝙤𝙙 - 2 : ᴠɪᴀ ᴇᴅɪᴛɪɴɢ ʀᴇᴘᴏ ɴᴀᴍᴇ ᴀɴᴅ ʟɪɴᴋ

Deploy

☂ Deploying on Railway.app

  1. For Direct Deploy,Click on the Below Button
    Deploy on Railway

  2. Fill the following Environment Values as per below Instructions:

path_to_gclone =./gclone ⚠ Don't touch this

group_ids = your telegram group ID (leave it blank if you don't want to add one). To get your group id, go to @MissRose_bot and type /id

telegram_token = go to @BotFather and send /newbot to get one

gclone_para_override = leave this empty if you don't know how to use it

user_ids = Your user id (go to @MissRose_bot and type /id to get your id) - If you want to authorize multiple users, add a comma between each ID (ex: 150654065,5897065)

  1. Click on Deploy
  2. Wait a little bit.You will see that your app has been deployed to Railway and then you can clone without any Time Limit.Railway does not restart App every 24 hours meaning you can clone large data which can run for days at a time

🌟 Deploying on Qovery

This Method does not work anymore as Qovery has stopped Open Signup

Deploy to Qovery

𝐒𝐓𝐄𝐏𝐒-

  1. Login to Qovery via Github Account.Fork this Repo.
  2. Then create a new Environment followed by new app.Just follow the On-Screen Instructions.
  3. Then select Deploy App from Repo and click the Repo in your Account.
  4. From settngs of the App scroll down and change Deploy Method from Buildpacks to DockerFile
  5. Then go to variables and add the below Environment Variables one by one with proper values.

path_to_gclone =./gclone ⚠ Don't touch this

group_ids = your telegram group ID (leave it blank if you don't want to add one). To get your group id, go to @MissRose_bot and type /id

telegram_token = go to @BotFather and send /newbot to get one

gclone_para_override = leave this empty if you don't know how to use it

user_ids = Your user id (go to @MissRose_bot and type /id to get your id) - If you want to authorize multiple users, add a comma between each ID (ex: 150654065,5897065)

  1. Wait a little bit.You will see that your app has been deployed to Qovery and then you can clone without any Time Limit.
    Qovery does not restart App every 24 hours meaning you can clone large data which can run for days at a time


💎 Deploying on Clever-Cloud


This Service provides enough resources so that the Bot can run for 40 days without the need to add CC.
Clever Cloud does not restart App every 24 hours meaning you can clone large data which can run for days at a time



Thanks to Katarina for the addition of this Service.

🗡️ Deploying on Scalingo

Deploy


This Service provides enough resources so that the Bot can run for 30 days without the need to add CC.
Scalingo does not restart App every 24 hours meaning you can clone large data which can run for days at a time



Thanks to Katarina for the addition of this Service.

💫 Deploying on Okteto

For quick use, use this repo directly and deploy it to Okteto Cloud. Customize docker-compose.yml as you want if needed.

You need to fillup the below variables in order to use it in Okteto

group_ids = your telegram group ID (leave it blank if you don't want to add one). To get your group id, go to @MissRose_bot and type /id

telegram_token = go to @BotFather and send /newbot to get one

PORT = Add PORT as an environmental variable, and add 8080. Use Cron Job to ping the App every 30 mins else the bot will sleep

user_ids = Your user id (go to @MissRose_bot and type /id to get your id) - If you want to authorize multiple users, add a comma between each ID (ex: 150654065,5897065)


This Service is like Heroku as it does not mention any definite number of days in Free Trial.
Okteto does not restart App every 24 hours meaning you can clone large data which can run for days at a time


📢 Follow us:

❤️ Credits & thanks :

  • wrenfairbank for the original python script
  • smartass08 to adapt the scrip to heroku
  • anymeofu for making the Direct Heroku deployable Version
  • Zero-The-Kamisama to making me discover this amazing bot and the detailed instructions
  • zorgof for the termux script
  • Aishik Tokdar for Adding Guide to Deploy on Railway.app , Qovery , Clever Cloud , Scalingo and some other Code Improvements.Also Added Heroku Workflow Deployment Method.
  • Katarina for adding the ability to be deployed to Clever Cloud and Scanlingo
  • Miss Emily for adding Support of Okteto Cloud Deployment as well as improving little layout

clonebot_heroku's People

Contributors

anymeofu avatar dishapatel010 avatar msgsuite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

clonebot_heroku's Issues

Add size, status and count commands

Please add Size command which will tell the size of the folder/file/td.

Also add Status command which will tell the bot status, how long its been running, cpu usage, ram, disk space etc

and finally do add Count command which will tell the media type available in particular folder

Port Issue

Can not convert '{PORT}:8080=8080:8080' to a port: Host IP is not allowed

How To Fix This Error in Okteto Deploy

Deploying Error On Railway

Hi,

I cannot deploy on Railway because it blocks it saying it is a mirror bot. Can you please tell me any fix?

how to use without SA?

hi , is there a way to use this without SA? . i want to sync a 116 gb of data between two remotes but i cannot add any accounts outside company domain so i cannot add SAs to my teamdrives . i was hoping there was a way to use the bot using just your google account or maybe by rclone.config file . Anyways thanks for your work on this bot

Getting error on HEROKU

im getting this error while deploying to heroku

Setting up libkrb5support0:amd64 (1.17-6ubuntu4.1) ...
Setting up libsasl2-modules-db:amd64 (2.1.27+dfsg-2ubuntu0.1) ...
Setting up tzdata (2022c-0ubuntu0.20.04.0) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
Configuring tzdata

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
  1. Africa        6. Asia            11. System V timezones
  2. America       7. Atlantic Ocean  12. US
  3. Antarctica    8. Europe          13. None of the above
  4. Australia     9. Indian Ocean
  5. Arctic Ocean  10. Pacific Ocean
Geographic area: =!= Build failed due to an error:
=!= Timed out compiling app
If this persists, please contact us at https://help.heroku.com/. 

add sync

add a simple sync feature for better manage data plz

Heroku: Select Time Zone Error

If you are facing Error, where Heroku Showing Select Time Zone then just replace the code of Docker file with below code:

FROM ubuntu:20.04

WORKDIR /usr/src/app
RUN chmod 777 /usr/src/app

ENV TZ=Asia/Kolkata
RUN ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime
RUN echo "$TZ" > /etc/timezone

RUN apt-get update
RUN apt-get install -y tzdata
RUN apt-get -qq update
RUN apt-get -qq install -y git python3 python3-pip
locales python3-lxml aria2
curl pv jq nginx npm

COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt &&
apt-get -qq purge git

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

COPY . .

RUN chmod +x start.sh
RUN chmod +x gclone

CMD ["bash","start.sh"]

Add new user id not work

It does not work to add new ids with / vip ID, which is the step to add new users since if they are added from heroku by modifying the variables, the bot restarts in its configurations and you have to add user accounts again, and each user has what to add

can't self host linux ubuntu 21.04

shadows@shadowdrivevm:~/clonebot/telegram_gcloner$ sudo python3 telegram_gcloner.py
2021-11-17 05:06:27,625 - utils.config_loader - INFO - Found telegram_token: 21xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2021-11-17 05:06:27,626 - utils.config_loader - INFO - Found user_ids: -1,xxxxxxxxxxxxxx
2021-11-17 05:06:27,626 - utils.config_loader - INFO - Found group_ids: -1,xxxxxxxxxxxx
2021-11-17 05:06:27,626 - utils.config_loader - INFO - Found path_to_gclone: ./gclone
2021-11-17 05:06:27,626 - utils.config_loader - INFO - Found gclone_para_override:
2021-11-17 05:06:27,626 - utils.config_loader - WARNING - Gclone Executable was not found in the Drectory.
Press Enter to continue...

But its clearly in the file.

shadows@shadowdrivevm:~/clonebot/telegram_gcloner$ ls -a
.  ..  config.ini  gclone.exe  handlers  logs  telegram_gcloner.py  utils

How to Save Configuration

Is there any way to store that sa file and favourite drive list in this not because each time it restarts it asks for it again.

Getting Error While selecting teamdrive for cloning

2022-05-09 07:16:23,552 - apscheduler.scheduler - INFO - Scheduler started
/usr/local/lib/python3.8/dist-packages/telegram/ext/filters.py:198: TelegramDeprecationWarning: Filters.private is deprecated. Use Filters.chat_type.private instead.
return self.filter(update.effective_message)
/usr/local/lib/python3.8/dist-packages/telegram/ext/filters.py:198: TelegramDeprecationWarning: Filters.group is deprecated. Use Filters.chat_type.groups instead.
return self.filter(update.effective_message)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/home/ubuntu/CloneBot/telegram_gcloner/utils/fire_save_files.py", line 95, in run
process = subprocess.Popen(command_line,
File "/usr/lib/python3.8/subprocess.py", line 858, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/ubuntu/CloneBot/gclone'

None of the deployment method works

Hi I tried all 3 methods to deploy and none of the are working. Heroku is flagging it as violation to their services. Railway is saying the same and in Quovery it fails to deploy. Please provide an updated approach.

Where to put SAs?

Hello;
First of all thanks for the repo its really useful.
I have created SAs but where to put them? Your heroku guide video url is dead, kindly update it

File missing problem

Today I tried to clone a folder with 50 sub-folders. Bot says it successfully cloned the folder to my td. But when I check that folder in my td I get 39 subfolders. Then again tried with a folder of another 50 sub-folders this time bot actually cloned 45 folders and other 5 are missing. Any solution?

Crashing Error R15 (Memory quota vastly exceeded)

2022-01-10T10:58:37.183286+00:00 heroku[worker.1]: Process running mem=1214M(237.2%)
2022-01-10T10:58:37.192749+00:00 heroku[worker.1]: Error R15 (Memory quota vastly exceeded)
2022-01-10T10:58:37.202439+00:00 heroku[worker.1]: Stopping process with SIGKILL
2022-01-10T10:58:37.425535+00:00 heroku[worker.1]: Process exited with status 137
2022-01-10T10:58:37.488054+00:00 heroku[worker.1]: State changed from up to crashed

ModuleNotFoundError: No module named 'utils'

Module Not Found Error, while there is config_loader under 'utils'. Why is this error showing up?

Starting process with command `bash start.sh`
State changed from starting to up
Traceback (most recent call last):
  File "/usr/src/app/telegram_gcloner.py", line 27, in <module>
    from utils.config_loader import config
ModuleNotFoundError: No module named 'utils'
Process exited with status 1
State changed from up to crashed

Telegram bot keeps resetting - even mid-task

Hello,

It looks like my Telegram bot keeps resetting every day, even mid-task and I have to re-send service accounts again and set up folders again. It's tedious and annoying, especially when the bot is running and it just says 'Welcome to CloneBot. Let's copy some data!' Could anyone help me please? I've attached some screenshots below.

Thank you :)

image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.