Commit Graph

4578 Commits

Author SHA1 Message Date
panshuxiao
33a4a54e85 !68 添加了devcontainer在k8s下的重启、暂停、webTerminal功能
* 修复k8s/devcontainer/suite_test
* 改进了DevStar Controller Manager镜像相关代码
* 修改了Dockerfile.rootless以解决go版本问题
* 移动Dockerfile.cotroller-manager位置
* Merge remote-tracking branch 'origin/dev' into devcontainer-on-k8s
* Merge remote-tracking branch 'origin/add_k8s' into AppOnK8s
* Merge remote-tracking branch 'origin/add-dockerfile-method-and-start-s…
*  添加了k8s下的停止、重启devcontainer和webterminal
* Merge branch 'add-dockerfile-method-and-start-stop-container' of https…
* 更新了容器镜像方式的构建、安装和使用方法,但是devcontainer功能还有问题
* fix run postCreateCommand bug
* sh文件方式管理启动脚本
* Merge branch 'add-dockerfile-method-and-start-stop-container' of https…
* add restart command and fix bug
* chore: 补充添加k8s controller的go.mod和go.sum文件
* Merge branch 'add-dockerfile-method-and-start-stop-container' of https…
* 为devstar添加k8s上的controller-manager
* add dockerfile method to create container and save container .restart …
2025-05-13 10:50:26 +00:00
xinitx
02baa3b7af !67 增加了重启停止容器、dockerfile方式创建保存容器功能
* change initializeScript path
* Merge branch 'add-dockerfile-method-and-start-stop-container' of https…
* 更新了容器镜像方式的构建、安装和使用方法,但是devcontainer功能还有问题
* fix run postCreateCommand bug
* sh文件方式管理启动脚本
* add restart command and fix bug
* add dockerfile method to create container and save container .restart …
2025-05-07 11:10:30 +00:00
Levi Yan
cd2d2a4d25 devcontainer works
- localhost doesn't work,you should config domain name or IP Address
2025-03-29 06:26:42 +00:00
xinitx
cd856c72bc !62 json管理和日志输出
* 合并输出按阶段显示
* ttyd初始目录
* 访问数据库放在services层
* 端口指定映射
* vscode链接
* 去掉devstar字符串
* Devcontainer前端页面显示进行了整理优化
* 修复 数据库 bug
* 增加容器output
2025-03-18 15:52:08 +00:00
孟宁
72e38d0913 !61 启动时能够自动启动act_runner
Merge pull request !61 from vecmatex/feature_add_runner
2025-02-20 01:28:04 +00:00
vecmatex
c944cd0e2a 启动时能够自动启动act_runner 2025-02-19 20:06:33 +08:00
孟宁
d8d6c5e8ec fixed bug:误修改了测试用例导致make test无法通过 2025-02-18 10:46:29 +08:00
孟宁
8f2a6dd48d !54 gitea.com相关链接无法访问,替换为gitea.cn
* https://gitea.com相关链接无法访问,替换为https://gitea.cn 部分替换为了https://devstar.cn
* https://docs.gitea.com相关链接无法访问,替换为https://docs.gitea.cn
2025-02-18 02:11:43 +00:00
孟宁
75343aca1e !53 整理了devcontainer的部分代码,只是修改了文件目录结构和命名,没有对代码进行本质上的改动
* fixed /api/devcontainer/user
* 修改了models/devcontainer目录下的文件命名
* 整理了devcontainer的部分代码,只是修改了文件目录结构和命名,没有对代码进行本质上的改动
2025-02-17 05:36:49 +00:00
孟宁
0557a744c0 !52 通过场景码SceneStr区分用户登录不同的部署版本,优化了代码
* 修改了微信公众号关注事件和文本消息的响应
* 通过场景码SceneStr区分用户登录不同的部署版本,优化了代码
* 兼容线上/api/wechat/official-account相关API
* 对第三方依赖中的PowerWeChat和officialAccount等字符串进行了本地化抽象,以Wechat和wechat_sdk命名可读性更好
* Merge branch 'dev' into refactoring-wechat-qr-code
* 梳理了routers到auth_service的代码,wechat_service还需要进一步整理
* 对代码文件目录结构进行了重构,内在逻辑还没有重构
* wechat相关路径中删掉了无意义的official-account字符串
2025-02-14 10:41:45 +00:00
xinitx
e31075b296 !50 devcontainer页面功能实现及代码结构优化
### devcontainer页面功能实现

