Compare commits
7 Commits
fix/setup-
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86549fb2ad | ||
|
|
22c2c9a2d4 | ||
|
|
75548fc039 | ||
|
|
202c0b2ec7 | ||
|
|
83dffb6785 | ||
|
|
d1b3f141ee | ||
|
|
25a59cc1ee |
94
README.md
94
README.md
@@ -38,12 +38,14 @@ bash ultroid_setup.sh
|
|||||||
```
|
```
|
||||||
This script will guide you through choosing either a Docker-based or a local Python installation for this fork and help configure the necessary variables.
|
This script will guide you through choosing either a Docker-based or a local Python installation for this fork and help configure the necessary variables.
|
||||||
|
|
||||||
For other deployment options or more details, see below.
|
For more detailed deployment options, including manual Docker setup, see below.
|
||||||
|
|
||||||
# Other Deployment Options
|
# Deployment Options
|
||||||
|
|
||||||
- [Okteto](#deploy-to-okteto)
|
- **Automated Setup (Recommended)**: Use the `ultroid_setup.sh` script as described above.
|
||||||
- [Manual Setup (Docker or Local)](#manual-setup)
|
- **Docker (Manual)**: For a manual Docker setup, see the [Manual Docker Setup](#manual-docker-setup) section below or the comprehensive [README_DOCKER.md](./README_DOCKER.md) for advanced details.
|
||||||
|
- **Local Python (Manual)**: See [Manual Local Python Setup](#manual-local-python-setup).
|
||||||
|
- **Okteto**: See [Deploy to Okteto](#deploy-to-okteto).
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
[](http://ultroid.tech/)
|
[](http://ultroid.tech/)
|
||||||
@@ -59,17 +61,79 @@ Get the [Necessary Variables](#Necessary-Variables) and then click the button be
|
|||||||
|
|
||||||
[](https://cloud.okteto.com/deploy?repository=https://github.com/TeamUltroid/Ultroid)
|
[](https://cloud.okteto.com/deploy?repository=https://github.com/TeamUltroid/Ultroid)
|
||||||
|
|
||||||
## Manual Setup
|
## Manual Docker Setup
|
||||||
If you prefer a manual setup or want to understand the components:
|
If you prefer a manual Docker setup instead of using the `ultroid_setup.sh` script:
|
||||||
|
|
||||||
* **Docker**: Refer to [DOCKER_DEPLOYMENT.md](./DOCKER_DEPLOYMENT.md) and [README_DOCKER.md](./README_DOCKER.md). The `ultroid_setup.sh` script automates this using these Docker files.
|
**1. Prerequisites:**
|
||||||
* **Local Python**: The `ultroid_setup.sh` script automates the following general steps using this fork's code:
|
- Docker and Docker Compose installed on your system.
|
||||||
1. Clone this repository: `git clone https://github.com/overspend1/Ultroid-fork.git && cd Ultroid-fork`
|
- Telegram API credentials (API_ID and API_HASH) from [my.telegram.org/apps](https://my.telegram.org/apps).
|
||||||
2. Create a Python virtual environment: `python3 -m venv .venv`
|
- A Telegram `SESSION` string (see [Session String](#Session-String) section for generation methods).
|
||||||
3. Activate it: `source .venv/bin/activate`
|
|
||||||
4. Install dependencies: `pip install -r requirements.txt`
|
**2. Clone the Repository:**
|
||||||
5. Configure your variables in a `.env` file (see [Necessary Variables](#Necessary-Variables) below).
|
```bash
|
||||||
6. Run the bot: `python3 -m pyUltroid`
|
git clone https://github.com/overspend1/Ultroid-fork.git
|
||||||
|
cd Ultroid-fork
|
||||||
|
```
|
||||||
|
|
||||||
|
**3. Configure `.env` File:**
|
||||||
|
Copy the sample environment file and fill in your details.
|
||||||
|
```bash
|
||||||
|
cp .env.sample .env
|
||||||
|
nano .env # Or use your preferred text editor
|
||||||
|
```
|
||||||
|
**Key variables to configure in `.env`:**
|
||||||
|
```env
|
||||||
|
# Mandatory
|
||||||
|
SESSION=your_session_string_here
|
||||||
|
API_ID=your_api_id
|
||||||
|
API_HASH=your_api_hash
|
||||||
|
|
||||||
|
# Database (choose one, Redis is recommended for Docker)
|
||||||
|
# Option 1: Redis (Default)
|
||||||
|
REDIS_URI=redis://redis:6379 # Default for docker-compose setup
|
||||||
|
REDIS_PASSWORD=ultroid123 # Default for docker-compose setup
|
||||||
|
|
||||||
|
# Option 2: MongoDB (Uncomment and configure if using Mongo)
|
||||||
|
# MONGO_URI=mongodb://ultroid:ultroid123@mongodb:27017/ultroid?authSource=admin
|
||||||
|
|
||||||
|
# Option 3: External SQL Database (Uncomment and configure if using external SQL)
|
||||||
|
# DATABASE_URL=postgresql://user:pass@host:port/db
|
||||||
|
|
||||||
|
# Optional, but recommended
|
||||||
|
BOT_TOKEN=your_assistant_bot_token # Optional, from @BotFather
|
||||||
|
LOG_CHANNEL=your_log_channel_id # Numeric ID, e.g., -100xxxxxxxx
|
||||||
|
OWNER_ID=your_telegram_user_id # Your numeric Telegram User ID
|
||||||
|
TZ=Asia/Kolkata # Your timezone, e.g., Europe/London
|
||||||
|
```
|
||||||
|
For a complete list of variables and their descriptions, refer to the `.env.sample` file and the [Necessary Variables](#Necessary-Variables) section.
|
||||||
|
|
||||||
|
**4. Build and Run with Docker Compose:**
|
||||||
|
This is the recommended way to run Ultroid with Docker manually.
|
||||||
|
```bash
|
||||||
|
docker-compose build
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
This command will:
|
||||||
|
- Build the Docker images for Ultroid and any associated services (like Redis or MongoDB if enabled in `docker-compose.yml`).
|
||||||
|
- Start all services in detached mode (running in the background).
|
||||||
|
|
||||||
|
**5. Basic Management Commands:**
|
||||||
|
- **View logs**: `docker-compose logs -f ultroid`
|
||||||
|
- **Stop services**: `docker-compose down`
|
||||||
|
- **Restart Ultroid service**: `docker-compose restart ultroid`
|
||||||
|
- **Update (after `git pull`):** `docker-compose build && docker-compose up -d`
|
||||||
|
|
||||||
|
For a comprehensive guide to Docker deployment, including advanced configurations, troubleshooting, Makefile shortcuts, backup/restore, and more, please refer to the detailed **[README_DOCKER.md](./README_DOCKER.md)**.
|
||||||
|
|
||||||
|
## Manual Local Python Setup
|
||||||
|
The `ultroid_setup.sh` script automates these steps, but if you prefer manual local Python setup:
|
||||||
|
|
||||||
|
1. Clone this repository: `git clone https://github.com/overspend1/Ultroid-fork.git && cd Ultroid-fork`
|
||||||
|
2. Create a Python virtual environment: `python3 -m venv .venv`
|
||||||
|
3. Activate it: `source .venv/bin/activate` (for Linux/macOS) or `.\.venv\Scripts\activate` (for Windows)
|
||||||
|
4. Install dependencies: `pip install -r requirements.txt`
|
||||||
|
5. Configure your variables in a `.env` file (see [Necessary Variables](#Necessary-Variables) below).
|
||||||
|
6. Run the bot: `python3 -m pyUltroid`
|
||||||
|
|
||||||
---
|
---
|
||||||
## Important: Necessary Variables
|
## Important: Necessary Variables
|
||||||
@@ -139,4 +203,4 @@ Ultroid is licensed under [GNU Affero General Public License](https://www.gnu.or
|
|||||||
* [Lonami](https://github.com/LonamiWebs/) for [Telethon.](https://github.com/LonamiWebs/Telethon)
|
* [Lonami](https://github.com/LonamiWebs/) for [Telethon.](https://github.com/LonamiWebs/Telethon)
|
||||||
* [MarshalX](https://github.com/MarshalX) for [PyTgCalls.](https://github.com/MarshalX/tgcalls)
|
* [MarshalX](https://github.com/MarshalX) for [PyTgCalls.](https://github.com/MarshalX/tgcalls)
|
||||||
|
|
||||||
> Made with 💕 by [@TeamUltroid](https://t.me/TeamUltroid).
|
> Made with 💕 by [@TeamUltroid](https://t.me/TeamUltroid).
|
||||||
@@ -76,16 +76,19 @@ _check_python_version() {
|
|||||||
_prompt_user() {
|
_prompt_user() {
|
||||||
local prompt_message="$1"
|
local prompt_message="$1"
|
||||||
local var_name="$2"
|
local var_name="$2"
|
||||||
local default_value="${3:-}" # Use bash specific default value assignment
|
local default_value="${3:-}"
|
||||||
local current_value="${!var_name:-$default_value}" # Get current value of var_name or default
|
|
||||||
local input
|
local input
|
||||||
|
|
||||||
|
# Echo the prompt using color codes
|
||||||
if [ -n "$default_value" ]; then
|
if [ -n "$default_value" ]; then
|
||||||
read -p "$(echo -e "${YELLOW}$prompt_message${NC} [Default: $default_value]: ")" input
|
echo -e -n "${YELLOW}${prompt_message}${NC} [Default: $default_value]: "
|
||||||
else
|
else
|
||||||
read -p "$(echo -e "${YELLOW}$prompt_message${NC}: ")" input
|
echo -e -n "${YELLOW}${prompt_message}${NC}: "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Read the input
|
||||||
|
read input
|
||||||
|
|
||||||
if [ -z "$input" ] && [ -n "$default_value" ]; then
|
if [ -z "$input" ] && [ -n "$default_value" ]; then
|
||||||
eval "$var_name=\"$default_value\""
|
eval "$var_name=\"$default_value\""
|
||||||
else
|
else
|
||||||
@@ -98,8 +101,13 @@ _prompt_user_sensitive() {
|
|||||||
local var_name="$2"
|
local var_name="$2"
|
||||||
local input
|
local input
|
||||||
|
|
||||||
read -sp "$(echo -e "${YELLOW}$prompt_message${NC}: ")" input
|
# Echo the prompt using color codes
|
||||||
|
echo -e -n "${YELLOW}${prompt_message}${NC}: "
|
||||||
|
|
||||||
|
# Read the input silently
|
||||||
|
read -s input
|
||||||
echo # Newline after sensitive input
|
echo # Newline after sensitive input
|
||||||
|
|
||||||
eval "$var_name=\"$input\""
|
eval "$var_name=\"$input\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user