Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork updates from go-gitea/gitea main #58 #59

Merged
merged 111 commits into from
Dec 30, 2022
Merged

Commits on Nov 28, 2022

  1. Replace fmt.Sprintf with hex.EncodeToString (go-gitea#21960)

    `hex.EncodeToString` has better performance than `fmt.Sprintf("%x",
    []byte)`, we should use it as much as possible.
    
    I'm not an extreme fan of performance, so I think there are some
    exceptions:
    
    - `fmt.Sprintf("%x", func(...)[N]byte())`
    - We can't slice the function return value directly, and it's not worth
    adding lines.
        ```diff
        func A()[20]byte { ... }
        - a := fmt.Sprintf("%x", A())
        - a := hex.EncodeToString(A()[:]) // invalid
        + tmp := A()
        + a := hex.EncodeToString(tmp[:])
        ```
    - `fmt.Sprintf("%X", []byte)`
    - `strings.ToUpper(hex.EncodeToString(bytes))` has even worse
    performance.
    wolfogre authored Nov 28, 2022
    Configuration menu
    Copy the full SHA
    9607750 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f047ee0 View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2022

  1. Normalize AppURL according to RFC 3986 (go-gitea#21950)

    Fixes go-gitea#21865.
    
    Scheme-based normalization ([RFC 3986, section
    6.2.3](https://www.rfc-editor.org/rfc/rfc3986#section-6.2.3)) was
    already implemented, but only for `defaultAppURL`.
    This PR implements the same for `AppURL`.
    
    Signed-off-by: Saswat Padhi <saswatpadhi@protonmail.com>
    Co-authored-by: John Olheiser <john.olheiser@gmail.com>
    SaswatPadhi and jolheiser authored Nov 29, 2022
    Configuration menu
    Copy the full SHA
    715cf46 View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2022

  1. Fix typos (go-gitea#21979)

    Found via codespell
    luzpaz authored Nov 30, 2022
    Configuration menu
    Copy the full SHA
    fdfd77f View commit details
    Browse the repository at this point in the history
  2. Fix leaving organization bug on user settings -> orgs (go-gitea#21983)

    Fix go-gitea#21772
    
    Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
    Cosin and wxiaoguang authored Nov 30, 2022
    Configuration menu
    Copy the full SHA
    7020c4a View commit details
    Browse the repository at this point in the history
  3. Skip initing disabled storages (go-gitea#21985)

    If `Attachment` or `Packages` are disabled, we don't have to init the
    storages for them.
    wolfogre authored Nov 30, 2022
    Configuration menu
    Copy the full SHA
    67881ae View commit details
    Browse the repository at this point in the history
  4. Fix parallel creating commit status bug with tests (go-gitea#21911)

    This PR is a follow up of go-gitea#21469
    
    Co-authored-by: Lauris BH <lauris@nix.lv>
    lunny and lafriks authored Nov 30, 2022
    Configuration menu
    Copy the full SHA
    b2c4870 View commit details
    Browse the repository at this point in the history

Commits on Dec 1, 2022

  1. Skip initing LFS storage if disabled (go-gitea#21996)

    A complement to go-gitea#21985.
    
    I overlooked it because the name of the switch is `StartServer`, not
    `Enabled`. I believe the weird name is a legacy, but renaming is out of
    scope.
    wolfogre authored Dec 1, 2022
    Configuration menu
    Copy the full SHA
    4e5d4d0 View commit details
    Browse the repository at this point in the history
  2. Util type to parse ref name (go-gitea#21969)

    Provide a new type to make it easier to parse a ref name.
    
    Actually, it's picked up from go-gitea#21937, to make the origin PR lighter.
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    wolfogre and lunny authored Dec 1, 2022
    Configuration menu
    Copy the full SHA
    f9cbf5a View commit details
    Browse the repository at this point in the history
  3. Update chroma to v2.4.0 (go-gitea#22000)

    Did a few cursory tests, seems to work well.
    silverwind authored Dec 1, 2022
    Configuration menu
    Copy the full SHA
    f0bd219 View commit details
    Browse the repository at this point in the history
  4. Use path not filepath in template filenames (go-gitea#21993)

    Paths in git are always separated by `/` not `\` - therefore we should
    `path` and not `filepath`
    
    Fix go-gitea#21987
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Co-authored-by: Lauris BH <lauris@nix.lv>
    3 people authored Dec 1, 2022
    Configuration menu
    Copy the full SHA
    64973cf View commit details
    Browse the repository at this point in the history

Commits on Dec 2, 2022

  1. Fix generate index failure possibility on postgres (go-gitea#21998)

    @wxiaoguang Please review
    
    Co-authored-by: silverwind <me@silverwind.io>
    lunny and silverwind authored Dec 2, 2022
    Configuration menu
    Copy the full SHA
    f7ade6d View commit details
    Browse the repository at this point in the history
  2. Remove duplicate "Actions" label in mobile view (go-gitea#21974)

    Closes go-gitea#21973.
    
    The "Actions" button on the commit view page is labelled twice in mobile
    view. No other buttons on the page have a `mobile-only` extra label, so
    this PR removes it.
    
    Before:
    
    
    ![before](https://user-images.githubusercontent.com/6496999/204540002-75baa08a-6c06-4b39-847b-34272e09d71e.PNG)
    
    After:
    
    
    ![after](https://user-images.githubusercontent.com/6496999/204539991-a0607765-d5e2-4b1a-84c9-a3e16cbc674e.PNG)
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    markormesher and lunny authored Dec 2, 2022
    Configuration menu
    Copy the full SHA
    665d02e View commit details
    Browse the repository at this point in the history
  3. Remove session in api tests (go-gitea#21984)

    It's no meaning to request an API route with session.
    lunny authored Dec 2, 2022
    Configuration menu
    Copy the full SHA
    df676a4 View commit details
    Browse the repository at this point in the history
  4. Multiple improvements for comment edit diff (go-gitea#21990)

    - Use explicit avatar size so when JS copies the HTML, the size gets
    copied with it
    - Replace icon font use with SVG
    - Improve styling and diff rendering
    - Sort lists in `svg.js`
    
    Fixes: go-gitea#21924
    
    <img width="933" alt="Screenshot 2022-11-30 at 17 52 17"
    src="https://user-images.githubusercontent.com/115237/204859608-f322a8f8-7b91-45e4-87c0-82694e574115.png">
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Co-authored-by: techknowlogick <techknowlogick@gitea.io>
    3 people authored Dec 2, 2022
    Configuration menu
    Copy the full SHA
    d640632 View commit details
    Browse the repository at this point in the history
  5. Update gitea-vet to check FSFE REUSE (go-gitea#22004)

    Related to:
    - go-gitea#21840
    - https://gitea.com/gitea/gitea-vet/pulls/21
    
    What it looks like when it's working:
    https://drone.gitea.io/go-gitea/gitea/64040/1/5
    
    All available SPDX license identifiers: [SPDX License
    List](https://spdx.org/licenses/).
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    wolfogre and lunny authored Dec 2, 2022
    Configuration menu
    Copy the full SHA
    f59a748 View commit details
    Browse the repository at this point in the history
  6. Update to Alpine 3.17 (go-gitea#21904)

    This pull request is for updating the base docker images to build with
    the latest version of Alpine.
    flynnnnnnnnnn authored Dec 2, 2022
    Configuration menu
    Copy the full SHA
    350bc83 View commit details
    Browse the repository at this point in the history
  7. Add pnpm to packages/overview (go-gitea#22008)

    [`pnpm`](https://pnpm.io/) is a "fast, disk space efficient" node
    package manager.
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    xtexChooser and lunny authored Dec 2, 2022
    Configuration menu
    Copy the full SHA
    21bcb92 View commit details
    Browse the repository at this point in the history
  8. Remove deprecated packages & staticcheck fixes (go-gitea#22012)

    `ioutil` is deprecated and should use `io` instead
    harryzcy authored Dec 2, 2022
    Configuration menu
    Copy the full SHA
    8698458 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2022

  1. refactor some functions to support ctx as first parameter (go-gitea#2…

    …1878)
    
    Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
    Co-authored-by: Lauris BH <lauris@nix.lv>
    3 people authored Dec 3, 2022
    Configuration menu
    Copy the full SHA
    0a7d3ff View commit details
    Browse the repository at this point in the history
  2. docs: add Edit this page (go-gitea#21981)

    Update theme to support `Edit this page`:
    https://gitea.com/gitea/theme/pulls/116
    
    Screenshot:
    ![Edit this
    page](https://user-images.githubusercontent.com/76462613/205257167-d6039d0c-c913-4ebc-98c1-834aece4b5e9.png)
    
    Signed-off-by: Xinyu Zhou <i@sourcehut.net>
    Co-authored-by: John Olheiser <john.olheiser@gmail.com>
    Co-authored-by: techknowlogick <techknowlogick@gitea.io>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    4 people authored Dec 3, 2022
    Configuration menu
    Copy the full SHA
    181f4bf View commit details
    Browse the repository at this point in the history
  3. Do not emit ambiguous character warning on rendered pages (go-gitea#2…

    …2016)
    
    The real sensitivity of ambiguous characters is in source code -
    therefore warning about them in rendered pages causes too many warnings.
    Therefore simply remove the warning on rendered pages.
    
    The escape button will remain available and it is present on the view
    source page.
    
    Fix go-gitea#20999
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath authored Dec 3, 2022
    Configuration menu
    Copy the full SHA
    0e46499 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2022

  1. Configuration menu
    Copy the full SHA
    d084ce3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9eb9cf5 View commit details
    Browse the repository at this point in the history
  3. Fix ListBranches to handle empty case (go-gitea#21921)

    Fix go-gitea#21910
    
    Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
    lunny and KN4CK3R authored Dec 4, 2022
    Configuration menu
    Copy the full SHA
    36cbaec View commit details
    Browse the repository at this point in the history
  4. On tag/branch-exist check, dont panic if repo is nil (go-gitea#21787)

    fix a panic found in gitea logs
    6543 authored Dec 4, 2022
    Configuration menu
    Copy the full SHA
    4648584 View commit details
    Browse the repository at this point in the history
  5. Add dumb-init to rootless docker (go-gitea#21775)

    Add dumb-init as process reaper to the rootless image to reap defunct git processes.
    viceice authored Dec 4, 2022
    Configuration menu
    Copy the full SHA
    84d2a82 View commit details
    Browse the repository at this point in the history
  6. Use GhostUser if needed for TrackedTimes (go-gitea#22021)

    When getting tracked times out of the db and loading their attributes
    handle not exist errors in a nicer way. (Also prevent an NPE.)
    
    Fix go-gitea#22006
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath authored Dec 4, 2022
    Configuration menu
    Copy the full SHA
    ea86c2b View commit details
    Browse the repository at this point in the history
  7. Ensure that Chinese punctuation is not ambiguous when locale is Chine…

    …se (go-gitea#22019)
    
    Although there are per-locale fallbacks for ambiguity the locale names
    for Chinese do not quite match our locales. This PR simply maps zh-CN on
    to zh-hans and other zh variants on to zh-hant.
    
    Ref go-gitea#20999
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath authored Dec 4, 2022
    Configuration menu
    Copy the full SHA
    a08584e View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2022

  1. Remove useless "Cancel" buttons (go-gitea#21872)

    * Continues go-gitea#21381
    
    These buttons have no real use. To cancel, one would simply navigate
    away.
    
    Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
    yardenshoham authored Dec 5, 2022
    Configuration menu
    Copy the full SHA
    77f5035 View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2022

  1. Fix issue/PR numbers (go-gitea#22037)

    When deleting a closed issue, we should update both `NumIssues`and
    `NumClosedIssues`, or `NumOpenIssues`(`= NumIssues -NumClosedIssues`)
    will be wrong. It's the same for pull requests.
    
    Releated to go-gitea#21557.
    
    Alse fixed two harmless problems:
    
    - The SQL to check issue/PR total numbers is wrong, that means it will
    update the numbers even if they are correct.
    - Replace legacy `num_issues = num_issues + 1` operations with
    `UpdateRepoIssueNumbers`.
    wolfogre authored Dec 6, 2022
    Configuration menu
    Copy the full SHA
    74874d0 View commit details
    Browse the repository at this point in the history
  2. Release and Tag List tweaks (go-gitea#21712)

    - Reduce font size on tag list and add muted links
    - Move Release tag to right side on release list
    - Move Release edit button to far-right and make it icon-only
    - Add styles for error dropdowns, seen on release edit page
    - Make the release page slightly more mobile-friendly
    
    <img width="468" alt="Screen Shot 2022-11-07 at 22 10 44"
    src="https://user-images.githubusercontent.com/115237/200417500-149f40f5-2376-42b4-92a7-d7eba3ac359d.png">
    
    <img width="1015" alt="Screen Shot 2022-11-07 at 22 27 14"
    src="https://user-images.githubusercontent.com/115237/200419201-b28f39d6-fe9e-4049-8023-b301c9bae528.png">
    <img width="1019" alt="Screen Shot 2022-11-07 at 22 27 27"
    src="https://user-images.githubusercontent.com/115237/200419206-3f07d988-42f6-421d-8ba9-303a0d59e711.png">
    
    <img width="709" alt="Screen Shot 2022-11-07 at 22 42 10"
    src="https://user-images.githubusercontent.com/115237/200421671-f0393cde-2d8f-4e1f-a788-f1f51fc4807c.png">
    <img width="713" alt="Screen Shot 2022-11-07 at 22 42 27"
    src="https://user-images.githubusercontent.com/115237/200421676-5797f8cf-dfe8-4dd6-85d4-dc69e31a9912.png">
    
    
    <img width="406" alt="image"
    src="https://user-images.githubusercontent.com/115237/200418220-8c3f7549-61b4-4661-935e-39e1352f7851.png">
    <img width="416" alt="Screen Shot 2022-11-07 at 22 21 36"
    src="https://user-images.githubusercontent.com/115237/200418107-cdb0eb6f-1292-469c-b89a-2cb13f24173c.png">
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    silverwind and lunny authored Dec 6, 2022
    Configuration menu
    Copy the full SHA
    e2fa84f View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2022

  1. Support disabling database auto migration (go-gitea#22053)

    Gitea will migrate the database model version automatically, but it
    should be able to be disabled and keep Gitea shutdown if the version is
    not matched.
    wolfogre authored Dec 7, 2022
    Configuration menu
    Copy the full SHA
    0a85537 View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2022

  1. Round language stats percentage using largest remainder (go-gitea#22026)

    Fix go-gitea#22023 
    
    I've changed how the percentages for the language statistics are rounded
    because they did not always add up to 100%
    Now it's done with the largest remainder method, which makes sure that
    total is 100%
    
    Co-authored-by: Lauris BH <lauris@nix.lv>
    hr-98 and lafriks authored Dec 8, 2022
    Configuration menu
    Copy the full SHA
    cf27403 View commit details
    Browse the repository at this point in the history
  2. Update go dev dependencies (go-gitea#22064)

    `golangci-lint`
    [deprecated](golangci/golangci-lint#1841) a
    bunch of linters, removed them.
    silverwind authored Dec 8, 2022
    Configuration menu
    Copy the full SHA
    0585ac3 View commit details
    Browse the repository at this point in the history
  3. Rename actions to operations on UI (go-gitea#22067)

    Use "operations" to indicate "some something can be done", to prevent
    users from confusing it with CICD.
    
    Releated to: go-gitea#13539.
    
    Snapshots:
    
    <img width="389" alt="image"
    src="https://user-images.githubusercontent.com/9418365/206409797-a99bac25-2d38-4066-b9ab-27a4f6fe67e7.png">
    <img width="398" alt="image"
    src="https://user-images.githubusercontent.com/9418365/206410099-bbd258a9-54d9-4664-8d95-31d29cb35209.png">
    <img width="442" alt="image"
    src="https://user-images.githubusercontent.com/9418365/206410218-009a3103-a9b9-4d0c-86b6-540dda5bce89.png">
    
    I'm not a native English speaker, but I think "operations" may be good
    enough, and Gitea already uses this word:
    
    <img width="1440" alt="image"
    src="https://user-images.githubusercontent.com/9418365/206410671-4a718b14-0603-40cb-bdcb-f6f84d1f5e24.png">
    wolfogre authored Dec 8, 2022
    Configuration menu
    Copy the full SHA
    8fb1e53 View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2022

  1. Add API management for issue/pull and comment attachments (go-gitea#2…

    …1783)
    
    Close go-gitea#14601
    Fix go-gitea#3690
    
    Revive of go-gitea#14601.
    Updated to current code, cleanup and added more read/write checks.
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    Signed-off-by: Andre Bruch <ab@andrebruch.com>
    Co-authored-by: zeripath <art27@cantab.net>
    Co-authored-by: 6543 <6543@obermui.de>
    Co-authored-by: Norwin <git@nroo.de>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    5 people authored Dec 9, 2022
    Configuration menu
    Copy the full SHA
    3c59d31 View commit details
    Browse the repository at this point in the history
  2. Optimize html templates (go-gitea#22080)

    Replace `active{{end}} item` with `active{{end}} item`.
    wolfogre authored Dec 9, 2022
    Configuration menu
    Copy the full SHA
    2779d47 View commit details
    Browse the repository at this point in the history
  3. Change ID pattern of raw content container for issue (go-gitea#21966)

    Implement differentiation to html id for issue raw content container.
    
    Fixes go-gitea#21965
    fsologureng authored Dec 9, 2022
    Configuration menu
    Copy the full SHA
    097d4e3 View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2022

  1. Configuration menu
    Copy the full SHA
    6870453 View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary whitespace in snapcraft.yaml (go-gitea#22090)

    Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
    yardenshoham authored Dec 10, 2022
    Configuration menu
    Copy the full SHA
    9745c33 View commit details
    Browse the repository at this point in the history
  3. Update xorm (go-gitea#22094)

    KN4CK3R authored Dec 10, 2022
    Configuration menu
    Copy the full SHA
    0e2d046 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2022

  1. Configuration menu
    Copy the full SHA
    601d126 View commit details
    Browse the repository at this point in the history
  2. fix(config): remove context on config template (go-gitea#22096)

    👋 Hey
    I'm new around here, so I may have done some mistakes, sorry! 
    
    ---
    
    ## Context
    On a fresh Gitea install, when I go to the [config admin
    page](http://localhost:3000/admin/config) I had a 500 error page.
    The logs:
    ```
    2022/12/10 20:08:47 ...s/context/context.go:232:HTML() [E] [6394d93f] Render failed: template: admin/config:180:22: executing "admin/config" at <.Service.DefaultAllowOnlyContributorsToTrackTime>: DefaultAllowOnlyContributorsToTrackTime has arguments but cannot be invoked as function
    2022/12/10 20:08:47 [6394d93f] router: completed GET /admin/config for [::1]:43800, 500 Internal Server Error in 5.1ms @ admin/config.go:99(admin.Config)
    ```
    
    ## The fix
    
    I removed the `$.Context` on the
    `.Service.DefaultAllowOnlyContributorsToTrackTime` to fix the 500 error
    page happening. It could be a mistake, and I don't fully understand what
    I've done!
    
    Signed-off-by: Restray <contact@restray.org>
    restray authored Dec 11, 2022
    Configuration menu
    Copy the full SHA
    112e425 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c9ef03a View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2022

  1. Fix sorting admin user list by last login (go-gitea#22081)

    Admin User Account list sort
    
    `updated_unix` is not the same as "Last Sign-In"
    aceArt-GmbH authored Dec 12, 2022
    Configuration menu
    Copy the full SHA
    352a50d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3e8285b View commit details
    Browse the repository at this point in the history
  3. Allow disable code tab (go-gitea#20805)

    I know some users created a repository in an organization but just use
    issues and projects to handle the whole organizations issues. So that
    `Code` could be disabled per repository.
    
    <img width="1148" alt="image"
    src="https://user-images.githubusercontent.com/81045/184792075-346cb508-b620-4adb-bc9a-cba76fdcb294.png">
    
    It could also become a wiki repository.
    
    <img width="1173" alt="image"
    src="https://user-images.githubusercontent.com/81045/184792324-e15c6f68-35c0-4105-ab77-83585ce53672.png">
    
    Co-authored-by: delvh <dev.lh@web.de>
    lunny and delvh authored Dec 12, 2022
    Configuration menu
    Copy the full SHA
    003b4e2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6398ca7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    36a2d2f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    87c64f6 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2022

  1. Configuration menu
    Copy the full SHA
    a95247b View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2022

  1. Fix markdown typo of an extra backtick in docs (go-gitea#22123)

    Fixes a visual bug in docs which is caused by a typo of an extra backtick.
    Yakov5776 authored Dec 14, 2022
    Configuration menu
    Copy the full SHA
    5aa8546 View commit details
    Browse the repository at this point in the history
  2. Make gitea work using cmd.exe again (go-gitea#22073)

    Gitea will attempt to lookup its location using LookPath however, this
    fails on cmd.exe if gitea is in the current working directory.
    
    exec.LookPath will return an exec.ErrDot error which we can test for and
    then simply using filepath.Abs(os.Args[0]) to absolute gitea against the
    current working directory.
    
    Fix go-gitea#22063
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Co-authored-by: techknowlogick <techknowlogick@gitea.io>
    3 people authored Dec 14, 2022
    Configuration menu
    Copy the full SHA
    4fb2006 View commit details
    Browse the repository at this point in the history
  3. Fix condition for is_internal (go-gitea#22095)

    depends on go-gitea#22094
    
    Fixes https://codeberg.org/forgejo/forgejo/issues/77
    
    The old logic did not consider `is_internal`.
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Co-authored-by: techknowlogick <techknowlogick@gitea.io>
    3 people authored Dec 14, 2022
    Configuration menu
    Copy the full SHA
    07461e1 View commit details
    Browse the repository at this point in the history
  4. remove duplicated read file code (go-gitea#22042)

    Merge the duplicated read file code as one function in reading text file
    and readme file.
    lunny authored Dec 14, 2022
    Configuration menu
    Copy the full SHA
    1b32ed0 View commit details
    Browse the repository at this point in the history
  5. Correctly handle moved files in apply patch (go-gitea#22118)

    Moved files in a patch will result in git apply returning:
    
    ```
    error: {filename}: No such file or directory
    ```
    
    This wasn't handled by the git apply patch code. This PR adds handling
    for this.
    
    Fix go-gitea#22083
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    Co-authored-by: techknowlogick <techknowlogick@gitea.io>
    zeripath and techknowlogick authored Dec 14, 2022
    Configuration menu
    Copy the full SHA
    cdc4345 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ae97197 View commit details
    Browse the repository at this point in the history

Commits on Dec 15, 2022

  1. remove silentcode from MAINTAINERS (go-gitea#22143)

    Signed-off-by: silentcode <silentcode@senga.org>
    silentcodeg authored Dec 15, 2022
    Configuration menu
    Copy the full SHA
    3243dbe View commit details
    Browse the repository at this point in the history
  2. Add doctor command for full GC of LFS (go-gitea#21978)

    The recent PR adding orphaned checks to the LFS storage is not
    sufficient to completely GC LFS, as it is possible for LFSMetaObjects to
    remain associated with repos but still need to be garbage collected.
    
    Imagine a situation where a branch is uploaded containing LFS files but
    that branch is later completely deleted. The LFSMetaObjects will remain
    associated with the Repository but the Repository will no longer contain
    any pointers to the object.
    
    This PR adds a second doctor command to perform a full GC.
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath authored Dec 15, 2022
    Configuration menu
    Copy the full SHA
    651fe4b View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2022

  1. Do not list active repositories as unadopted (go-gitea#22034)

    This fixes a bug where, when searching unadopted repositories, active
    repositories will be listed as well. This is because the size of the
    array of repository names to check is larger by one than the
    `IterateBufferSize`.
    
    For an `IterateBufferSize` of 50, the original code will pass 51
    repository names but set the query to `LIMIT 50`. If all repositories in
    the query are active (i.e. not unadopted) one of them will be omitted
    from the result. Due to the `ORDER BY` clause it will be the oldest (or
    least recently modified) one.
    
    Bug found in 1.17.3.
    
    Co-authored-by: zeripath <art27@cantab.net>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    3 people authored Dec 16, 2022
    Configuration menu
    Copy the full SHA
    84285a1 View commit details
    Browse the repository at this point in the history
  2. Update username (go-gitea#22147)

    update my email & username
    Xinyu Zhou authored Dec 16, 2022
    Configuration menu
    Copy the full SHA
    8400146 View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2022

  1. Fix margin and alignment in dashboard repolist (go-gitea#22120)

    Seems this has recently regressed, previously, there was a significant
    whitespace between icon and text, but it seems to be gone, so I added
    the margin and also vertically aligned the icon because it was slightly
    misaligned.
    
    Before:
    <img width="419" alt="Screenshot 2022-12-13 at 20 03 51"
    src="https://user-images.githubusercontent.com/115237/207422938-7c45110c-f73e-4344-afc8-c072266d1f95.png">
    
    After:
    <img width="419" alt="image"
    src="https://user-images.githubusercontent.com/115237/207447579-95525405-574d-4ca8-84ba-d8a9af50015a.png">
    
    Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
    silverwind and KN4CK3R authored Dec 17, 2022
    Configuration menu
    Copy the full SHA
    c4c4151 View commit details
    Browse the repository at this point in the history
  2. verify nodeinfo response by schema (go-gitea#22137)

    ... using
    [github.com/xeipuuv/gojsonschema](https://github.com/xeipuuv/gojsonschema)
    
    Co-authored-by: techknowlogick <techknowlogick@gitea.io>
    MFTabriz and techknowlogick authored Dec 17, 2022
    Configuration menu
    Copy the full SHA
    f3370ee View commit details
    Browse the repository at this point in the history
  3. Ensure that plain files are rendered correctly even when containing a…

    …mbiguous characters (go-gitea#22017)
    
    As recognised in go-gitea#21841 the rendering of plain text files is somewhat
    incorrect when there are ambiguous characters as the html code is double
    escaped. In fact there are several more problems here.
    
    We have a residual isRenderedHTML which is actually simply escaping the
    file - not rendering it. This is badly named and gives the wrong
    impression.
    
    There is also unusual behaviour whether the file is called a Readme or
    not and there is no way to get to the source code if the file is called
    README.
    
    In reality what should happen is different depending on whether the file
    is being rendered a README at the bottom of the directory view or not.
    
    1. If it is rendered as a README on a directory - it should simply be
    escaped and rendered as `<pre>` text.
    2. If it is rendered as a file then it should be rendered as source
    code.
    
    This PR therefore does:
    1. Rename IsRenderedHTML to IsPlainText
    2. Readme files rendered at the bottom of the directory are rendered
    without line numbers
    3. Otherwise plain text files are rendered as source code.
    
    Replace go-gitea#21841
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    zeripath and lunny authored Dec 17, 2022
    Configuration menu
    Copy the full SHA
    6e22605 View commit details
    Browse the repository at this point in the history

Commits on Dec 18, 2022

  1. Configuration menu
    Copy the full SHA
    998fe26 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2022

  1. Local storage should not store files as executable (go-gitea#22162)

    The PR go-gitea#21198 introduced a probable security vulnerability which
    resulted in making all storage files be marked as executable.
    
    This PR ensures that these are forcibly marked as non-executable.
    
    Fix go-gitea#22161
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath authored Dec 19, 2022
    Configuration menu
    Copy the full SHA
    a89b399 View commit details
    Browse the repository at this point in the history
  2. Add setting to disable the git apply step in test patch (go-gitea#22130)

    For a long time Gitea has tested PR patches using a git apply --check
    method, and in fact prior to the introduction of a read-tree assisted
    three-way merge in go-gitea#18004, this was the only way of checking patches.
    
    Since go-gitea#18004, the git apply --check method has been a fallback method,
    only used when the read-tree three-way merge method has detected a
    conflict. The read-tree assisted three-way merge method is much faster
    and less resource intensive method of detecting conflicts. go-gitea#18004 kept
    the git apply method around because it was thought possible that this
    fallback might be able to rectify conflicts that the read-tree three-way
    merge detected. I am not certain if this could ever be the case.
    
    Given the uncertainty here and the now relative stability of the
    read-tree method - this PR makes using this fallback optional and
    disables it by default. The hope is that users will not notice any
    significant difference in conflict detection and we will be able to
    remove the git apply fallback in future, and/or improve the read-tree
    three-way merge method to catch any conflicts that git apply method
    might have been able to fix.
    
    An additional benefit is that patch checking should be significantly
    less resource intensive and much quicker.
    
    (See
    https://github.com/go-gitea/gitea/issues/22083\#issuecomment-1347961737)
    
    Ref go-gitea#22083
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
    3 people authored Dec 19, 2022
    Configuration menu
    Copy the full SHA
    d6b9662 View commit details
    Browse the repository at this point in the history
  3. Fix heatmap first color being unused (go-gitea#22157)

    vue3-calendar-heatmap has the behaviour that the first and second colors
    are mapped to values null and 0, meaning the second color was not used
    as intended for values > 0. I think this is a behaviour change from
    previous vue2 version that was missed during the upgrade.
    
    This change makes first and second values the same, so the heatmap can
    now use one additional color for meaningful values.
    
    Before:
    <img width="710" alt="Screenshot 2022-12-18 at 09 17 58"
    src="https://user-images.githubusercontent.com/115237/208288347-df4973af-8ebd-4582-b828-bec948ffdf60.png">
    
    After:
    <img width="709" alt="Screenshot 2022-12-18 at 09 18 15"
    src="https://user-images.githubusercontent.com/115237/208288350-e0b85aa2-6925-4a37-83d2-89e2518c91ce.png">
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    silverwind and lunny authored Dec 19, 2022
    Configuration menu
    Copy the full SHA
    2774671 View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2022

  1. Check for zero time instant in TimeStamp.IsZero() (go-gitea#22171)

    - Currently, the 'IsZero' function for 'TimeStamp' just checks if the
    unix time is zero, which is not the behavior of 'Time.IsZero()', but
    Gitea is using this method in accordance with the behavior of
    'Time.IsZero()'.
    - Adds a new condition to check for the zero time instant.
    - Fixes a bug where non-expiring GPG keys where shown as they expired on
    Jan 01, 0001.
    - Related https://codeberg.org/Codeberg/Community/issues/791
    
    Before:
    
    ![image](https://user-images.githubusercontent.com/25481501/208509035-ecc5fa4a-3bd1-4fa3-beba-90875719163c.png)
    
    After:
    
    ![image](https://user-images.githubusercontent.com/25481501/208508950-3e7f6eeb-be83-432a-89a6-d738553dafe4.png)
    Gusted authored Dec 20, 2022
    Configuration menu
    Copy the full SHA
    40ba750 View commit details
    Browse the repository at this point in the history
  2. Secrets storage with SecretKey encrypted (go-gitea#22142)

    Fork of go-gitea#14483, but [gave up
    MasterKey](go-gitea#14483 (comment)),
    and fixed some problems.
    
    Close go-gitea#12065.
    Needed by go-gitea#13539.
    
    Featrues:
    - Secrets for repo and org, not user yet.
    - Use SecretKey to encrypte/encrypt secrets.
    - Trim spaces of secret value.
    - Add a new locale ini block, to make it easy to support secrets for
    user.
    
    Snapshots:
    
    Repo level secrets:
    
    ![image](https://user-images.githubusercontent.com/9418365/207823319-b8a4903f-38ca-4af7-9d05-336a5af906f3.png)
    
    Rrg level secrets
    
    ![image](https://user-images.githubusercontent.com/9418365/207823371-8bd02e93-1928-40d1-8c76-f48b255ace36.png)
    
    Co-authored-by: Lauris BH <lauris@nix.lv>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
    Co-authored-by: delvh <dev.lh@web.de>
    Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
    6 people authored Dec 20, 2022
    Configuration menu
    Copy the full SHA
    6590551 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    495b8b3 View commit details
    Browse the repository at this point in the history
  4. Update JS dependencies and eslint (go-gitea#22190)

    - Update all JS dependencies to latest version
    - Enable unicorn/prefer-node-protocol and autofix issues
    - Regenerate SVGs
    - Add some comments to eslint rules
    - Tested build, Mermaid and Katex rendering
    silverwind authored Dec 20, 2022
    Configuration menu
    Copy the full SHA
    e767b33 View commit details
    Browse the repository at this point in the history
  5. Fix misc whitespace issues in install docs (go-gitea#22189)

    I ran into issues when copy-pasting the docker-compose.yml contents from
    https://docs.gitea.io/en-us/install-with-docker/ - specifically the part
    about adding PostgreSQL to the YAML file; I tried manually adding the
    diffs by removing the `+` at the beginning of lines, and the resulting
    YAML was unparsable.
    
    This forces the indentation to be consistent across all places where
    YAML is used.
    
    Co-authored-by: techknowlogick <techknowlogick@gitea.io>
    h3xx and techknowlogick authored Dec 20, 2022
    Configuration menu
    Copy the full SHA
    70d15e7 View commit details
    Browse the repository at this point in the history

Commits on Dec 21, 2022

  1. Repair LFS web rendering. (go-gitea#22195)

    There was just a missing check.
    
    Fixes go-gitea#22193.
    
    Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>
    kousu authored Dec 21, 2022
    Configuration menu
    Copy the full SHA
    c4df10d View commit details
    Browse the repository at this point in the history
  2. Specify ID in TestAPITeam (go-gitea#22192)

    - There have been [CI
    failures](https://codeberg.org/forgejo/forgejo/issues/111) in this
    specific test function. The code on itself looks good, the CI failures
    are likely caused by not specifying any field in `TeamUser`, which might
    have caused to unittest to return another `TeamUser` than the code
    expects.
    
    Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
    Gusted and KN4CK3R authored Dec 21, 2022
    Configuration menu
    Copy the full SHA
    90572c5 View commit details
    Browse the repository at this point in the history
  3. Attempt to fix TestExportUserGPGKeys (go-gitea#22159)

    There are repeated failures with this test which appear related to
    failures in getTokenForLoggedInUser. It is difficult to further evaluate
    the cause of these failures as we do not get given further information.
    
    This PR will attempt to fix this.
    
    First it adds some extra logging and it uses the csrf cookie primarily
    for the csrf value.
    
    If the problem does not occur again with those changes we could merge,
    assume that it is fixed and hope that if it occurs in future the
    additional logging will be helpful.
    
    If not I will add more changes in attempt to fix.
    
    Fix go-gitea#22105
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Co-authored-by: John Olheiser <john.olheiser@gmail.com>
    Co-authored-by: techknowlogick <matti@mdranta.net>
    Co-authored-by: delvh <dev.lh@web.de>
    5 people authored Dec 21, 2022
    Configuration menu
    Copy the full SHA
    fe6608f View commit details
    Browse the repository at this point in the history
  4. Normalize NuGet package version on upload (go-gitea#22186)

    Fixes go-gitea#22178
    
    After this change upload versions with different semver metadata are
    treated as the same version and trigger a duplicated version error.
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    KN4CK3R and lunny authored Dec 21, 2022
    Configuration menu
    Copy the full SHA
    86ace4b View commit details
    Browse the repository at this point in the history
  5. Mobile fix for Project view: Add delay to Sortable.js on mobile, to e…

    …nsure scrolling is possible. (go-gitea#22152)
    
    Mobile / touch devices currently get "hung up" on the sortable action,
    preventing any ability to visually scroll through the Project board to
    see issues.
    
    Solution: Sortable.js has a built-in fix using `delayOnTouchOnly`
    
    BEFORE
    
    https://user-images.githubusercontent.com/24665/208266817-6f2968b7-4788-4656-a941-f85b25fc59d5.mp4
    
    AFTER
    
    https://user-images.githubusercontent.com/24665/208266822-3d327002-7a9d-41cf-9890-6d6b8dcb17be.mp4
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Co-authored-by: techknowlogick <techknowlogick@gitea.io>
    3 people authored Dec 21, 2022
    Configuration menu
    Copy the full SHA
    8e267af View commit details
    Browse the repository at this point in the history
  6. Fixed colour transparency regex matching in project board sorting (go…

    …-gitea#22091) (go-gitea#22092)
    
    As described in the linked issue (go-gitea#22091), semi-transparent UI elements
    would result in JS errors due to the fact that the CSS `backgroundColor`
    element was being matched by the pattern
    `^rgb\((\d+),\s*(\d+),\s*(\d+)\)$`, which does not take the alpha
    channel into account.
    
    I changed the pattern to `^rgba?\((\d+),\s*(\d+),\s*(\d+).*\)$`.
    This new pattern accepts both `rgb` and `rgba` tuples, and ignores the
    alpha channel (that little `.*` at the end) from the sorting criteria.
    The reason why I chose to ignore alpha is because when it comes to
    kanban colour sorting, only the hue is important; the order of the
    panels should stay the same, even if some of them are transparent.
    
    Alternative solutions were discussed in the bug report and are included
    here for completeness:
    1. Change the regex from ^rgb\((\d+),\s*(\d+),\s*(\d+)\)$ to
    ^rgba?\((\d+),\s*(\d+),\s*(\d+)(,\s*(\d+(\.\d+)?))?\)$ (alpha channel is
    a float or NaN on 5th group) and include the alpha channel in the
    sorting criteria.
    2. Rethink on why you're reading colours out of the CSS in the first
    place, then reformat this sorting procedure.
    
    Co-authored-by: Lauris BH <lauris@nix.lv>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Co-authored-by: techknowlogick <techknowlogick@gitea.io>
    4 people authored Dec 21, 2022
    Configuration menu
    Copy the full SHA
    c403e2f View commit details
    Browse the repository at this point in the history
  7. fix: update libcurl in docs pipeline (go-gitea#22203)

    updating libcurl fixes the mismatch between curl and libcurl
    
    Signed-off-by: jolheiser <john.olheiser@gmail.com>
    Co-authored-by: silverwind <me@silverwind.io>
    jolheiser and silverwind authored Dec 21, 2022
    Configuration menu
    Copy the full SHA
    9914b21 View commit details
    Browse the repository at this point in the history
  8. Add Feed for Releases and Tags (go-gitea#21696)

    Fixes go-gitea#19091
    
    Add Feed for Releases and Tags, can be accessed through
    `reponame/releases.rss`, `reponame/releases.atom`, `reponame/tags.rss`,
    and `reponame/tags.atom`
    
    Signed-off-by: Reo <reo_999@proton.me>
    reopt999 authored Dec 21, 2022
    Configuration menu
    Copy the full SHA
    48d71b7 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b767182 View commit details
    Browse the repository at this point in the history

Commits on Dec 22, 2022

  1. Update bleve and zapx to fix unaligned atomic (go-gitea#22031)

    There is an unaligned atomic field in zapx 15.3.5 which should have been
    fixed in a subsequent patch
    
    This bug causes issues on 32bit builds.
    
    Update bleve and zapx to account for this.
    
    Fix go-gitea#21957
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath authored Dec 22, 2022
    Configuration menu
    Copy the full SHA
    8e17fb5 View commit details
    Browse the repository at this point in the history
  2. Run hugo via go run and lock its version (go-gitea#22206)

    - Don't rely on obscure docker images like `plugins/hugo`
    - Lock down `hugo` to same version the image had used
    - Remove unnecessary verbosity in `trans-copy`
    - Rename `trans-copy` to `trans-copy.sh`
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Co-authored-by: John Olheiser <john+github@jolheiser.com>
    Co-authored-by: techknowlogick <techknowlogick@gitea.io>
    4 people authored Dec 22, 2022
    Configuration menu
    Copy the full SHA
    3affb02 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6037043 View commit details
    Browse the repository at this point in the history
  4. Upgrade hugo to 0.82 (go-gitea#22209)

    See
    go-gitea#22206 (comment).
    Apparently hugo 0.81.0 is a broken release in regards to checksums.
    
    https://github.com/gohugoio/hugo/releases/tag/v0.82.0
    
    Co-authored-by: Lauris BH <lauris@nix.lv>
    silverwind and lafriks authored Dec 22, 2022
    Configuration menu
    Copy the full SHA
    ac5b44b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8c1bb77 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7bf7c13 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ea5a752 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a2779de View commit details
    Browse the repository at this point in the history

Commits on Dec 23, 2022

  1. Hide file borders on sticky diff box (go-gitea#22217)

    Before: (1px border left and right when scrolled to a file)
    <img width="1143" alt="Screenshot 2022-12-22 at 15 37 54"
    src="https://user-images.githubusercontent.com/115237/209158082-c1a413b1-45b7-46b7-a71c-8e5a06324f43.png">
    
    After: (no border)
    <img width="1149" alt="Screenshot 2022-12-22 at 15 39 01"
    src="https://user-images.githubusercontent.com/115237/209158086-9b00641f-2f41-4de1-9c08-22230c8a966a.png">
    
    Layout in the box does not shift with the changes.
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    silverwind and lunny authored Dec 23, 2022
    Configuration menu
    Copy the full SHA
    41f0668 View commit details
    Browse the repository at this point in the history
  2. Check primary keys for all tables and drop ForeignReference (go-gitea…

    …#21721)
    
    Some dbs require that all tables have primary keys, see
    - go-gitea#16802
    - go-gitea#21086
    
    We can add a test to keep it from being broken again.
    
    Edit:
    
    ~Added missing primary key for `ForeignReference`~ Dropped the
    `ForeignReference` table to satisfy the check, so it closes go-gitea#21086.
    
    More context can be found in comments.
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    Co-authored-by: zeripath <art27@cantab.net>
    wolfogre and zeripath authored Dec 23, 2022
    Configuration menu
    Copy the full SHA
    71ca306 View commit details
    Browse the repository at this point in the history
  3. JS refactors (go-gitea#22227)

    - Replace all default exports with named exports, except for Vue SFCs
    - Remove names from Vue SFCs, they are automatically inferred from the
    filename
    - Misc whitespace-related tweaks
    silverwind authored Dec 23, 2022
    Configuration menu
    Copy the full SHA
    2cf0cf0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2b0b563 View commit details
    Browse the repository at this point in the history

Commits on Dec 25, 2022

  1. Configuration menu
    Copy the full SHA
    3bd49f7 View commit details
    Browse the repository at this point in the history
  2. Add Mermaid copy button, avoid unnecessary tooltip hide (go-gitea#22225)

    - Add Copy button to mermaid diagrams which copies their source.
    - Set tippy to not hide on click and avoid tooltip re-creation for
    temporary tooltips. This avoids hide and show when copying repo url.
    Popovers still hide the tooltip as usual.
    
    
    <img width="815" alt="Screenshot 2022-12-23 at 14 02 32"
    src="https://user-images.githubusercontent.com/115237/209341696-98e30953-f246-46d9-9157-2ececfd791c9.png">
    
    Co-authored-by: Lauris BH <lauris@nix.lv>
    Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
    3 people authored Dec 25, 2022
    Configuration menu
    Copy the full SHA
    f5cd0d9 View commit details
    Browse the repository at this point in the history

Commits on Dec 26, 2022

  1. Fix typo of Asia/Shanghai (go-gitea#22242)

    As the title.
    wolfogre authored Dec 26, 2022
    Configuration menu
    Copy the full SHA
    814b44a View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2022

  1. Remove ReverseProxy authentication from the API (go-gitea#22219)

    Since we changed the /api/v1/ routes to disallow session authentication
    we also removed their reliance on CSRF. However, we left the
    ReverseProxy authentication here - but this means that POSTs to the API
    are no longer protected by CSRF.
    
    Now, ReverseProxy authentication is a kind of session authentication,
    and is therefore inconsistent with the removal of session from the API.
    
    This PR proposes that we simply remove the ReverseProxy authentication
    from the API and therefore users of the API must explicitly use tokens
    or basic authentication.
    
    Replace go-gitea#22077
    Close go-gitea#22221 
    Close go-gitea#22077 
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath authored Dec 27, 2022
    Configuration menu
    Copy the full SHA
    83640c4 View commit details
    Browse the repository at this point in the history
  2. Remove deadcode (go-gitea#22245)

    - Remove code that isn't being used.
    
    Found this is my stash from a few weeks ago, not sure how I found this
    in the first place.
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    Gusted and lunny authored Dec 27, 2022
    Configuration menu
    Copy the full SHA
    b48cf03 View commit details
    Browse the repository at this point in the history
  3. Add more test directory to exclude dir of air, remove watching templa…

    …tes from air include dir because gitea has internal mechanism (go-gitea#22246)
    
    Since go-gitea#20218 introduced internal watching template, template watching
    should be removed from `air`. This will prevent restart the whole server
    once the template files changed to speed up developing when using `make
    watch`.
    
    To ensure `make watch` will reuse template watching, this PR introduced
    a new ENV `GITEA_RUN_MODE` to make sure `make watch` will always run in
    a dev mode of Gitea so that template watching will open.
    
    This PR also added more exclude testdata directories.
    lunny authored Dec 27, 2022
    Configuration menu
    Copy the full SHA
    90237d8 View commit details
    Browse the repository at this point in the history
  4. Use complete SHA to create and query commit status (go-gitea#22244)

    Fix go-gitea#13485.
    
    Co-authored-by: delvh <dev.lh@web.de>
    Co-authored-by: Lauris BH <lauris@nix.lv>
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    4 people authored Dec 27, 2022
    Configuration menu
    Copy the full SHA
    6cf09cc View commit details
    Browse the repository at this point in the history
  5. Add the 'ui.user' section to the cheat sheet (go-gitea#22249)

    The `ui.user` ini section with its single setting is not yet mentioned
    in the config cheat sheet.
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    chrullrich and lunny authored Dec 27, 2022
    Configuration menu
    Copy the full SHA
    d0c3d0b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    22a6e97 View commit details
    Browse the repository at this point in the history
  7. Add option to prohibit fork if user reached maximum limit of reposito…

    …ries (go-gitea#21848)
    
    If user has reached the maximum limit of repositories:
    
    - Before
      - disallow create
      - allow fork without limit
    - This patch:
      - disallow create
      - disallow fork
    - Add option `ALLOW_FORK_WITHOUT_MAXIMUM_LIMIT` (Default **true**) :
    enable this allow user fork repositories without maximum number limit
    
    fixed go-gitea#21847
    
    Signed-off-by: Xinyu Zhou <i@sourcehut.net>
    Xinyu Zhou authored Dec 27, 2022
    Configuration menu
    Copy the full SHA
    7cc7db7 View commit details
    Browse the repository at this point in the history

Commits on Dec 28, 2022

  1. refactor auth interface to return error when verify failure (go-gitea…

    …#22119)
    
    This PR changed the Auth interface signature from 
    `Verify(http *http.Request, w http.ResponseWriter, store DataStore, sess
    SessionStore) *user_model.User`
    to 
    `Verify(http *http.Request, w http.ResponseWriter, store DataStore, sess
    SessionStore) (*user_model.User, error)`.
    
    There is a new return argument `error` which means the verification
    condition matched but verify process failed, we should stop the auth
    process.
    
    Before this PR, when return a `nil` user, we don't know the reason why
    it returned `nil`. If the match condition is not satisfied or it
    verified failure? For these two different results, we should have
    different handler. If the match condition is not satisfied, we should
    try next auth method and if there is no more auth method, it's an
    anonymous user. If the condition matched but verify failed, the auth
    process should be stop and return immediately.
    
    This will fix go-gitea#20563
    
    Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
    Co-authored-by: Jason Song <i@wolfogre.com>
    3 people authored Dec 28, 2022
    Configuration menu
    Copy the full SHA
    ca67c5a View commit details
    Browse the repository at this point in the history
  2. Use dynamic package type list (go-gitea#22263)

    Replace the hardcoded list with the dynamic list.
    KN4CK3R authored Dec 28, 2022
    Configuration menu
    Copy the full SHA
    309e86a View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2022

  1. Move convert package to services (go-gitea#22264)

    Addition to go-gitea#22256
    
    The `convert` package relies heavily on different models which is
    [disallowed by our definition of
    modules](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#design-guideline).
    This helps to prevent possible import cycles.
    
    Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
    KN4CK3R and lunny authored Dec 29, 2022
    Configuration menu
    Copy the full SHA
    a357498 View commit details
    Browse the repository at this point in the history
  2. Support template for merge message description (go-gitea#22248)

    Fix go-gitea#21435.
    
    Use the first line of the template as the git commit message title, and
    the rest as the description.
    
    ## Snapshots
    
    <img width="806" alt="image"
    src="https://user-images.githubusercontent.com/9418365/209644083-5d85179c-cf58-404f-bc98-c662398a2411.png">
    <img width="860" alt="image"
    src="https://user-images.githubusercontent.com/9418365/209644392-22573090-e2c1-458b-ba44-855b79735632.png">
    <img width="1154" alt="image"
    src="https://user-images.githubusercontent.com/9418365/209644457-a1b2711a-6787-45b4-b52c-a88d7fc132d7.png">
    
    Co-authored-by: delvh <dev.lh@web.de>
    wolfogre and delvh authored Dec 29, 2022
    Configuration menu
    Copy the full SHA
    47efba7 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2022

  1. Correctly handle select on multiple channels in Queues (go-gitea#22146)

    There are a few places in FlushQueueWithContext which make an incorrect
    assumption about how `select` on multiple channels works.
    
    The problem is best expressed by looking at the following example:
    
    ```go
    package main
    
    import "fmt"
    
    func main() {
        closedChan := make(chan struct{})
        close(closedChan)
        toClose := make(chan struct{})
        count := 0
    
        for {
            select {
            case <-closedChan:
                count++
                fmt.Println(count)
                if count == 2 {
                    close(toClose)
                }
            case <-toClose:
                return
            }
        }
    }
    ```
    
    This PR double-checks that the contexts are closed outside of checking
    if there is data in the dataChan. It also rationalises the WorkerPool
    FlushWithContext because the previous implementation failed to handle
    pausing correctly. This will probably fix the underlying problem in
     go-gitea#22145
    
    Fix go-gitea#22145
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath authored Dec 30, 2022
    Configuration menu
    Copy the full SHA
    a609cae View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    205a392 View commit details
    Browse the repository at this point in the history