* 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
------
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…
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…
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
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>
This solution implements a new config variable MAX_ROWS, which
corresponds to the “Maximum allowed rows to render CSV files. (0 for no
limit)” and rewrites the Render function for CSV files in markup module.
Now the render function only reads the file once, having MAX_FILE_SIZE+1
as a reader limit and MAX_ROWS as a row limit. When the file is larger
than MAX_FILE_SIZE or has more rows than MAX_ROWS, it only renders until
the limit, and displays a user-friendly warning informing that the
rendered data is not complete, in the user's language.
---
Previously, when a CSV file was larger than the limit, the render
function lost its function to render the code. There were also multiple
reads to the file, in order to determine its size and render or
pre-render.
The warning: 
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 #25458Fix#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>
Add a configuration item to enable S3 virtual-hosted style (V2) to solve
the problem caused by some S3 service providers not supporting path
style (V1).
Follow #30454
And fix#24957
When using "preferred_username", if no such field,
`extractUserNameFromOAuth2` (old `getUserName`) shouldn't return an
error. All other USERNAME options do not return such error.
And fine tune some logic and error messages, make code more stable and
more friendly to end users.
Initial support for #25680
This PR only adds some simple styles from GitHub, it is big enough and
it focuses on adding the necessary framework-level supports. More styles
could be fine-tuned later.
Noteable additions:
- `redefines-builtin-id` forbid variable names that shadow go builtins
- `empty-lines` remove unnecessary empty lines that `gofumpt` does not
remove for some reason
- `superfluous-else` eliminate more superfluous `else` branches
Rules are also sorted alphabetically and I cleaned up various parts of
`.golangci.yml`.
Fix#29074 (allow to disable all builtin apps) and don't make the doctor
command remove the builtin apps.
By the way, rename refobject and joincond to camel case.
It doesn't change logic, it only does:
1. Rename the variable and function names
2. Use more consistent format when mentioning config section&key
3. Improve some messages
This allows you to hide the "Powered by" text in footer via
`SHOW_FOOTER_POWERED_BY` flag in configuration.
---------
Co-authored-by: silverwind <me@silverwind.io>
Major changes:
* Move some functions like "addReader" / "isSubDir" /
"addRecursiveExclude" to a separate package, and add tests
* Clarify the filename&dump type logic and add tests
* Clarify the logger behavior and remove FIXME comments
Co-authored-by: Giteabot <teabot@gitea.io>
## Changes
- Adds setting `EXTERNAL_USER_DISABLE_FEATURES` to disable any supported
user features when login type is not plain
- In general, this is necessary for SSO implementations to avoid
inconsistencies between the external account management and the linked
account
- Adds helper functions to encourage correct use
Previously, the default was a week.
As most instances don't set the setting, this leads to a bad user
experience by default.
## ⚠️ Breaking
If your instance requires a high level of security,
you may want to set `[security].LOGIN_REMEMBER_DAYS` so that logins are
not valid as long.
---------
Co-authored-by: Jason Song <i@wolfogre.com>
It is convenient to skip by setting environment, since it's OK
to use root user in job containers.
It's not a bug, but I want to backport it to v1.21 since it doesn't
break anything.
---------
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Extract from #20549
This PR added a new option on app.ini `[admin]USER_DISABLED_FEATURES` to
allow the site administrator to disable users visiting deletion user
interface or allow.
This options are also potentially allowed to define more features in
future PRs.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
- Databases are one of the most important parts of Forgejo, every
interaction uses the database in one way or another. Therefore, it is
important to maintain the database and recognize when the server is not
doing well with the database. There already is the option to log *every*
SQL query along with its execution time, but monitoring becomes
impractical for larger instances and takes up unnecessary storage in the
logs.
- Add a QoL enhancement that allows instance administrators to specify a
threshold value beyond which query execution time is logged as a warning
in the xorm logger. The default value is a conservative five seconds to
avoid this becoming a source of spam in the logs.
- The use case for this patch is that with an instance the size of
Codeberg, monitoring SQL logs is not very fruitful and most of them are
uninteresting. Recently, in the context of persistent deadlock issues
(https://codeberg.org/forgejo/forgejo/issues/220), I have noticed that
certain queries hold locks on tables like comment and issue for several
seconds. This patch helps to identify which queries these are and when
they happen.
- Added unit test.
(cherry picked from commit 9cf501f1af4cd870221cef6af489618785b71186)
---------
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
Old code is not consistent for generating & decoding the JWT secrets.
Now, the callers only need to use 2 consistent functions:
NewJwtSecretWithBase64 and DecodeJwtSecretBase64
And remove a non-common function Base64FixedDecode from util.go
Renames it to `ENABLED` to be consistent with other settings and
deprecates it.
I believe this change is necessary because other setting groups such as
`attachment`, `cors`, `mailer`, etc. have an `ENABLED` setting, but
`oauth2` is the only one with an `ENABLE` setting, which could cause
confusion for users.
This is no longer a breaking change because `ENABLE` has been set as
deprecated and as an alias to `ENABLED`.
Sometimes you need to work on a feature which depends on another (unmerged) feature.
In this case, you may create a PR based on that feature instead of the main branch.
Currently, such PRs will be closed without the possibility to reopen in case the parent feature is merged and its branch is deleted.
Automatic target branch change make life a lot easier in such cases.
Github and Bitbucket behave in such way.
Example:
$PR_1$: main <- feature1
$PR_2$: feature1 <- feature2
Currently, merging $PR_1$ and deleting its branch leads to $PR_2$ being closed without the possibility to reopen.
This is both annoying and loses the review history when you open a new PR.
With this change, $PR_2$ will change its target branch to main ($PR_2$: main <- feature2) after $PR_1$ has been merged and its branch has been deleted.
This behavior is enabled by default but can be disabled.
For security reasons, this target branch change will not be executed when merging PRs targeting another repo.
Fixes#27062Fixes#18408
---------
Co-authored-by: Denys Konovalov <kontakt@denyskon.de>
Co-authored-by: delvh <dev.lh@web.de>
Mainly for MySQL/MSSQL.
It is important for Gitea to use case-sensitive database charset
collation. If the database is using a case-insensitive collation, Gitea
will show startup error/warning messages, and show the errors/warnings
on the admin panel's Self-Check page.
Make `gitea doctor convert` work for MySQL to convert the collations of
database & tables & columns.
* Fix#28131
## ⚠️ BREAKING ⚠️
It is not quite breaking, but it's highly recommended to convert the
database&table&column to a consistent and case-sensitive collation.