Commit Graph

4123 Commits

Author SHA1 Message Date
孟宁
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的部分代码,只是修改了文件目录结构和命名,没有对代码进行本质上的改动
Some checks failed
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Has been cancelled
* fixed /api/devcontainer/user
* 修改了models/devcontainer目录下的文件命名
* 整理了devcontainer的部分代码,只是修改了文件目录结构和命名,没有对代码进行本质上的改动
2025-02-17 05:36:49 +00:00
孟宁
0557a744c0 !52 通过场景码SceneStr区分用户登录不同的部署版本,优化了代码
Some checks failed
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Has been cancelled
* 修改了微信公众号关注事件和文本消息的响应
* 通过场景码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
戴明辰
90a460599b [Feature] Added DevContainerJSON to unmarshal /.devcontainer/devcontainer.json
All checks were successful
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Successful in 10m9s
* fix `nil` parsed of `postCreateCommand`
* parse undefined fields to `nil` ptr
* Added JSON Unmarshaler with default values
* Refactored DevContainer Model Errors
* Added `DevContainerJSON` to unmarshal devcontainer.json
2024-12-25 04:13:51 +00:00
戴明辰
c96928b972 [DIP-1][WeChat] WeChat QR Signup, Login, and Unbind
All checks were successful
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Successful in 27m5s
* 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
戴明辰
c1ea93e233 !10 [Feature][Fix][Doc] Tencent NAT Auto-Portforwarding
All checks were successful
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Successful in 32m59s
* [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
戴明辰
6bb8bba3aa !8 Added SSH Public Key Login For DevContainer
All checks were successful
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Successful in 18m45s
* [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
戴明辰
4b6f1b9cb5 !6 k8s Agent for DevStar DevContainer
All checks were successful
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Successful in 21m49s
* 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 增、删、查
All checks were successful
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Successful in 11m12s
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
475e742e53 optimization 2024-08-28 15:36:22 +08:00
DAI Mingchen
32760a30f5 获取已登录用户 devContainer 列表
All checks were successful
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Successful in 10m56s
2024-08-27 19:03:07 +08:00
DAI Mingchen
05a7e0eb4f bugFix: 微信公众号迁移可能导致微信绑定失败 2024-08-23 15:28:07 +08:00
DAI Mingchen
64843e5786 removed stale DB tests
All checks were successful
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Successful in 13m9s
2024-08-13 19:23:05 +08:00
戴明辰
ce153fc768 !3 完成微信扫码登录数据库交互
Some checks failed
DevStar Studio CI Pipeline - dev branch / build-and-push-x86-64-docker-image (push) Failing after 11s
* 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
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
wxiaoguang
00fc29aee1 Refactor issue label selection (#31497)
Follow #26460
2024-06-26 23:41:59 +00:00
Chl
b5326a431f Optimization of labels handling in issue_search (#26460)
This PR enhances the labels handling in issue_search by optimizing the
SQL query and de-duplicate the IDs when generating the query string.

---------

Co-authored-by: techknowlogick <techknowlogick@gitea.com>
2024-06-25 13:09:13 -04:00
kiatt210
6a96deb589 Fix web notification icon not updated once you read all notifications (#31447)
Fix #29065
Remove status filtering from GetUIDsAndNotificationCounts sql.

---------

Co-authored-by: kiatt210 <kiatt210@github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-23 15:50:10 +08:00
wxiaoguang
37a4b233a0 Refactor repo unit "disabled" check (#31389)
1. There are already global "unit consts", no need to use context data, which is fragile
2. Remove the "String()" method from "unit", it would only cause rendering problems in templates

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-06-18 00:51:13 +00:00
6543
78e8296e11 Rename repo_model.SearchOrderByMap to repo_model.OrderByMap (#31359)
https://github.com/go-gitea/gitea/pull/30876#discussion_r1637112394
2024-06-15 06:45:02 +00:00
6543
e37ecd1732 rm const do inline (#31360)
https://github.com/go-gitea/gitea/pull/30876/files#r1637288202
2024-06-15 04:48:52 +00: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
yp05327
e61e9a36b7 Fix PullRequestList.GetIssueIDs's logic (#31352)
fix a bug from #30490

`prs.GetIssueIDs()` will also be used in other places, e.g.
`InvalidateCodeComments`
so we should not add `if pr.Issue == nil` in it, or if `pr.Issue` is
already loaded, you will not get the issueID in the results list and
this is not an expected result.

So this will caused a bug:
before calling `InvalidateCodeComments`, all `pr.Issues` in `prs` are
loaded, so `issueIDs` in this function will always be `[]`.

![image](https://github.com/go-gitea/gitea/assets/18380374/ef94d9d2-0bf9-455a-abd6-4d5e6497db7c)
2024-06-13 09:42:07 +00:00
6543
bb04311b0b [Refactor] Unify repo search order by logic (#30876)
have repo OrderBy definitions defined in one place and use a single type
for OrderBy database options
2024-06-13 09:13:11 +00:00
silverwind
fc2d75f86d Enable unparam linter (#31277)
Enable [unparam](https://github.com/mvdan/unparam) linter.

Often I could not tell the intention why param is unused, so I put
`//nolint` for those cases like webhook request creation functions never
using `ctx`.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
2024-06-11 18:47:45 +00:00
Lunny Xiao
98a61040b1 Fix the possible migration failure on 286 with postgres 16 (#31209)
Try to fix #31205
2024-06-02 03:01:08 +00:00
Max Wipfli
3cc7f763c3 Only update poster in issue/comment list if it has been loaded (#31216)
Previously, all posters were updated, even if they were not part of
posterMaps. In that case, a ghost user was erroneously inserted.

Fixes #31213.
2024-06-02 10:32:20 +08:00
Kemal Zebari
ab458ce10b Return an empty string when a repo has no avatar in the repo API (#31187)
Resolves #31167.

https://github.com/go-gitea/gitea/pull/30885 changed the behavior of
`repo.AvatarLink()` where it can now take the empty string and append it
to the app data URL. This does not point to a valid avatar image URL,
and, as the issue mentions, previous Gitea versions returned the empty
string.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-06-01 11:49:42 +00:00
Lunny Xiao
352a2cae24 Performance improvements for pull request list API (#30490)
Fix #30483

---------

Co-authored-by: yp05327 <576951401@qq.com>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-05-31 12:10:11 +00:00
Jason Song
572fa55fbc Drop IDOrderDesc for listing Actions task and always order by id DESC (#31150)
Close #31066

Just follow what `FindRunOptions` and `FindScheduleOptions` do.
2024-05-31 02:30:02 +00:00
Lunny Xiao
1137a0357e Fix branch order (#31174)
Fix #31172

The original order or the default order should not be ignored even if we
have an is_deleted order.
2024-05-31 09:58:41 +08:00
Lunny Xiao
fb7b743bd0 Azure blob storage support (#30995)
This PR implemented object storages(LFS/Packages/Attachments and etc.)
for Azure Blob Storage. It depends on azure official golang SDK and can
support both the azure blob storage cloud service and azurite mock
server.

Replace #25458
Fix #22527 

- [x] CI Tests
- [x] integration test, MSSQL integration tests will now based on
azureblob
  - [x] unit test 
- [x] CLI Migrate Storage
- [x] Documentation for configuration added

------

TODO (other PRs):
- [ ] Improve performance of `blob download`.

---------

Co-authored-by: yp05327 <576951401@qq.com>
2024-05-30 07:33:50 +00:00
Lunny Xiao
015efcd8bf Use repo as of renderctx's member rather than a repoPath on metas (#29222)
Use a `gitrepo.Repository` in the markup's RenderContext but not store
the repository's path.
2024-05-30 07:04:01 +00:00
metiftikci
aa92b13164 Prevent simultaneous editing of comments and issues (#31053)
fixes #22907 

Tested:
- [x] issue content edit
- [x] issue content change tasklist
- [x] pull request content edit
- [x] pull request change tasklist

![issue-content-edit](https://github.com/go-gitea/gitea/assets/29250154/a0828889-fb96-4bc4-8600-da92e3205812)
2024-05-27 15:34:18 +00:00
Lunny Xiao
98751108b1 Rename project board -> column to make the UI less confusing (#30170)
This PR split the `Board` into two parts. One is the struct has been
renamed to `Column` and the second we have a `Template Type`.

But to make it easier to review, this PR will not change the database
schemas, they are just renames. The database schema changes could be in
future PRs.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: yp05327 <576951401@qq.com>
2024-05-27 08:59:54 +00:00
André Rosenhammer
14f6105ce0 Make gitea webhooks openproject compatible (#28435)
This PR adds some fields to the gitea webhook payload that
[openproject](https://www.openproject.org/) expects to exists in order
to process the webhooks.
These fields do exists in Github's webhook payload so adding them makes
Gitea's native webhook more compatible towards Github's.
2024-05-26 04:08:13 +00:00
yp05327
daf2a4c047 Fix wrong display of recently pushed notification (#25812)
There's a bug in #25715: 
If user pushed a commit into another repo with same branch name, the
no-related repo will display the recently pushed notification
incorrectly.
It is simple to fix this, we should match the repo id in the sql query.


![image](https://github.com/go-gitea/gitea/assets/18380374/9411a926-16f1-419e-a1b5-e953af38bab1)
The latest commit is 2 weeks ago.

![image](https://github.com/go-gitea/gitea/assets/18380374/52f9ab22-4999-43ac-a86f-6d36fb1e0411)

The notification comes from another repo with same branch name:

![image](https://github.com/go-gitea/gitea/assets/18380374/a26bc335-8e5b-4b9c-a965-c3dc3fa6f252)


After:
In forked repo:

![image](https://github.com/go-gitea/gitea/assets/18380374/ce6ffc35-deb7-4be7-8b09-184207392f32)
New PR Link will redirect to the original repo:

![image](https://github.com/go-gitea/gitea/assets/18380374/7b98e76f-0c75-494c-9462-80cf9f98e786)
In the original repo:

![image](https://github.com/go-gitea/gitea/assets/18380374/5f6a821b-e51a-4bbd-9980-d9eb94a3c847)
New PR Link:

![image](https://github.com/go-gitea/gitea/assets/18380374/1ce8c879-9f11-4312-8c32-695d7d9af0df)

In the same repo:

![image](https://github.com/go-gitea/gitea/assets/18380374/64b56073-4d0e-40c4-b8a0-80be7a775f69)
New PR Link:

![image](https://github.com/go-gitea/gitea/assets/18380374/96e1b6a3-fb98-40ee-b2ee-648039fb0dcf)

08/15 Update:
Follow #26257, added permission check and logic fix mentioned in
https://github.com/go-gitea/gitea/pull/26257#discussion_r1294085203


2024/04/25 Update:
Fix #30611

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-05-21 17:00:35 +00:00
Lunny Xiao
c6cf96d31d Fix automerge will not work because of some events haven't been triggered (#30780)
Replace #25741
Close #24445
Close #30658
Close #20646
~Depends on #30805~

Since #25741 has been rewritten totally, to make the contribution
easier, I will continue the work in this PR. Thanks @6543

---------

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-05-21 23:23:22 +08:00
wxiaoguang
fb1ad920b7 Refactor sha1 and time-limited code (#31023)
Remove "EncodeSha1", it shouldn't be used as a general purpose hasher
(just like we have removed "EncodeMD5" in #28622)

Rewrite the "time-limited code" related code and write better tests, the
old code doesn't seem quite right.
2024-05-20 15:12:50 +00:00
wxiaoguang
47accfebbd Fix data-race during testing (#30999)
Fix #30992
2024-05-20 04:35:38 +00:00
wxiaoguang
f4f4e18b14 Filter out duplicate action(activity) items for a repository (#30957)
Fix #20986
2024-05-14 13:47:03 +00:00
KN4CK3R
b1d8f13bd0 Protected tag is no internal server error (#30962)
Fixes #30959

Adds an API test for protected tags.
Fix existing tag in combination with fixtures.
2024-05-14 06:48:21 +00:00
Lunny Xiao
40de54ece8 Remove If Exist check on migration for mssql because that syntax required SQL server 2016 (#30894)
Fix #30872

We will assume the database is consistent before executing the
migration. So the indexes should exist. Removing `IF EXIST` then is safe
enough.

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-05-11 22:16:09 +08:00
Lunny Xiao
a303c973e0 Fix various problems around projects board view (#30696)
# The problem
The previous implementation will start multiple POST requests from the
frontend when moving a column and another bug is moving the default
column will never be remembered in fact.

# What's changed

- [x] This PR will allow the default column to move to a non-first
position
- [x] And it also uses one request instead of multiple requests when
moving the columns
- [x] Use a star instead of a pin as the icon for setting the default
column action
- [x] Inserted new column will be append to the end
- [x] Fix #30701 the newly added issue will be append to the end of the
default column
- [x] Fix when deleting a column, all issues in it will be displayed
from UI but database records exist.
- [x] Add a limitation for columns in a project to 20. So the sorting
will not be overflow because it's int8.

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2024-05-08 13:44:57 +00:00
wxiaoguang
67c1a07285 Refactor AppURL usage (#30885)
Fix #30883
Fix #29591

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-05-07 08:26:13 +00:00
6543
8e8ca6c653 Get repo list with OrderBy alpha should respect owner too (#30784)
instead of:
- zowner/gcode
- awesome/nul
- zowner/nul
- zowner/zzz

we will get:
- awesome/nul
- zowner/gcode
- zowner/nul
- zowner/zzz
2024-05-06 16:36:02 +02:00
yp05327
a50026e2f3 Fix no edit history after editing issue's title and content (#30814)
Fix #30807

reuse functions in services
2024-05-03 14:11:51 +08:00
6543
f2d8ccc5bb Get repo assignees and reviewers should ignore deactivated users (#30770)
If an user is deactivated, it should not be in the list of users who are
suggested to be assigned or review-requested.

old assignees or reviewers are not affected.

---
*Sponsored by Kithara Software GmbH*
2024-04-30 08:43:08 +00:00