7 Commits

Author SHA1 Message Date
Wiktor
86549fb2ad Docs: Update README with integrated Docker information 2025-06-20 14:29:28 +02:00
Wiktor
22c2c9a2d4 Fix: Correct sensitive input reading in ultroid_setup.sh 2025-06-20 14:28:27 +02:00
Wiktor
75548fc039 Fix: Correct sensitive input reading in setup script and update README
- Modified `ultroid_setup.sh` to correctly read sensitive input like API_HASH when using Docker.
- Integrated key Docker deployment information from `README_DOCKER.md` into the main `README.md` for better visibility.
- Ensured `README.md` still links to `README_DOCKER.md` for comprehensive details.
2025-06-20 14:22:15 +02:00
Wiktor
202c0b2ec7 Fix: Correct sensitive input reading in setup script and update README
- Modified `ultroid_setup.sh` to correctly read sensitive input like API_HASH when using Docker.
- Integrated key Docker deployment information from `README_DOCKER.md` into the main `README.md` for better visibility.
- Ensured `README.md` still links to `README_DOCKER.md` for comprehensive details.
2025-06-20 14:13:51 +02:00
Wiktor
83dffb6785 Fix: Correct sensitive input reading in setup script and update README
- Modified `ultroid_setup.sh` to correctly read sensitive input like API_HASH when using Docker.
- Integrated key Docker deployment information from `README_DOCKER.md` into the main `README.md` for better visibility.
- Ensured `README.md` still links to `README_DOCKER.md` for comprehensive details.
2025-06-20 14:12:27 +02:00
Wiktor
d1b3f141ee Fix: API_HASH input in Docker setup and update README 2025-06-20 13:37:13 +02:00
Wiktor
25a59cc1ee Merge pull request #1 from overspend1/fix/pylint-startup-core
Fix/pylint startup core
2025-06-20 11:50:54 +02:00
2 changed files with 92 additions and 20 deletions

View File

@@ -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.
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)
- [Manual Setup (Docker or Local)](#manual-setup)
- **Automated Setup (Recommended)**: Use the `ultroid_setup.sh` script as described above.
- **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](https://img.shields.io/badge/Documentation-Ultroid-blue)](http://ultroid.tech/)
@@ -59,17 +61,79 @@ Get the [Necessary Variables](#Necessary-Variables) and then click the button be
[![Develop on Okteto](https://okteto.com/develop-okteto.svg)](https://cloud.okteto.com/deploy?repository=https://github.com/TeamUltroid/Ultroid)
## Manual Setup
If you prefer a manual setup or want to understand the components:
## Manual Docker Setup
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.
* **Local Python**: The `ultroid_setup.sh` script automates the following general steps using this fork's code:
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`
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`
**1. Prerequisites:**
- Docker and Docker Compose installed on your system.
- Telegram API credentials (API_ID and API_HASH) from [my.telegram.org/apps](https://my.telegram.org/apps).
- A Telegram `SESSION` string (see [Session String](#Session-String) section for generation methods).
**2. Clone the Repository:**
```bash
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
@@ -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)
* [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).

View File

@@ -76,16 +76,19 @@ _check_python_version() {
_prompt_user() {
local prompt_message="$1"
local var_name="$2"
local default_value="${3:-}" # Use bash specific default value assignment
local current_value="${!var_name:-$default_value}" # Get current value of var_name or default
local default_value="${3:-}"
local input
# Echo the prompt using color codes
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
read -p "$(echo -e "${YELLOW}$prompt_message${NC}: ")" input
echo -e -n "${YELLOW}${prompt_message}${NC}: "
fi
# Read the input
read input
if [ -z "$input" ] && [ -n "$default_value" ]; then
eval "$var_name=\"$default_value\""
else
@@ -98,8 +101,13 @@ _prompt_user_sensitive() {
local var_name="$2"
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
eval "$var_name=\"$input\""
}