mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-02-03 20:51:07 -05:00
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Replace the anti-CSRF token with a [cross origin protection by Go](https://go.dev/doc/go1.25#nethttppkgnethttp) that uses a stateless way of verifying if a request was cross origin or not. This allows is to remove al lot of code and replace it with a few lines of code and we no longer have to hand roll this protection. The new protection uses indicators by the browser itself that indicate if the request is cross-origin, thus we no longer have to take care of ensuring the generated CSRF token is passed back to the server any request by the the browser will have send this indicator. Resolves forgejo/forgejo#3538 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9830 Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org> Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
75 lines
3 KiB
Cheetah
75 lines
3 KiB
Cheetah
{{template "base/head" .}}
|
|
<div role="main" aria-label="{{.Title}}" class="page-content repository settings options{{if .ContextUser.IsOrganization}} organization{{end}}">
|
|
{{if .ContextUser.IsOrganization}}
|
|
{{template "org/header" .}}
|
|
{{else}}
|
|
{{template "shared/user/org_profile_avatar" .}}
|
|
{{end}}
|
|
<div class="ui container">
|
|
{{if not .ContextUser.IsOrganization}}
|
|
{{template "user/overview/header" .}}
|
|
{{end}}
|
|
{{template "base/alert" .}}
|
|
<p><a href="{{.PackageDescriptor.VersionWebLink}}">{{.PackageDescriptor.Package.Name}} ({{.PackageDescriptor.Version.Version}})</a> / <strong>{{ctx.Locale.Tr "repo.settings"}}</strong></p>
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "packages.settings.link"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<p>{{ctx.Locale.Tr "packages.settings.link.description"}}</p>
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
{{template "base/disable_form_autofill"}}
|
|
<input type="hidden" name="action" value="link">
|
|
<div class="field">
|
|
<div class="ui clearable selection dropdown">
|
|
{{$repoID := 0}}
|
|
{{if .PackageDescriptor.Repository}}
|
|
{{$repoID = .PackageDescriptor.Repository.ID}}
|
|
{{end}}
|
|
<input type="hidden" name="repo_id" value="{{$repoID}}">
|
|
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
|
<div class="default text">{{ctx.Locale.Tr "packages.settings.link.select"}}</div>
|
|
<div class="menu">
|
|
{{range .Repos}}
|
|
<div class="item" data-value="{{.ID}}">{{.Name}}</div>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<button class="ui primary button">{{ctx.Locale.Tr "packages.settings.link.button"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<h4 class="ui top attached error header">
|
|
{{ctx.Locale.Tr "repo.settings.danger_zone"}}
|
|
</h4>
|
|
<div class="ui attached error danger segment">
|
|
<div class="flex-list">
|
|
<div class="flex-item">
|
|
<div class="flex-item-main">
|
|
<div class="flex-item-title">{{ctx.Locale.Tr "packages.settings.delete"}}</div>
|
|
<div class="flex-item-body">{{ctx.Locale.Tr "packages.settings.delete.description"}}</div>
|
|
</div>
|
|
<div class="flex-item-trailing">
|
|
<button class="ui basic red show-modal button" data-modal="#delete-package-modal">{{ctx.Locale.Tr "packages.settings.delete"}}</button>
|
|
</div>
|
|
<div class="ui tiny modal" id="delete-package-modal">
|
|
<div class="header">
|
|
{{ctx.Locale.Tr "packages.settings.delete"}}
|
|
</div>
|
|
<div class="content">
|
|
<div class="ui warning message tw-break-anywhere">
|
|
{{ctx.Locale.Tr "packages.settings.delete.notice" .PackageDescriptor.Package.Name .PackageDescriptor.Version.Version}}
|
|
</div>
|
|
<form class="ui form" action="{{.Link}}" method="post">
|
|
<input type="hidden" name="action" value="delete">
|
|
{{template "base/modal_actions_confirm" .}}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{template "base/footer" .}}
|