As the Dockerfile defined WORKDIR /torapp, make sure you have /torapp folder in root with user write access.
If you use any other WORKDIR, please change the path mention from this method according to your needs.
I've uploaded 100 SA JSON files in "accounts" folder in a private repo. DO NOT UPLOAD them in a Public Repo.
Clone the Repo with your Personal Access Token (PAT). Always keep the token secret.
git clone https://${PAT}@github.com/USERNAME/PRIVATE_REPONAME --depth 1 /torapp/saThis will put the JSON files inside /torapp/sa/accounts/ folder.
Place your rclone config with this format. Make sure you have this line in the config -
service_account_file = /torapp/sa/accounts/__ServiceAcc__
So, the full rclone config would look like this -
[TeamDriveID]
type = drive
client_id = xxxxx-xxxxxxxxxxx.apps.googleusercontent.com
client_secret = yyyyyyyyyyyyyyyyyyyyyyyy
scope = drive
root_folder_id =
chunk_size = 128M
token = {"access_token":"zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz","token_type":"Bearer","refresh_token":"nnnnnnnnnnnnnnnnn","expiry":"2021-05-30T20:14:18.276611995+06:00"}
service_account_file = /torapp/sa/accounts/__ServiceAcc__
team_drive = xyz_yxz_010In ExecVarsSample.py, set DEF_RCLONE_DRIVE as the from rclone config.
Also set the rclone config path in RCLONE_CONFIG. Usually it's ~/.config/rclone/rclone.conf for any user.
_randomSA() {
# Get a list of SA JSON Filenames
ls /torapp/sa/accounts/ > /torapp/sa.list
# Change The SA Filename in rclone config file every 30m
while true; do
sed -i 's|__ServiceAcc__|'"$(shuf -n 1 /torapp/sa.list)"'|' ~/.config/rclone/rclone.conf
sleep 30m
done
}
# Run the randomizer in background
_randomSA & disown
# Run main Bot Start Script
gunicorn tortoolkit:start_server --bind 0.0.0.0:$PORT --worker-class aiohttp.GunicornWebWorker & python3 -m tortoolkit