nickvourd/DropperDragon

GitHub: nickvourd/DropperDragon

DropperDragon 是一个基于 Terraform 和 Ansible 的 Azure 基础设施自动化方案,能从零开始一键部署并配置支持 HTTPS 的生产级 Nginx Web 服务器。

Stars: 1 | Forks: 1

# DropperDragon 自动化 Dropper WebServer 解决方案。



GitHub License GitHub Repo stars
GitHub forks GitHub watchers GitHub contributors

## 描述 DropperDragon 是一个全面的基础设施自动化包,用于在 Azure 上部署和配置 web 服务器。它利用 Terraform 进行基础设施配置,并使用 Ansible 进行系统配置,提供无缝的自动化工作流。 ![Static Badge](https://img.shields.io/badge/Ansible-green?style=flat&logoSize=auto) ![Static Badge](https://img.shields.io/badge/Terraform-blue?style=flat&logoSize=auto) ![Static Badge](https://img.shields.io/badge/Python-purple?style=flat&logoSize=auto) ![Static Badge](https://img.shields.io/badge/Nginx-FF6900?style=flat&logoSize=auto) ![Static Badge](https://img.shields.io/badge/Azure-0078D4?style=flat&logoSize=auto) 以下列表解释了每个包的含义: - **Scripts-Pack**:用于编排基础设施部署和配置工作流的 Python 脚本。 - **Terraform-Pack**:用于配置 Azure VM 和网络资源的 Infrastructure-as-Code。 - **Ansible-Pack**:用于强化系统、安装 web 服务器和管理 SSL 证书的配置管理 playbook。 ℹ️ 本项目自动化了从裸基础设施到支持 HTTPS 的生产级 web 服务器的完整部署生命周期。 ## 免责声明 本项目的作者和贡献者对任何滥用该工具的行为不承担责任。该工具仅供教育和授权的基础设施部署目的使用。用户有责任确保其使用合法且已获得授权。 ## 目录 - [DropperDragon 基础设施包](#dropperdragon-infrastructure-pack) - [描述](#description) - [免责声明](#disclaimer) - [目录](#table-of-contents) - [功能](#features) - [安装](#installation) - [用法](#usage) - [目录结构](#directory-structure) ## 功能 - **自动化 Azure VM 配置**:一条命令完成基础设施部署 - **系统强化**:自动进行安全更新和包管理 - **Web 服务器配置**:自动安装和配置 nginx - **SSL 证书管理**:自动进行 Let's Encrypt 证书配置 - **幂等 Playbook**:可安全多次运行而无副作用 - **生产就绪**:配置为仅使用安全的 HTTPS 流量 ## 安装 在本地计算机上安装以下依赖。 ### 对于 Linux (Ubuntu/Debian): ``` sudo apt install terraform ansible azure-cli python3 -y ``` ### 对于 Mac: ``` brew install terraform azure-cli ansible python3 ``` ### 验证安装: ``` terraform --version ansible --version az --version python3 --version ssh -V ``` ## 用法 ### 身份验证 在部署基础设施之前,请先向 Azure 进行身份验证: ``` az login ``` ### 构建基础设施 #### 1. 克隆项目 ``` git clone https://github.com/nickvourd/DropperDragon.git cd DropperDragon ``` #### 2. 部署 Azure VM (Team Server) ``` python3 scripts-pack/setup.py \ -l \ -u \ -n \ -s \ -d \ -v ``` **示例:** ``` python3 scripts-pack/setup.py \ -l westus2 \ -u azureuser \ -n myapp \ -s ~/.ssh/id_rsa \ -d myapp-dns \ -v standard_b2s ``` **可用的 Azure 位置:** ``` eastus, eastus2, westus, westus2, westus3, northeurope, westeurope, southeastasia, eastasia, australiaeast, australiasoutheast, japaneast, japanwest ``` **可用的 VM 大小:** ``` standard_b1ms, standard_b2s, standard_b2ms ``` #### 3. 使用 Ansible 配置 Azure VM 在 Terraform 完成(2-3 分钟)后,配置 VM: ``` python3 scripts-pack/deploy.py --ssh-key ``` **示例:** ``` python3 scripts-pack/deploy.py --ssh-key ~/.ssh/id_rsa ``` #### 4. 访问您的服务 部署完成后,通过 HTTPS 访问您的服务: ``` https:// ``` FQDN 将显示在 `setup.py` 的输出中。 ## 目录结构 ``` DropperDragon/ ├── scripts-pack/ │ ├── setup.py # Azure VM provisioning (Terraform) │ ├── deploy.py # Ansible orchestration │ ├── README.md # This file │ └── __init__.py │ ├── Terraform-Pack/ │ ├── main.tf # Main Terraform configuration │ ├── outputs.tf # Terraform outputs │ ├── variables.tf # Terraform variables │ ├── terraform.tfvars # Generated by setup.py │ └── terraform.tfstate # State file │ ├── Ansible-Pack/ │ ├── site.yml # Main playbook with all tasks │ ├── nginx_default.j2 # Nginx config template │ └── inventory.ini # Generated dynamically by deploy.py │ └── docs/ └── superpowers/ └── plans/ # Implementation plans ```
标签:Ansible, ECS, Microsoft Azure, Nginx, Terraform, Web服务器, 系统提示词, 自动化运维, 逆向工具