Skip to content
SharafatKarim edited this page Dec 26, 2024 · 1 revision

Deploy

Deploy is the process we actually go run in an environment, that can be local, container based or shared environment. Here's all the things you need to know about the deployment process,

🐧 Deploy on Linux

On Linux, for most of the cases, modern Linux distros comes with python and git preinstalled, or can be installed right from the official repository without much of a hassle. It is recommended to use the latest package as much as possible.

Git clone

Clone the Ciraag Repository! Open your terminal and run the following command to clone the Ciraag repository:

git clone https://github.com/iniridwanul/Ciraag

But it's recommend to fork the repository if you want to help building with us! And a star is much appreciated!

Navigate to the directory

Then navigate to the Ciraag Directory. Change your current directory to the Ciraag folder:

cd Ciraag

Set Environment Variables

You will find a .env.sample file, for the reference of a .env file, as well as in the wiki. You can create one by executing

cd .env.sample .env

Afterwards, you must fill it up!

Create a python virtual environment

Creating a virtual environment is as easy as running,

python -m venv venv

Source from the venv

Activate the virtual environment with,

source venv/bin/activate

Install dependencies

Install required python dependencies, in this way,

pip install -r requirements.txt

Start Ciraag!

Finally, run the following command to start your own Ciraag,

bash start.sh

Ciraag will initialize and connect to Telegram automatically.


🪟 Deploy on Windows

On Windows, Python and Git may not come preinstalled. Make sure you install them before proceeding. It's recommended to use the latest version of both.

Install Required Tools

  1. Install Python:
    Download the latest version of Python from the [official website](https://www.python.org/downloads/) and install it. During installation, make sure to check the box that says "Add Python to PATH".

  2. Install Git:
    Download Git from [git-scm.com](https://git-scm.com/) and install it. During installation, select "Use Git from the command line and also from 3rd-party software" when prompted.

Clone the Repository

Open the Command Prompt or PowerShell and run the following command to clone the Ciraag repository:

git clone https://github.com/iniridwanul/Ciraag

If you'd like to contribute to the project, consider forking the repository first. Contributions are always welcome, and a star on GitHub is much appreciated!


Navigate to the Directory

Change your current directory to the Ciraag folder by running:

cd Ciraag

Create a .env File

A .env.sample file is provided as a reference. You need to create a .env file based on it. Run the following command to copy the .env.sample file to .env:

copy .env.sample .env

Edit the .env file and fill in all the required environment variables. You can use any text editor to do this, such as Notepad or VS Code.

Create a Python Virtual Environment

To isolate dependencies, create a virtual environment by running:

python -m venv venv

Activate the Virtual Environment

Activate the virtual environment with the following command:

venv\Scripts\activate

You should see (venv) at the beginning of your command line, indicating that the virtual environment is active.

Install Dependencies

Install the required Python dependencies by running:

pip install -r requirements.txt

Export Environment Variables (Manually)

Since Windows doesn’t support Bash scripts like start.sh, you need to manually set environment variables before running Ciraag. Open the Command Prompt or PowerShell and run the following commands for each variable in your .env file:

set VARIABLE_NAME=VALUE

For example, if your .env contains:

BOT_TOKEN=your_bot_token
API_ID=123456

Run:

set BOT_TOKEN=your_bot_token
set API_ID=123456

Repeat this process for all variables in the .env file.

Alternatively, you can permanently set environment variables using Windows Environment Variable settings.


Start Ciraag

With the virtual environment activated and environment variables set, start Ciraag using:

python -m ciraag

Ciraag will initialize and connect to Telegram automatically.

Warning

Deploying on windows is still not mature enough! In case you face some difficulities or errors, please contact with use. Above section is not fully tested. Feel free to contribute.