- devcontainer.json 可以正常编辑
- 可以创建devcontainer, **但是首次创建需要docker pull 容器镜像会造成系统卡死的情况,需要后续优化** 
- 可以open with WebTerminal, **但是进入的WebTerminal当前目录并不是当前项目目录下**
- 修改后的容器可以docker commit为新的容器镜像

### devcontainer代码结构优化

docker相关操作都放在了modules/docker/docker_api.go
2025-02-13 05:56:32 +00:00
xinitx
e6d1dbb381 !46 [DIP-2][DevContainer] 添加 WebSSH 和 保存镜像功能、更新了DevContainer相关的配置
* 合并devcontainer web相关的源文件,简化目录结构
* devcontainer、ssh_key_pair和devcontainer.cloud
* fixed bug:创建容器时Host为localhost时创建失败的问题
* 删除了死代码,更新了一些命名(主要是去掉devstar字符串)
* 常量名全大写
* devcontainer HOST改为用户设置的域名或IP
* 安装时如没有配置devcontainer则默认设置为docker方式
* 直接使用kubernetes和docker简化代码提高可读性
* 去除services/devstar_devcontainer文件夹名中不必要的devstar字符串
* 去除services/devstar_devcontainer文件夹名中不必要的devstar字符串
* 文件名中去掉不必要的devstar字符串
* 变量名中删除不必要的Devstar字符串
* Merge branch 'dev' into feature-websshAndUpdateImage
* change pages style
* change Structure
* fix bug
* websshAndUpdateImage
2025-01-07 01:25:54 +00:00
孟宁
de546fd294 [DIP-1] 完善微信二维码安装跳转用户注册过程
* 完善了微信扫码注册流程,注册过程中绑定微信用户可见
* 安装完成后可以直接跳转到二维码登录,完善了enable/disable微信二维码功能
2024-12-24 07:25:30 +00:00
戴明辰
8123bdf277 [Fix] Cloud NAT Rule Deletion Upon DevContainer Deletion
* NAT Rule deletion upon DevContainer deletion
* NAT Port query and delete
2024-12-11 02:55:26 +00:00
孟宁
3edc4ce1e4 [DIP-1] 微信公众号二维码登录:本地部署与线上部署双端共用代码
* 恢复误删了的从未登录状态下的页面登录后跳转到当前页的功能
* secret是敏感信息,不能打印在日志里面
* fixed bug: 根据配置AppID和AppSecret来createPowerWechatApp
* 完成本地部署微信二维码登录功能,用户设置绑定微信的功能本地测试正常
* 本地部署可以扫码跳转注册页面,尚未查询用户数据
* 本地部署的后端已经可以和devstar.cn上的微信代理API打通,但是还没有调用本地用户认证相关代码,功能上还不完整
* 优化了signin navbar前端显示逻辑,根据app.ini配置使能wechat qr和openid
* 增加wechat配置项,以便同时支持直接和间接的微信二维码登录
* 恢复openid原有的初始配置方法
* 默认支持微信二维码登录(仅在安装配置上实现,功能上尚未实现),默认disabled openid
* "Initial commit from " + gitURL + " ( " + sha1 + " ) "
2024-12-10 08:41:20 +00:00
孟宁
b23094d410 [DIP-4]支持DevStar模板及Git URL作为模板及其他杂项
* 支持从Git URL初始化新建的仓库
* 前端支持Git URL commit id为模板创建项目,并优化了前端代码footer等
* 在DevStar.cn上不必支持DevStar Template
* 在前端扩展方式支持了DevStar Template
* 增加了数据持久化存储配置方法
* 本地部署时不显示底部的API及devstar.cn的网站备案号
* update LICENSE
* 完善README.md 恢复了可执行文件名称gitea
2024-12-02 01:43:39 +00:00
戴明辰
1a0bb2f28a Revert "!28 [Refactor][Doc][Chore] 将Gitea改名为Devstar,补充README.md开发环境安装指南"
This reverts commit 05e37d8da7.
2024-11-19 09:58:22 +00:00
孟宁
05e37d8da7 !28 [Refactor][Doc][Chore] 将Gitea改名为Devstar,补充README.md开发环境安装指南
* 名称改为devstar,并在README.md中添加了开发环境的安装指南
2024-11-19 09:25:17 +00:00
戴明辰
c96928b972 [DIP-1][WeChat] WeChat QR Signup, Login, and Unbind
* WeChat QR Sign Up, Login, and Unbind
* Add QR Refresh Icon
* refactor wechat QR login, and apply Gitea `APIContexter`
* GET /api/wechat/official-account/generate-qr-code?qrExpireSeconds=${qrExpireSeconds}&sceneStr=${sceneStr}
2024-11-07 10:12:13 +00:00
xinitx
8d5b34e07e !16 [Feature] DevContainer 适配 Docker
* [Chore] format code style
* [Chore] go mod tidy
* remove deprecated config
* Update services/devstar_devcontainer/docker_agent/AssignDevcontainerCr…
2024-10-31 03:00:11 +00:00
戴明辰
c92eeecf06 !15 [Fix] WeChat QR Login
* [Fix] QR Expiration Mask too dark
* [Refactor] Deprecated in-memory cache, ready for Redis
* [Doc] Resolve WeChat QR config conflict in k8s mode
* [Fix] WeChat QR Login by default
2024-10-30 01:17:59 +00:00
戴明辰
6967ba9889 !12 [Feature][Fix][Doc] repo devcontainer.json parser, WeChat QR Expiration Mask, Zombie Process Mitigation
* [Fix] Zombie/Defunct Processes caused by SSH Daemon
* [Fix]  WeChat QR Expiration Mask with a refresh button
* [Doc] Updated API response field `publicKeySsh` of GET `/api/devstar_ssh/key_pair/new_temp`
* [Feature] Get or default DevContainer image from `.devcontainer/devcontainer.json` parser
2024-10-28 11:35:35 +00:00
戴明辰
c1ea93e233 !10 [Feature][Fix][Doc] Tencent NAT Auto-Portforwarding
* [Fix] Relocate User Permanent SSH Public Key queries to DevcontainerService Layer
* [Fix] Add Unix Timestamps in DB table `devstar_devcontainer`
* [Feature] Tencent NAT port forwarding
* [Doc] k8s Operator RBAC: ServiceAccount, ClusterRole, ClusterRoleBinding, etc.
* [fix] k8s Operator Reconciler error while converting YAML to JSON
* [Doc] Added DevStar API Doc
* [fix] detailed errors while listing user devcontainers
* [fix] Invalid metadata.labels: value must be no more than 63 characters
2024-10-23 03:05:44 +00:00
戴明辰
1fa57bca2d !9 [Feature] git clone repo before opening DevContainer
* [fix] SSH Connection refused
* [fix] retrieve NodePort upon ready
* [feature] git clone repo upon initialization
2024-10-14 06:58:43 +00:00
戴明辰
6bb8bba3aa !8 Added SSH Public Key Login For DevContainer
* [Feature] Added DevContainer Public Key Login, and deprecated SSH Password login
* [Improvement] Anti-spam
* GET /api/devstar_ssh/key_pair/new_temp: SSH Keypair Gen
* fix HTTP 500 error while deleting Repo
* updated DevContainer WorkDIR
* updated warn msg
2024-10-13 12:07:28 +00:00
戴明辰
ddd4109dbc !7 fix app.ini parser
* fix app.ini parser
2024-10-01 05:55:12 +00:00
戴明辰
4b6f1b9cb5 !6 k8s Agent for DevStar DevContainer
* DELETE /api/devcontainer?repoId=${repoId} 删除 DevContainer
* refactor
* GET /api/devcontainer?repoId=${repoId}&wait=true 阻塞式等待打开就绪的 DevContainer
* POST /api/devcontainer 创建 DevContainer
* refactored the code
* Updated context usage with cancel function
* 预留接口,适配单机版 DevStar DevContainer
* bugFix: context canceled while deleting k8s CRD DevcontainerApp
* 用户界面删除 k8s CRD DevContainer
* 用户界面创建 DevContainer 并更新 NodePort
* 完成用户界面创建 DevContainer
* transplant test code into DevStar Studio
* refactored API router to /routers/api
* 更改 DevContainer Doc
* 更改 DevContainer namespace
* 特殊仓库重定向
* [Doc] 更新 Kubernetes 部署 DevStar Studio 文档说明,特别是 namespace 管理
* [Doc] 更新 CI脚本说明
* Revert "optimized CI workflow"
* optimized CI workflow
* fix typo
* [feature test]: 测试 Pod 内使用 Kubernetes Operator 功能
* [Optimization] error msg for archived repo
* [Optimization]: display detailed err msg on creating devContainer for …
2024-09-30 06:48:01 +00:00
戴明辰
d44bd153c2 !4 完成Repo DevContainer 增、删、查
Merge pull request !4 from 戴明辰/feature-repo-devcontainer-panel
2024-08-30 12:28:59 +00:00
DAI Mingchen
2f5dfd3196 开发容器分页查询:
* 用户设置-> 开发容器列表
* GET /api/devcontainer/user?page=1&page_size=10
2024-08-29 12:53:07 +08:00
DAI Mingchen
72433d05fc 仓库上限达到提示:如需扩容请联系管理员 2024-08-23 21:06:19 +08:00
DAI Mingchen
2530394a2d [Optimization] 将微信扫码登录方式剥离,并设置为默认登录页,若无法使用微信扫码登录,则回退到密码登录页 2024-08-23 17:23:23 +08:00
DAI Mingchen
62705595a0 bugFix: cannot show out-of-site images due to CORS Header Content-Security-Policy 2024-08-23 15:31:32 +08:00
DAI Mingchen
a125592b4d * Added app.ini importer for the CORS header Content-Security-Policy
* Marked header `X-Frame-Options` as obsolete
2024-08-22 20:39:37 +08:00
DAI Mingchen
dab7418671 修改CSP默认安全策略: 允许 vscode-webview://* 2024-08-22 14:54:57 +08:00
戴明辰
ce153fc768 !3 完成微信扫码登录数据库交互
* Improvement: use commit SHA to tag artifact
* bugFix: inconsistent collation
* Added Database migration for DevStar Studio 1.0
* Updated Transaction for table `user_wechat_official_account_openid`
* WeChat Official Account binding/updating done
* WeChat Official Account QR login Success
2024-08-13 10:06:35 +00:00
DAI Mingchen
3fb1f1708f Updated Wechat QR Login Prototype: both Frontend and Backend
------
Squashed commit of the following:

