Skip to content

Commit b879c85

Browse files
authored
Merge branch 'main' into lunny/hide_href_if_empty
2 parents cd53bd5 + 1610a63 commit b879c85

File tree

234 files changed

+5060
-2939
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+5060
-2939
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.24-alpine3.21 AS build-env
2+
FROM docker.io/library/golang:1.24-alpine3.22 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY=${GOPROXY:-direct}
@@ -41,7 +41,7 @@ RUN chmod 755 /tmp/local/usr/bin/entrypoint \
4141
/go/src/code.gitea.io/gitea/environment-to-ini
4242
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
4343

44-
FROM docker.io/library/alpine:3.21
44+
FROM docker.io/library/alpine:3.22
4545
LABEL maintainer="[email protected]"
4646

4747
EXPOSE 22 3000

Dockerfile.rootless

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.24-alpine3.21 AS build-env
2+
FROM docker.io/library/golang:1.24-alpine3.22 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY=${GOPROXY:-direct}
@@ -39,7 +39,7 @@ RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
3939
/go/src/code.gitea.io/gitea/environment-to-ini
4040
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
4141

42-
FROM docker.io/library/alpine:3.21
42+
FROM docker.io/library/alpine:3.22
4343
LABEL maintainer="[email protected]"
4444

4545
EXPOSE 2222 3000
@@ -52,6 +52,7 @@ RUN apk --no-cache add \
5252
git \
5353
curl \
5454
gnupg \
55+
openssh-keygen \
5556
&& rm -rf /var/cache/apk/*
5657

5758
RUN addgroup \

assets/go-licenses.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/actions.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,21 @@
44
package cmd
55

66
import (
7+
"context"
78
"fmt"
89

910
"code.gitea.io/gitea/modules/private"
1011
"code.gitea.io/gitea/modules/setting"
1112

12-
"github.com/urfave/cli/v2"
13+
"github.com/urfave/cli/v3"
1314
)
1415

1516
var (
1617
// CmdActions represents the available actions sub-commands.
1718
CmdActions = &cli.Command{
1819
Name: "actions",
1920
Usage: "Manage Gitea Actions",
20-
Subcommands: []*cli.Command{
21+
Commands: []*cli.Command{
2122
subcmdActionsGenRunnerToken,
2223
},
2324
}
@@ -38,10 +39,7 @@ var (
3839
}
3940
)
4041

41-
func runGenerateActionsRunnerToken(c *cli.Context) error {
42-
ctx, cancel := installSignals()
43-
defer cancel()
44-
42+
func runGenerateActionsRunnerToken(ctx context.Context, c *cli.Command) error {
4543
setting.MustInstalled()
4644

4745
scope := c.String("scope")

cmd/admin.go

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ import (
1515
"code.gitea.io/gitea/modules/log"
1616
repo_module "code.gitea.io/gitea/modules/repository"
1717

18-
"github.com/urfave/cli/v2"
18+
"github.com/urfave/cli/v3"
1919
)
2020

2121
var (
2222
// CmdAdmin represents the available admin sub-command.
2323
CmdAdmin = &cli.Command{
2424
Name: "admin",
2525
Usage: "Perform common administrative operations",
26-
Subcommands: []*cli.Command{
26+
Commands: []*cli.Command{
2727
subcmdUser,
2828
subcmdRepoSyncReleases,
2929
subcmdRegenerate,
@@ -41,7 +41,7 @@ var (
4141
subcmdRegenerate = &cli.Command{
4242
Name: "regenerate",
4343
Usage: "Regenerate specific files",
44-
Subcommands: []*cli.Command{
44+
Commands: []*cli.Command{
4545
microcmdRegenHooks,
4646
microcmdRegenKeys,
4747
},
@@ -50,15 +50,15 @@ var (
5050
subcmdAuth = &cli.Command{
5151
Name: "auth",
5252
Usage: "Modify external auth providers",
53-
Subcommands: []*cli.Command{
54-
microcmdAuthAddOauth,
55-
microcmdAuthUpdateOauth,
56-
microcmdAuthAddLdapBindDn,
57-
microcmdAuthUpdateLdapBindDn,
58-
microcmdAuthAddLdapSimpleAuth,
59-
microcmdAuthUpdateLdapSimpleAuth,
60-
microcmdAuthAddSMTP,
61-
microcmdAuthUpdateSMTP,
53+
Commands: []*cli.Command{
54+
microcmdAuthAddOauth(),
55+
microcmdAuthUpdateOauth(),
56+
microcmdAuthAddLdapBindDn(),
57+
microcmdAuthUpdateLdapBindDn(),
58+
microcmdAuthAddLdapSimpleAuth(),
59+
microcmdAuthUpdateLdapSimpleAuth(),
60+
microcmdAuthAddSMTP(),
61+
microcmdAuthUpdateSMTP(),
6262
microcmdAuthList,
6363
microcmdAuthDelete,
6464
},
@@ -70,9 +70,9 @@ var (
7070
Action: runSendMail,
7171
Flags: []cli.Flag{
7272
&cli.StringFlag{
73-
Name: "title",
74-
Usage: `a title of a message`,
75-
Value: "",
73+
Name: "title",
74+
Usage: "a title of a message",
75+
Required: true,
7676
},
7777
&cli.StringFlag{
7878
Name: "content",
@@ -86,17 +86,16 @@ var (
8686
},
8787
},
8888
}
89+
)
8990

90-
idFlag = &cli.Int64Flag{
91+
func idFlag() *cli.Int64Flag {
92+
return &cli.Int64Flag{
9193
Name: "id",
9294
Usage: "ID of authentication source",
9395
}
94-
)
95-
96-
func runRepoSyncReleases(_ *cli.Context) error {
97-
ctx, cancel := installSignals()
98-
defer cancel()
96+
}
9997

98+
func runRepoSyncReleases(ctx context.Context, _ *cli.Command) error {
10099
if err := initDB(ctx); err != nil {
101100
return err
102101
}
@@ -107,7 +106,7 @@ func runRepoSyncReleases(_ *cli.Context) error {
107106

108107
log.Trace("Synchronizing repository releases (this may take a while)")
109108
for page := 1; ; page++ {
110-
repos, count, err := repo_model.SearchRepositoryByName(ctx, &repo_model.SearchRepoOptions{
109+
repos, count, err := repo_model.SearchRepositoryByName(ctx, repo_model.SearchRepoOptions{
111110
ListOptions: db.ListOptions{
112111
PageSize: repo_model.RepositoryListDefaultPageSize,
113112
Page: page,

cmd/admin_auth.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package cmd
55

66
import (
7+
"context"
78
"errors"
89
"fmt"
910
"os"
@@ -13,14 +14,14 @@ import (
1314
"code.gitea.io/gitea/models/db"
1415
auth_service "code.gitea.io/gitea/services/auth"
1516

16-
"github.com/urfave/cli/v2"
17+
"github.com/urfave/cli/v3"
1718
)
1819

1920
var (
2021
microcmdAuthDelete = &cli.Command{
2122
Name: "delete",
2223
Usage: "Delete specific auth source",
23-
Flags: []cli.Flag{idFlag},
24+
Flags: []cli.Flag{idFlag()},
2425
Action: runDeleteAuth,
2526
}
2627
microcmdAuthList = &cli.Command{
@@ -56,10 +57,7 @@ var (
5657
}
5758
)
5859

59-
func runListAuth(c *cli.Context) error {
60-
ctx, cancel := installSignals()
61-
defer cancel()
62-
60+
func runListAuth(ctx context.Context, c *cli.Command) error {
6361
if err := initDB(ctx); err != nil {
6462
return err
6563
}
@@ -90,14 +88,11 @@ func runListAuth(c *cli.Context) error {
9088
return nil
9189
}
9290

93-
func runDeleteAuth(c *cli.Context) error {
91+
func runDeleteAuth(ctx context.Context, c *cli.Command) error {
9492
if !c.IsSet("id") {
9593
return errors.New("--id flag is missing")
9694
}
9795

98-
ctx, cancel := installSignals()
99-
defer cancel()
100-
10196
if err := initDB(ctx); err != nil {
10297
return err
10398
}

0 commit comments

Comments
 (0)