2 Commits
Author SHA256 Message Date
jkljkluiouio c338d39ed4 Merge pull request 'chore(ansible): 停止Git追踪服务器相关配置文件,改为添加示例配置文件' (#1) from chore/ansible into main
Reviewed-on: https://cpp.tongji.sh:2080/jkljkluiouio/tjhlp-gitea/pulls/1
2026-04-22 19:52:50 +08:00
jkljkluiouio 25c1fa9bd7 chore(ansible): 停止Git追踪服务器相关配置文件,改为添加示例配置文件
添加hosts.yml和all.yml的示例配置文件
更新README.md中的部署说明
将敏感配置文件添加到.gitignore
2026-04-21 15:16:46 +08:00
4 changed files with 61 additions and 2 deletions
+4
View File
@@ -33,3 +33,7 @@ Thumbs.db
# OpenCode # OpenCode
.opencode/ .opencode/
# Server inventory
ansible/inventory/hosts.yml
ansible/inventory/group_vars/all.yml
+8 -2
View File
@@ -30,8 +30,14 @@ tjhlp-gitea/
```bash ```bash
cd ansible cd ansible
# 编辑 inventory/hosts.yml 填入服务器地址 cp inventory/hosts.yml.example inventory/hosts.yml
# 编辑 inventory/group_vars/all.yml 修改域名、密码等 cp inventory/group_vars/all.yml.example inventory/group_vars/all.yml
```
编辑 ansible/inventory/hosts.yml 填入服务器地址
编辑 ansible/inventory/group_vars/all.yml 修改域名、密码等
```bash
ansible-playbook playbook.yml ansible-playbook playbook.yml
``` ```
@@ -0,0 +1,42 @@
---
# =============================================================================
# Gitea 答疑平台部署变量
# =============================================================================
# -----------------------------------------------------------------------------
# Gitea 基础配置
# -----------------------------------------------------------------------------
# 留空则自动获取最新版本, 填写则使用指定版本(如 "1.25.1")
gitea_version: ""
gitea_http_port: 3000
gitea_domain: "gitea.example.com" # 替换为实际域名或 IP
gitea_app_name: "同济大学高级语言程序设计答疑平台"
# -----------------------------------------------------------------------------
# Gitea 管理员账号(首次部署自动创建, 部署后请修改密码)
# -----------------------------------------------------------------------------
gitea_admin_user: "admin"
gitea_admin_password: "ChangeMe!2026" # 部署后务必修改
gitea_admin_email: "[email protected]"
# -----------------------------------------------------------------------------
# PostgreSQL 数据库配置
# -----------------------------------------------------------------------------
postgresql_version: 18
gitea_db_name: "gitea"
gitea_db_user: "gitea"
gitea_db_password: "change_this_db_password" # 请修改为强密码
# -----------------------------------------------------------------------------
# Webhook 配置
# -----------------------------------------------------------------------------
gitea_webhook_allowed_hosts: "*"
gitea_webhook_skip_tls: "false"
# -----------------------------------------------------------------------------
# 安全密钥(留空则自动生成, 生成后建议记录保存)
# -----------------------------------------------------------------------------
gitea_secret_key: ""
gitea_internal_token: ""
gitea_lfs_jwt_secret: ""
+7
View File
@@ -0,0 +1,7 @@
---
all:
hosts:
gitea-server:
ansible_host: 192.168.1.100 # 替换为实际服务器 IP
ansible_user: root # 替换为实际 SSH 用户
# ansible_ssh_private_key_file: ~/.ssh/id_rsa