Fix: API_HASH input in Docker setup and update README

This commit is contained in:
Wiktor
2025-06-20 13:37:13 +02:00
parent 25a59cc1ee
commit d1b3f141ee
2 changed files with 51 additions and 19 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. 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
[![Documentation](https://img.shields.io/badge/Documentation-Ultroid-blue)](http://ultroid.tech/) [![Documentation](https://img.shields.io/badge/Documentation-Ultroid-blue)](http://ultroid.tech/)
@@ -59,17 +61,39 @@ 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) [![Develop on Okteto](https://okteto.com/develop-okteto.svg)](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:
* **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. **Clone the repository**:
* **Local Python**: The `ultroid_setup.sh` script automates the following general steps using this fork's code: ```bash
1. Clone this repository: `git clone https://github.com/overspend1/Ultroid-fork.git && cd Ultroid-fork` git clone https://github.com/overspend1/Ultroid-fork.git
2. Create a Python virtual environment: `python3 -m venv .venv` cd Ultroid-fork
3. Activate it: `source .venv/bin/activate` ```
4. Install dependencies: `pip install -r requirements.txt` 2. **Configure `.env` file**:
5. Configure your variables in a `.env` file (see [Necessary Variables](#Necessary-Variables) below). Copy the sample and fill in your details (API_ID, API_HASH, SESSION, etc.).
6. Run the bot: `python3 -m pyUltroid` ```bash
cp .env.sample .env
nano .env
```
Refer to the [Necessary Variables](#Necessary-Variables) section and [README_DOCKER.md](./README_DOCKER.md#-configuration) for details on all variables.
3. **Build and Run with Docker Compose**:
```bash
docker-compose build
docker-compose up -d
```
This will build the Docker images and start the Ultroid bot and any configured database services (like Redis) in detached mode.
For more advanced Docker configurations, troubleshooting, and management commands (like using the `Makefile`), 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

View File

@@ -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 </dev/tty
echo # Newline after sensitive input echo # Newline after sensitive input
eval "$var_name=\"$input\"" eval "$var_name=\"$input\""
} }