Enable SkipArchitectureCheck and IgnoreSignatures in mirror API

This commit is contained in:
Cal Jurgella
2024-06-12 17:58:43 -05:00
committed by André Roth
parent 57ff7c69cd
commit 4bd26f5977
2 changed files with 35 additions and 27 deletions
+1
View File
@@ -58,3 +58,4 @@ List of contributors, in chronological order:
* Ryan Gonzalez (https://github.com/refi64) * Ryan Gonzalez (https://github.com/refi64)
* Paul Cacheux (https://github.com/paulcacheux) * Paul Cacheux (https://github.com/paulcacheux)
* Nic Waller (https://github.com/sf-nwaller) * Nic Waller (https://github.com/sf-nwaller)
* iofq (https://github.com/iofq)
+34 -27
View File
@@ -52,19 +52,20 @@ func apiMirrorsList(c *gin.Context) {
func apiMirrorsCreate(c *gin.Context) { func apiMirrorsCreate(c *gin.Context) {
var err error var err error
var b struct { var b struct {
Name string `binding:"required"` Name string `binding:"required"`
ArchiveURL string `binding:"required"` ArchiveURL string `binding:"required"`
Distribution string Distribution string
Filter string Filter string
Components []string Components []string
Architectures []string Architectures []string
Keyrings []string Keyrings []string
DownloadSources bool DownloadSources bool
DownloadUdebs bool DownloadUdebs bool
DownloadInstaller bool DownloadInstaller bool
FilterWithDeps bool FilterWithDeps bool
SkipComponentCheck bool SkipComponentCheck bool
IgnoreSignatures bool SkipArchitectureCheck bool
IgnoreSignatures bool
} }
b.DownloadSources = context.Config().DownloadSourcePackages b.DownloadSources = context.Config().DownloadSourcePackages
@@ -105,6 +106,7 @@ func apiMirrorsCreate(c *gin.Context) {
repo.Filter = b.Filter repo.Filter = b.Filter
repo.FilterWithDeps = b.FilterWithDeps repo.FilterWithDeps = b.FilterWithDeps
repo.SkipComponentCheck = b.SkipComponentCheck repo.SkipComponentCheck = b.SkipComponentCheck
repo.SkipArchitectureCheck = b.SkipArchitectureCheck
repo.DownloadSources = b.DownloadSources repo.DownloadSources = b.DownloadSources
repo.DownloadUdebs = b.DownloadUdebs repo.DownloadUdebs = b.DownloadUdebs
@@ -275,20 +277,21 @@ func apiMirrorsUpdate(c *gin.Context) {
) )
var b struct { var b struct {
Name string Name string
ArchiveURL string ArchiveURL string
Filter string Filter string
Architectures []string Architectures []string
Components []string Components []string
Keyrings []string Keyrings []string
FilterWithDeps bool FilterWithDeps bool
DownloadSources bool DownloadSources bool
DownloadUdebs bool DownloadUdebs bool
SkipComponentCheck bool SkipComponentCheck bool
IgnoreChecksums bool SkipArchitectureCheck bool
IgnoreSignatures bool IgnoreChecksums bool
ForceUpdate bool IgnoreSignatures bool
SkipExistingPackages bool ForceUpdate bool
SkipExistingPackages bool
} }
collectionFactory := context.NewCollectionFactory() collectionFactory := context.NewCollectionFactory()
@@ -304,11 +307,14 @@ func apiMirrorsUpdate(c *gin.Context) {
b.DownloadUdebs = remote.DownloadUdebs b.DownloadUdebs = remote.DownloadUdebs
b.DownloadSources = remote.DownloadSources b.DownloadSources = remote.DownloadSources
b.SkipComponentCheck = remote.SkipComponentCheck b.SkipComponentCheck = remote.SkipComponentCheck
b.SkipArchitectureCheck = remote.SkipArchitectureCheck
b.FilterWithDeps = remote.FilterWithDeps b.FilterWithDeps = remote.FilterWithDeps
b.Filter = remote.Filter b.Filter = remote.Filter
b.Architectures = remote.Architectures b.Architectures = remote.Architectures
b.Components = remote.Components b.Components = remote.Components
b.IgnoreSignatures = context.Config().GpgDisableVerify
log.Info().Msgf("%s: Starting mirror update\n", b.Name) log.Info().Msgf("%s: Starting mirror update\n", b.Name)
if c.Bind(&b) != nil { if c.Bind(&b) != nil {
@@ -338,6 +344,7 @@ func apiMirrorsUpdate(c *gin.Context) {
remote.DownloadUdebs = b.DownloadUdebs remote.DownloadUdebs = b.DownloadUdebs
remote.DownloadSources = b.DownloadSources remote.DownloadSources = b.DownloadSources
remote.SkipComponentCheck = b.SkipComponentCheck remote.SkipComponentCheck = b.SkipComponentCheck
remote.SkipArchitectureCheck = b.SkipArchitectureCheck
remote.FilterWithDeps = b.FilterWithDeps remote.FilterWithDeps = b.FilterWithDeps
remote.Filter = b.Filter remote.Filter = b.Filter
remote.Architectures = b.Architectures remote.Architectures = b.Architectures