### Run Source Deployment Source: https://qd-today.github.io/qd/guide/deployment.html Starts the application using the Python interpreter. ```bash python ./run.py ``` -------------------------------- ### Deploy with Docker Compose Source: https://qd-today.github.io/qd/guide/deployment.html Recommended method for deployment. Requires creating a directory, downloading the compose file, and configuring environment variables before starting. ```sh # Create and switch to the QD directory. mkdir -p $(pwd)/qd/config && cd $(pwd)/qd # Download docker-compose.yml wget https://fastly.jsdelivr.net/gh/qd-today/qd@master/docker-compose.yml # Modify the configuration environment variables according to the requirements and configuration description vi ./docker-compose.yml # Execute Docker Compose command docker-compose up -d ``` -------------------------------- ### Install Dependencies Source: https://qd-today.github.io/qd/guide/deployment.html Installs required Python packages from the requirements file. ```bash # Please cd to the root of the framework source code first pip3 install -r requirements.txt ``` -------------------------------- ### Nginx Proxy Configuration for WeCom Source: https://qd-today.github.io/qd/toolbox/pusher.html Example Nginx configuration for proxying WeCom application push requests. ```nginx server { listen 443 ssl; server_name qywx.mydomain.com; ssl_certificate /etc/nginx/ssl/qywx.mydomain.com.crt; ssl_certificate_key /etc/nginx/ssl/qywx.mydomain.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; location / { proxy_pass https://qyapi.weixin.qq.com/; } } ``` -------------------------------- ### Deploy QD with Docker Source: https://qd-today.github.io/qd/guide/deployment.html Runs the QD container using host networking and a local configuration volume. ```bash docker run -d --name qd --env PORT=8923 --net=host -v $(pwd)/qd/config:/usr/src/app/config qdtoday/qd ``` -------------------------------- ### Configure Source Deployment Source: https://qd-today.github.io/qd/guide/deployment.html Copies the default configuration to a local file for persistent modifications. ```bash # Execute the following command to copy the configuration file # Modifying the content of the local_config.py file is not affected by updating the source code through git cp config.py local_config.py # Modify the configuration environment variables according to the requirements and configuration description vi local_config.py ``` -------------------------------- ### Access Web Interface Source: https://qd-today.github.io/qd/guide/deployment.html The URL to access the running application. ```bash # Access the web page http://localhost:8923/ ``` -------------------------------- ### Deploy with Docker Run Source: https://qd-today.github.io/qd/guide/deployment.html Direct container execution command. Maps port 8923 and mounts the local configuration directory. ```sh docker run -d --name qd -p 8923:80 -v $(pwd)/qd/config:/usr/src/app/config qdtoday/qd ``` -------------------------------- ### Configure Email Server in Docker Source: https://qd-today.github.io/qd/guide/faq.html Pass SMTP environment variables to the container during startup to enable email functionality. ```sh docker run -d --name qd -p 8923:80 -v $(pwd)/qd/config:/usr/src/app/config --env MAIL_SMTP=$STMP_Server_ --env MAIL_PORT=$Mailbox_server_port --env MAIL_USER=$Username --env MAIL_PASSWORD=$Password --env DOMAIN=$Domain qdtoday/qd ``` -------------------------------- ### Update Source Code Deployment Source: https://qd-today.github.io/qd/guide/update.html Execute this script from the source code directory to update the application and restart the process. ```sh # First cd to the directory of source code, execute the command and restart the process wget https://gitee.com/qd-today/qd/raw/master/update.sh -O ./update.sh && \ sh ./update.sh ``` -------------------------------- ### Configure Administrator Source: https://qd-today.github.io/qd/guide/deployment.html Promotes a user to administrator status using their email address. ```bash python ./chrole.py your@email.address admin ``` -------------------------------- ### Backup and Restore SQLite Database Source: https://qd-today.github.io/qd/guide/faq.html Use these commands to copy the database file to and from a running Docker container. ```sh # database backup docker cp container_name:/usr/src/app/config/database.db . # Database recovery docker cp database.db container_name:/usr/src/app/config/ ``` -------------------------------- ### Configure MySQL in Docker Source: https://qd-today.github.io/qd/guide/faq.html Set the database type and connection URL via environment variables to use MySQL instead of the default SQLite. ```sh docker run -d --name qd -p 8923:80 -v $(pwd)/qd/config:/usr/src/app/config --ENV DB_TYPE=mysql --ENV JAWSDB_MARIA_URL=mysql://$username:$password@$hostname:$port/$database_name?auth_plugin= qdtoday/qd ``` -------------------------------- ### Set GitHub acceleration environment variable Source: https://qd-today.github.io/qd/guide/faq.html Configure the SUBSCRIBE_ACCELERATE_URL environment variable in your container to resolve connection errors to GitHub. ```bash SUBSCRIBE_ACCELERATE_URL=https://xxx.xxx/https://raw.githubusercontent.com/ ``` -------------------------------- ### Telegram Bot Push Configuration Format Source: https://qd-today.github.io/qd/toolbox/pusher.html The final configuration string format for Telegram Bot push registration. ```text 1111111111:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;222222222;tg.mydomain.com ``` -------------------------------- ### Update Docker Container Deployment Source: https://qd-today.github.io/qd/guide/update.html Download and execute the update script inside the running container, then restart the container. ```sh # Enter the container background first, restart the container after executing the command wget https://gitee.com/qd-today/qd/raw/master/update.sh -O /usr/src/app/update.sh && \ sh /usr/src/app/update.sh ``` -------------------------------- ### Forcibly Synchronize Source Code Source: https://qd-today.github.io/qd/guide/update.html Use the -f flag to force a synchronization of the latest source code from the root directory. ```sh # First cd to the root directory of code, execute the command and restart the process # docker exec -it "container name" /bin/sh wget https://gitee.com/qd-today/qd/raw/master/update.sh -O ./update.sh && \ sh ./update.sh -f ``` -------------------------------- ### Update Docker Compose Deployment Source: https://qd-today.github.io/qd/guide/update.html Run these commands from the directory containing docker-compose.yml to pull the latest images and recreate the containers. ```sh # First cd to the directory of docker-compose.yml, execute the command and restart the container docker compose pull && \ docker compose up -d ``` -------------------------------- ### Configure Nginx for WebSocket support Source: https://qd-today.github.io/qd/guide/faq.html Use this configuration to enable WebSocket connections through an Nginx reverse proxy. Ensure the server_name and proxy_pass values are updated to match your environment. ```Nginx server { listen 80; # Modify server_name by yourself server_name qd.example.com; location / { proxy_pass http://ip:port; # Set WebSocket Configuration proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # Set other optional configuration proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } ``` -------------------------------- ### Update libseccomp on Debian Source: https://qd-today.github.io/qd/guide/faq.html Follow these steps to update libseccomp if encountering permission errors on ARM32 Debian systems. ```sh # Get signing keys to verify the new packages, otherwise they will not install sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138 # Add the Buster backport repository to apt sources.list echo 'deb http://httpredir.debian.org/debian buster-backports main contrib non-free' | sudo tee -a /etc/apt/sources.list.d/debian-backports.list sudo apt update sudo apt install libseccomp2 -t buster-backports ``` -------------------------------- ### PyCurl module import failure warning Source: https://qd-today.github.io/qd/guide/faq.html This warning occurs when the PyCurl module is missing, which is only necessary if using the proxy functionality. ```shell [W xxxxxx xx:xx:xx QD.Http.Fetcher fetcher:34] Import PyCurl module falied: No module named 'pycurl' ``` -------------------------------- ### Redis connection failure warning Source: https://qd-today.github.io/qd/guide/faq.html This warning appears when the Redis service is unavailable and the flow-limiting feature is not strictly required. ```shell [W xxxxxx xx:xx:xx QD.RedisDB redisdb:28] Connect Redis falied: Error 10061 connecting to localhost:6379. No connection could be made because the target machine actively refused it. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.