Skip to content

Commit

Permalink
update readme, some value hard coded, add user session string. thumb …
Browse files Browse the repository at this point in the history
…as preview
  • Loading branch information
5hojib committed Dec 31, 2024
1 parent bf20866 commit 9f19856
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 233 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@ on:
HEROKU_TEAM_NAME:
description: "Heroku Team Name"
required: false
BOT_TOKEN:
description: "Telegram bot token"
required: true
OWNER_ID:
description: "Owner's telegram ID"
required: true
DATABASE_URL:
description: "Database URL from MongoDB"
required: true
TELEGRAM_API:
description: "Telegram API ID from https://my.telegram.org/"
required: true
TELEGRAM_HASH:
description: "Telegram HASH from https://my.telegram.org/"
required: true

jobs:
deploy:
Expand Down Expand Up @@ -69,9 +54,3 @@ jobs:
docker_heroku_process_type: web
stack: "container"
region: "eu"
env:
HD_OWNER_ID: ${{inputs.OWNER_ID}}
HD_TELEGRAM_API: ${{inputs.TELEGRAM_API}}
HD_TELEGRAM_HASH: ${{inputs.TELEGRAM_HASH}}
HD_DATABASE_URL: ${{inputs.DATABASE_URL}}
HD_BOT_TOKEN: ${{inputs.BOT_TOKEN}}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ Follow these steps to deploy Aeon to Heroku:
- Enable **Actions** by selecting the appropriate option in the settings.

### 4. Run the Deployment Workflow
1. Open the **Actions** tab.
2. Select the `Deploy to Heroku` workflow from the available list.
3. Click **Run workflow** and fill out the required inputs:
1. Fill `config_sample.py` with required variables and rename it to `config.py`
2. Open the **Actions** tab.
3. Select the `Deploy to Heroku` workflow from the available list.
4. Click **Run workflow** and fill out the required inputs:
- **BOT_TOKEN**: Your Telegram bot token.
- **OWNER_ID**: Your Telegram ID.
- **DATABASE_URL**: MongoDB connection string.
Expand All @@ -44,8 +45,7 @@ Follow these steps to deploy Aeon to Heroku:
- **HEROKU_EMAIL**: Email address associated with your Heroku account.
- **HEROKU_API_KEY**: API key from your Heroku account.
- **HEROKU_TEAM_NAME** (Optional): Required only if deploying under a Heroku team account.

4. Run the workflow and wait for it to complete.
5. Run the workflow and wait for it to complete.

### 5. Finalize Setup
- After deployment, configure any remaining variables in your Heroku dashboard.
Expand Down
2 changes: 0 additions & 2 deletions bot/core/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class Config:
SEARCH_API_LINK = ""
SEARCH_LIMIT = 0
SEARCH_PLUGINS: ClassVar[list[str]] = []
STATUS_LIMIT = 10
STATUS_UPDATE_INTERVAL = 15
STOP_DUPLICATE = False
STREAMWISH_API = ""
SUDO_USERS = ""
Expand Down
2 changes: 1 addition & 1 deletion bot/helper/ext_utils/status_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ async def get_readable_message(sid, is_user, page_no=1, status="All", page_step=

tasks = await sync_to_async(get_specific_tasks, status, sid if is_user else None)

STATUS_LIMIT = Config.STATUS_LIMIT
STATUS_LIMIT = 4
tasks_no = len(tasks)
pages = (max(tasks_no, 1) + STATUS_LIMIT - 1) // STATUS_LIMIT
if page_no > pages:
Expand Down
2 changes: 1 addition & 1 deletion bot/helper/telegram_helper/message_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ async def send_status_message(msg, user_id=0):
}
if not intervals["status"].get(sid) and not is_user:
intervals["status"][sid] = SetInterval(
Config.STATUS_UPDATE_INTERVAL,
1,
update_status_message,
sid,
)
25 changes: 1 addition & 24 deletions bot/modules/bot_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"DOWNLOAD_DIR": "/usr/src/app/downloads/",
"LEECH_SPLIT_SIZE": TgClient.MAX_SPLIT_SIZE,
"RSS_DELAY": 600,
"STATUS_UPDATE_INTERVAL": 15,
"SEARCH_LIMIT": 0,
"UPSTREAM_BRANCH": "main",
"DEFAULT_UPLOAD": "rc",
Expand Down Expand Up @@ -151,16 +150,6 @@ async def edit_variable(_, message, pre_message, key):
elif key == "DOWNLOAD_DIR":
if not value.endswith("/"):
value += "/"
elif key == "STATUS_UPDATE_INTERVAL":
value = int(value)
if len(task_dict) != 0 and (st := intervals["status"]):
for cid, intvl in list(st.items()):
intvl.cancel()
intervals["status"][cid] = SetInterval(
value,
update_status_message,
cid,
)
elif key == "TORRENT_TIMEOUT":
value = int(value)
downloads = await sync_to_async(aria2.get_downloads)
Expand Down Expand Up @@ -356,18 +345,6 @@ async def edit_bot_settings(client, query):
value = ""
if data[2] in DEFAULT_VALUES:
value = DEFAULT_VALUES[data[2]]
if (
data[2] == "STATUS_UPDATE_INTERVAL"
and len(task_dict) != 0
and (st := intervals["status"])
):
for key, intvl in list(st.items()):
intvl.cancel()
intervals["status"][key] = SetInterval(
value,
update_status_message,
key,
)
elif data[2] == "EXTENSION_FILTER":
extension_filter.clear()
extension_filter.extend(["aria2", "!qB"])
Expand Down Expand Up @@ -484,7 +461,7 @@ async def load_config():
for key, intvl in list(st.items()):
intvl.cancel()
intervals["status"][key] = SetInterval(
Config.STATUS_UPDATE_INTERVAL,
1,
update_status_message,
key,
)
Expand Down
Loading

0 comments on commit 9f19856

Please sign in to comment.