Compare commits
15 Commits
v1.26.9-gitcaddy
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c9f94dad5 | ||
|
|
f6e9e3b17d | ||
|
|
e414c24004 | ||
|
|
ab0539cd31 | ||
|
|
bfdd2713d3 | ||
|
|
ddb06706f3 | ||
|
|
856c9d7f2b | ||
|
|
735d131321 | ||
|
|
b2b6686f46 | ||
|
|
710ec5d69a | ||
|
|
b92948cb0a | ||
|
|
8bc2b852eb | ||
|
|
4ad19d8b5c | ||
|
|
b7a8538f6e | ||
|
|
9bd0a95e9f |
@@ -127,7 +127,7 @@ jobs:
|
||||
|
||||
- name: Build test binary
|
||||
run: |
|
||||
go build -tags="bindata sqlite sqlite_unlock_notify" -o gitea .
|
||||
go build -tags="bindata sqlite sqlite_unlock_notify" -o gitcaddy-server .
|
||||
|
||||
- name: Generate test config
|
||||
run: |
|
||||
@@ -182,7 +182,7 @@ jobs:
|
||||
RESPONSE=$(curl -sf -X POST \
|
||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"tag_name":"'"$TAG"'","name":"Gitea '"$TAG"'","body":"Official release of Gitea '"$TAG"'.","draft":false,"prerelease":false}' \
|
||||
-d '{"tag_name":"'"$TAG"'","name":"GitCaddy Server '"$TAG"'","body":"Official release of GitCaddy Server '"$TAG"'.","draft":false,"prerelease":false}' \
|
||||
"https://direct.git.marketally.com/api/v1/repos/${{ github.repository }}/releases" 2>&1)
|
||||
|
||||
if echo "$RESPONSE" | grep -q '"id":[0-9]'; then
|
||||
@@ -199,7 +199,7 @@ jobs:
|
||||
name: Build Binaries
|
||||
runs-on: linux-latest
|
||||
needs: [lint, create-release]
|
||||
if: always() && needs.lint.result == 'success' && (needs.create-release.result == 'success' || needs.create-release.result == 'skipped')
|
||||
if: startsWith(github.ref, 'refs/tags/v') && needs.lint.result == 'success' && needs.create-release.result == 'success'
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
@@ -250,7 +250,7 @@ jobs:
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
TAGS: bindata sqlite sqlite_unlock_notify
|
||||
run: |
|
||||
VERSION=$(git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
||||
VERSION=$(git describe --tags --always --dirty 2>/dev/null | sed "s/-gitcaddy//" || echo "dev")
|
||||
LDFLAGS="-X code.gitea.io/gitea/modules/setting.AppVer=${VERSION}"
|
||||
|
||||
EXT=""
|
||||
@@ -258,7 +258,7 @@ jobs:
|
||||
EXT=".exe"
|
||||
fi
|
||||
|
||||
OUTPUT="gitea-${VERSION}-${GOOS}-${GOARCH}${EXT}"
|
||||
OUTPUT="gitcaddy-server-${VERSION}-${GOOS}-${GOARCH}${EXT}"
|
||||
|
||||
go build -v -trimpath -tags "${TAGS}" -ldflags "${LDFLAGS}" -o "dist/${OUTPUT}" .
|
||||
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -85,7 +85,6 @@ cpu.out
|
||||
/public/assets/js
|
||||
/public/assets/css
|
||||
/public/assets/fonts
|
||||
/public/assets/licenses.txt
|
||||
/vendor
|
||||
/VERSION
|
||||
/.air
|
||||
|
||||
6
Makefile
6
Makefile
@@ -41,7 +41,7 @@ GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1
|
||||
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1
|
||||
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1.7.9
|
||||
|
||||
DOCKER_IMAGE ?= gitea/gitea
|
||||
DOCKER_IMAGE ?= gitcaddy/gitcaddy-server
|
||||
DOCKER_TAG ?= latest
|
||||
DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
|
||||
|
||||
@@ -70,10 +70,10 @@ else ifeq ($(patsubst Windows%,Windows,$(OS)),Windows)
|
||||
endif
|
||||
ifeq ($(IS_WINDOWS),yes)
|
||||
GOFLAGS := -v -buildmode=exe
|
||||
EXECUTABLE ?= gitea.exe
|
||||
EXECUTABLE ?= gitcaddy-server.exe
|
||||
else
|
||||
GOFLAGS := -v
|
||||
EXECUTABLE ?= gitea
|
||||
EXECUTABLE ?= gitcaddy-server
|
||||
endif
|
||||
|
||||
ifeq ($(shell sed --version 2>/dev/null | grep -q GNU && echo gnu),gnu)
|
||||
|
||||
11
README.md
11
README.md
@@ -260,11 +260,11 @@ autoUpdater.checkForUpdates()
|
||||
|
||||
### From Binary
|
||||
|
||||
Download from [Releases](https://git.marketally.com/gitcaddy/gitea/releases):
|
||||
Download from [Releases](https://git.marketally.com/gitcaddy/gitcaddy-server/releases):
|
||||
|
||||
```bash
|
||||
# Linux (amd64)
|
||||
curl -L -o gitcaddy https://git.marketally.com/gitcaddy/gitea/releases/latest/download/gitea-linux-amd64
|
||||
curl -L -o gitcaddy-server https://git.marketally.com/gitcaddy/gitcaddy-server/releases/latest/download/gitcaddy-server-linux-amd64
|
||||
chmod +x gitcaddy
|
||||
./gitcaddy web
|
||||
```
|
||||
@@ -272,10 +272,10 @@ chmod +x gitcaddy
|
||||
### From Source
|
||||
|
||||
```bash
|
||||
git clone https://git.marketally.com/gitcaddy/gitea.git
|
||||
cd gitea
|
||||
git clone https://git.marketally.com/gitcaddy/gitcaddy-server.git
|
||||
cd gitcaddy-server
|
||||
TAGS="bindata sqlite sqlite_unlock_notify" make build
|
||||
./gitea web
|
||||
./gitcaddy-server web
|
||||
```
|
||||
|
||||
### Docker
|
||||
@@ -413,4 +413,5 @@ MIT License - see [LICENSE](LICENSE) for details.
|
||||
GitCaddy is a fork of [Gitea](https://gitea.io), the open-source self-hosted Git service. We thank the Gitea team and all contributors for building the foundation that makes GitCaddy possible.
|
||||
|
||||
- [Gitea Project](https://gitea.io)
|
||||
- [Claude Code](https://claude.ai/code) - AI-assisted development by Anthropic
|
||||
- [Gitea Contributors](https://github.com/go-gitea/gitea/graphs/contributors)
|
||||
|
||||
@@ -86,9 +86,9 @@ type AppVersion struct {
|
||||
|
||||
func NewMainApp(appVer AppVersion) *cli.Command {
|
||||
app := &cli.Command{}
|
||||
app.Name = "gitea" // must be lower-cased because it appears in the "USAGE" section like "gitea doctor [command [command options]]"
|
||||
app.Usage = "A painless self-hosted Git service"
|
||||
app.Description = `Gitea program contains "web" and other subcommands. If no subcommand is given, it starts the web server by default. Use "web" subcommand for more web server arguments, use other subcommands for other purposes.`
|
||||
app.Name = "gitcaddy-server" // must be lower-cased because it appears in the "USAGE" section like "gitea doctor [command [command options]]"
|
||||
app.Usage = "GitCaddy Server - A painless self-hosted Git service"
|
||||
app.Description = `GitCaddy Server contains "web" and other subcommands. If no subcommand is given, it starts the web server by default. Use "web" subcommand for more web server arguments, use other subcommands for other purposes. Based on Gitea - https://gitea.io`
|
||||
app.Version = appVer.Version + appVer.Extra
|
||||
app.EnableShellCompletion = true
|
||||
app.Flags = []cli.Flag{
|
||||
|
||||
@@ -405,6 +405,8 @@ func prepareMigrationTasks() []*migration {
|
||||
newMigration(328, "Add wiki index table for search", v1_26.AddWikiIndexTable),
|
||||
newMigration(329, "Add release archive columns", v1_26.AddReleaseArchiveColumns),
|
||||
newMigration(330, "Add runner capabilities column", v1_26.AddRunnerCapabilitiesColumn),
|
||||
newMigration(331, "Add is_homepage_pinned to user table", v1_26.AddIsHomepagePinnedToUser),
|
||||
newMigration(332, "Add display_title and license_type to repository", v1_26.AddDisplayTitleAndLicenseTypeToRepository),
|
||||
}
|
||||
return preparedMigrations
|
||||
}
|
||||
|
||||
16
models/migrations/v1_26/v331.go
Normal file
16
models/migrations/v1_26/v331.go
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v1_26
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
// AddIsHomepagePinnedToUser adds is_homepage_pinned column to user table for organizations
|
||||
func AddIsHomepagePinnedToUser(x *xorm.Engine) error {
|
||||
type User struct {
|
||||
IsHomepagePinned bool `xorm:"NOT NULL DEFAULT false"`
|
||||
}
|
||||
return x.Sync(new(User))
|
||||
}
|
||||
18
models/migrations/v1_26/v332.go
Normal file
18
models/migrations/v1_26/v332.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package v1_26
|
||||
|
||||
import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
// AddDisplayTitleAndLicenseTypeToRepository adds display_title and license_type columns to the repository table
|
||||
func AddDisplayTitleAndLicenseTypeToRepository(x *xorm.Engine) error {
|
||||
type Repository struct {
|
||||
DisplayTitle string `xorm:"VARCHAR(255)"`
|
||||
LicenseType string `xorm:"VARCHAR(50)"`
|
||||
}
|
||||
|
||||
return x.Sync(new(Repository))
|
||||
}
|
||||
@@ -596,3 +596,21 @@ func getUserTeamIDsQueryBuilder(orgID, userID int64) *builder.Builder {
|
||||
"team_user.uid": userID,
|
||||
})
|
||||
}
|
||||
|
||||
// GetHomepagePinnedOrganizations returns all organizations that are pinned to the homepage
|
||||
func GetHomepagePinnedOrganizations(ctx context.Context) ([]*Organization, error) {
|
||||
orgs := make([]*Organization, 0, 10)
|
||||
return orgs, db.GetEngine(ctx).
|
||||
Where("type = ?", user_model.UserTypeOrganization).
|
||||
And("is_homepage_pinned = ?", true).
|
||||
And("visibility = ?", structs.VisibleTypePublic).
|
||||
OrderBy("name ASC").
|
||||
Find(&orgs)
|
||||
}
|
||||
|
||||
// SetHomepagePinned updates the homepage pinned status for an organization
|
||||
func (org *Organization) SetHomepagePinned(ctx context.Context, pinned bool) error {
|
||||
org.IsHomepagePinned = pinned
|
||||
_, err := db.GetEngine(ctx).ID(org.ID).Cols("is_homepage_pinned").Update(org)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -159,6 +159,8 @@ type Repository struct {
|
||||
LowerName string `xorm:"UNIQUE(s) INDEX NOT NULL"`
|
||||
Name string `xorm:"INDEX NOT NULL"`
|
||||
Description string `xorm:"TEXT"`
|
||||
DisplayTitle string `xorm:"VARCHAR(255)"`
|
||||
LicenseType string `xorm:"VARCHAR(50)"`
|
||||
Website string `xorm:"VARCHAR(2048)"`
|
||||
OriginalServiceType api.GitServiceType `xorm:"index"`
|
||||
OriginalURL string `xorm:"VARCHAR(2048)"`
|
||||
|
||||
@@ -121,6 +121,8 @@ type User struct {
|
||||
// true: the user is only allowed to see organizations/repositories that they has explicit rights to.
|
||||
// (ex: in private Gitea instances user won't be allowed to see even organizations/repositories that are set as public)
|
||||
IsRestricted bool `xorm:"NOT NULL DEFAULT false"`
|
||||
// IsHomepagePinned indicates if this organization should appear on the homepage
|
||||
IsHomepagePinned bool `xorm:"NOT NULL DEFAULT false"`
|
||||
|
||||
AllowGitHook bool
|
||||
AllowImportLocal bool // Allow migrate repository by local path
|
||||
|
||||
@@ -109,3 +109,7 @@ func UnmarshalHandleDoubleEncode(bs []byte, v any) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// RawMessage is a raw encoded JSON value.
|
||||
// It implements Marshaler and Unmarshaler and can be used to delay JSON decoding.
|
||||
type RawMessage = json.RawMessage
|
||||
|
||||
@@ -53,9 +53,22 @@ type RepositoryStruct struct {
|
||||
GitGuideRemoteName *config.Value[string]
|
||||
}
|
||||
|
||||
type ThemeStruct struct {
|
||||
DisableRegistration *config.Value[bool]
|
||||
CustomSiteIconURL *config.Value[string]
|
||||
CustomHomeLogoURL *config.Value[string]
|
||||
CustomHomeHTML *config.Value[string]
|
||||
APIHeaderURL *config.Value[string]
|
||||
CustomHomeTitle *config.Value[string]
|
||||
CustomHomeTagline *config.Value[string]
|
||||
PinnedOrgDisplayFormat *config.Value[string]
|
||||
ExploreOrgDisplayFormat *config.Value[string]
|
||||
}
|
||||
|
||||
type ConfigStruct struct {
|
||||
Picture *PictureStruct
|
||||
Repository *RepositoryStruct
|
||||
Theme *ThemeStruct
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -74,6 +87,17 @@ func initDefaultConfig() {
|
||||
OpenWithEditorApps: config.ValueJSON[OpenWithEditorAppsType]("repository.open-with.editor-apps"),
|
||||
GitGuideRemoteName: config.ValueJSON[string]("repository.git-guide-remote-name").WithDefault("origin"),
|
||||
},
|
||||
Theme: &ThemeStruct{
|
||||
DisableRegistration: config.ValueJSON[bool]("theme.disable_registration").WithFileConfig(config.CfgSecKey{Sec: "service", Key: "DISABLE_REGISTRATION"}),
|
||||
CustomSiteIconURL: config.ValueJSON[string]("theme.custom_site_icon_url").WithDefault(""),
|
||||
CustomHomeLogoURL: config.ValueJSON[string]("theme.custom_home_logo_url").WithDefault(""),
|
||||
CustomHomeHTML: config.ValueJSON[string]("theme.custom_home_html").WithDefault(""),
|
||||
APIHeaderURL: config.ValueJSON[string]("theme.api_header_url").WithDefault(""),
|
||||
CustomHomeTitle: config.ValueJSON[string]("theme.custom_home_title").WithDefault(""),
|
||||
CustomHomeTagline: config.ValueJSON[string]("theme.custom_home_tagline").WithDefault(""),
|
||||
PinnedOrgDisplayFormat: config.ValueJSON[string]("theme.pinned_org_display_format").WithDefault("condensed"),
|
||||
ExploreOrgDisplayFormat: config.ValueJSON[string]("theme.explore_org_display_format").WithDefault("list"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
// EnvConfigKeyPrefixGitCaddy is the primary prefix for GitCaddy environment variables
|
||||
EnvConfigKeyPrefixGitCaddy = "GITCADDY__"
|
||||
// EnvConfigKeyPrefixGitea is the legacy prefix for backward compatibility
|
||||
EnvConfigKeyPrefixGitea = "GITEA__"
|
||||
EnvConfigKeySuffixFile = "__FILE"
|
||||
)
|
||||
@@ -24,7 +27,8 @@ var escapeRegex = regexp.MustCompile(escapeRegexpString)
|
||||
|
||||
func CollectEnvConfigKeys() (keys []string) {
|
||||
for _, env := range os.Environ() {
|
||||
if strings.HasPrefix(env, EnvConfigKeyPrefixGitea) {
|
||||
// Support both GITCADDY__ and GITEA__ prefixes
|
||||
if strings.HasPrefix(env, EnvConfigKeyPrefixGitCaddy) || strings.HasPrefix(env, EnvConfigKeyPrefixGitea) {
|
||||
k, _, _ := strings.Cut(env, "=")
|
||||
keys = append(keys, k)
|
||||
}
|
||||
@@ -41,7 +45,7 @@ func ClearEnvConfigKeys() {
|
||||
// decodeEnvSectionKey will decode a portable string encoded Section__Key pair
|
||||
// Portable strings are considered to be of the form [A-Z0-9_]*
|
||||
// We will encode a disallowed value as the UTF8 byte string preceded by _0X and
|
||||
// followed by _. E.g. _0X2C_ for a '-' and _0X2E_ for '.'
|
||||
// followed by _. E.g. _0X2C_ for a '-', and _0X2E_ for '.'.
|
||||
// Section and Key are separated by a plain '__'.
|
||||
// The entire section can be encoded as a UTF8 byte string
|
||||
func decodeEnvSectionKey(encoded string) (ok bool, section, key string) {
|
||||
@@ -96,16 +100,22 @@ func decodeEnvSectionKey(encoded string) (ok bool, section, key string) {
|
||||
}
|
||||
|
||||
// decodeEnvironmentKey decode the environment key to section and key
|
||||
// The environment key is in the form of GITEA__SECTION__KEY or GITEA__SECTION__KEY__FILE
|
||||
func decodeEnvironmentKey(prefixGitea, suffixFile, envKey string) (ok bool, section, key string, useFileValue bool) {
|
||||
if !strings.HasPrefix(envKey, prefixGitea) {
|
||||
// The environment key is in the form of GITCADDY__SECTION__KEY or GITEA__SECTION__KEY (legacy)
|
||||
// or GITCADDY__SECTION__KEY__FILE / GITEA__SECTION__KEY__FILE
|
||||
func decodeEnvironmentKey(prefixGitCaddy, prefixGitea, suffixFile, envKey string) (ok bool, section, key string, useFileValue bool) {
|
||||
var prefix string
|
||||
if strings.HasPrefix(envKey, prefixGitCaddy) {
|
||||
prefix = prefixGitCaddy
|
||||
} else if strings.HasPrefix(envKey, prefixGitea) {
|
||||
prefix = prefixGitea
|
||||
} else {
|
||||
return false, "", "", false
|
||||
}
|
||||
if strings.HasSuffix(envKey, suffixFile) {
|
||||
useFileValue = true
|
||||
envKey = envKey[:len(envKey)-len(suffixFile)]
|
||||
}
|
||||
ok, section, key = decodeEnvSectionKey(envKey[len(prefixGitea):])
|
||||
ok, section, key = decodeEnvSectionKey(envKey[len(prefix):])
|
||||
return ok, section, key, useFileValue
|
||||
}
|
||||
|
||||
@@ -119,7 +129,7 @@ func EnvironmentToConfig(cfg ConfigProvider, envs []string) (changed bool) {
|
||||
// parse the environment variable to config section name and key name
|
||||
envKey := before
|
||||
envValue := after
|
||||
ok, sectionName, keyName, useFileValue := decodeEnvironmentKey(EnvConfigKeyPrefixGitea, EnvConfigKeySuffixFile, envKey)
|
||||
ok, sectionName, keyName, useFileValue := decodeEnvironmentKey(EnvConfigKeyPrefixGitCaddy, EnvConfigKeyPrefixGitea, EnvConfigKeySuffixFile, envKey)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
@@ -167,20 +177,25 @@ func EnvironmentToConfig(cfg ConfigProvider, envs []string) (changed bool) {
|
||||
return changed
|
||||
}
|
||||
|
||||
// InitGiteaEnvVars initializes the environment variables for gitea
|
||||
func InitGiteaEnvVars() {
|
||||
// Ideally Gitea should only accept the environment variables which it clearly knows instead of unsetting the ones it doesn't want,
|
||||
// InitGitCaddyEnvVars initializes the environment variables for GitCaddy Server
|
||||
func InitGitCaddyEnvVars() {
|
||||
// Ideally GitCaddy should only accept the environment variables which it clearly knows instead of unsetting the ones it doesn't want,
|
||||
// but the ideal behavior would be a breaking change, and it seems not bringing enough benefits to end users,
|
||||
// so at the moment we could still keep "unsetting the unnecessary environments"
|
||||
|
||||
// HOME is managed by Gitea, Gitea's git should use "HOME/.gitconfig".
|
||||
// HOME is managed by GitCaddy, GitCaddy's git should use "HOME/.gitconfig".
|
||||
// But git would try "XDG_CONFIG_HOME/git/config" first if "HOME/.gitconfig" does not exist,
|
||||
// then our git.InitFull would still write to "XDG_CONFIG_HOME/git/config" if XDG_CONFIG_HOME is set.
|
||||
_ = os.Unsetenv("XDG_CONFIG_HOME")
|
||||
}
|
||||
|
||||
// InitGiteaEnvVars is an alias for InitGitCaddyEnvVars for backward compatibility
|
||||
func InitGiteaEnvVars() {
|
||||
InitGitCaddyEnvVars()
|
||||
}
|
||||
|
||||
func InitGiteaEnvVarsForTesting() {
|
||||
InitGiteaEnvVars()
|
||||
InitGitCaddyEnvVars()
|
||||
_ = os.Unsetenv("GIT_AUTHOR_NAME")
|
||||
_ = os.Unsetenv("GIT_AUTHOR_EMAIL")
|
||||
_ = os.Unsetenv("GIT_AUTHOR_DATE")
|
||||
|
||||
@@ -33,28 +33,29 @@ func TestDecodeEnvSectionKey(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDecodeEnvironmentKey(t *testing.T) {
|
||||
prefix := "GITEA__"
|
||||
prefixGitCaddy := "GITCADDY__"
|
||||
prefixGitea := "GITEA__"
|
||||
suffix := "__FILE"
|
||||
|
||||
ok, section, key, file := decodeEnvironmentKey(prefix, suffix, "SEC__KEY")
|
||||
ok, section, key, file := decodeEnvironmentKey(prefixGitCaddy, prefixGitea, suffix, "SEC__KEY")
|
||||
assert.False(t, ok)
|
||||
assert.Empty(t, section)
|
||||
assert.Empty(t, key)
|
||||
assert.False(t, file)
|
||||
|
||||
ok, section, key, file = decodeEnvironmentKey(prefix, suffix, "GITEA__SEC")
|
||||
ok, section, key, file = decodeEnvironmentKey(prefixGitCaddy, prefixGitea, suffix, "GITEA__SEC")
|
||||
assert.False(t, ok)
|
||||
assert.Empty(t, section)
|
||||
assert.Empty(t, key)
|
||||
assert.False(t, file)
|
||||
|
||||
ok, section, key, file = decodeEnvironmentKey(prefix, suffix, "GITEA____KEY")
|
||||
ok, section, key, file = decodeEnvironmentKey(prefixGitCaddy, prefixGitea, suffix, "GITEA____KEY")
|
||||
assert.True(t, ok)
|
||||
assert.Empty(t, section)
|
||||
assert.Equal(t, "KEY", key)
|
||||
assert.False(t, file)
|
||||
|
||||
ok, section, key, file = decodeEnvironmentKey(prefix, suffix, "GITEA__SEC__KEY")
|
||||
ok, section, key, file = decodeEnvironmentKey(prefixGitCaddy, prefixGitea, suffix, "GITEA__SEC__KEY")
|
||||
assert.True(t, ok)
|
||||
assert.Equal(t, "sec", section)
|
||||
assert.Equal(t, "KEY", key)
|
||||
@@ -62,19 +63,19 @@ func TestDecodeEnvironmentKey(t *testing.T) {
|
||||
|
||||
// with "__FILE" suffix, it doesn't support to write "[sec].FILE" to config (no such key FILE is used in Gitea)
|
||||
// but it could be fixed in the future by adding a new suffix like "__VALUE" (no such key VALUE is used in Gitea either)
|
||||
ok, section, key, file = decodeEnvironmentKey(prefix, suffix, "GITEA__SEC__FILE")
|
||||
ok, section, key, file = decodeEnvironmentKey(prefixGitCaddy, prefixGitea, suffix, "GITEA__SEC__FILE")
|
||||
assert.False(t, ok)
|
||||
assert.Empty(t, section)
|
||||
assert.Empty(t, key)
|
||||
assert.True(t, file)
|
||||
|
||||
ok, section, key, file = decodeEnvironmentKey(prefix, suffix, "GITEA__SEC__KEY__FILE")
|
||||
ok, section, key, file = decodeEnvironmentKey(prefixGitCaddy, prefixGitea, suffix, "GITEA__SEC__KEY__FILE")
|
||||
assert.True(t, ok)
|
||||
assert.Equal(t, "sec", section)
|
||||
assert.Equal(t, "KEY", key)
|
||||
assert.True(t, file)
|
||||
|
||||
ok, _, _, _ = decodeEnvironmentKey("PREFIX__", "", "PREFIX__SEC__KEY")
|
||||
ok, _, _, _ = decodeEnvironmentKey("PREFIX__", "", "", "PREFIX__SEC__KEY")
|
||||
assert.True(t, ok)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ var (
|
||||
// AppPath represents the path to the gitea binary
|
||||
AppPath string
|
||||
|
||||
// AppWorkPath is the "working directory" of Gitea. It maps to the: WORK_PATH in app.ini, "--work-path" flag, environment variable GITEA_WORK_DIR.
|
||||
// AppWorkPath is the "working directory" of GitCaddy. It maps to the: WORK_PATH in app.ini, "--work-path" flag, environment variable GITCADDY_WORK_DIR (or GITEA_WORK_DIR for backward compatibility).
|
||||
// If that is not set it is the default set here by the linker or failing that the directory of AppPath.
|
||||
// It is used as the base path for several other paths.
|
||||
AppWorkPath string
|
||||
CustomPath string // Custom directory path. Env: GITEA_CUSTOM
|
||||
CustomPath string // Custom directory path. Env: GITCADDY_CUSTOM (or GITEA_CUSTOM for backward compatibility)
|
||||
CustomConf string
|
||||
|
||||
appWorkPathBuiltin string
|
||||
|
||||
@@ -183,7 +183,7 @@ func MakeAbsoluteAssetURL(appURL, staticURLPrefix string) string {
|
||||
|
||||
func loadServerFrom(rootCfg ConfigProvider) {
|
||||
sec := rootCfg.Section("server")
|
||||
AppName = rootCfg.Section("").Key("APP_NAME").MustString("Gitea: Git with a cup of tea")
|
||||
AppName = rootCfg.Section("").Key("APP_NAME").MustString("GitCaddy")
|
||||
|
||||
Domain = sec.Key("DOMAIN").MustString("localhost")
|
||||
HTTPAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0")
|
||||
|
||||
@@ -96,7 +96,7 @@ func InitCfgProvider(file string) {
|
||||
|
||||
func MustInstalled() {
|
||||
if !InstallLock {
|
||||
log.Fatal(`Unable to load config file for a installed Gitea instance, you should either use "--config" to set your config file (app.ini), or run "gitea web" command to install Gitea.`)
|
||||
log.Fatal(`Unable to load config file for a installed GitCaddy instance, you should either use "--config" to set your config file (app.ini), or run "gitcaddy-server web" command to install GitCaddy.`)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,9 +176,9 @@ func loadRunModeFrom(rootCfg ConfigProvider) {
|
||||
if os.Getuid() == 0 {
|
||||
if !unsafeAllowRunAsRoot {
|
||||
// Special thanks to VLC which inspired the wording of this messaging.
|
||||
log.Fatal("Gitea is not supposed to be run as root. Sorry. If you need to use privileged TCP ports please instead use setcap and the `cap_net_bind_service` permission")
|
||||
log.Fatal("GitCaddy Server is not supposed to be run as root. Sorry. If you need to use privileged TCP ports please instead use setcap and the `cap_net_bind_service` permission")
|
||||
}
|
||||
log.Critical("You are running Gitea using the root user, and have purposely chosen to skip built-in protections around this. You have been warned against this.")
|
||||
log.Critical("You are running GitCaddy Server using the root user, and have purposely chosen to skip built-in protections around this. You have been warned against this.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ func NewFuncMap() template.FuncMap {
|
||||
"QueryEscape": queryEscape,
|
||||
"QueryBuild": QueryBuild,
|
||||
"SanitizeHTML": SanitizeHTML,
|
||||
"SafeHTML": SafeHTML,
|
||||
"URLJoin": util.URLJoin,
|
||||
"DotEscape": dotEscape,
|
||||
|
||||
@@ -172,6 +173,11 @@ func SanitizeHTML(s string) template.HTML {
|
||||
return markup.Sanitize(s)
|
||||
}
|
||||
|
||||
// SafeHTML marks a string as safe HTML (no sanitization). Use with caution - only for trusted admin content.
|
||||
func SafeHTML(s string) template.HTML {
|
||||
return template.HTML(s)
|
||||
}
|
||||
|
||||
func htmlFormat(s any, args ...any) template.HTML {
|
||||
if len(args) == 0 {
|
||||
// to prevent developers from calling "HTMLFormat $userInput" by mistake which will lead to XSS
|
||||
|
||||
@@ -174,14 +174,14 @@
|
||||
"error.report_message": "Pokud jste si jisti, že se jedná o chybu Gitea, prosím vyhledejte problémy na <a href=\"%s\" target=\"_blank\">GitHub</a> a v případě potřeby založte nový problém.",
|
||||
"error.not_found": "Cíl nebyl nalezen.",
|
||||
"error.network_error": "Chyba sítě",
|
||||
"startpage.app_desc": "Snadno přístupný vlastní Git",
|
||||
"startpage.install": "Jednoduchá na instalaci",
|
||||
"startpage.install_desc": "Jednoduše <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">spusťte jako binární program</a> pro vaši platformu, nasaďte jej pomocí <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">Docker</a>, nebo jej stáhněte jako <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">balíček</a>.",
|
||||
"startpage.platform": "Multiplatformní",
|
||||
"startpage.platform_desc": "Gitea běží všude, kde <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">Go</a> může kompilovat: Windows, macOS, Linux, ARM, atd. Vyberte si ten, který milujete!",
|
||||
"startpage.lightweight": "Lehká",
|
||||
"startpage.lightweight_desc": "Gitea má minimální požadavky a může běžet na Raspberry Pi. Šetřete energii vašeho stroje!",
|
||||
"startpage.license_desc": "Vše je na <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[1]s\">%[2]s</a>! Připojte se tím, že <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[3]s\">přispějete</a> a uděláte tento projekt ještě lepší. Nestyďte se být přispěvatel!",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.install_desc": "Run the binary, deploy with Docker, or use your favorite package manager. GitCaddy runs wherever you need it.",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.platform_desc": "Built for the age of AI-assisted development. Structured APIs, capability discovery, and intelligent context for AI tools.",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license_desc": "GitCaddy is open source and built on the shoulders of giants. Based on Gitea, enhanced for the AI era.",
|
||||
"install.install": "Instalace",
|
||||
"install.title": "Výchozí konfigurace",
|
||||
"install.docker_helper": "Pokud spouštíte Gitea v Dockeru, přečtěte si <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">dokumentaci</a>, než budete měnit jakákoliv nastavení.",
|
||||
@@ -3307,4 +3307,4 @@
|
||||
"git.filemode.executable_file": "Spustitelný soubor",
|
||||
"git.filemode.symbolic_link": "Symbolický odkaz",
|
||||
"git.filemode.submodule": "Submodul"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -149,12 +149,12 @@
|
||||
"error.occurred": "Παρουσιάστηκε ένα σφάλμα",
|
||||
"error.not_found": "Ο προορισμός δεν βρέθηκε.",
|
||||
"error.network_error": "Σφάλμα δικτύου",
|
||||
"startpage.app_desc": "Μια ανώδυνη, αυτο-φιλοξενούμενη υπηρεσία Git",
|
||||
"startpage.install": "Εύκολο στην εγκατάσταση",
|
||||
"startpage.platform": "Πολυπλατφορμικό",
|
||||
"startpage.lightweight": "Ελαφρύ",
|
||||
"startpage.lightweight_desc": "Gitea έχει χαμηλές ελάχιστες απαιτήσεις και μπορεί να τρέξει σε ένα οικονομικό Raspberry Pi. Εξοικονομήστε ενέργεια!",
|
||||
"startpage.license": "Ανοικτού κώδικα",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"install.install": "Εγκατάσταση",
|
||||
"install.title": "Αρχικές Ρυθμίσεις",
|
||||
"install.docker_helper": "Αν εκτελέσετε το Gitea μέσα στο Docker, παρακαλώ διαβάστε την <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">τεκμηρίωση</a> πριν αλλάξετε τις ρυθμίσεις.",
|
||||
@@ -3001,4 +3001,4 @@
|
||||
"git.filemode.normal_file": "Κανονικό αρχείο",
|
||||
"git.filemode.executable_file": "Εκτελέσιμο αρχείο",
|
||||
"git.filemode.submodule": "Υπομονάδα"
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@
|
||||
"register": "Register",
|
||||
"version": "Version",
|
||||
"powered_by": "Powered by %s",
|
||||
"based_on": "Based on",
|
||||
"page": "Page",
|
||||
"template": "Template",
|
||||
"language": "Language",
|
||||
@@ -209,15 +210,15 @@
|
||||
"error.report_message": "If you believe that this is a GitCaddy bug, please search for issues on <a href=\"%s\" target=\"_blank\">GitCaddy Gitea</a> or open a new issue if necessary.",
|
||||
"error.not_found": "The target couldn't be found.",
|
||||
"error.network_error": "Network error",
|
||||
"startpage.app_desc": "A painless, self-hosted Git service",
|
||||
"startpage.install": "Easy to install",
|
||||
"startpage.install_desc": "Simply <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[1]s\">run the binary</a> for your platform, ship it with <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[2]s\">Docker</a>, or get it <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[3]s\">packaged</a>.",
|
||||
"startpage.platform": "Cross-platform",
|
||||
"startpage.platform_desc": "Gitea runs anywhere <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">Go</a> can compile for: Windows, macOS, Linux, ARM, etc. Choose the one you love!",
|
||||
"startpage.lightweight": "Lightweight",
|
||||
"startpage.lightweight_desc": "Gitea has low minimal requirements and can run on an inexpensive Raspberry Pi. Save your machine energy!",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.install_desc": "Run the binary, deploy with Docker, or use your favorite package manager. GitCaddy runs wherever you need it.",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.platform_desc": "Built for the age of AI-assisted development. Structured APIs, capability discovery, and intelligent context for AI tools.",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"startpage.license_desc": "Go get <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[1]s\">%[2]s</a>! Join us by <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[3]s\">contributing</a> to make this project even better. Don't be shy to be a contributor!",
|
||||
"startpage.license_desc": "GitCaddy is open source and built on the shoulders of giants. Based on Gitea, enhanced for the AI era.",
|
||||
"install.install": "Installation",
|
||||
"install.installing_desc": "Installing now, please wait…",
|
||||
"install.title": "Initial Configuration",
|
||||
@@ -338,6 +339,7 @@
|
||||
"home.collaborative_repos": "Collaborative Repositories",
|
||||
"home.my_orgs": "My Organizations",
|
||||
"home.my_mirrors": "My Mirrors",
|
||||
"home.featured_organizations": "Featured Organizations",
|
||||
"home.view_home": "View %s",
|
||||
"home.filter": "Other Filters",
|
||||
"home.filter_by_team_repositories": "Filter by team repositories",
|
||||
@@ -2512,15 +2514,15 @@
|
||||
"repo.settings.rename_branch_from": "old branch name",
|
||||
"repo.settings.rename_branch_to": "new branch name",
|
||||
"repo.settings.rename_branch": "Rename branch",
|
||||
"repo.settings.pages": "Pages",
|
||||
"repo.settings.pages.enabled": "Pages Enabled",
|
||||
"repo.settings.pages": "Landing Page",
|
||||
"repo.settings.pages.enabled": "Landing Page Enabled",
|
||||
"repo.settings.pages.enabled_desc": "Your landing page is now accessible to visitors.",
|
||||
"repo.settings.pages.not_enabled": "Pages Not Enabled",
|
||||
"repo.settings.pages.not_enabled_desc": "Enable Pages to create a landing page for your repository.",
|
||||
"repo.settings.pages.enable": "Enable Pages",
|
||||
"repo.settings.pages.disable": "Disable Pages",
|
||||
"repo.settings.pages.enabled_success": "Pages have been enabled for this repository.",
|
||||
"repo.settings.pages.disabled_success": "Pages have been disabled for this repository.",
|
||||
"repo.settings.pages.not_enabled": "Landing Page Not Enabled",
|
||||
"repo.settings.pages.not_enabled_desc": "Enable the landing page feature to create a public page for your repository.",
|
||||
"repo.settings.pages.enable": "Enable Landing Page",
|
||||
"repo.settings.pages.disable": "Disable Landing Page",
|
||||
"repo.settings.pages.enabled_success": "Landing page has been enabled for this repository.",
|
||||
"repo.settings.pages.disabled_success": "Landing page has been disabled for this repository.",
|
||||
"repo.settings.pages.template": "Template",
|
||||
"repo.settings.pages.update_template": "Update Template",
|
||||
"repo.settings.pages.subdomain": "Subdomain URL",
|
||||
@@ -2798,6 +2800,9 @@
|
||||
"org.settings.confirm_delete_account": "Confirm Deletion",
|
||||
"org.settings.delete_failed": "Deleting organization failed due to an internal error",
|
||||
"org.settings.delete_successful": "Organization <b>%s</b> has been deleted successfully.",
|
||||
"org.settings.homepage_pinning": "Homepage Visibility",
|
||||
"org.settings.pin_to_homepage": "Pin this organization to the homepage",
|
||||
"org.settings.pin_to_homepage_help": "When enabled, this organization will be featured on the public homepage. Only administrators can change this setting.",
|
||||
"org.settings.hooks_desc": "Add webhooks which will be triggered for <strong>all repositories</strong> under this organization.",
|
||||
"org.settings.labels_desc": "Add labels which can be used on issues for <strong>all repositories</strong> under this organization.",
|
||||
"org.members.membership_visibility": "Membership Visibility:",
|
||||
@@ -3828,5 +3833,69 @@
|
||||
"org.stats": "Stats",
|
||||
"org.recent_activity": "Recent Activity",
|
||||
"org.profile_repo_no_permission": "You do not have permission to create repositories in this organization.",
|
||||
"org.profile_repo_create_failed": "Failed to create the profile repository."
|
||||
}
|
||||
"org.profile_repo_create_failed": "Failed to create the profile repository.",
|
||||
"admin.config.theme_config": "Theme Configuration",
|
||||
"admin.config.disable_registration": "Disable Registration",
|
||||
"admin.config.disable_registration_desc": "When enabled, new users cannot sign up. Only administrators can create new accounts.",
|
||||
"admin.config.custom_home_logo": "Homepage Logo",
|
||||
"admin.config.custom_logo_url_placeholder": "Enter URL or upload a file below",
|
||||
"admin.config.upload_logo": "Upload Logo File",
|
||||
"admin.config.reset_logo": "Reset to Default",
|
||||
"admin.config.custom_home_html": "Custom Homepage Content",
|
||||
"admin.config.custom_home_html_placeholder": "Enter custom HTML for the homepage (shown to non-logged-in users)",
|
||||
"admin.config.custom_home_html_help": "This HTML will replace the default homepage content. Leave empty to use the default.",
|
||||
"admin.config.help_url": "Help URL",
|
||||
"admin.config.help_url_placeholder": "https://docs.example.com",
|
||||
"admin.config.help_url_help": "URL for the Help link in the navigation. Leave empty to hide the Help link.",
|
||||
"admin.config.hide_explore_users": "Hide Explore Users",
|
||||
"admin.config.hide_explore_users_desc": "Hide the Users tab from the Explore menu",
|
||||
"admin.config.custom_home_title": "Homepage Title",
|
||||
"admin.config.custom_home_title_placeholder": "Leave empty to use app name",
|
||||
"admin.config.custom_home_title_help": "Custom title displayed on the homepage. Leave empty to use the default app name.",
|
||||
"admin.config.custom_home_tagline": "Homepage Tagline",
|
||||
"admin.config.custom_home_tagline_placeholder": "Leave empty to use default tagline",
|
||||
"admin.config.custom_home_tagline_help": "Custom tagline displayed below the title on the homepage. Leave empty to use the default.",
|
||||
"admin.config.pinned_org_display_format": "Pinned Organization Display Format",
|
||||
"admin.config.pinned_org_format_promotional": "Promotional Content (hide pinned orgs)",
|
||||
"admin.config.pinned_org_format_condensed": "Condensed (icon on left)",
|
||||
"admin.config.pinned_org_format_regular": "Regular (icon above)",
|
||||
"admin.config.pinned_org_display_format_help": "Choose how pinned organizations are displayed on the homepage.",
|
||||
"admin.config.logo_upload_success": "Homepage logo uploaded successfully",
|
||||
"admin.config.logo_url_success": "Homepage logo URL updated successfully",
|
||||
"admin.config.logo_reset_success": "Homepage logo reset to default",
|
||||
"admin.config.logo_invalid_type": "Invalid file type. Allowed: SVG, PNG, JPG, GIF",
|
||||
"admin.config.home_logo_help": "This logo will be displayed on the homepage for non-logged-in users. Recommended: SVG, PNG, JPG or GIF.",
|
||||
"admin.config.custom_site_icon": "Site Icon (Favicon & Navbar)",
|
||||
"admin.config.custom_icon_url_placeholder": "Enter icon URL or upload a file below",
|
||||
"admin.config.upload_icon": "Upload Icon File",
|
||||
"admin.config.reset_icon": "Reset to Default",
|
||||
"admin.config.current_icon": "Current Icon",
|
||||
"admin.config.icon_url": "Icon URL",
|
||||
"admin.config.icon_upload_success": "Site icon uploaded successfully",
|
||||
"admin.config.icon_url_success": "Site icon URL updated successfully",
|
||||
"admin.config.icon_reset_success": "Site icon reset to default",
|
||||
"admin.config.icon_invalid_type": "Invalid file type. Allowed: SVG, PNG, ICO",
|
||||
"admin.config.site_icon_help": "This icon will be used as the site favicon and in the navbar. Recommended: SVG or PNG, square dimensions.",
|
||||
"admin.config.current_logo": "Current Homepage Logo",
|
||||
"admin.config.logo_url": "Logo URL",
|
||||
"repo.settings.display_title": "Display Title",
|
||||
"repo.settings.display_title_placeholder": "Optional display title for this repository",
|
||||
"repo.settings.display_title_help": "A custom title shown prominently on the repository page. Leave empty to use the repository name.",
|
||||
"repo.settings.license": "License",
|
||||
"repo.settings.license_type": "License Type",
|
||||
"repo.settings.license_none": "No license selected",
|
||||
"repo.settings.license_help": "Select a license for your repository. This will create a LICENSE.md file in the repository root.",
|
||||
"repo.settings.license_saved": "License has been saved and LICENSE.md has been created.",
|
||||
"repo.settings.license_cleared": "License has been cleared.",
|
||||
"repo.settings.license_file_error": "License saved but failed to create LICENSE.md file. You may need to create it manually.",
|
||||
"repo.settings.current_license": "Current License",
|
||||
"repo.settings.view_license_file": "View LICENSE.md file",
|
||||
"api": "API",
|
||||
"admin.config.api_header_url": "API Header Link",
|
||||
"admin.config.api_header_url_placeholder": "https://example.com/api/docs",
|
||||
"admin.config.api_header_url_help": "URL for the API documentation link in the header. Leave empty to hide the link.",
|
||||
"admin.config.explore_org_display_format": "Explore Organizations Display",
|
||||
"admin.config.explore_org_display_format_help": "Choose how organizations are displayed on the explore/organizations page",
|
||||
"admin.config.explore_org_format_list": "List View",
|
||||
"admin.config.explore_org_format_tiles": "Tile Cards"
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -87,12 +87,12 @@
|
||||
"filter.public": "عمومی",
|
||||
"filter.private": "خصوصی",
|
||||
"editor.buttons.table.add.insert": "افزودن",
|
||||
"startpage.app_desc": "یک سرویس گیت بیدرد سر و راحت",
|
||||
"startpage.install": "راهاندازی ساده",
|
||||
"startpage.platform": "مستقل از سکو",
|
||||
"startpage.lightweight": "ابزارک سبک",
|
||||
"startpage.lightweight_desc": "گیتی با حداقل منابع میتوانید برای روی دستگاه Raspberry Pi اجرا شود و مصرف انرژی شما را کاهش دهد!",
|
||||
"startpage.license": "متن باز",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"install.install": "نصب و راه اندازی",
|
||||
"install.title": "تنظیمات اولیه",
|
||||
"install.docker_helper": "اگر گیتی را با داکر اجرا کردهاید، لطفا قبل از هر تغییری <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">مستندات</a> را مطالعه نمایید.",
|
||||
@@ -2229,4 +2229,4 @@
|
||||
"actions.runners.version": "نسخه",
|
||||
"actions.runs.commit": "کامیت",
|
||||
"git.filemode.symbolic_link": "پیوند نمادین"
|
||||
}
|
||||
}
|
||||
@@ -101,12 +101,12 @@
|
||||
"error.occurred": "Virhe tapahtui",
|
||||
"error.not_found": "Kohdetta ei löytynyt.",
|
||||
"error.network_error": "Verkkovirhe",
|
||||
"startpage.app_desc": "Kivuton, itsehostattu Git-palvelu",
|
||||
"startpage.install": "Helppo asentaa",
|
||||
"startpage.platform": "Alustariippumaton",
|
||||
"startpage.lightweight": "Kevyt",
|
||||
"startpage.lightweight_desc": "Gitealla on vähäiset vähimmäisvaatimukset, joten se toimii jopa halvassa Raspberry Pi:ssä. Säästä koneesi energiaa!",
|
||||
"startpage.license": "Avoin lähdekoodi",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"install.install": "Asennus",
|
||||
"install.title": "Alkuperäiset asetukset",
|
||||
"install.docker_helper": "Jos ajat Giteaa Dockerin sisällä, lue <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">ohjeet</a> ennen minkään asetuksen muuttamista.",
|
||||
@@ -1475,4 +1475,4 @@
|
||||
"actions.runners.task_list.run": "Suorita",
|
||||
"actions.runners.task_list.repository": "Repo",
|
||||
"actions.runners.version": "Versio"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -207,15 +207,15 @@
|
||||
"error.report_message": "Má chreideann tú gur fabht Gitea é seo, déan cuardach le haghaidh ceisteanna ar <a href=\"%s\" target=\"_blank\">GitHub</a> nó oscail eagrán nua más gá.",
|
||||
"error.not_found": "Ní raibh an sprioc in ann a fháil.",
|
||||
"error.network_error": "Earráid líonra",
|
||||
"startpage.app_desc": "Seirbhís Git gan phian, féin-óstáil",
|
||||
"startpage.install": "Éasca a shuiteáil",
|
||||
"startpage.install_desc": "Níl ort ach <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[1]s\">rith an dénártha</a> do d'ardán, seol é le <a target=\"_blank\" rel=\"noopener noreferrer \" href=\"%[2]s\">Docker</a>, nó faigh <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[3]s\">pacáilte</a> é.",
|
||||
"startpage.platform": "Tras-ardán",
|
||||
"startpage.platform_desc": "Ritheann Gitea áit ar <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://go.dev/\">bith is féidir le Go</a> tiomsú le haghaidh: Windows, macOS, Linux, ARM, srl Roghnaigh an ceann is breá leat!",
|
||||
"startpage.lightweight": "Éadrom",
|
||||
"startpage.lightweight_desc": "Tá íosta riachtanais íseal ag Gitea agus is féidir leo rith ar Raspberry Pi saor. Sábháil fuinneamh do mheaisín!",
|
||||
"startpage.license": "Foinse Oscailte",
|
||||
"startpage.license_desc": "Téigh go bhfaighidh <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[1]s\">%[2]s</a>! Bí linn trí <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%[3]s\">cur leis</a> chun an tionscadal seo a fheabhsú fós. Ná bíodh cúthail ort a bheith i do rannpháirtí!",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.install_desc": "Run the binary, deploy with Docker, or use your favorite package manager. GitCaddy runs wherever you need it.",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.platform_desc": "Built for the age of AI-assisted development. Structured APIs, capability discovery, and intelligent context for AI tools.",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"startpage.license_desc": "GitCaddy is open source and built on the shoulders of giants. Based on Gitea, enhanced for the AI era.",
|
||||
"install.install": "Suiteáil",
|
||||
"install.installing_desc": "Suiteáil anois, fan go fóill…",
|
||||
"install.title": "Cumraíocht Tosaigh",
|
||||
@@ -3698,4 +3698,4 @@
|
||||
"git.filemode.executable_file": "Comhad infheidhmithe",
|
||||
"git.filemode.symbolic_link": "Nasc siombalach",
|
||||
"git.filemode.submodule": "Fo-mhodúl"
|
||||
}
|
||||
}
|
||||
@@ -75,11 +75,11 @@
|
||||
"filter.public": "Nyilvános",
|
||||
"filter.private": "Privát",
|
||||
"editor.buttons.table.add.insert": "Hozzáadás",
|
||||
"startpage.app_desc": "Fájdalommentes, saját gépre telepíthető Git szolgáltatás",
|
||||
"startpage.install": "Könnyen telepíthető",
|
||||
"startpage.platform": "Keresztplatformos",
|
||||
"startpage.lightweight": "Könnyűsúlyú",
|
||||
"startpage.license": "Nyílt forráskódú",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.license": "Open Source",
|
||||
"install.install": "Telepítés",
|
||||
"install.title": "Kezdeti konfiguráció",
|
||||
"install.docker_helper": "Ha ön a Gitea-t Docker-ből futtatja, kérem olvassa el a <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">dokumentációt</a> a beállítások megváltoztatása előtt.",
|
||||
@@ -1384,4 +1384,4 @@
|
||||
"actions.runners.status.active": "Aktív",
|
||||
"actions.runners.version": "Verzió",
|
||||
"git.filemode.symbolic_link": "Szimbolikus hivatkozás"
|
||||
}
|
||||
}
|
||||
@@ -147,12 +147,12 @@
|
||||
"error.occurred": "Terjadi kesalahan",
|
||||
"error.report_message": "Jika Anda yakin ini adalah bug Gitea, silakan cari isu di <a href=\"%s\" target=\"_blank\">GitHub</a> atau buka isu baru jika diperlukan.",
|
||||
"error.not_found": "Target tidak dapat ditemukan.",
|
||||
"startpage.app_desc": "Sebuah layanan hosting Git sendiri yang tanpa kesulitan",
|
||||
"startpage.install": "Mudah dipasang",
|
||||
"startpage.platform": "Lintas platform",
|
||||
"startpage.lightweight": "Ringan",
|
||||
"startpage.lightweight_desc": "Gitea hanya membutuhkan persyaratan minimal dan bisa berjalan pada Raspberry Pi yang murah. Bisa menghemat listrik!",
|
||||
"startpage.license": "Sumber Terbuka",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"install.title": "Konfigurasi Awal",
|
||||
"install.user": "Nama Pengguna",
|
||||
"install.password": "Kata Sandi",
|
||||
@@ -1199,4 +1199,4 @@
|
||||
"projects.type-1.display_name": "Proyek Individu",
|
||||
"projects.type-2.display_name": "Proyek Repositori",
|
||||
"projects.type-3.display_name": "Proyek Organisasi"
|
||||
}
|
||||
}
|
||||
@@ -100,12 +100,12 @@
|
||||
"error.occurred": "Villa kom upp",
|
||||
"error.not_found": "Markmiðið fannst ekki.",
|
||||
"error.network_error": "Netkerfisvilla",
|
||||
"startpage.app_desc": "Þrautalaus og sjálfhýst Git þjónusta",
|
||||
"startpage.install": "Einföld uppsetning",
|
||||
"startpage.platform": "Fjölvettvangur",
|
||||
"startpage.lightweight": "Létt",
|
||||
"startpage.lightweight_desc": "Gitea hefur lágar lágmarkskröfur og getur keyrt á ódýrum Raspberry Pi. Sparaðu orku!",
|
||||
"startpage.license": "Frjáls Hugbúnaður",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"install.install": "Uppsetning",
|
||||
"install.title": "Upphafleg Uppsetning",
|
||||
"install.docker_helper": "Ef þú keyrir Gitea inni í Docker þá viltu vinsamlegast lesa <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">leiðbeiningaritið</a> áður en þú breytir stillingum.",
|
||||
@@ -1117,4 +1117,4 @@
|
||||
"actions.runners.status.active": "Virkt",
|
||||
"actions.runners.version": "Útgáfa",
|
||||
"actions.runs.commit": "Framlag"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -155,12 +155,12 @@
|
||||
"error.occurred": "Radusies kļūda",
|
||||
"error.not_found": "Pieprasītie dati netika atrasti.",
|
||||
"error.network_error": "Tīkla kļūda",
|
||||
"startpage.app_desc": "Viegli uzstādāms Git serviss",
|
||||
"startpage.install": "Vienkārši instalējams",
|
||||
"startpage.platform": "Pieejama dažādām platformām",
|
||||
"startpage.lightweight": "Viegla",
|
||||
"startpage.lightweight_desc": "Gitea ir miminālas prasības un to var darbināt uz nedārga Raspberry Pi datora. Ietaupi savai ierīcei resursus!",
|
||||
"startpage.license": "Atvērtā pirmkoda",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"install.install": "Instalācija",
|
||||
"install.title": "Sākotnējā konfigurācija",
|
||||
"install.docker_helper": "Ja Gitea ir uzstādīts Docker konteinerī, izlasiet <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">vadlīninas</a> pirms maināt iestatījumus.",
|
||||
@@ -3043,4 +3043,4 @@
|
||||
"git.filemode.executable_file": "Izpildāmais fails",
|
||||
"git.filemode.symbolic_link": "Simboliska saite",
|
||||
"git.filemode.submodule": "Apakšmodulis"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -87,12 +87,12 @@
|
||||
"filter.public": "ප්රසිද්ධ",
|
||||
"filter.private": "පෞද්ගලික",
|
||||
"editor.buttons.table.add.insert": "එකතු",
|
||||
"startpage.app_desc": "වේදනාකාරී, ස්වයං-සත්කාරක Git සේවාවක්",
|
||||
"startpage.install": "ස්ථාපනයට පහසුය",
|
||||
"startpage.platform": "හරස් වේදිකාව",
|
||||
"startpage.lightweight": "සැහැල්ලු",
|
||||
"startpage.lightweight_desc": "Gitea අඩු අවම අවශ්යතා ඇති අතර මිල අඩු Raspberry Pi මත ධාවනය කළ හැකිය. ඔබේ යන්ත්ර ශක්තිය සුරකින්න!",
|
||||
"startpage.license": "විවෘත මූලාශ්ර",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"install.install": "ස්ථාපනය",
|
||||
"install.title": "මූලික වින්යාසය",
|
||||
"install.docker_helper": "ඔබ Docker තුළ Gitea ධාවනය කරන්නේ නම්, කරුණාකර ඕනෑම සැකසුම් වෙනස් කිරීමට පෙර <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">ලියකියවිලි</a> කියවන්න.",
|
||||
@@ -2190,4 +2190,4 @@
|
||||
"actions.runners.version": "අනුවාදය",
|
||||
"actions.runs.commit": "කැප",
|
||||
"git.filemode.symbolic_link": "සංකේතාත්මක සබැඳිය"
|
||||
}
|
||||
}
|
||||
@@ -147,12 +147,12 @@
|
||||
"error.occurred": "Vyskytla sa chyba",
|
||||
"error.not_found": "Nebolo možné nájsť cieľ.",
|
||||
"error.network_error": "Chyba siete",
|
||||
"startpage.app_desc": "Jednoducho prístupný vlastný Git",
|
||||
"startpage.install": "Jednoduchá inštalácia",
|
||||
"startpage.platform": "Multiplatformový",
|
||||
"startpage.lightweight": "Ľahká",
|
||||
"startpage.lightweight_desc": "Gitea má minimálne požiadavky a môže bežať na Raspberry Pi. Šetrite energiou vášho stroja!",
|
||||
"startpage.license": "Otvorený zdrojový kód",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"install.install": "Inštalácia",
|
||||
"install.title": "Východzia konfigurácia",
|
||||
"install.docker_helper": "Ak spúšťate Gitea v Docker kontajneri, prečítajte si <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">dokumentáciu</a> pred zmenou akýchkoľvek nastavení.",
|
||||
@@ -1161,4 +1161,4 @@
|
||||
"actions.runners.status.unspecified": "Neznámy",
|
||||
"actions.runners.version": "Verzia",
|
||||
"git.filemode.symbolic_link": "Symbolický odkaz"
|
||||
}
|
||||
}
|
||||
@@ -74,12 +74,12 @@
|
||||
"filter.public": "Offentlig",
|
||||
"filter.private": "Privat",
|
||||
"editor.buttons.table.add.insert": "Lägg till",
|
||||
"startpage.app_desc": "En smidig, självhostad Git-tjänst",
|
||||
"startpage.install": "Lätt att installera",
|
||||
"startpage.platform": "Plattformsoberoende",
|
||||
"startpage.lightweight": "Lättviktig",
|
||||
"startpage.lightweight_desc": "Gitea har låga minimum-krav och kan köras på en billig Rasperry Pi. Spara på din maskins kraft!",
|
||||
"startpage.license": "Öppen källkod",
|
||||
"startpage.app_desc": "Steeped in your workflow",
|
||||
"startpage.install": "Deploy Anywhere",
|
||||
"startpage.platform": "AI-Native Platform",
|
||||
"startpage.lightweight": "Lightning Fast",
|
||||
"startpage.lightweight_desc": "Minimal footprint, maximum performance. GitCaddy runs efficiently on everything from Raspberry Pi to enterprise servers.",
|
||||
"startpage.license": "Open Source",
|
||||
"install.title": "Ursprunglig konfiguration",
|
||||
"install.docker_helper": "Om du kör Gitea i Docker, vänligen läs igenom <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"%s\">dokumentationen</a> innan några inställningar ändras.",
|
||||
"install.db_title": "Databasinställningar",
|
||||
@@ -1734,4 +1734,4 @@
|
||||
"actions.runners.task_list.repository": "Utvecklingskatalog",
|
||||
"actions.runners.status.active": "Aktiv",
|
||||
"git.filemode.symbolic_link": "Symbolisk länk"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
19
public/assets/img/gitcaddy-icon.svg
Normal file
19
public/assets/img/gitcaddy-icon.svg
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="374px" height="374px" viewBox="397.5 371.5 374 374" style="enable-background:new 397.5 371.5 374 374;"
|
||||
xml:space="preserve">
|
||||
<path style="fill:#609926;" d="M526.05,605.17c-0.69,0-1.39-0.14-2.08-0.46l-82.52-37.42v95.65l138.07,48.38V563.78l-50.37,40.29
|
||||
C528.27,604.76,527.16,605.17,526.05,605.17L526.05,605.17z"/>
|
||||
<path style="fill:#609926;" d="M643.03,605.17c-1.16,0-2.26-0.42-3.15-1.11l-50.37-40.29v147.55l138.16-48.38v-95.65l-82.56,37.42
|
||||
c-0.65,0.28-1.34,0.46-2.04,0.46L643.03,605.17z"/>
|
||||
<path style="fill:#609926;" d="M525.31,594.35l49.08-39.22l-137-48.06l-37.88,30.34L525.31,594.35z"/>
|
||||
<path style="fill:#609926;" d="M594.69,555.13l49.03,39.22l125.81-56.94l-37.88-30.34L594.69,555.13z"/>
|
||||
<path style="fill:#609926;" d="M525.36,438.98c-11.01-3.42-23.22-7.26-36.22-13.46c-1.62,64.89,35.94,80.94,52.68,84.88
|
||||
c16.47,3.88,30.57,0.55,35.48-3.88c-11.24-14.06-25.81-26.6-43.43-31.45c16.19,1.76,31.13,9.62,43.99,19.89
|
||||
c-3.88-40.66-22.76-46.62-52.45-55.97H525.36z"/>
|
||||
<path style="fill:#609926;" d="M589.74,491.11c5.23,5,20.81,8.79,38.85,4.53c18.22-4.3,59.16-21.79,57.22-92.6
|
||||
c-14.2,6.8-27.57,10.96-39.59,14.76c-32.47,10.17-53.01,16.6-56.98,61.52c13.92-11.38,30.16-20.26,47.96-22.29
|
||||
c-19.24,5.23-35.2,18.87-47.41,34.04L589.74,491.11z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
1062
public/assets/img/gitcaddy-logo.svg
Normal file
1062
public/assets/img/gitcaddy-logo.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 105 KiB |
27649
public/assets/licenses.txt
Normal file
27649
public/assets/licenses.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -22,16 +22,13 @@ import (
|
||||
"code.gitea.io/gitea/services/context"
|
||||
)
|
||||
|
||||
// RawMessage is a raw encoded JSON value (equivalent to encoding/json.RawMessage)
|
||||
type RawMessage []byte
|
||||
|
||||
// MCP Protocol Types (JSON-RPC 2.0)
|
||||
|
||||
type MCPRequest struct {
|
||||
JSONRPC string `json:"jsonrpc"`
|
||||
ID any `json:"id"`
|
||||
Method string `json:"method"`
|
||||
Params RawMessage `json:"params,omitempty"`
|
||||
JSONRPC string `json:"jsonrpc"`
|
||||
ID any `json:"id"`
|
||||
Method string `json:"method"`
|
||||
Params json.RawMessage `json:"params,omitempty"`
|
||||
}
|
||||
|
||||
type MCPResponse struct {
|
||||
|
||||
@@ -5,8 +5,11 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -235,6 +238,13 @@ func ChangeConfig(ctx *context.Context) {
|
||||
cfg.Picture.EnableFederatedAvatar.DynKey(): marshalBool,
|
||||
cfg.Repository.OpenWithEditorApps.DynKey(): marshalOpenWithApps,
|
||||
cfg.Repository.GitGuideRemoteName.DynKey(): marshalString(cfg.Repository.GitGuideRemoteName.DefaultValue()),
|
||||
cfg.Theme.DisableRegistration.DynKey(): marshalBool,
|
||||
cfg.Theme.CustomHomeHTML.DynKey(): marshalString(""),
|
||||
cfg.Theme.APIHeaderURL.DynKey(): marshalString(""),
|
||||
cfg.Theme.CustomHomeTitle.DynKey(): marshalString(""),
|
||||
cfg.Theme.CustomHomeTagline.DynKey(): marshalString(""),
|
||||
cfg.Theme.PinnedOrgDisplayFormat.DynKey(): marshalString("condensed"),
|
||||
cfg.Theme.ExploreOrgDisplayFormat.DynKey(): marshalString("list"),
|
||||
}
|
||||
|
||||
_ = ctx.Req.ParseForm()
|
||||
@@ -272,3 +282,167 @@ loop:
|
||||
config.GetDynGetter().InvalidateCache()
|
||||
ctx.JSONOK()
|
||||
}
|
||||
|
||||
// ChangeThemeLogo handles homepage logo upload and custom URL
|
||||
func ChangeThemeLogo(ctx *context.Context) {
|
||||
cfg := setting.Config()
|
||||
|
||||
action := ctx.FormString("action")
|
||||
if action == "reset" {
|
||||
configSettings := map[string]string{
|
||||
cfg.Theme.CustomHomeLogoURL.DynKey(): "\"\"",
|
||||
}
|
||||
if err := system_model.SetSettings(ctx, configSettings); err != nil {
|
||||
ctx.ServerError("SetSettings", err)
|
||||
return
|
||||
}
|
||||
config.GetDynGetter().InvalidateCache()
|
||||
ctx.Flash.Success(ctx.Tr("admin.config.logo_reset_success"))
|
||||
ctx.Redirect(setting.AppSubURL + "/-/admin/config/settings")
|
||||
return
|
||||
}
|
||||
|
||||
// Check for file upload first
|
||||
file, header, err := ctx.Req.FormFile("logo_file")
|
||||
if err == nil && header != nil {
|
||||
defer file.Close()
|
||||
|
||||
ext := strings.ToLower(filepath.Ext(header.Filename))
|
||||
allowedExts := map[string]bool{".svg": true, ".png": true, ".jpg": true, ".jpeg": true, ".gif": true}
|
||||
if !allowedExts[ext] {
|
||||
ctx.Flash.Error(ctx.Tr("admin.config.logo_invalid_type"))
|
||||
ctx.Redirect(setting.AppSubURL + "/-/admin/config/settings")
|
||||
return
|
||||
}
|
||||
|
||||
customDir := filepath.Join(setting.CustomPath, "public", "assets", "img")
|
||||
if err := os.MkdirAll(customDir, 0o755); err != nil {
|
||||
ctx.ServerError("MkdirAll", err)
|
||||
return
|
||||
}
|
||||
|
||||
fileName := "custom-home-logo" + ext
|
||||
filePath := filepath.Join(customDir, fileName)
|
||||
destFile, err := os.Create(filePath)
|
||||
if err != nil {
|
||||
ctx.ServerError("Create", err)
|
||||
return
|
||||
}
|
||||
defer destFile.Close()
|
||||
|
||||
if _, err := io.Copy(destFile, file); err != nil {
|
||||
ctx.ServerError("Copy", err)
|
||||
return
|
||||
}
|
||||
|
||||
fileURL := setting.AppSubURL + "/assets/img/" + fileName
|
||||
marshaledValue, _ := json.Marshal(fileURL)
|
||||
configSettings := map[string]string{
|
||||
cfg.Theme.CustomHomeLogoURL.DynKey(): string(marshaledValue),
|
||||
}
|
||||
if err := system_model.SetSettings(ctx, configSettings); err != nil {
|
||||
ctx.ServerError("SetSettings", err)
|
||||
return
|
||||
}
|
||||
config.GetDynGetter().InvalidateCache()
|
||||
ctx.Flash.Success(ctx.Tr("admin.config.logo_upload_success"))
|
||||
ctx.Redirect(setting.AppSubURL + "/-/admin/config/settings")
|
||||
return
|
||||
}
|
||||
|
||||
// Check for custom URL
|
||||
customURL := ctx.FormString("custom_logo_url")
|
||||
marshaledValue, _ := json.Marshal(customURL)
|
||||
configSettings := map[string]string{
|
||||
cfg.Theme.CustomHomeLogoURL.DynKey(): string(marshaledValue),
|
||||
}
|
||||
if err := system_model.SetSettings(ctx, configSettings); err != nil {
|
||||
ctx.ServerError("SetSettings", err)
|
||||
return
|
||||
}
|
||||
config.GetDynGetter().InvalidateCache()
|
||||
ctx.Flash.Success(ctx.Tr("admin.config.logo_url_success"))
|
||||
ctx.Redirect(setting.AppSubURL + "/-/admin/config/settings")
|
||||
}
|
||||
|
||||
// ChangeThemeIcon handles site icon (favicon + navbar) upload and custom URL
|
||||
func ChangeThemeIcon(ctx *context.Context) {
|
||||
cfg := setting.Config()
|
||||
|
||||
action := ctx.FormString("action")
|
||||
if action == "reset" {
|
||||
configSettings := map[string]string{
|
||||
cfg.Theme.CustomSiteIconURL.DynKey(): "\"\"",
|
||||
}
|
||||
if err := system_model.SetSettings(ctx, configSettings); err != nil {
|
||||
ctx.ServerError("SetSettings", err)
|
||||
return
|
||||
}
|
||||
config.GetDynGetter().InvalidateCache()
|
||||
ctx.Flash.Success(ctx.Tr("admin.config.icon_reset_success"))
|
||||
ctx.Redirect(setting.AppSubURL + "/-/admin/config/settings")
|
||||
return
|
||||
}
|
||||
|
||||
// Check for file upload first
|
||||
file, header, err := ctx.Req.FormFile("icon_file")
|
||||
if err == nil && header != nil {
|
||||
defer file.Close()
|
||||
|
||||
ext := strings.ToLower(filepath.Ext(header.Filename))
|
||||
allowedExts := map[string]bool{".svg": true, ".png": true, ".ico": true}
|
||||
if !allowedExts[ext] {
|
||||
ctx.Flash.Error(ctx.Tr("admin.config.icon_invalid_type"))
|
||||
ctx.Redirect(setting.AppSubURL + "/-/admin/config/settings")
|
||||
return
|
||||
}
|
||||
|
||||
customDir := filepath.Join(setting.CustomPath, "public", "assets", "img")
|
||||
if err := os.MkdirAll(customDir, 0o755); err != nil {
|
||||
ctx.ServerError("MkdirAll", err)
|
||||
return
|
||||
}
|
||||
|
||||
fileName := "custom-site-icon" + ext
|
||||
filePath := filepath.Join(customDir, fileName)
|
||||
destFile, err := os.Create(filePath)
|
||||
if err != nil {
|
||||
ctx.ServerError("Create", err)
|
||||
return
|
||||
}
|
||||
defer destFile.Close()
|
||||
|
||||
if _, err := io.Copy(destFile, file); err != nil {
|
||||
ctx.ServerError("Copy", err)
|
||||
return
|
||||
}
|
||||
|
||||
fileURL := setting.AppSubURL + "/assets/img/" + fileName
|
||||
marshaledValue, _ := json.Marshal(fileURL)
|
||||
configSettings := map[string]string{
|
||||
cfg.Theme.CustomSiteIconURL.DynKey(): string(marshaledValue),
|
||||
}
|
||||
if err := system_model.SetSettings(ctx, configSettings); err != nil {
|
||||
ctx.ServerError("SetSettings", err)
|
||||
return
|
||||
}
|
||||
config.GetDynGetter().InvalidateCache()
|
||||
ctx.Flash.Success(ctx.Tr("admin.config.icon_upload_success"))
|
||||
ctx.Redirect(setting.AppSubURL + "/-/admin/config/settings")
|
||||
return
|
||||
}
|
||||
|
||||
// Check for custom URL
|
||||
customURL := ctx.FormString("custom_icon_url")
|
||||
marshaledValue, _ := json.Marshal(customURL)
|
||||
configSettings := map[string]string{
|
||||
cfg.Theme.CustomSiteIconURL.DynKey(): string(marshaledValue),
|
||||
}
|
||||
if err := system_model.SetSettings(ctx, configSettings); err != nil {
|
||||
ctx.ServerError("SetSettings", err)
|
||||
return
|
||||
}
|
||||
config.GetDynGetter().InvalidateCache()
|
||||
ctx.Flash.Success(ctx.Tr("admin.config.icon_url_success"))
|
||||
ctx.Redirect(setting.AppSubURL + "/-/admin/config/settings")
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"code.gitea.io/gitea/modules/container"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
"code.gitea.io/gitea/services/context"
|
||||
)
|
||||
|
||||
@@ -40,7 +39,7 @@ func Organizations(ctx *context.Context) {
|
||||
)
|
||||
sortOrder := ctx.FormString("sort")
|
||||
if sortOrder == "" {
|
||||
sortOrder = util.Iif(supportedSortOrders.Contains(setting.UI.ExploreDefaultSort), setting.UI.ExploreDefaultSort, "newest")
|
||||
sortOrder = "alphabetically"
|
||||
ctx.SetFormString("sort", sortOrder)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"strconv"
|
||||
|
||||
"code.gitea.io/gitea/models/db"
|
||||
organization_model "code.gitea.io/gitea/models/organization"
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
@@ -61,6 +62,14 @@ func Home(ctx *context.Context) {
|
||||
|
||||
ctx.Data["PageIsHome"] = true
|
||||
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
|
||||
|
||||
// Load pinned organizations for homepage
|
||||
pinnedOrgs, err := organization_model.GetHomepagePinnedOrganizations(ctx)
|
||||
if err != nil {
|
||||
log.Error("GetHomepagePinnedOrganizations: %v", err)
|
||||
} else {
|
||||
ctx.Data["PinnedOrganizations"] = pinnedOrgs
|
||||
}
|
||||
ctx.HTML(http.StatusOK, tplHome)
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ func Settings(ctx *context.Context) {
|
||||
ctx.Data["PageIsSettingsOptions"] = true
|
||||
ctx.Data["CurrentVisibility"] = ctx.Org.Organization.Visibility
|
||||
ctx.Data["RepoAdminChangeTeamAccess"] = ctx.Org.Organization.RepoAdminChangeTeamAccess
|
||||
ctx.Data["IsHomepagePinned"] = ctx.Org.Organization.IsHomepagePinned
|
||||
ctx.Data["ContextUser"] = ctx.ContextUser
|
||||
|
||||
if _, err := shared_user.RenderUserOrgHeader(ctx); err != nil {
|
||||
@@ -89,6 +90,14 @@ func SettingsPost(ctx *context.Context) {
|
||||
opts.MaxRepoCreation = optional.Some(form.MaxRepoCreation)
|
||||
}
|
||||
|
||||
// Handle homepage pinning (admin only)
|
||||
if ctx.Doer.IsAdmin {
|
||||
if err := org.SetHomepagePinned(ctx, form.IsHomepagePinned); err != nil {
|
||||
ctx.ServerError("SetHomepagePinned", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if err := user_service.UpdateUser(ctx, org.AsUser(), opts); err != nil {
|
||||
ctx.ServerError("UpdateUser", err)
|
||||
return
|
||||
|
||||
155
routers/web/repo/setting/license.go
Normal file
155
routers/web/repo/setting/license.go
Normal file
@@ -0,0 +1,155 @@
|
||||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package setting
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
repo_module "code.gitea.io/gitea/modules/repository"
|
||||
"code.gitea.io/gitea/modules/templates"
|
||||
"code.gitea.io/gitea/services/context"
|
||||
files_service "code.gitea.io/gitea/services/repository/files"
|
||||
)
|
||||
|
||||
const tplLicense templates.TplName = "repo/settings/license"
|
||||
|
||||
// LicenseInfo holds license information
|
||||
type LicenseInfo struct {
|
||||
Key string
|
||||
Name string
|
||||
Description string
|
||||
}
|
||||
|
||||
// LicenseCategory holds a category of licenses
|
||||
type LicenseCategory struct {
|
||||
Category string
|
||||
Licenses []LicenseInfo
|
||||
}
|
||||
|
||||
// LicenseTypes defines all available license types
|
||||
var LicenseTypes = []LicenseCategory{
|
||||
{
|
||||
Category: "Permissive Licenses",
|
||||
Licenses: []LicenseInfo{
|
||||
{"MIT", "MIT License", "Most popular overall, minimal restrictions"},
|
||||
{"Apache-2.0", "Apache License 2.0", "Like MIT, plus explicit patent protection"},
|
||||
{"BSD-2-Clause", "BSD 2-Clause", "Similar to MIT"},
|
||||
{"BSD-3-Clause", "BSD 3-Clause", "BSD with no-endorsement rule"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Category: "Weak Copyleft Licenses",
|
||||
Licenses: []LicenseInfo{
|
||||
{"MPL-2.0", "Mozilla Public License 2.0", "Only modified files must remain open source"},
|
||||
{"LGPL-2.1", "LGPL 2.1", "Allows linking from proprietary software"},
|
||||
{"LGPL-3.0", "LGPL 3.0", "Allows linking from proprietary software"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Category: "Strong Copyleft Licenses",
|
||||
Licenses: []LicenseInfo{
|
||||
{"GPL-2.0", "GNU GPL v2", "Derivatives must also be GPL"},
|
||||
{"GPL-3.0", "GNU GPL v3", "Derivatives must be GPL, includes patent clauses"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Category: "Network/SaaS Copyleft",
|
||||
Licenses: []LicenseInfo{
|
||||
{"AGPL-3.0", "AGPL v3", "Like GPL, but closes the SaaS loophole"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Category: "Source-Available",
|
||||
Licenses: []LicenseInfo{
|
||||
{"BSL-1.0", "Business Source License", "Free to use, becomes open source later"},
|
||||
{"SSPL-1.0", "Server Side Public License", "Requires publishing entire service stack"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Category: "Public Domain",
|
||||
Licenses: []LicenseInfo{
|
||||
{"Unlicense", "Unlicense", "Public domain, no attribution required"},
|
||||
{"CC0-1.0", "CC0", "Public domain, internationally defensible"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
// License shows the license settings page
|
||||
func License(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.settings.license")
|
||||
ctx.Data["PageIsSettingsLicense"] = true
|
||||
ctx.Data["LicenseTypes"] = LicenseTypes
|
||||
ctx.HTML(http.StatusOK, tplLicense)
|
||||
}
|
||||
|
||||
// LicensePost handles license settings form submission
|
||||
func LicensePost(ctx *context.Context) {
|
||||
licenseType := ctx.FormString("license_type")
|
||||
repo := ctx.Repo.Repository
|
||||
|
||||
oldLicenseType := repo.LicenseType
|
||||
|
||||
// Update repo license type
|
||||
repo.LicenseType = licenseType
|
||||
if err := repo_model.UpdateRepositoryColsWithAutoTime(ctx, repo, "license_type"); err != nil {
|
||||
ctx.ServerError("UpdateRepositoryCols", err)
|
||||
return
|
||||
}
|
||||
|
||||
// Create LICENSE.md file if license selected and different from before
|
||||
if licenseType != "" && licenseType != oldLicenseType {
|
||||
if err := createLicenseFile(ctx, repo, licenseType); err != nil {
|
||||
log.Error("Failed to create LICENSE.md: %v", err)
|
||||
ctx.Flash.Warning(ctx.Tr("repo.settings.license_file_error"))
|
||||
} else {
|
||||
ctx.Flash.Success(ctx.Tr("repo.settings.license_saved"))
|
||||
}
|
||||
} else if licenseType == "" {
|
||||
ctx.Flash.Success(ctx.Tr("repo.settings.license_cleared"))
|
||||
} else {
|
||||
ctx.Flash.Success(ctx.Tr("repo.settings.license_saved"))
|
||||
}
|
||||
|
||||
ctx.Redirect(ctx.Repo.RepoLink + "/settings/license")
|
||||
}
|
||||
|
||||
func createLicenseFile(ctx *context.Context, repo *repo_model.Repository, licenseType string) error {
|
||||
// Get license content from templates
|
||||
licenseContent, err := repo_module.GetLicense(licenseType, &repo_module.LicenseValues{
|
||||
Owner: repo.OwnerName,
|
||||
Email: ctx.Doer.Email,
|
||||
Repo: repo.Name,
|
||||
Year: time.Now().Format("2006"),
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("GetLicense: %w", err)
|
||||
}
|
||||
|
||||
// Create/update LICENSE.md using files service
|
||||
opts := &files_service.ChangeRepoFilesOptions{
|
||||
Message: fmt.Sprintf("Add LICENSE.md (%s)", licenseType),
|
||||
OldBranch: repo.DefaultBranch,
|
||||
NewBranch: repo.DefaultBranch,
|
||||
Files: []*files_service.ChangeRepoFile{
|
||||
{
|
||||
Operation: "create",
|
||||
TreePath: "LICENSE.md",
|
||||
ContentReader: bytes.NewReader(licenseContent),
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
_, err = files_service.ChangeRepoFiles(ctx, repo, ctx.Doer, opts)
|
||||
if err != nil {
|
||||
// If file already exists, try to update it instead
|
||||
opts.Files[0].Operation = "update"
|
||||
_, err = files_service.ChangeRepoFiles(ctx, repo, ctx.Doer, opts)
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -204,6 +204,7 @@ func handleSettingsPostUpdate(ctx *context.Context) {
|
||||
repo.Name = newRepoName
|
||||
repo.LowerName = strings.ToLower(newRepoName)
|
||||
repo.Description = form.Description
|
||||
repo.DisplayTitle = form.DisplayTitle
|
||||
repo.Website = form.Website
|
||||
repo.IsTemplate = form.Template
|
||||
|
||||
|
||||
@@ -778,6 +778,8 @@ func registerWebRoutes(m *web.Router) {
|
||||
m.Post("/test_mail", admin.SendTestMail)
|
||||
m.Post("/test_cache", admin.TestCache)
|
||||
m.Get("/settings", admin.ConfigSettings)
|
||||
m.Post("/theme/logo", admin.ChangeThemeLogo)
|
||||
m.Post("/theme/icon", admin.ChangeThemeIcon)
|
||||
})
|
||||
|
||||
m.Group("/monitor", func() {
|
||||
@@ -1138,6 +1140,11 @@ func registerWebRoutes(m *web.Router) {
|
||||
m.Post("/avatar", web.Bind(forms.AvatarForm{}), repo_setting.SettingsAvatar)
|
||||
m.Post("/avatar/delete", repo_setting.SettingsDeleteAvatar)
|
||||
|
||||
m.Group("/license", func() {
|
||||
m.Get("", repo_setting.License)
|
||||
m.Post("", repo_setting.LicensePost)
|
||||
})
|
||||
|
||||
m.Combo("/public_access").Get(repo_setting.PublicAccess).Post(repo_setting.PublicAccessPost)
|
||||
|
||||
m.Group("/collaboration", func() {
|
||||
|
||||
@@ -26,6 +26,7 @@ type CreateOrgForm struct {
|
||||
OrgName string `binding:"Required;Username;MaxSize(40)" locale:"org.org_name_holder"`
|
||||
Visibility structs.VisibleType
|
||||
RepoAdminChangeTeamAccess bool
|
||||
IsHomepagePinned bool
|
||||
}
|
||||
|
||||
// Validate validates the fields
|
||||
@@ -43,6 +44,7 @@ type UpdateOrgSettingForm struct {
|
||||
Location string `binding:"MaxSize(50)"`
|
||||
MaxRepoCreation int
|
||||
RepoAdminChangeTeamAccess bool
|
||||
IsHomepagePinned bool
|
||||
}
|
||||
|
||||
// Validate validates the fields
|
||||
|
||||
@@ -91,6 +91,7 @@ func (f *MigrateRepoForm) Validate(req *http.Request, errs binding.Errors) bindi
|
||||
type RepoSettingForm struct {
|
||||
RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"`
|
||||
Description string `binding:"MaxSize(2048)"`
|
||||
DisplayTitle string `binding:"MaxSize(255)"`
|
||||
Website string `binding:"ValidUrl;MaxSize(1024)"`
|
||||
Interval string
|
||||
MirrorAddress string
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import path from 'node:path';
|
||||
import type {Config} from 'stylelint';
|
||||
|
||||
// Use process.cwd() for more reliable path resolution across different environments
|
||||
const cssVarFiles = [
|
||||
fileURLToPath(new URL('web_src/css/base.css', import.meta.url)),
|
||||
fileURLToPath(new URL('web_src/css/themes/theme-gitea-light.css', import.meta.url)),
|
||||
fileURLToPath(new URL('web_src/css/themes/theme-gitea-dark.css', import.meta.url)),
|
||||
path.join(process.cwd(), 'web_src/css/base.css'),
|
||||
path.join(process.cwd(), 'web_src/css/themes/theme-gitea-light.css'),
|
||||
path.join(process.cwd(), 'web_src/css/themes/theme-gitea-dark.css'),
|
||||
];
|
||||
|
||||
export default {
|
||||
@@ -133,9 +134,9 @@ export default {
|
||||
'media-feature-name-no-vendor-prefix': true,
|
||||
'no-descending-specificity': null,
|
||||
'no-invalid-position-at-import-rule': [true, {ignoreAtRules: ['tailwind']}],
|
||||
'no-unknown-animations': null, // disabled until stylelint supports multi-file linting
|
||||
'no-unknown-custom-media': null, // disabled until stylelint supports multi-file linting
|
||||
'no-unknown-custom-properties': null, // disabled until stylelint supports multi-file linting
|
||||
'no-unknown-animations': null,
|
||||
'no-unknown-custom-media': null,
|
||||
'no-unknown-custom-properties': null,
|
||||
'plugin/declaration-block-no-ignored-properties': true,
|
||||
'scale-unlimited/declaration-strict-value': [['/color$/', 'font-weight'], {ignoreValues: '/^(inherit|transparent|unset|initial|currentcolor|none)$/', ignoreFunctions: true, disableFix: true, expandShorthand: true}],
|
||||
'selector-attribute-quotes': 'always',
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin config")}}
|
||||
|
||||
{{template "admin/config_settings/theme" .}}
|
||||
|
||||
{{template "admin/config_settings/avatars" .}}
|
||||
|
||||
{{template "admin/config_settings/repository" .}}
|
||||
|
||||
170
templates/admin/config_settings/theme.tmpl
Normal file
170
templates/admin/config_settings/theme.tmpl
Normal file
@@ -0,0 +1,170 @@
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "admin.config.theme_config"}}
|
||||
</h4>
|
||||
<div class="ui attached table segment">
|
||||
<dl class="admin-dl-horizontal">
|
||||
<dt>{{ctx.Locale.Tr "admin.config.disable_registration"}}</dt>
|
||||
<dd>
|
||||
<div class="ui toggle checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.config.disable_registration_desc"}}">
|
||||
<input type="checkbox" data-config-dyn-key="theme.disable_registration" {{if .SystemConfig.Theme.DisableRegistration.Value ctx}}checked{{end}}><label></label>
|
||||
</div>
|
||||
</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.hide_explore_users"}}</dt>
|
||||
<dd>
|
||||
<div class="ui toggle checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.config.hide_explore_users_desc"}}">
|
||||
<input type="checkbox" data-config-dyn-key="theme.hide_explore_users" {{if .SystemConfig.Theme.HideExploreUsers.Value ctx}}checked{{end}}><label></label>
|
||||
</div>
|
||||
</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.help_url"}}</dt>
|
||||
<dd>
|
||||
<form class="ui form form-fetch-action" method="post" action="{{AppSubUrl}}/-/admin/config">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="key" value="theme.help_url">
|
||||
<div class="field">
|
||||
<input type="text" name="value" value="{{.SystemConfig.Theme.HelpURL.Value ctx}}" placeholder="{{ctx.Locale.Tr "admin.config.help_url_placeholder"}}">
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.help_url_help"}}</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</form>
|
||||
</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.custom_site_icon"}}</dt>
|
||||
<dd>
|
||||
<form class="ui form" method="post" action="{{AppSubUrl}}/-/admin/config/theme/icon" enctype="multipart/form-data">
|
||||
{{.CsrfTokenHtml}}
|
||||
{{if .SystemConfig.Theme.CustomSiteIconURL.Value ctx}}
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.current_icon"}}</label>
|
||||
<img src="{{.SystemConfig.Theme.CustomSiteIconURL.Value ctx}}" alt="Current Icon" style="max-height: 32px; max-width: 32px; background: var(--color-secondary-bg); padding: 4px; border-radius: 4px;">
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.icon_url"}}</label>
|
||||
<input type="text" name="custom_icon_url" value="{{.SystemConfig.Theme.CustomSiteIconURL.Value ctx}}" placeholder="{{ctx.Locale.Tr "admin.config.custom_icon_url_placeholder"}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.upload_icon"}}</label>
|
||||
<input type="file" name="icon_file" accept="image/svg+xml,image/png,image/x-icon,image/vnd.microsoft.icon">
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.site_icon_help"}}</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
{{if .SystemConfig.Theme.CustomSiteIconURL.Value ctx}}
|
||||
<button class="ui red button" type="submit" name="action" value="reset">{{ctx.Locale.Tr "admin.config.reset_icon"}}</button>
|
||||
{{end}}
|
||||
</form>
|
||||
</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.custom_home_logo"}}</dt>
|
||||
<dd>
|
||||
<form class="ui form" method="post" action="{{AppSubUrl}}/-/admin/config/theme/logo" enctype="multipart/form-data">
|
||||
{{.CsrfTokenHtml}}
|
||||
{{if .SystemConfig.Theme.CustomHomeLogoURL.Value ctx}}
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.current_logo"}}</label>
|
||||
<img src="{{.SystemConfig.Theme.CustomHomeLogoURL.Value ctx}}" alt="Current Logo" style="max-height: 80px; max-width: 200px; background: var(--color-secondary-bg); padding: 8px; border-radius: 4px;">
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.logo_url"}}</label>
|
||||
<input type="text" name="custom_logo_url" value="{{.SystemConfig.Theme.CustomHomeLogoURL.Value ctx}}" placeholder="{{ctx.Locale.Tr "admin.config.custom_logo_url_placeholder"}}">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "admin.config.upload_logo"}}</label>
|
||||
<input type="file" name="logo_file" accept="image/svg+xml,image/png,image/jpeg,image/gif">
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.home_logo_help"}}</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
{{if .SystemConfig.Theme.CustomHomeLogoURL.Value ctx}}
|
||||
<button class="ui red button" type="submit" name="action" value="reset">{{ctx.Locale.Tr "admin.config.reset_logo"}}</button>
|
||||
{{end}}
|
||||
</form>
|
||||
</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.custom_home_title"}}</dt>
|
||||
<dd>
|
||||
<form class="ui form form-fetch-action" method="post" action="{{AppSubUrl}}/-/admin/config">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="key" value="theme.custom_home_title">
|
||||
<div class="field">
|
||||
<input type="text" name="value" value="{{.SystemConfig.Theme.CustomHomeTitle.Value ctx}}" placeholder="{{ctx.Locale.Tr "admin.config.custom_home_title_placeholder"}}" maxlength="100">
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.custom_home_title_help"}}</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</form>
|
||||
</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.custom_home_tagline"}}</dt>
|
||||
<dd>
|
||||
<form class="ui form form-fetch-action" method="post" action="{{AppSubUrl}}/-/admin/config">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="key" value="theme.custom_home_tagline">
|
||||
<div class="field">
|
||||
<input type="text" name="value" value="{{.SystemConfig.Theme.CustomHomeTagline.Value ctx}}" placeholder="{{ctx.Locale.Tr "admin.config.custom_home_tagline_placeholder"}}" maxlength="255">
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.custom_home_tagline_help"}}</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</form>
|
||||
</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.pinned_org_display_format"}}</dt>
|
||||
<dd>
|
||||
<form class="ui form form-fetch-action" method="post" action="{{AppSubUrl}}/-/admin/config">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="key" value="theme.pinned_org_display_format">
|
||||
<div class="field">
|
||||
<select class="ui dropdown" name="value">
|
||||
<option value="promotional" {{if eq (.SystemConfig.Theme.PinnedOrgDisplayFormat.Value ctx) "promotional"}}selected{{end}}>{{ctx.Locale.Tr "admin.config.pinned_org_format_promotional"}}</option>
|
||||
<option value="condensed" {{if eq (.SystemConfig.Theme.PinnedOrgDisplayFormat.Value ctx) "condensed"}}selected{{end}}>{{ctx.Locale.Tr "admin.config.pinned_org_format_condensed"}}</option>
|
||||
<option value="regular" {{if eq (.SystemConfig.Theme.PinnedOrgDisplayFormat.Value ctx) "regular"}}selected{{end}}>{{ctx.Locale.Tr "admin.config.pinned_org_format_regular"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.pinned_org_display_format_help"}}</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</form>
|
||||
</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.explore_org_display_format"}}</dt>
|
||||
<dd>
|
||||
<form class="ui form form-fetch-action" method="post" action="{{AppSubUrl}}/-/admin/config">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="key" value="theme.explore_org_display_format">
|
||||
<div class="field">
|
||||
<select class="ui dropdown" name="value">
|
||||
<option value="list" {{if eq (.SystemConfig.Theme.ExploreOrgDisplayFormat.Value ctx) "list"}}selected{{end}}>{{ctx.Locale.Tr "admin.config.explore_org_format_list"}}</option>
|
||||
<option value="tiles" {{if eq (.SystemConfig.Theme.ExploreOrgDisplayFormat.Value ctx) "tiles"}}selected{{end}}>{{ctx.Locale.Tr "admin.config.explore_org_format_tiles"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.explore_org_display_format_help"}}</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</form>
|
||||
</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.api_header_url"}}</dt>
|
||||
<dd>
|
||||
<form class="ui form form-fetch-action" method="post" action="{{AppSubUrl}}/-/admin/config">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="key" value="theme.api_header_url">
|
||||
<div class="field">
|
||||
<input type="text" name="value" value="{{.SystemConfig.Theme.APIHeaderURL.Value ctx}}" placeholder="{{ctx.Locale.Tr "admin.config.api_header_url_placeholder"}}">
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.api_header_url_help"}}</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</form>
|
||||
</dd>
|
||||
<div class="divider"></div>
|
||||
<dt>{{ctx.Locale.Tr "admin.config.custom_home_html"}}</dt>
|
||||
<dd>
|
||||
<form class="ui form form-fetch-action" method="post" action="{{AppSubUrl}}/-/admin/config">
|
||||
{{.CsrfTokenHtml}}
|
||||
<input type="hidden" name="key" value="theme.custom_home_html">
|
||||
<div class="field">
|
||||
<textarea id="custom-home-html-editor" name="value" rows="15" placeholder="{{ctx.Locale.Tr "admin.config.custom_home_html_placeholder"}}" style="font-family: var(--fonts-monospace); font-size: 13px;">{{.SystemConfig.Theme.CustomHomeHTML.Value ctx}}</textarea>
|
||||
</div>
|
||||
<div class="help">{{ctx.Locale.Tr "admin.config.custom_home_html_help"}}</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</form>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -1,7 +1,8 @@
|
||||
<footer class="page-footer" role="group" aria-label="{{ctx.Locale.Tr "aria.footer"}}">
|
||||
<div class="left-links" role="contentinfo" aria-label="{{ctx.Locale.Tr "aria.footer.software"}}">
|
||||
{{if ShowFooterPoweredBy}}
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://about.gitea.com">{{ctx.Locale.Tr "powered_by" "Gitea"}}</a>
|
||||
<span>{{ctx.Locale.Tr "powered_by" "GitCaddy Server"}}</span>
|
||||
<span class="tw-text-secondary tw-text-12">{{ctx.Locale.Tr "based_on"}} <a target="_blank" rel="noopener noreferrer" href="https://about.gitea.com">Gitea</a></span>
|
||||
{{end}}
|
||||
{{if (or .ShowFooterVersion .PageIsAdmin)}}
|
||||
{{ctx.Locale.Tr "version"}}:
|
||||
|
||||
@@ -16,8 +16,12 @@
|
||||
<link rel="alternate" type="application/atom+xml" title="" href="{{.FeedURL}}.atom">
|
||||
<link rel="alternate" type="application/rss+xml" title="" href="{{.FeedURL}}.rss">
|
||||
{{end}}
|
||||
<link rel="icon" href="{{AssetUrlPrefix}}/img/favicon.svg" type="image/svg+xml">
|
||||
{{if .SystemConfig.Theme.CustomSiteIconURL.Value ctx}}
|
||||
<link rel="icon" href="{{.SystemConfig.Theme.CustomSiteIconURL.Value ctx}}">
|
||||
{{else}}
|
||||
<link rel="icon" href="{{AssetUrlPrefix}}/img/gitcaddy-icon.svg" type="image/svg+xml">
|
||||
<link rel="alternate icon" href="{{AssetUrlPrefix}}/img/favicon.png" type="image/png">
|
||||
{{end}}
|
||||
{{template "base/head_opengraph" .}}
|
||||
{{template "base/head_style" .}}
|
||||
{{template "base/head_script" .}}
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
<div class="navbar-left">
|
||||
<!-- the logo -->
|
||||
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home_title"}}{{end}}">
|
||||
{{if .SystemConfig.Theme.CustomSiteIconURL.Value ctx}}
|
||||
<img width="30" height="30" src="{{.SystemConfig.Theme.CustomSiteIconURL.Value ctx}}" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
|
||||
{{else}}
|
||||
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
|
||||
{{end}}
|
||||
</a>
|
||||
|
||||
<!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column -->
|
||||
@@ -27,11 +31,17 @@
|
||||
{{end}}
|
||||
{{end}}
|
||||
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore_title"}}</a>
|
||||
{{if .SystemConfig.Theme.APIHeaderURL.Value ctx}}
|
||||
<a class="item" href="{{.SystemConfig.Theme.APIHeaderURL.Value ctx}}">{{ctx.Locale.Tr "api"}}</a>
|
||||
{{end}}
|
||||
{{else if .IsLandingPageOrganizations}}
|
||||
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{ctx.Locale.Tr "explore_title"}}</a>
|
||||
{{else}}
|
||||
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{ctx.Locale.Tr "explore_title"}}</a>
|
||||
{{end}}
|
||||
{{if .SystemConfig.Theme.APIHeaderURL.Value ctx}}
|
||||
<a class="item" href="{{.SystemConfig.Theme.APIHeaderURL.Value ctx}}">{{ctx.Locale.Tr "api"}}</a>
|
||||
{{end}}
|
||||
|
||||
{{template "custom/extra_links" .}}
|
||||
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
{{if and .PageIsExploreOrganizations (eq (.SystemConfig.Theme.ExploreOrgDisplayFormat.Value ctx) "tiles")}}
|
||||
{{/* Tile Cards View for Organizations */}}
|
||||
<div class="ui four doubling stackable cards">
|
||||
{{range .Users}}
|
||||
<a class="ui card" href="{{.HomeLink}}">
|
||||
<div class="content tw-text-center">
|
||||
<div class="tw-mb-3">
|
||||
{{ctx.AvatarUtils.Avatar . 64 "tw-rounded"}}
|
||||
</div>
|
||||
<div class="header">{{.DisplayName}}</div>
|
||||
{{if .Description}}
|
||||
<div class="meta tw-mt-2">{{.Description}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</a>
|
||||
{{else}}
|
||||
<div class="ui card">
|
||||
<div class="content">
|
||||
{{ctx.Locale.Tr "search.no_results"}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{/* Default List View */}}
|
||||
<div class="flex-list">
|
||||
{{range .Users}}
|
||||
<div class="flex-item tw-items-center">
|
||||
@@ -6,7 +31,7 @@
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title">
|
||||
{{template "shared/user/name" .}}
|
||||
{{if $.PageIsExploreOrganizations}}<a class="text muted" href="{{.HomeLink}}">{{.DisplayName}}</a>{{else}}<a class="text muted" href="{{.HomeLink}}">{{.Name}}</a>{{end}}
|
||||
{{if .Visibility.IsPrivate}}
|
||||
<span class="ui basic tiny label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
|
||||
{{end}}
|
||||
@@ -31,3 +56,4 @@
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
@@ -1,16 +1,77 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home_title"}}{{end}}" class="page-content home">
|
||||
{{if .SystemConfig.Theme.CustomHomeHTML.Value ctx}}
|
||||
{{/* Custom homepage content */}}
|
||||
{{.SystemConfig.Theme.CustomHomeHTML.Value ctx | SafeHTML}}
|
||||
{{else}}
|
||||
{{/* Default homepage content */}}
|
||||
<div class="tw-mb-8 tw-px-8">
|
||||
<div class="center">
|
||||
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
|
||||
{{if .SystemConfig.Theme.CustomHomeLogoURL.Value ctx}}
|
||||
<img class="logo" width="220" height="220" src="{{.SystemConfig.Theme.CustomHomeLogoURL.Value ctx}}" alt="{{ctx.Locale.Tr "logo"}}">
|
||||
{{else}}
|
||||
<img class="logo" width="220" height="220" src="{{AssetUrlPrefix}}/img/gitcaddy-logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
|
||||
{{end}}
|
||||
<div class="hero">
|
||||
<h1 class="ui icon header title tw-text-balance">
|
||||
{{AppName}}
|
||||
{{if .SystemConfig.Theme.CustomHomeTitle.Value ctx}}
|
||||
{{.SystemConfig.Theme.CustomHomeTitle.Value ctx}}
|
||||
{{else}}
|
||||
{{AppName}}
|
||||
{{end}}
|
||||
</h1>
|
||||
<h2 class="tw-text-balance">{{ctx.Locale.Tr "startpage.app_desc"}}</h2>
|
||||
<h2 class="tw-text-balance">
|
||||
{{if .SystemConfig.Theme.CustomHomeTagline.Value ctx}}
|
||||
{{.SystemConfig.Theme.CustomHomeTagline.Value ctx}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "startpage.app_desc"}}
|
||||
{{end}}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{if .PinnedOrganizations}}
|
||||
<div class="ui container tw-my-8">
|
||||
{{if eq (.SystemConfig.Theme.PinnedOrgDisplayFormat.Value ctx) "regular"}}
|
||||
{{/* Regular format: icon above, title below, description below that */}}
|
||||
<div class="ui four doubling stackable cards">
|
||||
{{range .PinnedOrganizations}}
|
||||
<a class="ui card" href="{{.HomeLink}}">
|
||||
<div class="content tw-text-center">
|
||||
<div class="tw-mb-3">
|
||||
{{ctx.AvatarUtils.Avatar . 64 "tw-rounded"}}
|
||||
</div>
|
||||
<div class="header">{{.DisplayName}}</div>
|
||||
{{if .Description}}
|
||||
<div class="meta tw-mt-2">{{.Description}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{/* Condensed format (default): icon on left, title/description on right */}}
|
||||
<div class="ui four doubling stackable cards">
|
||||
{{range .PinnedOrganizations}}
|
||||
<a class="ui card" href="{{.HomeLink}}">
|
||||
<div class="content">
|
||||
<div class="tw-flex tw-items-center tw-gap-3">
|
||||
{{ctx.AvatarUtils.Avatar . 48 "tw-rounded"}}
|
||||
<div class="tw-flex-1 tw-overflow-hidden">
|
||||
<div class="header tw-truncate">{{.DisplayName}}</div>
|
||||
{{if .Description}}
|
||||
<div class="meta tw-truncate">{{.Description}}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{/* Only show promotional text when there are no pinned organizations */}}
|
||||
<div class="ui stackable middle very relaxed page grid">
|
||||
<div class="eight wide center column">
|
||||
<h1 class="hero ui icon header">
|
||||
@@ -47,5 +108,7 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
{{if .Repo.IsPrivate}}{{svg "octicon-lock" 48}}{{else if .Repo.IsFork}}{{svg "octicon-repo-forked" 48}}{{else if .Repo.IsMirror}}{{svg "octicon-mirror" 48}}{{else}}{{svg "octicon-repo" 48}}{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="header tw-mt-2">{{.Repo.Name}}</div>
|
||||
<div class="header tw-mt-2">{{if .Repo.DisplayTitle}}{{.Repo.DisplayTitle}}{{else}}{{.Repo.Name}}{{end}}</div>
|
||||
{{if .Repo.Description}}
|
||||
<div class="description text grey tw-text-sm tw-mt-1">{{.Repo.Description}}</div>
|
||||
{{end}}
|
||||
@@ -83,7 +83,7 @@
|
||||
{{if .Repo.IsPrivate}}{{svg "octicon-lock" 48}}{{else if .Repo.IsFork}}{{svg "octicon-repo-forked" 48}}{{else if .Repo.IsMirror}}{{svg "octicon-mirror" 48}}{{else}}{{svg "octicon-repo" 48}}{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="header tw-mt-2">{{.Repo.Name}}</div>
|
||||
<div class="header tw-mt-2">{{if .Repo.DisplayTitle}}{{.Repo.DisplayTitle}}{{else}}{{.Repo.Name}}{{end}}</div>
|
||||
{{if .Repo.Description}}
|
||||
<div class="description text grey tw-text-sm tw-mt-1">{{.Repo.Description}}</div>
|
||||
{{end}}
|
||||
@@ -172,7 +172,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="tw-flex-1 tw-min-w-0">
|
||||
<a href="{{.Repo.Link}}" class="tw-font-semibold">{{.Repo.Name}}</a>
|
||||
<a href="{{.Repo.Link}}" class="tw-font-semibold">{{if .Repo.DisplayTitle}}{{.Repo.DisplayTitle}}{{else}}{{.Repo.Name}}{{end}}</a>
|
||||
{{if .CommitMessage}}
|
||||
<p class="text grey tw-text-sm tw-truncate tw-mb-0">{{.CommitMessage}}</p>
|
||||
{{end}}
|
||||
|
||||
@@ -46,6 +46,17 @@
|
||||
<input id="max_repo_creation" name="max_repo_creation" type="number" min="-1" value="{{.Org.MaxRepoCreation}}">
|
||||
<p class="help">{{ctx.Locale.Tr "admin.users.max_repo_creation_desc"}}</p>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "org.settings.homepage_pinning"}}</label>
|
||||
<div class="field">
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="is_homepage_pinned" {{if .IsHomepagePinned}}checked{{end}}>
|
||||
<label>{{ctx.Locale.Tr "org.settings.pin_to_homepage"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<p class="help">{{ctx.Locale.Tr "org.settings.pin_to_homepage_help"}}</p>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="field">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
<div class="flex-item-main">
|
||||
<div class="flex-item-title tw-text-18">
|
||||
<a class="muted tw-font-normal" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/<a class="muted" href="{{$.RepoLink}}">{{.Name}}</a>
|
||||
<a class="muted tw-font-normal" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/<a class="muted" href="{{$.RepoLink}}">{{if .DisplayTitle}}{{.DisplayTitle}}{{else}}{{.Name}}{{end}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
|
||||
@@ -50,7 +50,11 @@
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
{{if .DetectedRepoLicenses}}
|
||||
{{if .Repository.LicenseType}}
|
||||
<a class="flex-text-block muted" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/LICENSE.md" title="{{.Repository.LicenseType}}">
|
||||
{{svg "octicon-law"}} {{.Repository.LicenseType}}
|
||||
</a>
|
||||
{{else if .DetectedRepoLicenses}}
|
||||
<a class="flex-text-block muted" href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/{{PathEscapeSegments .LicenseFileName}}" title="{{StringUtils.Join .DetectedRepoLicenses ", "}}">
|
||||
{{svg "octicon-law"}} {{if eq (len .DetectedRepoLicenses) 1}}{{index .DetectedRepoLicenses 0}}{{else}}{{ctx.Locale.Tr "repo.multiple_licenses"}}{{end}}
|
||||
</a>
|
||||
|
||||
36
templates/repo/settings/license.tmpl
Normal file
36
templates/repo/settings/license.tmpl
Normal file
@@ -0,0 +1,36 @@
|
||||
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings license")}}
|
||||
<div class="repo-setting-content">
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "repo.settings.license"}}
|
||||
</h4>
|
||||
<div class="ui attached segment">
|
||||
<form class="ui form" action="{{.Link}}" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "repo.settings.license_type"}}</label>
|
||||
<select name="license_type" class="ui dropdown">
|
||||
<option value="">{{ctx.Locale.Tr "repo.settings.license_none"}}</option>
|
||||
{{range .LicenseTypes}}
|
||||
<optgroup label="{{.Category}}">
|
||||
{{range .Licenses}}
|
||||
<option value="{{.Key}}" {{if eq $.Repository.LicenseType .Key}}selected{{end}} title="{{.Description}}">{{.Name}}</option>
|
||||
{{end}}
|
||||
</optgroup>
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
{{if .Repository.LicenseType}}
|
||||
<div class="field">
|
||||
<label>{{ctx.Locale.Tr "repo.settings.current_license"}}</label>
|
||||
<p><strong>{{.Repository.LicenseType}}</strong></p>
|
||||
<p class="help">
|
||||
<a href="{{.RepoLink}}/src/{{.Repository.DefaultBranch}}/LICENSE.md">{{ctx.Locale.Tr "repo.settings.view_license_file"}}</a>
|
||||
</p>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="help tw-mb-4">{{ctx.Locale.Tr "repo.settings.license_help"}}</div>
|
||||
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{{template "repo/settings/layout_footer" .}}
|
||||
@@ -4,6 +4,9 @@
|
||||
<a class="{{if .PageIsSettingsOptions}}active {{end}}item" href="{{.RepoLink}}/settings">
|
||||
{{ctx.Locale.Tr "repo.settings.options"}}
|
||||
</a>
|
||||
<a class="{{if .PageIsSettingsLicense}}active {{end}}item" href="{{.RepoLink}}/settings/license">
|
||||
{{ctx.Locale.Tr "repo.settings.license"}}
|
||||
</a>
|
||||
{{if or .Repository.IsPrivate .Permission.HasAnyUnitPublicAccess}}
|
||||
<a class="{{if .PageIsSettingsPublicAccess}}active {{end}}item" href="{{.RepoLink}}/settings/public_access">
|
||||
{{ctx.Locale.Tr "repo.settings.public_access"}}
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
<label for="description">{{ctx.Locale.Tr "repo.repo_desc"}}</label>
|
||||
<textarea id="description" name="description" rows="2" maxlength="2048">{{.Repository.Description}}</textarea>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="display_title">{{ctx.Locale.Tr "repo.settings.display_title"}}</label>
|
||||
<input id="display_title" name="display_title" type="text" maxlength="255" value="{{.Repository.DisplayTitle}}" placeholder="{{ctx.Locale.Tr "repo.settings.display_title_placeholder"}}">
|
||||
<p class="help">{{ctx.Locale.Tr "repo.settings.display_title_help"}}</p>
|
||||
</div>
|
||||
<div class="field {{if .Err_Website}}error{{end}}">
|
||||
<label for="website">{{ctx.Locale.Tr "repo.settings.site"}}</label>
|
||||
<input id="website" name="website" type="url" maxlength="1024" value="{{.Repository.Website}}">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="username">{{ctx.Locale.Tr "repo.settings.discord_username"}}</label>
|
||||
<input id="username" name="username" value="{{.DiscordHook.Username}}" placeholder="Gitea">
|
||||
<input id="username" name="username" value="{{.DiscordHook.Username}}" placeholder="GitCaddy">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="icon_url">{{ctx.Locale.Tr "repo.settings.discord_icon_url"}}</label>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<form class="ui form" action="{{.BaseLink}}/packagist/{{or .Webhook.ID "new"}}" method="post">
|
||||
<div class="required field {{if .Err_Username}}error{{end}}">
|
||||
<label for="username">{{ctx.Locale.Tr "repo.settings.packagist_username"}}</label>
|
||||
<input id="username" name="username" value="{{.PackagistHook.Username}}" placeholder="Gitea" autofocus required>
|
||||
<input id="username" name="username" value="{{.PackagistHook.Username}}" placeholder="GitCaddy" autofocus required>
|
||||
</div>
|
||||
<div class="required field {{if .Err_APIToken}}error{{end}}">
|
||||
<label for="api_token">{{ctx.Locale.Tr "repo.settings.packagist_api_token"}}</label>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<div class="field">
|
||||
<label for="username">{{ctx.Locale.Tr "repo.settings.slack_username"}}</label>
|
||||
<input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="Gitea">
|
||||
<input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="GitCaddy">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="icon_url">{{ctx.Locale.Tr "repo.settings.slack_icon_url"}}</label>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
{{if and $.ShowRepoOwnerOnList .Owner}}
|
||||
<a class="text primary name" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/
|
||||
{{end}}
|
||||
<a class="text primary name" href="{{.Link}}">{{.Name}}</a>
|
||||
<a class="text primary name" href="{{.Link}}">{{if .DisplayTitle}}{{.DisplayTitle}}{{else}}{{.Name}}{{end}}</a>
|
||||
<span class="label-list">
|
||||
{{if .IsArchived}}
|
||||
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Gitea API</title>
|
||||
<title>GitCaddy API</title>
|
||||
<link href="{{AssetUrlPrefix}}/css/swagger.css?v={{AssetVersion}}" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
4
templates/swagger/v1_json.tmpl
generated
4
templates/swagger/v1_json.tmpl
generated
@@ -13,8 +13,8 @@
|
||||
],
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"description": "This documentation describes the Gitea API.",
|
||||
"title": "Gitea API",
|
||||
"description": "This documentation describes the GitCaddy Server API (based on Gitea).",
|
||||
"title": "GitCaddy API",
|
||||
"license": {
|
||||
"name": "MIT",
|
||||
"url": "http://opensource.org/licenses/MIT"
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
{{if and .Repo.Owner (ne .Repo.OwnerID $.ContextUser.ID)}}
|
||||
<span class="text grey">{{.Repo.Owner.Name}}/</span>
|
||||
{{end}}
|
||||
{{.Repo.Name}}
|
||||
{{if .Repo.DisplayTitle}}{{.Repo.DisplayTitle}}{{else}}{{.Repo.Name}}{{end}}
|
||||
</div>
|
||||
{{if .Repo.Description}}
|
||||
<div class="description text grey tw-text-sm tw-mt-1">{{.Repo.Description}}</div>
|
||||
|
||||
Reference in New Issue
Block a user