Skip to content

Commit

Permalink
Enable SkipArchitectureCheck and IgnoreSignatures in mirror API
Browse files Browse the repository at this point in the history
  • Loading branch information
Cal Jurgella authored and neolynx committed Jun 14, 2024
1 parent 57ff7c6 commit 4bd26f5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 27 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ List of contributors, in chronological order:
* Ryan Gonzalez (https://github.com/refi64)
* Paul Cacheux (https://github.com/paulcacheux)
* Nic Waller (https://github.com/sf-nwaller)
* iofq (https://github.com/iofq)
61 changes: 34 additions & 27 deletions api/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,20 @@ func apiMirrorsList(c *gin.Context) {
func apiMirrorsCreate(c *gin.Context) {
var err error
var b struct {
Name string `binding:"required"`
ArchiveURL string `binding:"required"`
Distribution string
Filter string
Components []string
Architectures []string
Keyrings []string
DownloadSources bool
DownloadUdebs bool
DownloadInstaller bool
FilterWithDeps bool
SkipComponentCheck bool
IgnoreSignatures bool
Name string `binding:"required"`
ArchiveURL string `binding:"required"`
Distribution string
Filter string
Components []string
Architectures []string
Keyrings []string
DownloadSources bool
DownloadUdebs bool
DownloadInstaller bool
FilterWithDeps bool
SkipComponentCheck bool
SkipArchitectureCheck bool
IgnoreSignatures bool
}

b.DownloadSources = context.Config().DownloadSourcePackages
Expand Down Expand Up @@ -105,6 +106,7 @@ func apiMirrorsCreate(c *gin.Context) {
repo.Filter = b.Filter
repo.FilterWithDeps = b.FilterWithDeps
repo.SkipComponentCheck = b.SkipComponentCheck
repo.SkipArchitectureCheck = b.SkipArchitectureCheck
repo.DownloadSources = b.DownloadSources
repo.DownloadUdebs = b.DownloadUdebs

Expand Down Expand Up @@ -275,20 +277,21 @@ func apiMirrorsUpdate(c *gin.Context) {
)

var b struct {
Name string
ArchiveURL string
Filter string
Architectures []string
Components []string
Keyrings []string
FilterWithDeps bool
DownloadSources bool
DownloadUdebs bool
SkipComponentCheck bool
IgnoreChecksums bool
IgnoreSignatures bool
ForceUpdate bool
SkipExistingPackages bool
Name string
ArchiveURL string
Filter string
Architectures []string
Components []string
Keyrings []string
FilterWithDeps bool
DownloadSources bool
DownloadUdebs bool
SkipComponentCheck bool
SkipArchitectureCheck bool
IgnoreChecksums bool
IgnoreSignatures bool
ForceUpdate bool
SkipExistingPackages bool
}

collectionFactory := context.NewCollectionFactory()
Expand All @@ -304,11 +307,14 @@ func apiMirrorsUpdate(c *gin.Context) {
b.DownloadUdebs = remote.DownloadUdebs
b.DownloadSources = remote.DownloadSources
b.SkipComponentCheck = remote.SkipComponentCheck
b.SkipArchitectureCheck = remote.SkipArchitectureCheck
b.FilterWithDeps = remote.FilterWithDeps
b.Filter = remote.Filter
b.Architectures = remote.Architectures
b.Components = remote.Components

b.IgnoreSignatures = context.Config().GpgDisableVerify

log.Info().Msgf("%s: Starting mirror update\n", b.Name)

if c.Bind(&b) != nil {
Expand Down Expand Up @@ -338,6 +344,7 @@ func apiMirrorsUpdate(c *gin.Context) {
remote.DownloadUdebs = b.DownloadUdebs
remote.DownloadSources = b.DownloadSources
remote.SkipComponentCheck = b.SkipComponentCheck
remote.SkipArchitectureCheck = b.SkipArchitectureCheck
remote.FilterWithDeps = b.FilterWithDeps
remote.Filter = b.Filter
remote.Architectures = b.Architectures
Expand Down

0 comments on commit 4bd26f5

Please sign in to comment.