commit b6108854f87c72832b4ccf65f2b02cfa79818d28
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Tue Jul 30 11:43:27 2024 +0000

    Wechat QR scan prototype done: frontend and backend

commit ace0cbbc75c5441c77121463a658115c59292727
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Tue Jul 30 07:53:47 2024 +0000

    Updated ICP license for https://*.devstar.cn

commit eab20f110c1f89447ad7bea9dd1f325a99e1f196
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Tue Jul 30 04:14:11 2024 +0000

    updated wechat callback and changed sceneStr with higher entropy

commit dd04b3b21b613d470d0ae27edbcead9aa2958861
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Mon Jul 29 14:33:04 2024 +0000

    WeChat callback interfaces

commit 320ba2225a420feb58c3668d4afca96fcbfe5c79
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Mon Jul 29 13:16:16 2024 +0000

    updated env settings

commit 2ed4e3e307
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 11:48:00 2024 +0000

    resolved WARN NoEmptyContinuation (grammar mistakes), and removed trivial unit test for hCAPTCHA

commit 690157811b
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 10:21:39 2024 +0000

    fix: checkout the corresponding branch(master or dev)

commit 046ff63e42
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 10:01:24 2024 +0000

    test new CI pipeline workflow in the org repo, with a bunch of ENV vars

