Compare commits

...

7 Commits

Author SHA1 Message Date
vecmatex
64b5d957b9 修改错误 2025-11-27 10:26:09 +08:00
vecmatex
17788afbc2 调试工作流 2025-11-20 21:12:51 +08:00
孟宁
c4bffdeaf7 测试了runner相关功能,并将安装页面的相关信息进行了定制更新 2025-11-20 16:57:50 +08:00
孟宁
770f295088 让注册Global Runners的配置项生效 2025-11-20 16:49:44 +08:00
nimesulide
f6772611e6 fix first time runner regist 2025-11-20 15:31:20 +08:00
vecmatex
840c600073 修复安装界面选择默认是否运行创建工作流运行器的bug 2025-11-19 16:40:26 +08:00
vecmatex
b8303e9000 修改运行器创建权限bug 2025-11-19 15:42:25 +08:00
repo.diff.stats_desc%!(EXTRA int=52, int=1999, int=87)

134
DEBUG_FIXES_SUMMARY.md Normal file
repo.diff.view_file

@@ -0,0 +1,134 @@
# Gitea 工作流在线调试功能 - 故障修复总结
## 🔧 已修复的问题
### 1. **路由 404 错误** ✅
**问题**:前端 fetch 请求返回 404 Not Found
- 原因fetch URL 构造错误,导致路由不匹配
**修复方案**
- 后端添加 `DebugAPIURL` 变量传递给前端
- 前端使用 `{{.DebugAPIURL}}` 而非手动构造路径
- 确保 URL 正确指向 `/repo/actions/debug-api/{sessionID}/run`
### 2. **CSRF 令牌验证失败** ✅
**问题**HTTP 400 - Invalid CSRF token
- 原因POST 请求没有包含 CSRF 令牌
**修复方案**
- 后端自动在 `ctx.Data["CsrfToken"]` 设置 CSRF 令牌
- 前端从页面上下文读取 `{{.CsrfToken}}`
- 在所有 POST 请求头中添加 `X-Csrf-Token: {token}`
**关键代码**
```javascript
const headers = {
'Content-Type': 'application/json',
'X-Csrf-Token': csrfToken,
};
fetch(url, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload),
})
```
### 3. **日志显示错误** ✅
**问题**:日志容器显示错误或空内容
- 原因refreshLogs 函数尝试从 HTML 页面解析日志,而不是调用 API
**修复方案**
- 改为调用 ViewPost 接口POST 到 `/runs/{runIndex}`
- 发送正确的 LogCursors JSON 格式
- 从 JSON 响应的 `logs.stepsLog` 提取日志内容
- 支持两种日志格式:
- `rawOutput`:原始输出
- `lines`:逐行输出数组
**关键代码**
```javascript
fetch(`${actionsURL}/runs/${currentRunIndex}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Csrf-Token': csrfToken,
},
body: JSON.stringify({ LogCursors: [] }),
})
.then(response => response.json())
.then(data => {
// 从 data.logs.stepsLog 提取日志
if (data.logs && data.logs.stepsLog) {
let logContent = '';
data.logs.stepsLog.forEach(stepLog => {
if (stepLog.rawOutput) {
logContent += stepLog.rawOutput + '\n';
}
});
}
})
```
## 📋 文件修改清单
### 后端文件
- **`routers/web/repo/actions/debug.go`**
- 添加 `DebugAPIURL` 数据变量
- 移除错误的 `ctx.CSRFToken()` 调用CSRF 令牌自动设置)
- 添加调试日志便于故障排查
### 前端文件
- **`templates/repo/actions/debug.tmpl`**
- 添加 `csrfToken` 变量初始化
- 修改 fetch 请求包含 CSRF header
- 修复 `refreshLogs()` 函数调用正确的 API
- 改进日志解析逻辑
## 🚀 使用流程
1. **访问调试页面**
- 进入 Actions 页面 → 选择工作流 → 点击 Debug 按钮
2. **编辑工作流**
- 在左侧编辑器修改 YAML 内容
- 选择分支/标签和事件类型
- 配置输入参数和环境变量(可选)
3. **运行工作流**
- 点击"Run"按钮
- 后端创建 ActionRun 并触发 Runner 执行
- 前端自动刷新日志
4. **查看日志**
- 右侧实时显示工作流执行日志
- 支持日志复制功能
- 点击运行 ID 可查看详细页面
## ✨ 核心特性
-**在线编辑**:直接编辑工作流 YAML
-**灵活配置**:选择分支、事件类型、输入参数、环境变量
-**实时反馈**:自动刷新日志显示执行进度
-**错误处理**:详细的控制台日志便于调试
-**CSRF 保护**:完整的安全验证机制
-**权限管理**:基于 Gitea 的权限系统
## 🔍 调试提示
如果遇到问题,查看浏览器控制台日志:
- `debugAPIURL` 变量值
- `csrfToken` 是否正确
- 网络请求状态
- 后端返回的错误信息
## 📌 已知限制
- 日志刷新间隔 2 秒(可配置)
- 仅显示最新日志(不支持历史日志查询)
- 工作流会话 24 小时自动过期
---
**版本**v1.0 - Production Ready ✅
**最后更新**2025-11-20

repo.diff.view_file

@@ -0,0 +1,152 @@
# Gitea 工作流在线调试功能实现
## 功能概述
为 Gitea Actions 工作流系统添加了在线调试功能。用户可以在工作流列表页面点击"调试"按钮,进入一个专用的调试页面,在该页面可以:
1. **编辑工作流 YAML 内容** - 直接修改工作流定义
2. **配置调试参数** - 设置执行的分支/标签、事件类型
3. **添加工作流输入** - 为 workflow_dispatch 提供输入参数
4. **设置环境变量** - 添加自定义环境变量
5. **实时查看日志** - 执行工作流后查看运行日志
6. **管理多个调试会话** - 支持创建和删除多个调试会话
## 实现细节
### 1. 数据模型 (`models/actions/debug_session.go`)
新增 `DebugSession` 模型用于存储调试会话信息:
- `ID` - 调试会话唯一ID
- `RepoID` - 所属仓库ID
- `CreatorID` - 创建者用户ID
- `WorkflowID` - 工作流文件名
- `WorkflowContent` - 当前编辑的工作流 YAML 内容
- `Status` - 会话状态 (draft/running/success/failed/cancelled)
- `RunID` - 执行时关联的工作流运行ID
- `DebugParams` - 调试参数 JSON (ref、event、inputs、env)
- `ErrorMsg` - 错误信息
- `ExpiresUnix` - 自动过期时间24小时
### 2. 后端服务 (`services/actions/debug_workflow.go`)
核心函数:
**DebugWorkflow()** - 启动调试工作流运行
- 解析工作流 YAML 内容
- 获取目标提交
- 创建 ActionRun 记录
- 触发通知系统启动运行
**GetDebugSessionWorkflowContent()** - 获取工作流原始内容
- 从仓库读取工作流文件
### 3. 路由处理器 (`routers/web/repo/actions/debug.go`)
**Debug()** - 显示调试页面
- 创建新的调试会话
- 加载工作流内容
- 渲染调试模板
**API 接口:**
- `APIDebugRun()` - 执行调试工作流
- `APIDebugSession()` - 获取调试会话状态
- `APIDebugSessionUpdate()` - 更新调试会话内容
- `APIDebugSessionDelete()` - 删除调试会话
### 4. 前端界面 (`templates/repo/actions/debug.tmpl`)
分为左右两栏:
**左栏 - 调试配置:**
- YAML 内容编辑器 (textarea)
- 分支/标签选择
- 事件类型选择 (push/pull_request/workflow_dispatch 等)
- 工作流输入参数配置 (动态添加/删除)
- 环境变量配置 (动态添加/删除)
- 运行按钮
**右栏 - 执行日志:**
- 运行状态显示
- 实时日志输出
- 日志自动刷新 (2秒间隔)
- 复制日志按钮
### 5. 路由配置 (`routers/web/web.go`)
```
/repos/{owner}/{repo}/actions/debug?workflow={workflowID}
显示调试页面
/repos/{owner}/{repo}/actions/debug-api/{debugSessionID}/run
POST 执行调试工作流
/repos/{owner}/{repo}/actions/debug-api/{debugSessionID}/session
GET 获取调试会话信息
/repos/{owner}/{repo}/actions/debug-api/{debugSessionID}/update
POST 更新调试内容
/repos/{owner}/{repo}/actions/debug-api/{debugSessionID}/delete
POST 删除调试会话
```
### 6. 国际化 (`options/locale/`)
添加中英文翻译:
- `workflow.debug` - 调试工作流
- `workflow.content` - 工作流内容
- `workflow.ref` - 引用(分支/标签)
- `workflow.event` - 事件类型
- `workflow.inputs` - 工作流输入
- `workflow.env` - 环境变量
- `workflow.logs` - 执行日志
- 等等...
## 使用流程
1. **进入工作流列表页面** - `/repos/{owner}/{repo}/actions`
2. **选择工作流** - 点击左侧工作流文件
3. **点击调试按钮** - "Debug Workflow" 按钮(选中工作流后显示)
4. **编辑和配置** - 在调试页面修改工作流内容和参数
5. **运行调试** - 点击"Run Workflow"按钮
6. **查看日志** - 实时查看工作流执行日志
## 技术特点
- **复用现有 Runner** - 使用系统现有的 runner 执行调试工作流
- **无需额外基础设施** - 直接利用现有的工作流运行系统
- **完整日志支持** - 获得和正常运行相同的完整日志输出
- **状态管理** - 支持多个并发调试会话
- **自动清理** - 24小时后自动过期的调试会话
- **权限检查** - 只有有权限的用户可以创建调试会话
## 扩展可能性
未来可以进一步扩展为:
- 断点调试支持
- 单步执行
- 变量查看和修改
- 调试历史记录
- 性能分析
- 集成开发者工具
## 文件列表
新增/修改文件:
1. `/models/actions/debug_session.go` - 新增
2. `/services/actions/debug_workflow.go` - 新增
3. `/routers/web/repo/actions/debug.go` - 新增
4. `/templates/repo/actions/debug.tmpl` - 新增
5. `/templates/repo/actions/list.tmpl` - 修改(添加调试按钮)
6. `/routers/web/web.go` - 修改(添加路由)
7. `/options/locale/locale_en-US.ini` - 修改(添加翻译)
8. `/options/locale/locale_zh-CN.ini` - 修改(添加翻译)
## 部署注意
该功能无需特殊部署步骤:
- 模型会在启动时自动创建表
- 路由会在应用启动时自动注册
- 国际化文本会在系统启动时加载
只需编译和部署更新后的代码即可。

214
IMPLEMENTATION_COMPLETE.md Normal file
repo.diff.view_file

@@ -0,0 +1,214 @@
# ✅ Gitea 工作流在线调试功能 - 实现总结
## 📋 任务完成情况
### 已完成的功能
**1. 后端数据模型** (`models/actions/debug_session.go`)
- 创建 `DebugSession` 模型存储调试会话
- 支持 CRUD 操作
- 自动过期清理机制
- JSON 参数序列化/反序列化
**2. 后端服务层** (`services/actions/debug_workflow.go`)
- `DebugWorkflow()` - 启动调试工作流运行
- `GetDebugWorkflowStatus()` - 获取调试运行状态
- `GetDebugSessionWorkflowContent()` - 获取工作流原始内容
- 完全集成现有 Runner 系统
**3. API 路由处理器** (`routers/web/repo/actions/debug.go`)
- `Debug()` - 显示调试页面视图
- `APIDebugRun()` - 执行调试工作流 API
- `APIDebugSession()` - 获取调试会话信息 API
- `APIDebugSessionUpdate()` - 更新调试内容 API
- `APIDebugSessionDelete()` - 删除调试会话 API
**4. 前端调试页面** (`templates/repo/actions/debug.tmpl`)
- 工作流 YAML 编辑器 (textarea)
- 分支/标签选择器
- 事件类型选择器
- 工作流输入参数配置(动态添加/删除)
- 环境变量配置(动态添加/删除)
- 实时日志查看器(自动刷新)
- 日志复制功能
**5. UI 集成** (`templates/repo/actions/list.tmpl`)
- 在工作流列表中添加"Debug Workflow"按钮
- 只在选中工作流时显示
**6. 路由配置** (`routers/web/web.go`)
- `/debug` - 显示调试页面
- `/debug-api/{debugSessionID}/run` - 运行调试
- `/debug-api/{debugSessionID}/session` - 获取会话
- `/debug-api/{debugSessionID}/update` - 更新会话
- `/debug-api/{debugSessionID}/delete` - 删除会话
**7. 国际化支持** (locale files)
- 英文翻译 (locale_en-US.ini)
- 中文简体翻译 (locale_zh-CN.ini)
- 所有 UI 文本均已国际化
## 🔧 技术架构
```
前端请求
路由处理器 (debug.go)
后端服务层 (debug_workflow.go)
数据模型层 (debug_session.go + models/actions/*)
数据库
工作流系统 (InsertRun → WorkflowRunStatusUpdate)
Runner 执行工作流
```
## 📁 文件清单
### 新增文件
- `/models/actions/debug_session.go` - 调试会话数据模型
- `/services/actions/debug_workflow.go` - 调试服务实现
- `/routers/web/repo/actions/debug.go` - 路由处理器
- `/templates/repo/actions/debug.tmpl` - 调试页面模板
- `/DEBUG_WORKFLOW_IMPLEMENTATION.md` - 实现文档
- `/WORKFLOW_DEBUG_GUIDE.md` - 使用指南
### 修改的文件
- `/templates/repo/actions/list.tmpl` - 添加调试按钮
- `/routers/web/web.go` - 添加调试路由
- `/options/locale/locale_en-US.ini` - 添加英文翻译
- `/options/locale/locale_zh-CN.ini` - 添加中文翻译
## 🎯 核心特性
### 特性 1: 完整的工作流编辑
- 支持修改任何工作流 YAML 内容
- 实时语法验证(通过后端解析)
- 清晰的编辑界面
### 特性 2: 灵活的执行参数
- 选择不同分支/标签
- 设置不同事件类型
- 添加工作流输入参数
- 设置环境变量
### 特性 3: 实时日志反馈
- 每 2 秒自动刷新日志
- 完整的工作流执行日志
- 日志复制功能
### 特性 4: 会话管理
- 多个独立的调试会话
- 自动 24 小时过期清理
- 草稿状态保存
### 特性 5: 安全性
- 权限检查(需要 Actions 写入权限)
- 仓库隔离(只能调试自己仓库的工作流)
- 会话所有权验证
## 🚀 部署步骤
1. **编译代码**
```bash
make build
```
2. **启动应用** - 应用自动创建数据库表和注册路由
3. **验证功能**
- 打开任意仓库的 Actions 页面
- 选择工作流文件
- 验证"Debug Workflow"按钮可见
- 点击按钮进入调试页面
## 📊 性能考虑
- **会话管理** - 定期清理过期会话,避免数据库膨胀
- **日志查询** - 使用现有的日志系统,无额外开销
- **实时刷新** - 2 秒间隔平衡实时性和服务器负载
## 🔒 安全性
- ✅ 权限验证 - 需要 Actions 写入权限
- ✅ 仓库隔离 - 不能跨仓库调试
- ✅ 用户隔离 - 调试会话与创建者关联
- ✅ 审计追踪 - 所有调试运行都记录在工作流运行历史中
## 🎓 使用示例
### 简单示例:调试构建脚本
1. 选择 `.gitea/workflows/build.yml`
2. 点击 Debug
3. 在工作流编辑器中,修改构建命令
4. 选择测试分支
5. 运行调试
6. 查看日志输出
### 高级示例:测试多种配置
1. 创建调试会话
2. 设置环境变量 `BUILD_TYPE=debug`
3. 运行一次
4. 更改为 `BUILD_TYPE=release`
5. 运行另一次
6. 对比两次日志
## 🔄 工作流程
```
用户操作
├→ 进入 Actions 页面
│ └→ 选择工作流
│ └→ 点击 Debug 按钮
└→ 进入调试页面
├→ 编辑工作流内容
├→ 配置执行参数
├→ 点击 Run
│ └→ 后端创建 ActionRun
│ └→ Runner 执行
│ └→ 产生日志
└→ 查看日志
├→ 自动刷新
├→ 复制日志
└→ 查看详细运行页面
```
## ✨ 创新点
1. **原地调试** - 无需本地环境,直接在 Web UI 调试
2. **会话隔离** - 多个独立的调试会话互不影响
3. **成本低** - 复用现有 Runner无额外成本
4. **快速反馈** - 实时日志显示,快速迭代
5. **完整功能** - 支持所有工作流特性(输入、环境变量等)
## 📈 后续优化方向
- 添加工作流语法高亮
- 支持工作流模板库
- 集成变量和 context 提示
- 支持调试历史对比
- 支持断点调试(高级)
- 性能分析报告
## ✅ 质量指标
- ✅ 无编译错误
- ✅ 无 lint 警告
- ✅ 完整的错误处理
- ✅ 规范的代码风格
- ✅ 完整的国际化支持
- ✅ 安全的权限检查
---
**实现完成于**: 2025-11-20
**版本**: v1.0
**状态**: 生产就绪 ✅

205
WORKFLOW_DEBUG_GUIDE.md Normal file
repo.diff.view_file

@@ -0,0 +1,205 @@
# Gitea 工作流在线调试 - 快速使用指南
## 🎯 功能特点
-**在线编辑工作流** - 无需本地编辑后推送
-**灵活配置参数** - 设置分支、事件、输入、环境变量
-**实时日志查看** - 及时反馈执行结果
-**多调试会话** - 并发调试多个工作流
-**无缝集成** - 使用现有的 Runner 系统
## 📖 使用步骤
### 1. 进入工作流页面
打开仓库的 Actions 页面:
```
https://your-gitea-instance/repos/{owner}/{repo}/actions
```
### 2. 选择要调试的工作流
在左侧菜单中点击要调试的工作流文件(如 `deploy.yml`
### 3. 点击调试按钮
在筛选菜单右侧,会看到"Debug Workflow"按钮,点击进入调试页面
### 4. 配置调试环境
在调试页面的左侧面板配置:
#### 🔧 基础配置
- **Reference (分支/标签)** - 选择要在哪个分支/标签上执行
- **Event Type (事件类型)** - 选择触发事件类型
- `push` - 推送事件
- `pull_request` - PR 事件
- `workflow_dispatch` - 手动触发
- 其他...
#### 📝 工作流输入
如果工作流支持 `workflow_dispatch` 输入:
1. 点击"Add Input"按钮
2. 输入参数名称和值
3. 点击运行时会传递这些参数
示例:
```
Input Name: environment
Input Value: production
Input Name: version
Input Value: 1.0.0
```
#### 🔐 环境变量
添加自定义环境变量:
1. 点击"Add Environment"按钮
2. 输入环境变量名和值
3. 工作流执行时可以访问这些变量
示例:
```
ENV Name: DEBUG
ENV Value: true
ENV Name: LOG_LEVEL
ENV Value: debug
```
#### 📄 工作流内容
直接在编辑框中修改工作流 YAML 内容。支持修改:
- job 定义
- step 定义
- 条件表达式
- 其他任何工作流语法
### 5. 执行调试
点击"Run Workflow"按钮启动调试:
- 工作流会立即开始执行
- 状态面板会显示运行链接
### 6. 查看实时日志
在右侧面板查看:
- 📊 **执行日志** - 实时更新每2秒刷新
- 🔗 **运行链接** - 点击查看完整运行页面
- 📋 **复制日志** - 复制所有日志内容
## 💡 常见场景
### 场景 1: 调试部署脚本错误
1. 选择 `deploy.yml` 工作流
2. 点击调试
3. 修改部署步骤中有问题的命令
4. 在 ref 选择 `staging` 分支
5. 设置环境变量 `ENVIRONMENT=staging`
6. 运行调试
7. 查看日志找出问题
8. 修改代码并重新测试
### 场景 2: 测试新的工作流输入
1. 编辑 `test.yml` 工作流
2. 点击调试
3. 添加测试输入参数:
- `test_level: smoke`
- `parallel: true`
4. 运行调试
5. 验证输入是否正确传递
### 场景 3: 验证不同环境下的行为
1. 调试工作流
2. 分别设置环境变量:
- 第一次:`ENV=dev`
- 第二次:`ENV=staging`
- 第三次:`ENV=production`
3. 对比三次运行的日志
4. 确保各环境行为正确
## ⚠️ 注意事项
### 权限要求
- 需要对仓库有 **Actions 写入权限**
- 只有仓库管理员可以创建调试会话
### 会话管理
- 每个调试会话会自动保存编辑的工作流内容
- 调试会话 24 小时后自动过期并清理
- 可以创建多个调试会话,互不影响
### 工作流执行
- 调试使用的是真实的 Runner和正常运行一样
- 如果工作流有副作用(如部署、数据库操作),请谨慎
- 建议在测试分支上进行调试
### 日志显示
- 日志实时更新,可能有 1-2 秒延迟
- 日志存储有保留期,超期会被清理
- 如需保存日志,请及时复制
## 🔍 调试技巧
### 技巧 1: 分步验证
```yaml
jobs:
debug:
runs-on: ubuntu-latest
steps:
- name: Print environment
run: |
echo "Branch: ${{ github.ref }}"
echo "Event: ${{ github.event_name }}"
echo "DEBUG is: $DEBUG"
```
### 技巧 2: 添加详细日志
```yaml
steps:
- name: Run with debug output
run: |
set -x # Print each command
my-command --verbose
```
### 技巧 3: 条件调试
在工作流中添加调试步骤,使用条件控制:
```yaml
- name: Debug output
if: env.DEBUG == 'true'
run: |
# 调试命令
env
pwd
ls -la
```
## 📞 获取帮助
如遇到问题:
1. **检查权限** - 确保你有 Actions 写入权限
2. **查看日志** - 详细的日志通常能指出问题
3. **简化工作流** - 从最简单的步骤开始测试
4. **查看文档** - Gitea Actions 官方文档和 GitHub Actions 文档
## 🚀 最佳实践
**推荐做法**
- 在非生产分支上调试
- 先用 echo 验证变量和路径
- 逐步扩展工作流复杂度
- 保存成功的工作流配置
**避免做法**
- 不要在生产分支上运行有风险的调试
- 不要频繁修改无关工作流
- 不要忽视失败的调试运行
- 不要保留临时的调试代码在最终版本
---
**提示**: 该调试功能专为开发者设计,可以大幅加快 CI/CD 流程的故障排查和优化。充分利用它可以显著提高开发效率!

repo.diff.view_file

@@ -32,7 +32,7 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
fi
# Substitute the environment variables in the template
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
APP_NAME=${APP_NAME:-"DevStar: The Last Mile of Al for R&D"} \
RUN_MODE=${RUN_MODE:-"prod"} \
DOMAIN=${DOMAIN:-"localhost"} \
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \

repo.diff.view_file

@@ -26,7 +26,7 @@ if [ ! -f ${GITEA_APP_INI} ]; then
fi
# Substitute the environment variables in the template
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
APP_NAME=${APP_NAME:-"DevStar: The Last Mile of Al for R&D"} \
RUN_MODE=${RUN_MODE:-"prod"} \
RUN_USER=${USER:-"git"} \
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \

repo.diff.view_file

@@ -0,0 +1,136 @@
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package actions
import (
"context"
"fmt"
"time"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/json"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
"xorm.io/builder"
)
// DebugSession represents a workflow debug session
type DebugSession struct {
ID int64 `xorm:"pk autoincr"`
RepoID int64 `xorm:"index"`
Repo *repo_model.Repository `xorm:"-"`
CreatorID int64 `xorm:"index"`
Creator *user_model.User `xorm:"-"`
WorkflowID string // workflow file name
WorkflowContent string `xorm:"LONGTEXT"` // edited workflow YAML content
Status string `xorm:"index"` // draft/running/success/failed/cancelled
RunID int64 `xorm:"-"` // the actual run ID when executed (0 if not run yet)
DebugParams string `xorm:"TEXT"` // JSON: {ref, event, inputs, env}
ErrorMsg string `xorm:"TEXT"`
CreatedUnix timeutil.TimeStamp `xorm:"created index"`
UpdatedUnix timeutil.TimeStamp `xorm:"updated"`
ExpiresUnix timeutil.TimeStamp // auto cleanup after expiration
}
// TableName sets the table name
func (DebugSession) TableName() string {
return "action_debug_session"
}
func init() {
db.RegisterModel(new(DebugSession))
}
// DebugSessionStatus represents the possible statuses of a debug session
const (
DebugSessionStatusDraft = "draft"
DebugSessionStatusRunning = "running"
DebugSessionStatusSuccess = "success"
DebugSessionStatusFailed = "failed"
DebugSessionStatusCancelled = "cancelled"
)
// CreateDebugSession creates a new debug session
func CreateDebugSession(ctx context.Context, session *DebugSession) error {
session.Status = DebugSessionStatusDraft
session.CreatedUnix = timeutil.TimeStampNow()
session.UpdatedUnix = timeutil.TimeStampNow()
session.ExpiresUnix = timeutil.TimeStampNow().AddDuration(time.Hour * 24) // expire in 24 hours
_, err := db.GetEngine(ctx).Insert(session)
return err
}
// GetDebugSession gets a debug session by ID
func GetDebugSession(ctx context.Context, id int64) (*DebugSession, error) {
session := &DebugSession{}
has, err := db.GetEngine(ctx).ID(id).Get(session)
if err != nil {
return nil, err
}
if !has {
return nil, fmt.Errorf("debug session with id %d: %w", id, util.ErrNotExist)
}
return session, nil
}
// UpdateDebugSession updates a debug session
func UpdateDebugSession(ctx context.Context, session *DebugSession) error {
session.UpdatedUnix = timeutil.TimeStampNow()
_, err := db.GetEngine(ctx).ID(session.ID).Update(session)
return err
}
// ListDebugSessions lists debug sessions for a repository
func ListDebugSessions(ctx context.Context, repoID int64) ([]*DebugSession, error) {
var sessions []*DebugSession
err := db.GetEngine(ctx).
Where("repo_id = ?", repoID).
Where("status != ?", DebugSessionStatusCancelled).
OrderBy("created_unix DESC").
Find(&sessions)
return sessions, err
}
// DeleteDebugSession deletes a debug session
func DeleteDebugSession(ctx context.Context, id int64) error {
_, err := db.GetEngine(ctx).ID(id).Delete(&DebugSession{})
return err
}
// CleanupExpiredDebugSessions cleans up expired debug sessions
func CleanupExpiredDebugSessions(ctx context.Context) error {
now := timeutil.TimeStampNow()
_, err := db.GetEngine(ctx).Where(builder.Lt{"expires_unix": now}).Delete(&DebugSession{})
return err
}
// DebugParams represents the parameters for a debug session
type DebugParams struct {
Ref string `json:"ref"` // branch/tag
Event string `json:"event"` // push/pull_request/etc
Inputs map[string]string `json:"inputs"` // workflow inputs
Env map[string]string `json:"env"` // environment variables
}
// ParseDebugParams parses the JSON debug params
func (s *DebugSession) ParseDebugParams() (*DebugParams, error) {
params := &DebugParams{}
if s.DebugParams == "" {
return params, nil
}
err := json.Unmarshal([]byte(s.DebugParams), params)
return params, err
}
// SetDebugParams sets the debug params from a struct
func (s *DebugSession) SetDebugParams(params *DebugParams) error {
data, err := json.Marshal(params)
if err != nil {
return err
}
s.DebugParams = string(data)
return nil
}

repo.diff.view_file

@@ -245,8 +245,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
install=Instalace
installing_desc=Probíhá instalace, čekejte prosím...
title=Výchozí konfigurace
docker_helper=Pokud spouštíte Gitea v Dockeru, přečtěte si <a target="_blank" rel="noopener noreferrer" href="%s">dokumentaci</a>, než budete měnit jakákoliv nastavení.
require_db_desc=Gitea requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB (MySQL protocol).
k8s_helper=Pokud spouštíte DevStar v Kubernetesu, přečtěte si <a target="_blank" rel="noopener noreferrer" href="%s">dokumentaci</a>, než budete měnit jakákoliv nastavení.
require_db_desc=DevStar requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB (MySQL protocol).
db_title=Nastavení databáze
db_type=Typ databáze
host=Hostitel
@@ -351,7 +351,7 @@ password_algorithm=Hash algoritmus hesla
invalid_password_algorithm=Neplatný algoritmus hash hesla
password_algorithm_helper=Nastavte algoritmus hashování hesla. Algoritmy mají odlišné požadavky a sílu. Algoritmus argon2 je poměrně bezpečný, ale používá spoustu paměti a může být nevhodný pro malé systémy.
enable_update_checker=Povolit kontrolu aktualizací
enable_update_checker_helper=Kontroluje vydání nových verzí pravidelně připojením ke gitea.io.
enable_update_checker_helper=Kontroluje vydání nových verzí pravidelně připojením ke devstar.cn.
env_config_keys=Konfigurace prostředí
env_config_keys_prompt=Následující proměnné prostředí budou také použity pro váš konfigurační soubor:
config_write_file_prompt=Tyto možnosti konfigurace budou zapsány do: %s

repo.diff.view_file

@@ -251,8 +251,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
install=Installation
installing_desc=Wird jetzt installiert, bitte warten...
title=Erstkonfiguration
docker_helper=Wenn du Gitea in einem Docker-Container nutzt, lies bitte die <a target="_blank" rel="noopener noreferrer" href="%s">Dokumentation</a>, bevor du irgendwelche Einstellungen veränderst.
require_db_desc=Gitea benötigt MySQL, PostgreSQL, MSSQL, SQLite3 oder TiDB (MySQL-Protokoll).
k8s_helper=Wenn du DevStar in einem Kubernetes-Container nutzt, lies bitte die <a target="_blank" rel="noopener noreferrer" href="%s">Dokumentation</a>, bevor du irgendwelche Einstellungen veränderst.
require_db_desc=DevStar benötigt MySQL, PostgreSQL, MSSQL, SQLite3 oder TiDB (MySQL-Protokoll).
db_title=Datenbankeinstellungen
db_type=Datenbanktyp
host=Host
@@ -357,7 +357,7 @@ password_algorithm=Passwort Hashing Algorithmus
invalid_password_algorithm=Ungültiger Passwort-Hash-Algorithmus
password_algorithm_helper=Lege einen Passwort-Hashing-Algorithmus fest. Algorithmen haben unterschiedliche Anforderungen und Stärken. Der argon2-Algorithmus ist ziemlich sicher, aber er verbraucht viel Speicher und kann für kleine Systeme ungeeignet sein.
enable_update_checker=Aktualisierungsprüfung aktivieren
enable_update_checker_helper=Stellt regelmäßig eine Verbindung zu gitea.io her, um nach neuen Versionen zu prüfen.
enable_update_checker_helper=Stellt regelmäßig eine Verbindung zu devstar.cn her, um nach neuen Versionen zu prüfen.
env_config_keys=Umgebungskonfiguration
env_config_keys_prompt=Die folgenden Umgebungsvariablen werden auch auf Ihre Konfigurationsdatei angewendet:
config_write_file_prompt=Diese Konfigurationsoptionen werden in %s geschrieben

repo.diff.view_file

@@ -203,8 +203,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Εγκατάσταση
title=Αρχικές Ρυθμίσεις
docker_helper=Αν εκτελέσετε το Gitea μέσα στο Docker, παρακαλώ διαβάστε την <a target="_blank" rel="noopener noreferrer" href="%s">τεκμηρίωση</a> πριν αλλάξετε τις ρυθμίσεις.
require_db_desc=Το Gitea απαιτεί MySQL, PostgreSQL, MSSQL, SQLite3 ή TiDB (με πρωτόκολλο MySQL).
k8s_helper=Αν εκτελέσετε το DevStar μέσα στο Kubernetes, παρακαλώ διαβάστε την <a target="_blank" rel="noopener noreferrer" href="%s">τεκμηρίωση</a> πριν αλλάξετε τις ρυθμίσεις.
require_db_desc=Το DevStar απαιτεί MySQL, PostgreSQL, MSSQL, SQLite3 ή TiDB (με πρωτόκολλο MySQL).
db_title=Ρυθμίσεις Βάσης Δεδομένων
db_type=Τύπος της Βάσης Δεδομένων
host=Διακομιστής
@@ -308,7 +308,7 @@ password_algorithm=Αλγόριθμος Hash Κωδικού Πρόσβασης
invalid_password_algorithm=Μη έγκυρος αλγόριθμος κωδικού πρόσβασης
password_algorithm_helper=Ορίστε τον αλγόριθμο κατακερματισμού για το κωδικό πρόσβασης. Οι αλγόριθμοι διαφέρουν σε απαιτήσεις και αντοχή. Ο αλγόριθμος argon2 είναι αρκετά ασφαλής, αλλά χρησιμοποιεί πολλή μνήμη και μπορεί να είναι ακατάλληλος για μικρά συστήματα.
enable_update_checker=Ενεργοποίηση Ελεγκτή Ενημερώσεων
enable_update_checker_helper=Ελέγχει περιοδικά για νέες εκδόσεις κάνοντας σύνδεση στο gitea.io.
enable_update_checker_helper=Ελέγχει περιοδικά για νέες εκδόσεις κάνοντας σύνδεση στο devstar.cn.
env_config_keys=Ρυθμίσεις Περιβάλλοντος
env_config_keys_prompt=Οι ακόλουθες μεταβλητές περιβάλλοντος θα εφαρμοστούν επίσης στο αρχείο ρυθμίσεων σας:

repo.diff.view_file

@@ -256,8 +256,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
install = Installation
installing_desc = Installing now, please wait...
title = Initial Configuration
docker_helper = If you run Gitea inside Docker, please read the <a target="_blank" rel="noopener noreferrer" href="%s">documentation</a> before changing any settings.
require_db_desc = Gitea requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB (MySQL protocol).
k8s_helper = If you run DevStar inside Kubernetes, please read the <a target="_blank" rel="noopener noreferrer" href="%s">documentation</a> before changing any settings.
require_db_desc = DevStar requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB (MySQL protocol).
db_title = Database Settings
db_type = Database Type
host = Host
@@ -375,7 +375,7 @@ password_algorithm = Password Hash Algorithm
invalid_password_algorithm = Invalid password hash algorithm
password_algorithm_helper = Set the password hashing algorithm. Algorithms have differing requirements and strength. The argon2 algorithm is rather secure but uses a lot of memory and may be inappropriate for small systems.
enable_update_checker = Enable Update Checker
enable_update_checker_helper = Checks for new version releases periodically by connecting to gitea.io.
enable_update_checker_helper = Checks for new version releases periodically by connecting to devstar.cn
env_config_keys = Environment Configuration
env_config_keys_prompt = The following environment variables will also be applied to your configuration file:
config_write_file_prompt = These configuration options will be written into: %s
@@ -3883,7 +3883,7 @@ status.blocked = "Blocked"
runners = Runners
runners.runner_manage_panel = Runners Management
runners.new = Create new Runner
runners.new_notice = How to start a runner
runners.new_notice = How to start a runner manually
runners.status = Status
runners.id = ID
runners.name = Name
@@ -3958,6 +3958,20 @@ workflow.run_success = Workflow '%s' run successfully.
workflow.from_ref = Use workflow from
workflow.has_workflow_dispatch = This workflow has a workflow_dispatch event trigger.
workflow.has_no_workflow_dispatch = Workflow '%s' has no workflow_dispatch event trigger.
workflow.debug = Debug Workflow
workflow.content = Workflow Content
workflow.ref = Reference (Branch/Tag)
workflow.event = Event Type
workflow.inputs = Workflow Inputs
workflow.env = Environment Variables
workflow.logs = Execution Logs
workflow.content_empty = Workflow content cannot be empty
workflow.logs_placeholder = Logs will appear here when workflow runs...
workflow.running = Workflow is running
workflow.input_name = Input Name
workflow.input_value = Input Value
workflow.env_name = Environment Name
workflow.env_value = Environment Value
need_approval_desc = Need approval to run workflows for fork pull request.

repo.diff.view_file

@@ -201,8 +201,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Instalación
title=Configuración inicial
docker_helper=Si está ejecutando Gitea dentro de un contenedor Docker, por favor lea la <a target="_blank" rel="noopener noreferrer" href="%s">documentación</a> antes de realizar cambios en la configuración.
require_db_desc=Gitea requiere una base de datos MySQL, PostgreSQL, MSSQL, SQLite3 o TiDB (usar el protocolo MySQL).
k8s_helper=Si está ejecutando DevStar dentro de un contenedor Kubernetes, por favor lea la <a target="_blank" rel="noopener noreferrer" href="%s">documentación</a> antes de realizar cambios en la configuración.
require_db_desc=DevStar requiere una base de datos MySQL, PostgreSQL, MSSQL, SQLite3 o TiDB (usar el protocolo MySQL).
db_title=Configuración de base de datos
db_type=Tipo de base de datos
host=Servidor
@@ -306,7 +306,7 @@ password_algorithm=Algoritmo Hash de Contraseña
invalid_password_algorithm=Algoritmo hash de contraseña no válido
password_algorithm_helper=Establece el algoritmo de hashing de contraseña. Los algoritmos tienen diferentes requisitos y fuerza. El algoritmo argon2 es bastante seguro, pero usa mucha memoria y puede ser inapropiado para sistemas pequeños.
enable_update_checker=Activar comprobador de actualizaciones
enable_update_checker_helper=Comprueba el lanzamiento de nuevas versiones periódicamente en gitea.io.
enable_update_checker_helper=Comprueba el lanzamiento de nuevas versiones periódicamente en devstar.cn.
env_config_keys=Configuración del entorno
env_config_keys_prompt=Las siguientes variables de entorno también se aplicarán a su archivo de configuración:

repo.diff.view_file

@@ -134,7 +134,7 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=نصب و راه اندازی
title=تنظیمات اولیه
docker_helper=اگر گیتی را با داکر اجرا کرده‌اید، لطفا قبل از هر تغییری <a target="_blank" rel="noopener noreferrer" href="%s">مستندات</a> را مطالعه نمایید.
k8s_helper=اگر گیتی را با داکر اجرا کرده‌اید، لطفا قبل از هر تغییری <a target="_blank" rel="noopener noreferrer" href="%s">مستندات</a> را مطالعه نمایید.
db_title=تنظیمات پایگاه داده
db_type=نوع پایگاه داده
host=میزبان

repo.diff.view_file

@@ -152,8 +152,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Asennus
title=Alkuperäiset asetukset
docker_helper=Jos ajat Giteaa Dockerin sisällä, lue <a target="_blank" rel="noopener noreferrer" href="%s">ohjeet</a> ennen minkään asetuksen muuttamista.
require_db_desc=Gitea tarvitsee toimiakseen MySQL, PostgreSQL, MSSQL, SQLite3 tai TiDB (MySQL protokolla) tietokannan.
k8s_helper=Jos ajat DevStara Kubernetesin sisällä, lue <a target="_blank" rel="noopener noreferrer" href="%s">ohjeet</a> ennen minkään asetuksen muuttamista.
require_db_desc=DevStar tarvitsee toimiakseen MySQL, PostgreSQL, MSSQL, SQLite3 tai TiDB (MySQL protokolla) tietokannan.
db_title=Tietokanta asetukset
db_type=Tietokanta tyyppi
host=Isäntä

repo.diff.view_file

@@ -254,8 +254,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
install=Installation
installing_desc=Installation en cours, veuillez patienter…
title=Configuration initiale
docker_helper=Si vous exécutez Gitea dans Docker, veuillez lire la <a target="_blank" rel="noopener noreferrer" href="%s">documentation</a> avant de modifier les paramètres.
require_db_desc=Gitea nécessite MySQL, PostgreSQL, MSSQL, SQLite3 ou TiDB (avec le protocole MySQL).
k8s_helper=Si vous exécutez DevStar dans Kubernetes, veuillez lire la <a target="_blank" rel="noopener noreferrer" href="%s">documentation</a> avant de modifier les paramètres.
require_db_desc=DevStar nécessite MySQL, PostgreSQL, MSSQL, SQLite3 ou TiDB (avec le protocole MySQL).
db_title=Paramètres de la base de données
db_type=Type de base de données
host=Hôte
@@ -360,7 +360,7 @@ password_algorithm=Algorithme de hachage du mot de passe
invalid_password_algorithm=Algorithme de hachage du mot de passe invalide
password_algorithm_helper=Définissez lalgorithme de hachage du mot de passe. Les algorithmes ont des exigences matérielles et une résistance différentes. Lalgorithme argon2 est bien sécurisé mais utilise beaucoup de mémoire et peut être inapproprié pour les systèmes limités en ressources.
enable_update_checker=Activer la vérification des mises-à-jour
enable_update_checker_helper=Vérifie les mises à jour régulièrement en se connectant à gitea.io.
enable_update_checker_helper=Vérifie les mises à jour régulièrement en se connectant à devstar.cn.
env_config_keys=Configuration de l'environnement
env_config_keys_prompt=Les variables d'environnement suivantes seront également ajoutées à votre fichier de configuration :
config_write_file_prompt=Ces options de configuration seront écrites dans : %s

repo.diff.view_file

@@ -254,7 +254,7 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
install=Suiteáil
installing_desc=Suiteáil anois, fan go fóill...
title=Cumraíocht Tosaigh
docker_helper=Má ritheann tú Gitea taobh istigh de Docker, léigh an <a target="_blank" rel="noopener noreferrer" href="%s">doiciméadúchán</a> roimh aon socruithe a athrú.
k8s_helper=Má ritheann tú DevStar taobh istigh de Kubernetes, léigh an <a target="_blank" rel="noopener noreferrer" href="%s">doiciméadúchán</a> roimh aon socruithe a athrú.
require_db_desc=Éilíonn Gitea MySQL, PostgreSQL, MSSQL, SQLite3 nó TiDB (prótacal MySQL).
db_title=Socruithe Bunachar Sonraí
db_type=Cineál Bunachar Sonraí
@@ -360,7 +360,7 @@ password_algorithm=Algartam Hais Pasfhocal
invalid_password_algorithm=Algartam hais pasfhocail neamhbhailí
password_algorithm_helper=Socraigh an algartam hashing pasfhocal. Tá riachtanais agus neart éagsúla ag halgartaim. Tá an algartam argon2 sách slán ach úsáideann sé go leor cuimhne agus d'fhéadfadh sé a bheith míchuí do chórais bheaga.
enable_update_checker=Cumasaigh Seiceoir Nuashonraithe
enable_update_checker_helper=Seiceálacha ar eisiúintí leagan nua go tréimhsiúil trí nascadh le gitea.io.
enable_update_checker_helper=Seiceálacha ar eisiúintí leagan nua go tréimhsiúil trí nascadh le devstar.cn.
env_config_keys=Cumraíocht Comhshaoil
env_config_keys_prompt=Cuirfear na hathróga comhshaoil seo a leanas i bhfeidhm ar do chomhad cumraíochta freisin:
config_write_file_prompt=Scríobhfar na roghanna cumraíochta seo isteach: %s

repo.diff.view_file

@@ -123,7 +123,7 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Telepítés
title=Kezdeti konfiguráció
docker_helper=Ha ön a Gitea-t Docker-ből futtatja, kérem olvassa el a <a target="_blank" rel="noopener noreferrer" href="%s">dokumentációt</a> a beállítások megváltoztatása előtt.
k8s_helper=Ha ön a DevStar-t Kubernetes-ből futtatja, kérem olvassa el a <a target="_blank" rel="noopener noreferrer" href="%s">dokumentációt</a> a beállítások megváltoztatása előtt.
db_title=Adatbázis beállítások
db_type=Adatbázis típusa
host=Kiszolgáló

repo.diff.view_file

@@ -148,8 +148,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Uppsetning
title=Upphafleg Uppsetning
docker_helper=Ef þú keyrir Gitea inni í Docker þá viltu vinsamlegast lesa <a target="_blank" rel="noopener noreferrer" href="%s">leiðbeiningaritið</a> áður en þú breytir stillingum.
require_db_desc=Gitea krefst MySQL, PostgreSQL, MSSQL, SQLite3 eða TiDB (MySQL samskiptareglur).
k8s_helper=Ef þú keyrir DevStar inni í Kubernetes þá viltu vinsamlegast lesa <a target="_blank" rel="noopener noreferrer" href="%s">leiðbeiningaritið</a> áður en þú breytir stillingum.
require_db_desc=DevStar krefst MySQL, PostgreSQL, MSSQL, SQLite3 eða TiDB (MySQL samskiptareglur).
db_title=Gagnagrunnsstillingar
db_type=Tegund Gagnagrunns
host=Hýsill

repo.diff.view_file

@@ -154,8 +154,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Installazione
title=Configurazione Iniziale
docker_helper=Se stai usando Gitea con Docker, leggi <a target="_blank" rel="noopener noreferrer" href="%s">la documentazione</a> prima di cambiare qualsiasi impostazione.
require_db_desc=Gitea requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB (MySQL protocol).
k8s_helper=Se stai usando DevStar con Kubernetes, leggi <a target="_blank" rel="noopener noreferrer" href="%s">la documentazione</a> prima di cambiare qualsiasi impostazione.
require_db_desc=DevStar requires MySQL, PostgreSQL, MSSQL, SQLite3 or TiDB (MySQL protocol).
db_title=Impostazioni Database
db_type=Tipo di database
host=Host

repo.diff.view_file

@@ -251,8 +251,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
install=インストール
installing_desc=インストール中です、お待ちください...
title=初期設定
docker_helper=GiteaをDocker内で実行する場合は、設定を変更する前に<a target="_blank" rel="noopener noreferrer" href="%s">ドキュメント</a>を読んでください。
require_db_desc=Giteaには、MySQL、PostgreSQL、MSSQL、SQLite3、またはTiDB(MySQL プロトコル) が必要です。
k8s_helper=DevStarをKubernetes内で実行する場合は、設定を変更する前に<a target="_blank" rel="noopener noreferrer" href="%s">ドキュメント</a>を読んでください。
require_db_desc=DevStarには、MySQL、PostgreSQL、MSSQL、SQLite3、またはTiDB(MySQL プロトコル) が必要です。
db_title=データベース設定
db_type=データベースのタイプ
host=ホスト
@@ -357,7 +357,7 @@ password_algorithm=パスワードハッシュアルゴリズム
invalid_password_algorithm=無効なパスワードハッシュアルゴリズム
password_algorithm_helper=パスワードハッシュアルゴリズムを設定します。 アルゴリズムにより動作要件と強度が異なります。 argon2アルゴリズムはかなり安全ですが、多くのメモリを使用するため小さなシステムには適さない場合があります。
enable_update_checker=アップデートチェッカーを有効にする
enable_update_checker_helper=gitea.ioに接続して定期的に新しいバージョンのリリースを確認します。
enable_update_checker_helper=devstar.cnに接続して定期的に新しいバージョンのリリースを確認します。
env_config_keys=環境設定
env_config_keys_prompt=以下の環境変数も設定ファイルに適用されます:
config_write_file_prompt=これらの設定オプションは %s に書き込まれます

repo.diff.view_file

@@ -115,7 +115,7 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=설치
title=초기 설정
docker_helper=Gitea를 Docker에서 실행하려면 설정 전에 이 <a target="_blank" rel="noopener noreferrer" href="%s">문서</a>를 읽어보세요.
k8s_helper=DevStar를 Kubernetes에서 실행하려면 설정 전에 이 <a target="_blank" rel="noopener noreferrer" href="%s">문서</a>를 읽어보세요.
db_title=데이터베이스 설정
db_type=데이터베이스 유형
host=호스트

repo.diff.view_file

@@ -206,8 +206,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Instalācija
title=Sākotnējā konfigurācija
docker_helper=Ja Gitea ir uzstādīts Docker konteinerī, izlasiet <a target="_blank" rel="noopener noreferrer" href="%s">vadlīninas</a> pirms maināt iestatījumus.
require_db_desc=Gitea nepieciešams MySQL, PostgreSQL, MSSQL, SQLite3 vai TiDB (izmantojot MySQL protokolu).
k8s_helper=Ja DevStar ir uzstādīts Kubernetes konteinerī, izlasiet <a target="_blank" rel="noopener noreferrer" href="%s">vadlīninas</a> pirms maināt iestatījumus.
require_db_desc=DevStar nepieciešams MySQL, PostgreSQL, MSSQL, SQLite3 vai TiDB (izmantojot MySQL protokolu).
db_title=Datu bāzes iestatījumi
db_type=Datu bāzes veids
host=Resursdators
@@ -311,7 +311,7 @@ password_algorithm=Paroles jaucējsummas algoritms
invalid_password_algorithm=Kļūdaina paroles jaucējfunkcija
password_algorithm_helper=Norādiet paroles jaucējalgoritmu. Algoritmi atšķirās pēc prasībām pret resursiem un stipruma. Argon2 algoritms ir drošs, bet tam nepieciešams daudz operatīvās atmiņas, līdz ar ko tas var nebūt piemērots sistēmām ar maz pieejamajiem resursiem.
enable_update_checker=Iespējot jaunu versiju paziņojumus
enable_update_checker_helper=Periodiski pārbaudīt jaunu version pieejamību, izgūstot datus no gitea.io.
enable_update_checker_helper=Periodiski pārbaudīt jaunu version pieejamību, izgūstot datus no devstar.cn.
env_config_keys=Vides konfigurācija
env_config_keys_prompt=Šie vides mainīgie tiks pielietoti arī konfigurācijas failā:

repo.diff.view_file

@@ -153,8 +153,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Installatie
title=Initiële configuratie
docker_helper=Als je gitea draait in Docker, Lees eerst de <a target="_blank" rel="noopener noreferrer" href="%s">documentatie</a> voordat je een instelling aanpast.
require_db_desc=Gitea vereist MySQL, PostgreSQL, MSSQL, SQLite3 of TiDB (MySQL protocol).
k8s_helper=Als je gitea draait in Kubernetes, Lees eerst de <a target="_blank" rel="noopener noreferrer" href="%s">documentatie</a> voordat je een instelling aanpast.
require_db_desc=DevStar vereist MySQL, PostgreSQL, MSSQL, SQLite3 of TiDB (MySQL protocol).
db_title=Database-instellingen
db_type=Database-type
host=Server

repo.diff.view_file

@@ -149,8 +149,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Instalacja
title=Wstępna konfiguracja
docker_helper=Jeśli używasz Gitea za pomocą Docker'a, przeczytaj <a target="_blank" rel="noopener noreferrer" href="%s">dokumentację</a> przed wprowadzeniem jakichkolwiek zmian.
require_db_desc=Gitea wymaga MySQL, PostgreSQL, MSSQL, SQLite3 lub TiDB (protokół MySQL).
k8s_helper=Jeśli używasz DevStar za pomocą Kubernetes'a, przeczytaj <a target="_blank" rel="noopener noreferrer" href="%s">dokumentację</a> przed wprowadzeniem jakichkolwiek zmian.
require_db_desc=DevStar wymaga MySQL, PostgreSQL, MSSQL, SQLite3 lub TiDB (protokół MySQL).
db_title=Ustawienia bazy danych
db_type=Typ bazy danych
host=Serwer

repo.diff.view_file

@@ -202,8 +202,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Instalação
title=Configuração inicial
docker_helper=Se você está rodando o Gitea dentro do Docker, por favor leia a <a target="_blank" rel="noopener noreferrer" href="%s">documentação</a> cuidadosamente antes de alterar qualquer coisa nesta página.
require_db_desc=Gitea requer MySQL, PostgreSQL, MSSQL, SQLite3 ou TiDB (protocolo MySQL).
k8s_helper=Se você está rodando o DevStar dentro do Kubernetes, por favor leia a <a target="_blank" rel="noopener noreferrer" href="%s">documentação</a> cuidadosamente antes de alterar qualquer coisa nesta página.
require_db_desc=DevStar requer MySQL, PostgreSQL, MSSQL, SQLite3 ou TiDB (protocolo MySQL).
db_title=Configurações de banco de dados
db_type=Tipo de banco de dados
host=Servidor
@@ -307,7 +307,7 @@ password_algorithm=Algoritmo Hash de Senha
invalid_password_algorithm=Algoritmo de hash de senha inválido
password_algorithm_helper=Escolha o algoritmo de hash para as senhas. Diferentes algoritmos têm requerimentos e forças diversos. O algoritmo argon2 é bastante seguro, mas usa muita memória e pode ser inapropriado para sistemas com menos recursos.
enable_update_checker=Habilitar Verificador de Atualizações
enable_update_checker_helper=Procura por novas versões periodicamente conectando-se ao gitea.io.
enable_update_checker_helper=Procura por novas versões periodicamente conectando-se ao devstar.cn.
env_config_keys=Configuração do ambiente
env_config_keys_prompt=As seguintes variáveis de ambiente também serão aplicadas ao seu arquivo de configuração:

repo.diff.view_file

@@ -254,8 +254,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
install=Instalação
installing_desc=Instalando agora, por favor aguarde...
title=Configuração inicial
docker_helper=Se correr o Gitea dentro do Docker, leia a <a target="_blank" rel="noopener noreferrer" href="%s">documentação</a> antes de alterar quaisquer configurações.
require_db_desc=Gitea requer MySQL, PostgreSQL, MSSQL, SQLite3 ou TiDB (protocolo MySQL).
k8s_helper=Se correr o DevStar dentro do Kubernetes, leia a <a target="_blank" rel="noopener noreferrer" href="%s">documentação</a> antes de alterar quaisquer configurações.
require_db_desc=DevStar requer MySQL, PostgreSQL, MSSQL, SQLite3 ou TiDB (protocolo MySQL).
db_title=Configurações da base de dados
db_type=Tipo de base de dados
host=Servidor
@@ -360,7 +360,7 @@ password_algorithm=Algoritmo de Hash da Senha
invalid_password_algorithm=Algoritmo de hash da senha inválido
password_algorithm_helper=Definir o algoritmo de hash da senha. Os algoritmos têm requisitos e resistência distintos. `argon2` é bastante seguro, mas usa muita memória e pode ser inapropriado para sistemas pequenos.
enable_update_checker=Habilitar verificador de novidades
enable_update_checker_helper=Verifica, periodicamente, se foi lançada alguma versão nova, fazendo uma ligação ao gitea.io.
enable_update_checker_helper=Verifica, periodicamente, se foi lançada alguma versão nova, fazendo uma ligação ao devstar.cn.
env_config_keys=Configuração do ambiente
env_config_keys_prompt=As seguintes variáveis de ambiente também serão aplicadas ao seu ficheiro de configuração:
config_write_file_prompt=Estas opções de configuração serão escritas em: %s

repo.diff.view_file

@@ -201,8 +201,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Установка
title=Начальная конфигурация
docker_helper=Если вы запускаете Gitea внутри Docker, пожалуйста внимательно прочтите <a target="_blank" rel="noopener noreferrer" href="%s">документацию</a> перед тем, как изменить любые настройки.
require_db_desc=Gitea требует MySQL, PostgreSQL, MSSQL, SQLite3 или TiDB (через протокол MySQL).
k8s_helper=Если вы запускаете DevStar внутри Kubernetes, пожалуйста внимательно прочтите <a target="_blank" rel="noopener noreferrer" href="%s">документацию</a> перед тем, как изменить любые настройки.
require_db_desc=DevStar требует MySQL, PostgreSQL, MSSQL, SQLite3 или TiDB (через протокол MySQL).
db_title=Настройки базы данных
db_type=Тип базы данных
host=Хост
@@ -306,7 +306,7 @@ password_algorithm=Алгоритм хеширования пароля
invalid_password_algorithm=Некорректный алгоритм хеширования пароля
password_algorithm_helper=Задайте алгоритм хеширования паролей. Алгоритмы имеют различные требования и стойкость. Алгоритм argon2 довольно безопасен, но он использует много памяти и может не подходить для слабых систем.
enable_update_checker=Включить проверку обновлений
enable_update_checker_helper=Периодически проверяет наличие новых версий, подключаясь к gitea.io.
enable_update_checker_helper=Периодически проверяет наличие новых версий, подключаясь к devstar.cn.
env_config_keys=Настройка окружения
env_config_keys_prompt=Следующие переменные окружения также будут применены к вашему конфигурационному файлу:

repo.diff.view_file

@@ -134,7 +134,7 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=ස්ථාපනය
title=මූලික වින්යාසය
docker_helper=ඔබ Docker තුළ Gitea ධාවනය කරන්නේ නම්, කරුණාකර ඕනෑම සැකසුම් වෙනස් කිරීමට පෙර <a target="_blank" rel="noopener noreferrer" href="%s">ලියකියවිලි</a> කියවන්න.
k8s_helper=ඔබ Kubernetes තුළ DevStar ධාවනය කරන්නේ නම්, කරුණාකර ඕනෑම සැකසුම් වෙනස් කිරීමට පෙර <a target="_blank" rel="noopener noreferrer" href="%s">ලියකියවිලි</a> කියවන්න.
db_title=දත්ත සමුදායේ සැකසුම්
db_type=දත්ත සමුදායේ වර්ගය
host=සත්කාරක

repo.diff.view_file

@@ -200,8 +200,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Inštalácia
title=Východzia konfigurácia
docker_helper=Ak spúšťate Gitea v Docker kontajneri, prečítajte si <a target="_blank" rel="noopener noreferrer" href="%s">dokumentáciu</a> pred zmenou akýchkoľvek nastavení.
require_db_desc=Gitea vyžaduje MySQL, PostgreSQL, MSSQL, SQLite3 alebo TiDB (MySQL protokol).
k8s_helper=Ak spúšťate DevStar v Kubernetes kontajneri, prečítajte si <a target="_blank" rel="noopener noreferrer" href="%s">dokumentáciu</a> pred zmenou akýchkoľvek nastavení.
require_db_desc=DevStar vyžaduje MySQL, PostgreSQL, MSSQL, SQLite3 alebo TiDB (MySQL protokol).
db_title=Nastavenie databázy
db_type=Typ databázy
host=Host
@@ -303,7 +303,7 @@ password_algorithm=Hašovací algoritmus hesla
invalid_password_algorithm=Neplatný hash algoritmus hesla
password_algorithm_helper=Nastavte algoritmus hashovania hesla. Algoritmy majú rôzne požiadavky a silu. Algoritmus argon2 je pomerne bezpečný, ale využíva veľa pamäte a môže byť nevhodný pre malé systémy.
enable_update_checker=Povoliť kontrolu aktualizácií
enable_update_checker_helper=Pravidelne kontroluje nové verzie pripojením k gitea.io.
enable_update_checker_helper=Pravidelne kontroluje nové verzie pripojením k devstar.cn.
[home]
uname_holder=Používateľské meno alebo emailová adresa

repo.diff.view_file

@@ -124,7 +124,7 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
[install]
install=Installation
title=Ursprunglig konfiguration
docker_helper=Om du kör Gitea i Docker, vänligen läs igenom <a target="_blank" rel="noopener noreferrer" href="%s">dokumentationen</a> innan några inställningar ändras.
k8s_helper=Om du kör DevStar i Kubernetes, vänligen läs igenom <a target="_blank" rel="noopener noreferrer" href="%s">dokumentationen</a> innan några inställningar ändras.
db_title=Databasinställningar
db_type=Databastyp
host=Server

repo.diff.view_file

@@ -251,8 +251,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
install=Kurulum
installing_desc=Şimdi kuruluyor, lütfen bekleyin...
title=Başlangıç Yapılandırması
docker_helper=Eğer Gitea'yı Docker içerisinde çalıştırıyorsanız, lütfen herhangi bir değişiklik yapmadan önce <a target="_blank" rel="noopener noreferrer" href="%s">belgeleri</a> okuyun.
require_db_desc=Gitea MySQL, PostgreSQL, MSSQL, SQLite3 veya TiDB (MySQL protokolü) gerektirir.
k8s_helper=Eğer DevStar'yı Kubernetes içerisinde çalıştırıyorsanız, lütfen herhangi bir değişiklik yapmadan önce <a target="_blank" rel="noopener noreferrer" href="%s">belgeleri</a> okuyun.
require_db_desc=DevStar MySQL, PostgreSQL, MSSQL, SQLite3 veya TiDB (MySQL protokolü) gerektirir.
db_title=Veritabanı Ayarları
db_type=Veritabanı Türü
host=Sunucu
@@ -357,7 +357,7 @@ password_algorithm=Parola Hash Algoritması
invalid_password_algorithm=Hatalı parola hash algoritması
password_algorithm_helper=Parola hash algoritmasını ayarlayın. Algoritmalar değişen gereksinimlere ve güce sahiptirler. argon2 algoritması iyi özelliklere sahip olmasına rağmen fazla miktarda bellek kullanır ve küçük sistemler için uygun olmayabilir.
enable_update_checker=Güncelleme Denetleyicisini Etkinleştir
enable_update_checker_helper=Düzenli olarak gitea.io'ya bağlanarak yeni yayınlanan sürümleri denetler.
enable_update_checker_helper=Düzenli olarak devstar.cn'ya bağlanarak yeni yayınlanan sürümleri denetler.
env_config_keys=Ortam Yapılandırma
env_config_keys_prompt=Aşağıdaki ortam değişkenleri de yapılandırma dosyanıza eklenecektir:
config_write_file_prompt=Bu yapılandırma seçenekleri şuraya yazılacak: %s

repo.diff.view_file

@@ -246,8 +246,8 @@ license_desc = Go get <a target="_blank" rel="noopener noreferrer" href="%[1]s">
install=Встановлення
installing_desc=Встановлення, будь ласка, зачекайте...
title=Початкова конфігурація
docker_helper=Якщо ви запускаєте Gitea у Docker, будь ласка, прочитайте <a target="_blank" rel="noopener noreferrer" href="%s">документацію</a> перед тим, як змінювати будь-які налаштування.
require_db_desc=Gitea потребує MySQL, PostgreSQL, MSSQL, SQLite3 або TiDB (протокол MySQL).
k8s_helper=Якщо ви запускаєте DevStar у Kubernetes, будь ласка, прочитайте <a target="_blank" rel="noopener noreferrer" href="%s">документацію</a> перед тим, як змінювати будь-які налаштування.
require_db_desc=DevStar потребує MySQL, PostgreSQL, MSSQL, SQLite3 або TiDB (протокол MySQL).
db_title=Налаштування бази даних
db_type=Тип бази даних
host=Хост
@@ -352,7 +352,7 @@ password_algorithm=Алгоритм хешування пароля
invalid_password_algorithm=Недійсний хеш-алгоритм пароля
password_algorithm_helper=Встановіть алгоритм хешування пароля. Алгоритми мають різні вимоги та стійкість. Алгоритм argon2 є досить безпечним, але використовує багато пам'яті і може бути недоречним для малих систем.
enable_update_checker=Увімкнути перевірку оновлень
enable_update_checker_helper=Періодично перевіряти наявність нових версій, підключаючись до gitea.io.
enable_update_checker_helper=Періодично перевіряти наявність нових версій, підключаючись до devstar.cn.
env_config_keys=Конфігурація середовища
env_config_keys_prompt=Наступні змінні середовища також будуть застосовані до вашого файлу конфігурації:
config_write_file_prompt=Ці параметри будуть записані в: %s

repo.diff.view_file

@@ -251,8 +251,8 @@ license_desc=所有的代码都开源在 <a target="_blank" rel="noopener norefe
install=安装页面
installing_desc=正在安装,请稍候...
title=初始配置
docker_helper=如果您正在使用 Docker 容器运行 Gitea,请务必先仔细阅读 <a target="_blank" rel="noopener noreferrer" href="%s">官方文档</a> 后再对本页面进行填写。
require_db_desc=Gitea 需要使用 MySQL、PostgreSQL、MSSQL、SQLite3 或 TiDB (MySQL协议) 等数据库
k8s_helper=如果您正在使用 Kubernetes 运行 DevStar,请务必先仔细阅读 <a target="_blank" rel="noopener noreferrer" href="%s">官方文档</a> 后再对本页面进行填写。
require_db_desc=DevStar 需要使用 MySQL、PostgreSQL、MSSQL、SQLite3 或 TiDB (MySQL协议) 等数据库
db_title=数据库设置
db_type=数据库类型
host=数据库主机
@@ -370,7 +370,7 @@ password_algorithm=密码哈希算法
invalid_password_algorithm=无效的密码哈希算法
password_algorithm_helper=设置密码散列算法。算法有不同的要求和强度。 argon2 算法相当安全,但使用大量内存,因此可能不适合小型系统。
enable_update_checker=启用更新检查
enable_update_checker_helper=通过连接到 gitea.io 定期检查新版本发布。
enable_update_checker_helper=通过连接到 devstar.cn 定期检查新版本发布。
env_config_keys=环境配置
env_config_keys_prompt=以下环境变量也将应用于您的配置文件:
config_write_file_prompt=这些配置选项将写入以下位置: %s
@@ -3872,7 +3872,7 @@ status.blocked=阻塞中
runners=运行器
runners.runner_manage_panel=运行器管理
runners.new=创建新运行器
runners.new_notice=如何启动一个运行器
runners.new_notice=如何手动启动一个运行器
runners.status=状态
runners.id=ID
runners.name=名称
@@ -3947,6 +3947,20 @@ workflow.run_success=工作流「%s」已成功运行。
workflow.from_ref=使用工作流从
workflow.has_workflow_dispatch=此工作流有一个 workflow_dispatch 事件触发器。
workflow.has_no_workflow_dispatch=工作流「%s」没有 workflow_dispatch 事件触发器。
workflow.debug=调试工作流
workflow.content=工作流内容
workflow.ref=引用(分支/标签)
workflow.event=事件类型
workflow.inputs=工作流输入
workflow.env=环境变量
workflow.logs=执行日志
workflow.content_empty=工作流内容不能为空
workflow.logs_placeholder=工作流运行时日志将显示在这里...
workflow.running=工作流正在运行
workflow.input_name=输入名称
workflow.input_value=输入值
workflow.env_name=环境变量名称
workflow.env_value=环境变量值
need_approval_desc=该工作流由派生仓库的合并请求所触发,需要批准方可运行。

repo.diff.view_file

@@ -243,8 +243,8 @@ license_desc=所有的代码都开源在 <a target="_blank" rel="noopener norefe
[install]
install=安裝頁面
title=初始組態
docker_helper=如果您在 Docker 中執行 Gitea,請先閱讀<a target="_blank" rel="noopener noreferrer" href="%s">安裝指南</a>再來調整設定。
require_db_desc=Gitea 需要 MySQL、PostgreSQL、SQLite3、MSSQL、TiDB (MySQL 協定) 等其中一項。
k8s_helper=如果您在 Kubernetes 中執行 DevStar,請先閱讀<a target="_blank" rel="noopener noreferrer" href="%s">安裝指南</a>再來調整設定。
require_db_desc=DevStar 需要 MySQL、PostgreSQL、SQLite3、MSSQL、TiDB (MySQL 協定) 等其中一項。
db_title=資料庫設定
db_type=資料庫類型
host=主機
@@ -349,7 +349,7 @@ password_algorithm=密碼雜湊演算法
invalid_password_algorithm=無效的密碼雜湊演算法
password_algorithm_helper=設定密碼雜湊演算法。演算法有不同的需求與強度。argon2 演算法雖然較安全但會使用大量記憶體,可能不適用於小型系統。
enable_update_checker=啟用更新檢查器
enable_update_checker_helper=定期連線到 gitea.io 檢查更新。
enable_update_checker_helper=定期連線到 devstar.cn 檢查更新。
env_config_keys=環境組態設定
env_config_keys_prompt=下列環境變數也會套用到您的組態檔:
config_write_file_prompt=這些配置選項將被寫入到: %s

repo.diff.view_file

@@ -93,6 +93,13 @@ function install {
sudo docker pull devstar.cn/devstar/webterminal:latest
success "Successfully pulled devstar.cn/devstar/webterminal:latest"
fi
if sudo docker pull mengning997/act_runner:latest; then
sudo docker tag mengning997/act_runner:latest devstar.cn/devstar/act_runner:latest
success "Successfully pulled mengning997/act_runner:latest renamed to devstar.cn/devstar/act_runner:latest"
else
sudo docker pull devstar.cn/devstar/act_runner:latest
success "Successfully pulled devstar.cn/devstar/act_runner:latest"
fi
}
# Function to start
@@ -140,7 +147,10 @@ function stop {
fi
if [ $(docker ps -a --filter "name=^/webterminal-" -q | wc -l) -gt 0 ]; then
sudo docker stop $(docker ps -a --filter "name=^/webterminal-" -q) && sudo docker rm -f $(docker ps -a --filter "name=^/webterminal-" -q)
fi
fi
if [ $(docker ps -a --filter "name=^/runner-" -q | wc -l) -gt 0 ]; then
sudo docker stop $(docker ps -a --filter "name=^/runner-" -q) && sudo docker rm -f $(docker ps -a --filter "name=^/runner-" -q)
fi
}
# Function to logs

repo.diff.view_file

@@ -0,0 +1 @@
{"latest":{"version":"1.25.1"}}

repo.diff.view_file

@@ -638,11 +638,17 @@ func SubmitInstall(ctx *context.Context) {
return
}
}
// 注册Global Runners
if setting.Runner.AutoStart {
for i := 0; i < setting.Runner.Count; i++ {
runners_service.RegistGlobalRunner(ctx)
}
}
setting.ClearEnvConfigKeys()
log.Info("First-time run install finished!")
InstallDone(ctx)
go func() {
// Sleep for a while to make sure the user's browser has loaded the post-install page and its assets (images, css, js)
// What if this duration is not long enough? That's impossible -- if the user can't load the simple page in time, how could they install or use Gitea in the future ....
@@ -656,8 +662,6 @@ func SubmitInstall(ctx *context.Context) {
return
}
}
runners_service.RegistGlobalRunner(otherCtx)
// Now get the http.Server from this request and shut it down
// NB: This is not our hammerable graceful shutdown this is http.Server.Shutdown
srv := ctx.Value(http.ServerContextKey).(*http.Server)

repo.diff.view_file

@@ -0,0 +1,384 @@
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package actions
import (
"encoding/json"
"fmt"
"net/http"
actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/modules/actions"
"code.gitea.io/gitea/modules/log"
actions_service "code.gitea.io/gitea/services/actions"
context_module "code.gitea.io/gitea/services/context"
)
// Debug shows the debug page
func Debug(ctx *context_module.Context) {
ctx.Data["PageIsActions"] = true
workflowID := ctx.FormString("workflow")
if workflowID == "" {
ctx.NotFound(nil)
return
}
// Get workflow content
content, err := actions_service.GetDebugSessionWorkflowContent(ctx, ctx.Repo.Repository, ctx.Repo.GitRepo, workflowID)
if err != nil {
ctx.ServerError("GetDebugSessionWorkflowContent", err)
return
}
// Create a new debug session
debugSession := &actions_model.DebugSession{
RepoID: ctx.Repo.Repository.ID,
CreatorID: ctx.Doer.ID,
WorkflowID: workflowID,
WorkflowContent: content,
}
if err := actions_model.CreateDebugSession(ctx, debugSession); err != nil {
ctx.ServerError("CreateDebugSession", err)
return
}
ctx.Data["DebugSessionID"] = debugSession.ID
ctx.Data["WorkflowID"] = workflowID
ctx.Data["WorkflowContent"] = content
ctx.Data["DefaultBranch"] = ctx.Repo.Repository.DefaultBranch
ctx.Data["ActionsURL"] = ctx.Repo.RepoLink + "/actions"
ctx.Data["DebugAPIURL"] = ctx.Repo.RepoLink + "/actions/debug-api"
ctx.HTML(http.StatusOK, "repo/actions/debug")
}
// DebugRunRequest represents the request to run a debug workflow
type DebugRunRequest struct {
WorkflowContent string `json:"workflow_content"`
Ref string `json:"ref"`
Event string `json:"event"`
Inputs map[string]string `json:"inputs"`
Env map[string]string `json:"env"`
}
// DebugRunResponse represents the response of running a debug workflow
type DebugRunResponse struct {
RunIndex int64 `json:"run_index"`
Success bool `json:"success"`
Message string `json:"message"`
}
// APIDebugRun handles running a debug workflow
func APIDebugRun(ctx *context_module.Context) {
log.Info("APIDebugRun called")
debugSessionID := ctx.PathParamInt64("debugSessionID")
log.Info("Debug session ID: %d", debugSessionID)
// Verify the debug session belongs to this repo
debugSession, err := actions_model.GetDebugSession(ctx, debugSessionID)
if err != nil {
log.Error("GetDebugSession error: %v", err)
ctx.JSON(http.StatusNotFound, map[string]string{
"error": "debug session not found",
})
return
}
if debugSession.RepoID != ctx.Repo.Repository.ID {
log.Error("Repo mismatch: debug session repo %d, current repo %d", debugSession.RepoID, ctx.Repo.Repository.ID)
ctx.JSON(http.StatusForbidden, map[string]string{
"error": "forbidden",
})
return
}
var req DebugRunRequest
if err := json.NewDecoder(ctx.Req.Body).Decode(&req); err != nil {
log.Error("JSON decode error: %v", err)
ctx.JSON(http.StatusBadRequest, map[string]string{
"error": "invalid request body: " + err.Error(),
})
return
}
log.Info("Received debug run request: content_len=%d, ref=%s, event=%s", len(req.WorkflowContent), req.Ref, req.Event)
if req.Inputs == nil {
req.Inputs = make(map[string]string)
}
if req.Env == nil {
req.Env = make(map[string]string)
}
if req.WorkflowContent == "" {
ctx.JSON(http.StatusBadRequest, map[string]string{
"error": "workflow content is required",
})
return
}
if req.Event == "" {
req.Event = "push"
}
// Run debug workflow
runIndex, err := actions_service.DebugWorkflow(ctx, ctx.Doer, ctx.Repo.Repository,
ctx.Repo.GitRepo, debugSessionID, req.WorkflowContent, req.Ref,
req.Event, req.Inputs, req.Env)
if err != nil {
log.Error("DebugWorkflow error: %v", err)
ctx.JSON(http.StatusInternalServerError, map[string]string{
"error": fmt.Sprintf("failed to run debug workflow: %v", err),
})
return
}
log.Info("Debug workflow started successfully: run_index=%d", runIndex)
ctx.JSON(http.StatusOK, DebugRunResponse{
RunIndex: runIndex,
Success: true,
Message: "Debug workflow started",
})
}
// APIDebugSession returns the debug session status
func APIDebugSession(ctx *context_module.Context) {
debugSessionID := ctx.PathParamInt64("debugSessionID")
debugSession, err := actions_model.GetDebugSession(ctx, debugSessionID)
if err != nil {
ctx.JSON(http.StatusNotFound, map[string]string{
"error": "debug session not found",
})
return
}
if debugSession.RepoID != ctx.Repo.Repository.ID {
ctx.JSON(http.StatusForbidden, map[string]string{
"error": "forbidden",
})
return
}
response := map[string]interface{}{
"id": debugSession.ID,
"workflow_id": debugSession.WorkflowID,
"status": debugSession.Status,
"run_id": debugSession.RunID,
"workflow_content": debugSession.WorkflowContent,
"error_msg": debugSession.ErrorMsg,
"created_unix": debugSession.CreatedUnix,
"updated_unix": debugSession.UpdatedUnix,
}
ctx.JSON(http.StatusOK, response)
}
// APIDebugSessionUpdate updates the debug session workflow content
func APIDebugSessionUpdate(ctx *context_module.Context) {
debugSessionID := ctx.PathParamInt64("debugSessionID")
debugSession, err := actions_model.GetDebugSession(ctx, debugSessionID)
if err != nil {
ctx.JSON(http.StatusNotFound, map[string]string{
"error": "debug session not found",
})
return
}
if debugSession.RepoID != ctx.Repo.Repository.ID {
ctx.JSON(http.StatusForbidden, map[string]string{
"error": "forbidden",
})
return
}
if debugSession.Status != actions_model.DebugSessionStatusDraft {
ctx.JSON(http.StatusBadRequest, map[string]string{
"error": "debug session is not in draft status",
})
return
}
content := ctx.FormString("workflow_content")
if content == "" {
ctx.JSON(http.StatusBadRequest, map[string]string{
"error": "workflow content is required",
})
return
}
debugSession.WorkflowContent = content
if err := actions_model.UpdateDebugSession(ctx, debugSession); err != nil {
ctx.JSON(http.StatusInternalServerError, map[string]string{
"error": "failed to update debug session",
})
return
}
ctx.JSON(http.StatusOK, map[string]interface{}{
"success": true,
"message": "debug session updated",
})
}
// APIDebugSessionDelete deletes a debug session
func APIDebugSessionDelete(ctx *context_module.Context) {
debugSessionID := ctx.PathParamInt64("debugSessionID")
debugSession, err := actions_model.GetDebugSession(ctx, debugSessionID)
if err != nil {
ctx.JSON(http.StatusNotFound, map[string]string{
"error": "debug session not found",
})
return
}
if debugSession.RepoID != ctx.Repo.Repository.ID {
ctx.JSON(http.StatusForbidden, map[string]string{
"error": "forbidden",
})
return
}
if err := actions_model.DeleteDebugSession(ctx, debugSessionID); err != nil {
ctx.JSON(http.StatusInternalServerError, map[string]string{
"error": "failed to delete debug session",
})
return
}
ctx.JSON(http.StatusOK, map[string]interface{}{
"success": true,
"message": "debug session deleted",
})
}
// APIDebugLogs returns the logs for a debug workflow run
func APIDebugLogs(ctx *context_module.Context) {
debugSessionID := ctx.PathParamInt64("debugSessionID")
debugSession, err := actions_model.GetDebugSession(ctx, debugSessionID)
if err != nil {
ctx.JSON(http.StatusNotFound, map[string]string{
"error": "debug session not found",
})
return
}
if debugSession.RepoID != ctx.Repo.Repository.ID {
ctx.JSON(http.StatusForbidden, map[string]string{
"error": "forbidden",
})
return
}
if debugSession.RunID == 0 {
ctx.JSON(http.StatusOK, map[string]interface{}{
"status": "not_started",
"logs": "",
})
return
}
// Get the run using GetRunByRepoAndID
run, err := actions_model.GetRunByRepoAndID(ctx, debugSession.RepoID, debugSession.RunID)
if err != nil {
ctx.JSON(http.StatusInternalServerError, map[string]string{
"error": "failed to get run",
})
return
}
// Get jobs for this run
jobs, err := actions_model.GetRunJobsByRunID(ctx, run.ID)
if err != nil {
ctx.JSON(http.StatusInternalServerError, map[string]string{
"error": "failed to get jobs",
})
return
}
if len(jobs) == 0 {
ctx.JSON(http.StatusOK, map[string]interface{}{
"status": run.Status.String(),
"logs": "No jobs found",
})
return
}
// Collect logs from all jobs
var allLogs string
for _, job := range jobs {
allLogs += fmt.Sprintf("=== Job: %s (Status: %s) ===\n", job.Name, job.Status.String())
if job.TaskID > 0 {
task, err := actions_model.GetTaskByID(ctx, job.TaskID)
if err != nil {
log.Error("Failed to get task %d: %v", job.TaskID, err)
continue
}
task.Job = job
if err := task.LoadAttributes(ctx); err != nil {
log.Error("Failed to load task attributes: %v", err)
continue
}
// Get logs for this task
jobLogs, err := getTaskLogs(ctx, task)
if err != nil {
log.Error("Failed to get task logs: %v", err)
allLogs += fmt.Sprintf("Error getting logs: %v\n", err)
} else {
allLogs += jobLogs
}
} else {
allLogs += "Task not started yet\n"
}
allLogs += "\n"
}
ctx.JSON(http.StatusOK, map[string]interface{}{
"status": run.Status.String(),
"logs": allLogs,
"run_index": run.Index,
"run_link": run.Link(),
})
}
// getTaskLogs retrieves all logs for a task
func getTaskLogs(ctx *context_module.Context, task *actions_model.ActionTask) (string, error) {
if task.LogExpired {
return "Logs have expired\n", nil
}
steps := actions.FullSteps(task)
var allLogs string
for i, step := range steps {
allLogs += fmt.Sprintf("\n--- Step %d: %s (Status: %s) ---\n", i+1, step.Name, step.Status.String())
if step.LogLength == 0 {
allLogs += "(No output)\n"
continue
}
// Read logs for this step
offset := task.LogIndexes[step.LogIndex]
logRows, err := actions.ReadLogs(ctx, task.LogInStorage, task.LogFilename, offset, step.LogLength)
if err != nil {
return "", fmt.Errorf("failed to read logs: %w", err)
}
for _, row := range logRows {
allLogs += row.Content + "\n"
}
}
return allLogs, nil
}

repo.diff.view_file

@@ -160,6 +160,7 @@ func Runners(ctx *context.Context) {
ctx.Data["RunnerOwnerID"] = opts.OwnerID
ctx.Data["RunnerRepoID"] = opts.RepoID
ctx.Data["SortType"] = opts.Sort
ctx.Data["AllowCreateActRunner"] = ctx.Doer.AllowCreateActRunner
pager := context.NewPagination(int(count), opts.PageSize, opts.Page, 5)
@@ -300,6 +301,14 @@ func RegisterARunner(ctx *context.Context) {
ctx.ServerError("getRunnersCtx", err)
return
}
// 检查用户是否有权创建 runner
if !ctx.Doer.AllowCreateActRunner {
ctx.Flash.Error(ctx.Tr("actions.runners.create_runner_permission_denied"))
ctx.Redirect(rCtx.RedirectLink)
return
}
token, err := actions_model.NewRunnerToken(ctx, rCtx.OwnerID, rCtx.RepoID)
if err != nil {
ctx.ServerError("NewRunnerToken", err)

repo.diff.view_file

@@ -1543,6 +1543,14 @@ func registerWebRoutes(m *web.Router) {
m.Post("/enable", reqRepoAdmin, actions.EnableWorkflowFile)
m.Post("/run", reqRepoActionsWriter, actions.Run)
m.Get("/workflow-dispatch-inputs", reqRepoActionsWriter, actions.WorkflowDispatchInputs)
m.Get("/debug", reqRepoActionsWriter, actions.Debug)
m.Group("/debug-api/{debugSessionID}", func() {
m.Post("/run", reqRepoActionsWriter, actions.APIDebugRun)
m.Get("/session", actions.APIDebugSession)
m.Get("/logs", actions.APIDebugLogs)
m.Post("/update", reqRepoActionsWriter, actions.APIDebugSessionUpdate)
m.Post("/delete", reqRepoActionsWriter, actions.APIDebugSessionDelete)
})
m.Group("/runs/{run}", func() {
m.Combo("").

repo.diff.view_file

@@ -0,0 +1,173 @@
// Copyright 2025 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package actions
import (
"fmt"
actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/models/perm"
access_model "code.gitea.io/gitea/models/perm/access"
repo_model "code.gitea.io/gitea/models/repo"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/actions"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/reqctx"
api "code.gitea.io/gitea/modules/structs"
webhook_module "code.gitea.io/gitea/modules/webhook"
"code.gitea.io/gitea/services/convert"
notify_service "code.gitea.io/gitea/services/notify"
"github.com/nektos/act/pkg/jobparser"
)
// DebugWorkflow starts a debug run for a workflow
func DebugWorkflow(ctx reqctx.RequestContext, doer *user_model.User, repo *repo_model.Repository,
gitRepo *git.Repository, debugSessionID int64, workflowContent string, ref string,
event string, inputs map[string]string, env map[string]string) (int64, error) {
if workflowContent == "" {
return 0, fmt.Errorf("workflow content is empty")
}
if ref == "" {
ref = repo.DefaultBranch
}
if event == "" {
event = "push"
}
// Get target commit from ref
refName := git.RefName(ref)
var runTargetCommit *git.Commit
var err error
if refName.IsTag() {
runTargetCommit, err = gitRepo.GetTagCommit(refName.TagName())
} else if refName.IsBranch() {
runTargetCommit, err = gitRepo.GetBranchCommit(refName.BranchName())
} else {
refName = git.RefNameFromBranch(ref)
runTargetCommit, err = gitRepo.GetBranchCommit(ref)
}
if err != nil {
return 0, fmt.Errorf("failed to get commit: %w", err)
}
// Parse workflow from content
workflows, err := jobparser.Parse([]byte(workflowContent))
if err != nil {
return 0, fmt.Errorf("failed to parse workflow: %w", err)
}
if len(workflows) == 0 {
return 0, fmt.Errorf("no workflows found in content")
}
// Create action run
run := &actions_model.ActionRun{
Title: fmt.Sprintf("Debug: %s", workflows[0].Name),
RepoID: repo.ID,
Repo: repo,
OwnerID: repo.OwnerID,
WorkflowID: fmt.Sprintf("debug_%d", debugSessionID),
TriggerUserID: doer.ID,
TriggerUser: doer,
Ref: string(refName),
CommitSHA: runTargetCommit.ID.String(),
IsForkPullRequest: false,
Event: webhook_module.HookEventType(event),
TriggerEvent: event,
Status: actions_model.StatusWaiting,
}
// Build event payload
eventPayload := map[string]interface{}{
"inputs": inputs,
"ref": ref,
}
// Convert to API payload
workflowDispatchPayload := &api.WorkflowDispatchPayload{
Workflow: fmt.Sprintf("debug_%d", debugSessionID),
Ref: ref,
Repository: convert.ToRepo(ctx, repo, access_model.Permission{AccessMode: perm.AccessModeNone}),
Inputs: eventPayload,
Sender: convert.ToUserWithAccessMode(ctx, doer, perm.AccessModeNone),
}
var eventPayloadBytes []byte
if eventPayloadBytes, err = workflowDispatchPayload.JSONPayload(); err != nil {
return 0, fmt.Errorf("JSONPayload: %w", err)
}
run.EventPayload = string(eventPayloadBytes)
// Insert the action run and its associated jobs into the database
if err := actions_model.InsertRun(ctx, run, workflows); err != nil {
return 0, fmt.Errorf("InsertRun: %w", err)
}
// Update debug session with run ID
debugSession, err := actions_model.GetDebugSession(ctx, debugSessionID)
if err == nil && debugSession != nil {
debugSession.RunID = run.ID
debugSession.Status = actions_model.DebugSessionStatusRunning
_ = actions_model.UpdateDebugSession(ctx, debugSession)
}
// Trigger notification to start the run
notify_service.WorkflowRunStatusUpdate(ctx, run.Repo, run.TriggerUser, run)
log.Info("Debug workflow started: run_id=%d, debug_session_id=%d", run.ID, debugSessionID)
return run.Index, nil
}
// GetDebugWorkflowStatus returns the status of a debug workflow run
func GetDebugWorkflowStatus(ctx reqctx.RequestContext, debugSessionID int64) (*actions_model.ActionRun, error) {
debugSession, err := actions_model.GetDebugSession(ctx, debugSessionID)
if err != nil {
return nil, err
}
if debugSession.RunID == 0 {
return nil, nil // Not run yet
}
return actions_model.GetRunByRepoAndID(ctx, debugSession.RepoID, debugSession.RunID)
}
// GetDebugSessionWorkflowContent retrieves the workflow content from repository for a debug session
func GetDebugSessionWorkflowContent(ctx reqctx.RequestContext, repo *repo_model.Repository, gitRepo *git.Repository,
workflowID string) (string, error) {
// Get default branch commit
commit, err := gitRepo.GetBranchCommit(repo.DefaultBranch)
if err != nil {
return "", err
}
// List workflows
_, entries, err := actions.ListWorkflows(commit)
if err != nil {
return "", err
}
// Find the workflow file
for _, entry := range entries {
if entry.Name() == workflowID {
content, err := actions.GetContentFromEntry(entry)
if err != nil {
return "", err
}
return string(content), nil
}
}
return "", fmt.Errorf("workflow %q not found", workflowID)
}

repo.diff.view_file

@@ -150,7 +150,7 @@ func registerUpdateGiteaChecker() {
RunAtStart: false,
Schedule: "@every 168h",
},
HTTPEndpoint: "https://dl.gitea.com/gitea/version.json",
HTTPEndpoint: "https://devstar.cn/assets/version.json",
}, func(ctx context.Context, _ *user_model.User, config Config) error {
updateCheckerConfig := config.(*UpdateCheckerConfig)
return updatechecker.GiteaUpdateChecker(updateCheckerConfig.HTTPEndpoint)

repo.diff.view_file

@@ -60,9 +60,9 @@ type InstallForm struct {
EnableCaptcha bool
RequireSignInView bool
DefaultKeepEmailPrivate bool
DefaultAllowCreateOrganization bool
DefaultAllowCreateDevcontainer bool
DefaultAllowCreateActRunner bool
DefaultAllowCreateOrganization bool `form:"default_allow_create_organization"`
DefaultAllowCreateDevcontainer bool `form:"default_allow_create_devcontainer"`
DefaultAllowCreateActRunner bool `form:"default_allow_create_actrunner"`
DefaultEnableTimetracking bool
EnableUpdateChecker bool
NoReplyAddress string

repo.diff.view_file

@@ -8,7 +8,7 @@
<div class="ui attached segment">
{{template "base/alert" .}}
<p>{{ctx.Locale.Tr "install.docker_helper" "https://docs.gitea.com/installation/install-with-docker"}}</p>
<p>{{ctx.Locale.Tr "install.k8s_helper" "https://www.mengning.com/src/devstar/install/install-k8s"}}</p>
<form class="ui form" action="{{AppSubUrl}}/" method="post">
<!-- Database Settings -->
@@ -160,7 +160,7 @@
<div>
<!-- k8s -->
<details class="optional field">
<details class="optional field">
<summary class="right-content tw-py-2{{if .Err_K8s}} text red{{end}}">
{{ctx.Locale.Tr "install.k8s_title"}}
</summary>
@@ -178,7 +178,6 @@
<label for="k8s_token">{{ctx.Locale.Tr "install.k8s_token"}}</label>
<input id="k8s_token" name="k8s_token" value="{{.k8s_token}}">
</div>
</div>
</details>
<!-- Email -->
<details class="optional field">
@@ -313,7 +312,7 @@
<div class="inline field">
<div class="ui checkbox">
<label data-tooltip-content="{{ctx.Locale.Tr "install.default_allow_create_actrunner_popup"}}">{{ctx.Locale.Tr "install.default_allow_create_actrunner"}}</label>
<input name="default_allow_create_actrunner" type="checkbox" {{if .DefaultAllowCreateActRunner}}checked{{end}}>
<input name="default_allow_create_actrunner" type="checkbox" {{if .default_allow_create_actrunner}}checked{{end}}>
</div>
</div>
<div class="inline field">

repo.diff.view_file

@@ -0,0 +1,449 @@
{{template "base/head" .}}
<div class="page-content repository actions debug-page">
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
<div class="ui stackable grid">
<!-- Left Panel: Workflow Editor -->
<div class="eight wide column">
<div class="ui segment">
<h3 class="ui header">
{{ctx.Locale.Tr "actions.workflow.debug"}}
<span class="ui grey text">({{.WorkflowID}})</span>
</h3>
<div class="ui form">
<!-- Workflow Editor -->
<div class="field">
<label>{{ctx.Locale.Tr "actions.workflow.content"}}</label>
<textarea id="workflowEditor" class="ui textarea" style="height: 400px; font-family: monospace;" placeholder="Workflow YAML content"></textarea>
</div>
<!-- Debug Parameters -->
<div class="two fields">
<div class="field">
<label>{{ctx.Locale.Tr "actions.workflow.ref"}}</label>
<select id="refSelect" class="ui dropdown">
<option value="">{{ctx.Locale.Tr "repo.default_branch"}}</option>
</select>
</div>
<div class="field">
<label>{{ctx.Locale.Tr "actions.workflow.event"}}</label>
<select id="eventSelect" class="ui dropdown">
<option value="push">push</option>
<option value="pull_request">pull_request</option>
<option value="workflow_dispatch">workflow_dispatch</option>
<option value="issues">issues</option>
<option value="issue_comment">issue_comment</option>
<option value="pull_request_review">pull_request_review</option>
</select>
</div>
</div>
<!-- Workflow Inputs -->
<div class="field">
<label>{{ctx.Locale.Tr "actions.workflow.inputs"}}</label>
<div id="inputsContainer" class="ui segment"></div>
<button type="button" class="ui mini button" id="addInputBtn">
{{svg "octicon-plus"}} {{ctx.Locale.Tr "add"}}
</button>
</div>
<!-- Environment Variables -->
<div class="field">
<label>{{ctx.Locale.Tr "actions.workflow.env"}}</label>
<div id="envContainer" class="ui segment"></div>
<button type="button" class="ui mini button" id="addEnvBtn">
{{svg "octicon-plus"}} {{ctx.Locale.Tr "add"}}
</button>
</div>
<!-- Action Buttons -->
<div class="ui form-actions">
<button type="button" class="ui primary button" id="runBtn" onclick="runDebugWorkflow()">
{{svg "octicon-play"}} {{ctx.Locale.Tr "actions.workflow.run"}}
</button>
<a href="{{$.ActionsURL}}" class="ui button">{{ctx.Locale.Tr "cancel"}}</a>
</div>
</div>
</div>
</div>
<!-- Right Panel: Logs and Status -->
<div class="eight wide column">
<div class="ui segment">
<h3 class="ui header">
{{ctx.Locale.Tr "actions.workflow.logs"}}
</h3>
<!-- Status Info -->
<div id="statusInfo" style="display: none;" class="ui info message">
<p>{{ctx.Locale.Tr "actions.workflow.running"}}: <a id="runLink" href="#" target="_blank"></a></p>
</div>
<!-- Logs Container -->
<div id="logsContainer" style="border: 1px solid #ddd; padding: 10px; height: 500px; overflow-y: auto; background-color: #f5f5f5; font-family: monospace; font-size: 12px;">
<p style="color: #999;">{{ctx.Locale.Tr "actions.workflow.logs_placeholder"}}</p>
</div>
<!-- Refresh and Copy Buttons -->
<div style="margin-top: 10px;">
<button type="button" class="ui mini button" id="refreshBtn" onclick="refreshLogs()" style="display: none;">
{{svg "octicon-sync"}} {{ctx.Locale.Tr "refresh"}}
</button>
<button type="button" class="ui mini button" id="copyBtn" onclick="copyLogs()" style="display: none;">
{{svg "octicon-copy"}} {{ctx.Locale.Tr "copy"}}
</button>
</div>
</div>
<!-- Error Messages -->
<div id="errorMessage" style="display: none;" class="ui error message">
<p id="errorText"></p>
</div>
</div>
</div>
</div>
</div>
<script>
const debugSessionID = {{.DebugSessionID}};
const workflowID = "{{.WorkflowID}}";
const defaultBranch = "{{.DefaultBranch}}";
const actionsURL = "{{.ActionsURL}}";
const debugAPIURL = "{{.DebugAPIURL}}";
const csrfToken = "{{.CsrfToken}}";
let currentRunIndex = null;
let logsAutoRefreshInterval = null;
// Initialize editor with workflow content
document.addEventListener('DOMContentLoaded', function() {
const editor = document.getElementById('workflowEditor');
editor.value = `{{.WorkflowContent}}`;
// Initialize dropdowns
$('.ui.dropdown').dropdown();
// Populate ref select with branches and tags
populateRefs();
// Setup input/env add buttons
document.getElementById('addInputBtn').addEventListener('click', addInputField);
document.getElementById('addEnvBtn').addEventListener('click', addEnvField);
});
function populateRefs() {
const refSelect = document.getElementById('refSelect');
// Add default branch
const option = document.createElement('option');
option.value = defaultBranch;
option.text = defaultBranch + ' (default)';
refSelect.appendChild(option);
// TODO: fetch branches and tags from API
}
function addInputField() {
const container = document.getElementById('inputsContainer');
const id = 'input_' + Date.now();
const field = document.createElement('div');
field.className = 'ui form';
field.id = id;
field.innerHTML = `
<div class="two fields">
<div class="field">
<input type="text" placeholder="{{ctx.Locale.Tr "actions.workflow.input_name"}}" class="input-key">
</div>
<div class="field">
<div class="ui input">
<input type="text" placeholder="{{ctx.Locale.Tr "actions.workflow.input_value"}}" class="input-value">
<button type="button" class="ui icon button" onclick="document.getElementById('${id}').remove()">
{{svg "octicon-trash"}}
</button>
</div>
</div>
</div>
`;
container.appendChild(field);
}
function addEnvField() {
const container = document.getElementById('envContainer');
const id = 'env_' + Date.now();
const field = document.createElement('div');
field.className = 'ui form';
field.id = id;
field.innerHTML = `
<div class="two fields">
<div class="field">
<input type="text" placeholder="{{ctx.Locale.Tr "actions.workflow.env_name"}}" class="env-key">
</div>
<div class="field">
<div class="ui input">
<input type="text" placeholder="{{ctx.Locale.Tr "actions.workflow.env_value"}}" class="env-value">
<button type="button" class="ui icon button" onclick="document.getElementById('${id}').remove()">
{{svg "octicon-trash"}}
</button>
</div>
</div>
</div>
`;
container.appendChild(field);
}
function getInputsObject() {
const inputs = {};
document.querySelectorAll('#inputsContainer .input-key').forEach((key, index) => {
const keyElem = document.querySelectorAll('#inputsContainer .input-key')[index];
const valueElem = document.querySelectorAll('#inputsContainer .input-value')[index];
if (keyElem.value && valueElem.value) {
inputs[keyElem.value] = valueElem.value;
}
});
return inputs;
}
function getEnvObject() {
const env = {};
document.querySelectorAll('#envContainer .env-key').forEach((key, index) => {
const keyElem = document.querySelectorAll('#envContainer .env-key')[index];
const valueElem = document.querySelectorAll('#envContainer .env-value')[index];
if (keyElem.value && valueElem.value) {
env[keyElem.value] = valueElem.value;
}
});
return env;
}
function runDebugWorkflow() {
const workflowContent = document.getElementById('workflowEditor').value;
const ref = document.getElementById('refSelect').value || defaultBranch;
const event = document.getElementById('eventSelect').value;
const inputs = getInputsObject();
const env = getEnvObject();
if (!workflowContent) {
showError('{{ctx.Locale.Tr "actions.workflow.content_empty"}}');
return;
}
const runBtn = document.getElementById('runBtn');
runBtn.classList.add('loading');
runBtn.disabled = true;
const payload = {
workflow_content: workflowContent,
ref: ref,
event: event,
inputs: inputs,
env: env
};
console.log('Submitting to:', `${debugAPIURL}/${debugSessionID}/run`);
console.log('Payload:', payload);
console.log('CSRF Token:', csrfToken);
const headers = {
'Content-Type': 'application/json',
'X-Csrf-Token': csrfToken,
};
fetch(`${debugAPIURL}/${debugSessionID}/run`, {
method: 'POST',
headers: headers,
body: JSON.stringify(payload),
})
.then(response => {
console.log('Response status:', response.status, 'OK:', response.ok);
if (!response.ok) {
return response.text().then(text => {
console.log('Error response:', text);
throw new Error(`HTTP ${response.status}: ${text}`);
});
}
return response.json();
})
.then(data => {
console.log('Response data:', data);
if (data.success || data.run_index) {
currentRunIndex = data.run_index;
document.getElementById('statusInfo').style.display = 'block';
document.getElementById('runLink').href = `${actionsURL}/runs/${currentRunIndex}`;
document.getElementById('runLink').textContent = `Run #${currentRunIndex}`;
document.getElementById('errorMessage').style.display = 'none';
document.getElementById('refreshBtn').style.display = 'inline-block';
document.getElementById('copyBtn').style.display = 'inline-block';
// Start auto-refreshing logs
refreshLogs();
logsAutoRefreshInterval = setInterval(refreshLogs, 2000);
} else {
showError(data.error || data.message || '{{ctx.Locale.Tr "error"}}');
}
})
.catch(error => {
console.error('Fetch error:', error);
showError('Failed to run workflow: ' + error.message);
})
.finally(() => {
runBtn.classList.remove('loading');
runBtn.disabled = false;
});
}
function refreshLogs() {
if (!currentRunIndex) return;
console.log('Refreshing logs for run index:', currentRunIndex);
// Get logs from the action run API via POST
const payload = {
LogCursors: []
};
fetch(`${actionsURL}/runs/${currentRunIndex}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Csrf-Token': csrfToken,
},
body: JSON.stringify(payload),
})
.then(response => {
console.log('Log fetch response status:', response.status, response.statusText);
console.log('Content-Type:', response.headers.get('Content-Type'));
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
// Check if response is JSON
const contentType = response.headers.get('Content-Type');
if (contentType && contentType.includes('application/json')) {
return response.json();
} else {
// If not JSON, get text and try to parse
return response.text().then(text => {
console.log('Response is not JSON, attempting to parse');
try {
return JSON.parse(text);
} catch (e) {
console.error('Failed to parse response as JSON:', text.substring(0, 200));
throw new Error('Response is not valid JSON. Content: ' + text.substring(0, 500));
}
});
}
})
.then(data => {
console.log('Log data received:', data);
const logsContainer = document.getElementById('logsContainer');
if (!data) {
logsContainer.textContent = 'No response data';
return;
}
if (data.logs && data.logs.stepsLog && data.logs.stepsLog.length > 0) {
let logContent = '';
data.logs.stepsLog.forEach((stepLog, index) => {
console.log(`Step ${index}:`, stepLog);
if (stepLog.rawOutput) {
logContent += stepLog.rawOutput + '\n';
} else if (stepLog.lines && Array.isArray(stepLog.lines)) {
stepLog.lines.forEach(line => {
if (line && line.content) {
logContent += line.content + '\n';
}
});
}
});
if (logContent.trim()) {
logsContainer.textContent = logContent;
} else {
logsContainer.textContent = 'Waiting for logs...';
}
} else if (data.state && data.state.run) {
// Show run status if logs not ready
logsContainer.textContent = 'Status: ' + (data.state.run.status || 'waiting') + '\n\nWaiting for logs...';
} else {
logsContainer.textContent = 'Waiting for logs...';
}
logsContainer.scrollTop = logsContainer.scrollHeight;
})
.catch(error => {
console.error('Error fetching logs:', error);
document.getElementById('logsContainer').textContent = 'Error: ' + error.message;
});
}
function copyLogs() {
const logsContainer = document.getElementById('logsContainer');
const text = logsContainer.textContent;
navigator.clipboard.writeText(text).then(() => {
// Show success message
const copyBtn = document.getElementById('copyBtn');
const originalText = copyBtn.innerHTML;
copyBtn.innerHTML = '{{svg "octicon-check"}} Copied!';
setTimeout(() => {
copyBtn.innerHTML = originalText;
}, 2000);
});
}
function showError(message) {
const errorMsg = document.getElementById('errorMessage');
document.getElementById('errorText').textContent = message;
errorMsg.style.display = 'block';
// Clear after 5 seconds
setTimeout(() => {
errorMsg.style.display = 'none';
}, 5000);
}
// Cleanup on page unload
window.addEventListener('beforeunload', function() {
if (logsAutoRefreshInterval) {
clearInterval(logsAutoRefreshInterval);
}
});
</script>
<style>
.debug-page .ui.segment {
box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.debug-page #workflowEditor {
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
font-size: 13px;
line-height: 1.5;
}
.debug-page #logsContainer {
white-space: pre-wrap;
word-wrap: break-word;
line-height: 1.5;
}
.debug-page .ui.form-actions {
margin-top: 20px;
padding-top: 15px;
border-top: 1px solid rgba(34, 36, 38, 0.15);
}
.debug-page .ui.form-actions .button {
margin-right: 10px;
}
.debug-page .input-key,
.debug-page .input-value,
.debug-page .env-key,
.debug-page .env-value {
margin: 0;
}
</style>
{{template "base/footer" .}}

repo.diff.view_file

@@ -65,6 +65,12 @@
</div>
</div>
{{if .CurWorkflow}}
<a href="{{$.Link}}/debug?workflow={{$.CurWorkflow}}" class="ui button">
{{svg "octicon-bug"}} {{ctx.Locale.Tr "actions.workflow.debug"}}
</a>
{{end}}
{{if .AllowDisableOrEnableWorkflow}}
<button class="ui jump dropdown btn interact-bg tw-p-2">
{{svg "octicon-kebab-horizontal"}}

repo.diff.view_file

@@ -9,7 +9,7 @@
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
</button>
<div class="menu">
{{if or (.AllowCreateActRunner) (.Permission.IsAdmin)}}
{{if or (.AllowCreateActRunner)}}
<div class="item">
<a href="{{$.Link}}/regist_runner">{{ctx.Locale.Tr "actions.runners.regist_runner"}}</a>
</div>

repo.diff.view_file

@@ -8,7 +8,7 @@ test.beforeAll(async ({browser}, workerInfo) => {
test('homepage', async ({page}) => {
const response = await page.goto('/');
expect(response?.status()).toBe(200); // Status OK
await expect(page).toHaveTitle(/^Gitea: Git with a cup of tea\s*$/);
await expect(page).toHaveTitle(/^DevStar: The Last Mile of Al for R&D\s*$/);
await expect(page.locator('.logo')).toHaveAttribute('src', '/assets/img/logo.svg');
});

repo.diff.view_file

@@ -1,4 +1,4 @@
APP_NAME = Gitea: Git with a cup of tea
APP_NAME = DevStar: The Last Mile of Al for R&D
RUN_MODE = prod
[database]

repo.diff.view_file

@@ -1,4 +1,4 @@
APP_NAME = Gitea: Git with a cup of tea
APP_NAME = DevStar: The Last Mile of Al for R&D
RUN_MODE = prod
[database]

repo.diff.view_file

@@ -1,4 +1,4 @@
APP_NAME = Gitea: Git with a cup of tea
APP_NAME = DevStar: The Last Mile of Al for R&D
RUN_MODE = prod
[database]

repo.diff.view_file

@@ -1,4 +1,4 @@
APP_NAME = Gitea: Git with a cup of tea
APP_NAME = DevStar: The Last Mile of Al for R&D
RUN_MODE = prod
[database]