diff --git a/routers/api/packages/container/manifest.go b/routers/api/packages/container/manifest.go index 6167d00f311a9..e36c6a851bf03 100644 --- a/routers/api/packages/container/manifest.go +++ b/routers/api/packages/container/manifest.go @@ -17,6 +17,7 @@ import ( user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/json" "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/modules/notification" packages_module "code.gitea.io/gitea/modules/packages" container_module "code.gitea.io/gitea/modules/packages/container" "code.gitea.io/gitea/modules/util" @@ -71,11 +72,9 @@ func processManifest(mci *manifestCreationInfo, buf *packages_module.HashedBuffe } if isImageManifestMediaType(mci.MediaType) { - d, err := processImageManifest(mci, buf) - return d, err + return processImageManifest(mci, buf) } else if isImageIndexMediaType(mci.MediaType) { - d, err := processImageManifestIndex(mci, buf) - return d, err + return processImageManifestIndex(mci, buf) } return "", errManifestInvalid } @@ -182,6 +181,10 @@ func processImageManifest(mci *manifestCreationInfo, buf *packages_module.Hashed return err } + if err := notifyPackageCreate(mci.Creator, pv); err != nil { + return err + } + manifestDigest = digest return nil @@ -271,6 +274,10 @@ func processImageManifestIndex(mci *manifestCreationInfo, buf *packages_module.H return err } + if err := notifyPackageCreate(mci.Creator, pv); err != nil { + return err + } + manifestDigest = digest return nil @@ -282,6 +289,17 @@ func processImageManifestIndex(mci *manifestCreationInfo, buf *packages_module.H return manifestDigest, nil } +func notifyPackageCreate(doer *user_model.User, pv *packages_model.PackageVersion) error { + pd, err := packages_model.GetPackageDescriptor(db.DefaultContext, pv) + if err != nil { + return err + } + + notification.NotifyPackageCreate(db.DefaultContext, doer, pd) + + return nil +} + func createPackageAndVersion(ctx context.Context, mci *manifestCreationInfo, metadata *container_module.Metadata) (*packages_model.PackageVersion, error) { created := true p := &packages_model.Package{ diff --git a/routers/web/user/home.go b/routers/web/user/home.go index 36d9d4f019f7d..4f45c1d5c3149 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -338,6 +338,11 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { filterMode int ) + // Default to recently updated, unlike repository issues list + if sortType == "" { + sortType = "recentupdate" + } + // -------------------------------------------------------------------------------- // Distinguish User from Organization. // Org: diff --git a/templates/base/head_script.tmpl b/templates/base/head_script.tmpl index 1b130d9cb49df..ca8c7e6a77341 100644 --- a/templates/base/head_script.tmpl +++ b/templates/base/head_script.tmpl @@ -46,3 +46,4 @@ If you introduce mistakes in it, Gitea JavaScript code wouldn't run correctly. {{/* in case some pages don't render the pageData, we make sure it is an object to prevent null access */}} window.config.pageData = window.config.pageData || {}; + diff --git a/templates/package/content/cargo.tmpl b/templates/package/content/cargo.tmpl index 54c40a5b0dc0a..f78647ca69c63 100644 --- a/templates/package/content/cargo.tmpl +++ b/templates/package/content/cargo.tmpl @@ -8,7 +8,7 @@ default = "gitea" [registries.gitea] -index = "{{AppUrl}}{{.PackageDescriptor.Owner.Name}}/_cargo-index.git" +index = "" [net] git-fetch-with-cli = true diff --git a/templates/package/content/chef.tmpl b/templates/package/content/chef.tmpl index f0f8de7bd5587..edc175f9beddc 100644 --- a/templates/package/content/chef.tmpl +++ b/templates/package/content/chef.tmpl @@ -4,7 +4,7 @@
-
knife[:supermarket_site] = '{{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/chef'
+
knife[:supermarket_site] = ''
diff --git a/templates/package/content/composer.tmpl b/templates/package/content/composer.tmpl index 8cc18f8ba8fb7..9acf20955c891 100644 --- a/templates/package/content/composer.tmpl +++ b/templates/package/content/composer.tmpl @@ -7,7 +7,7 @@
{
 	"repositories": [{
 			"type": "composer",
-			"url": "{{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/composer"
+			"url": ""
 		}
 	]
 }
diff --git a/templates/package/content/conan.tmpl b/templates/package/content/conan.tmpl index c496cee55cf62..138890f334c52 100644 --- a/templates/package/content/conan.tmpl +++ b/templates/package/content/conan.tmpl @@ -4,7 +4,7 @@
-
conan remote add gitea {{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/conan
+
conan remote add gitea 
diff --git a/templates/package/content/conda.tmpl b/templates/package/content/conda.tmpl index ecc26bce98e64..3c79d3902fae6 100644 --- a/templates/package/content/conda.tmpl +++ b/templates/package/content/conda.tmpl @@ -4,11 +4,11 @@
-
channel_alias: {{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/conda
+				
channel_alias: 
 channels:
-  - {{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/conda
+  - 
 default_channels:
-  - {{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/conda
+ -
diff --git a/templates/package/content/generic.tmpl b/templates/package/content/generic.tmpl index 2948d9eb02cac..eae4d670f9c6f 100644 --- a/templates/package/content/generic.tmpl +++ b/templates/package/content/generic.tmpl @@ -4,8 +4,11 @@
-
{{range .PackageDescriptor.Files}}curl {{AppUrl}}api/packages/{{$.PackageDescriptor.Owner.Name}}/generic/{{$.PackageDescriptor.Package.Name}}/{{$.PackageDescriptor.Version.Version}}/{{.File.Name}}
-{{end}}
+

+					{{- range .PackageDescriptor.Files -}}
+curl 
+ {{- end -}} +
diff --git a/templates/package/content/helm.tmpl b/templates/package/content/helm.tmpl index 59cdc157b4087..fc190e0e459bb 100644 --- a/templates/package/content/helm.tmpl +++ b/templates/package/content/helm.tmpl @@ -4,7 +4,7 @@
-
helm repo add gitea {{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/helm
+				
helm repo add gitea 
 helm repo update
diff --git a/templates/package/content/maven.tmpl b/templates/package/content/maven.tmpl index 0b5612151c577..ff89145fd0023 100644 --- a/templates/package/content/maven.tmpl +++ b/templates/package/content/maven.tmpl @@ -7,19 +7,19 @@
<repositories>
 	<repository>
 		<id>gitea</id>
-		<url>{{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/maven</url>
+			<url></url>
 	</repository>
 </repositories>
 
 <distributionManagement>
 	<repository>
 		<id>gitea</id>
-		<url>{{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/maven</url>
+		<url></url>
 	</repository>
 
 	<snapshotRepository>
 		<id>gitea</id>
-		<url>{{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/maven</url>
+		<url></url>
 	</snapshotRepository>
 </distributionManagement>
@@ -37,7 +37,7 @@
-
mvn dependency:get -DremoteRepositories={{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/maven -Dartifact={{.PackageDescriptor.Metadata.GroupID}}:{{.PackageDescriptor.Metadata.ArtifactID}}:{{.PackageDescriptor.Version.Version}}
+
mvn dependency:get -DremoteRepositories= -Dartifact={{.PackageDescriptor.Metadata.GroupID}}:{{.PackageDescriptor.Metadata.ArtifactID}}:{{.PackageDescriptor.Version.Version}}
diff --git a/templates/package/content/npm.tmpl b/templates/package/content/npm.tmpl index 33d51d4dfd87d..ea514c5263ad9 100644 --- a/templates/package/content/npm.tmpl +++ b/templates/package/content/npm.tmpl @@ -4,7 +4,7 @@
-
{{if .PackageDescriptor.Metadata.Scope}}{{.PackageDescriptor.Metadata.Scope}}:{{end}}registry={{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/npm/
+
{{if .PackageDescriptor.Metadata.Scope}}{{.PackageDescriptor.Metadata.Scope}}:{{end}}registry=
diff --git a/templates/package/content/nuget.tmpl b/templates/package/content/nuget.tmpl index 4ea41fa826a28..8ed2f04e4a55f 100644 --- a/templates/package/content/nuget.tmpl +++ b/templates/package/content/nuget.tmpl @@ -4,7 +4,7 @@
-
dotnet nuget add source --name Gitea --username your_username --password your_token {{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/nuget/index.json
+
dotnet nuget add source --name Gitea --username your_username --password your_token 
diff --git a/templates/package/content/pub.tmpl b/templates/package/content/pub.tmpl index 999e48ce82011..e81439d4daece 100644 --- a/templates/package/content/pub.tmpl +++ b/templates/package/content/pub.tmpl @@ -4,7 +4,7 @@
-
dart pub add {{.PackageDescriptor.Package.Name}}:{{.PackageDescriptor.Version.Version}} --hosted-url={{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/pub/
+
dart pub add {{.PackageDescriptor.Package.Name}}:{{.PackageDescriptor.Version.Version}} --hosted-url=
diff --git a/templates/package/content/pypi.tmpl b/templates/package/content/pypi.tmpl index 1ae243813de65..830ba9bd67e54 100644 --- a/templates/package/content/pypi.tmpl +++ b/templates/package/content/pypi.tmpl @@ -4,7 +4,7 @@
-
pip install --index-url {{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/pypi/simple {{.PackageDescriptor.Package.Name}}
+
pip install --index-url 
diff --git a/templates/package/content/rubygems.tmpl b/templates/package/content/rubygems.tmpl index 0cb7b670b1dea..d8190ba4f59df 100644 --- a/templates/package/content/rubygems.tmpl +++ b/templates/package/content/rubygems.tmpl @@ -4,11 +4,11 @@
-
gem install {{.PackageDescriptor.Package.Name}} --version "{{.PackageDescriptor.Version.Version}}" --source "{{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/rubygems"
+
gem install {{.PackageDescriptor.Package.Name}} --version "{{.PackageDescriptor.Version.Version}}" --source ""
-
source "{{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/rubygems" do
+				
source "" do
 	gem "{{.PackageDescriptor.Package.Name}}", "{{.PackageDescriptor.Version.Version}}"
 end
diff --git a/templates/package/content/vagrant.tmpl b/templates/package/content/vagrant.tmpl index 7bd686e6ab689..a6a92f5ecd8cb 100644 --- a/templates/package/content/vagrant.tmpl +++ b/templates/package/content/vagrant.tmpl @@ -4,7 +4,7 @@
-
vagrant box add --box-version {{.PackageDescriptor.Version.Version}} "{{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/vagrant/{{.PackageDescriptor.Package.Name}}"
+
vagrant box add --box-version {{.PackageDescriptor.Version.Version}} ""
diff --git a/templates/post-install.tmpl b/templates/post-install.tmpl index e098f43fda82e..0d6cd3082c185 100644 --- a/templates/post-install.tmpl +++ b/templates/post-install.tmpl @@ -13,7 +13,7 @@
diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl index 39349d6ca42f7..5a7f6e867b551 100644 --- a/templates/repo/issue/view_content/pull_merge_instruction.tmpl +++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl @@ -5,8 +5,7 @@
{{if eq $.Issue.PullRequest.Flow 0}}
git checkout -b {{if ne $.Issue.PullRequest.HeadRepo.ID $.Issue.PullRequest.BaseRepo.ID}}{{$.Issue.PullRequest.HeadRepo.OwnerName}}-{{end}}{{$.Issue.PullRequest.HeadBranch}} {{$.Issue.PullRequest.BaseBranch}}
- {{/* the only legacy HTMLURL used in template, which doesn't affect users too much and is very diffcult to fix, it should be fixed together with other AppUrl usages*/}} -
git pull {{if ne $.Issue.PullRequest.HeadRepo.ID $.Issue.PullRequest.BaseRepo.ID}}{{$.Issue.PullRequest.HeadRepo.HTMLURL}}{{else}}origin{{end}} {{$.Issue.PullRequest.HeadBranch}}
+
git pull {{if ne $.Issue.PullRequest.HeadRepo.ID $.Issue.PullRequest.BaseRepo.ID}}{{else}}origin{{end}} {{$.Issue.PullRequest.HeadBranch}}
{{else}}
git fetch origin {{$.Issue.PullRequest.GetGitRefName}}:{{$.Issue.PullRequest.HeadBranch}}
{{end}} diff --git a/templates/repo/settings/lfs_file.tmpl b/templates/repo/settings/lfs_file.tmpl index eb67de20a0187..54b40bd00400f 100644 --- a/templates/repo/settings/lfs_file.tmpl +++ b/templates/repo/settings/lfs_file.tmpl @@ -35,7 +35,7 @@ {{.locale.Tr "repo.audio_not_supported_in_browser"}} {{else if .IsPDFFile}} - + {{else}} {{.locale.Tr "repo.file_view_raw"}} {{end}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 45d098d3c54dd..ab7065015c1f2 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -52,7 +52,7 @@ {{if $entry.IsSubModule}} {{svg "octicon-file-submodule"}} - {{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}} + {{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}} {{/* FIXME: the usage of AppUrl seems incorrect, it would be fixed in the future, use AppSubUrl instead */}} {{if $refURL}} {{$entry.Name}}@{{ShortSha $subModuleFile.RefID}} {{else}} diff --git a/templates/swagger/ui.tmpl b/templates/swagger/ui.tmpl index d4d0889f9d4ab..57b560bc1591d 100644 --- a/templates/swagger/ui.tmpl +++ b/templates/swagger/ui.tmpl @@ -6,8 +6,8 @@ - {{svg "octicon-reply"}}{{.locale.Tr "return_to_gitea"}} -
+ {{svg "octicon-reply"}}{{.locale.Tr "return_to_gitea"}} +
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index 5ecae3a7b9f3f..049b6a1681456 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -89,10 +89,10 @@ {{svg "octicon-triangle-down" 14 "dropdown icon"}}