commit faf7f51d85
Author: 戴明辰 <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 07:59:31 2024 +0000

    !1 DevStar Studio 界面原型 + CI流水线测试通过
    * finalize this PoC repo, and migrate to the main repo (as a dev branch)
    * bugFix: nullptr dereference @ routers/web/auth/wechat_utils.go
    * bugFix: CAPTCHA needs manual reloading
    * Updated UI
    * Changed logo and favicon
    * Made WeChat QR optional (will not cause HTTP 500 Internal Error), and …
    * Added Unit Test in CI workflow, and removed redundant tests in dev container
    * Compliance with open source licensing requirements
    * Fix workflow: only exec 'docker rm' if there are dangling volumes
    * Removed Magic values about: Docker registry(URL, username), k8s(nanesp…
    * fix mistakes: git checkout branch should be master rather than the sta…
    * Updated UI layouts and build scripts
    * Updated copyright info and ICP License ID at page footer
    * Updated ICP License ID at page footer
    * Updated code ownership: web footer,  logo and favicon
    * Updated Internationalization(i18n): removed languages other than CN an…
2024-07-30 12:57:46 +00:00
DAI Mingchen
3b768dac65 Squashed commit of the following:
commit 2ed4e3e307
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 11:48:00 2024 +0000

    resolved WARN NoEmptyContinuation (grammar mistakes), and removed trivial unit test for hCAPTCHA

commit 690157811b
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 10:21:39 2024 +0000

    fix: checkout the corresponding branch(master or dev)

commit 046ff63e42
Author: DAI Mingchen <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 10:01:24 2024 +0000

    test new CI pipeline workflow in the org repo, with a bunch of ENV vars

commit faf7f51d85
Author: 戴明辰 <daimingchen@mail.ustc.edu.cn>
Date:   Thu Jul 25 07:59:31 2024 +0000

    !1 DevStar Studio 界面原型 + CI流水线测试通过
    * finalize this PoC repo, and migrate to the main repo (as a dev branch)
    * bugFix: nullptr dereference @ routers/web/auth/wechat_utils.go
    * bugFix: CAPTCHA needs manual reloading
    * Updated UI
    * Changed logo and favicon
    * Made WeChat QR optional (will not cause HTTP 500 Internal Error), and …
    * Added Unit Test in CI workflow, and removed redundant tests in dev container
    * Compliance with open source licensing requirements
    * Fix workflow: only exec 'docker rm' if there are dangling volumes
    * Removed Magic values about: Docker registry(URL, username), k8s(nanesp…
    * fix mistakes: git checkout branch should be master rather than the sta…
    * Updated UI layouts and build scripts
    * Updated copyright info and ICP License ID at page footer
    * Updated ICP License ID at page footer
    * Updated code ownership: web footer,  logo and favicon
    * Updated Internationalization(i18n): removed languages other than CN an…
2024-07-30 12:46:01 +00:00
techknowlogick
a4899ffa24 bump golang deps (#31422) 2024-06-24 13:26:42 +00:00
Sergey Sharybin
49b8716c40 Support relative paths to videos from Wiki pages (#31061)
This change fixes cases when a Wiki page refers to a video stored in the
Wiki repository using relative path. It follows the similar case which
has been already implemented for images.

Test plan:
- Create repository and Wiki page
- Clone the Wiki repository
- Add video to it, say `video.mp4`
- Modify the markdown file to refer to the video using `<video
src="video.mp4">`
- Commit the Wiki page
- Observe that the video is properly displayed

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-21 18:23:54 +00:00
charles
90a3c20e79 Fix markdown math brackets render problem (#31420)
Close #31371, support `($ ... $)` like GitHub

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-20 02:12:54 +00:00
Tobias Balle-Petersen
1c26127b52 Increase max length of org team names from 30 to 255 characters (#31410)
This PR modifies the structs for editing and creating org teams to allow
team names to be up to 255 characters. The previous maximum length was
30 characters.
2024-06-19 10:36:09 -04:00
wxiaoguang
43c7a2e7b1 Refactor names (#31405)
This PR only does "renaming":

* `Route` should be `Router` (and chi router is also called "router")
* `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`)
* Use lower case for private functions to avoid exposing or abusing
2024-06-19 06:32:45 +08:00
wxiaoguang
21783a5752 Fix rendered wiki page link (#31398)
Fix #31395
2024-06-18 03:09:20 +00:00
wxiaoguang
d32648b204 Refactor route path normalization (#31381)
Refactor route path normalization and decouple it from the chi router.
Fix the TODO, fix the legacy strange path behavior.
2024-06-17 23:28:47 +00:00
wxiaoguang
5a7376c060 Refactor markup code (#31399)
1. use clearer names
2. remove deadcode
3. avoid name shadowing
4. eliminate some lint warnings
2024-06-17 22:56:45 +00:00
6543
363c123598 Add cache test for admins (#31265)
Add a test to probe the cache similar to the email test func.


![image](https://github.com/go-gitea/gitea/assets/24977596/700e2733-586d-4091-900f-f5f71e6e94bf)


![image](https://github.com/go-gitea/gitea/assets/24977596/2a953802-18fc-4e81-a37d-24ebe1297365)


![image](https://github.com/go-gitea/gitea/assets/24977596/e00d62ad-bb60-41cc-9138-09993daee156)

---------

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: silverwind <me@silverwind.io>
2024-06-17 21:22:39 +02:00
wxiaoguang
25f3ec5b65 Fix natural sort (#31384)
Fix #31374
2024-06-17 06:45:12 +00:00
Brecht Van Lommel
597d1da96b Fix missing images in editor preview due to wrong links (#31299)
Parse base path and tree path so that media links can be correctly
created with /media/.

Resolves #31294

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-17 14:16:14 +08:00
wxiaoguang
84cbb6c4d2 Fix duplicate sub-path for avatars (#31365)
Fix #31361, and add tests

And this PR introduces an undocumented & debug-purpose-only config
option: `USE_SUB_URL_PATH`. It does nothing for end users, it only helps
the development of sub-path related problems.

And also fix #31366

Co-authored-by: @ExplodingDragon
2024-06-15 11:43:57 +08:00
mzroot
d4e4226c3c Add tag protection via rest api #17862 (#31295)
Add tag protection manage via rest API.

---------

Co-authored-by: Alexander Kogay <kogay.a@citilink.ru>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-06-14 18:56:10 +02:00