Compare commits

..

4 Commits

Author SHA1 Message Date
André Roth cd81790334 swagger: fix validation error 2026-07-01 16:09:56 +02:00
André Roth f59b0d2b06 go: 1.26 2026-07-01 10:40:38 +02:00
André Roth aa42fc1025 Merge pull request #1598 from C0deSentin3l/master
Dont lock the go version to the .0 release
2026-06-29 16:58:46 +02:00
C0deSentin3l 080da87b4e Dont lock the go version to the .0 release
the .0 release of go 1.25 is not the latest version of that release so missing out on security fixes etc
2026-06-29 12:06:48 +01:00
5 changed files with 5 additions and 78 deletions
+1 -1
View File
@@ -141,7 +141,7 @@ func apiGPGAddKey(c *gin.Context) {
// @Description Returns all public keys currently installed in the aptly GPG keyring.
// @Description
// @Tags Mirrors
// @Param keyring query string false "Keyring file to list keys from (default: trustedkeys.gpg)" example(trustedkeys.gpg)
// @Param keyring query string false "Keyring file to list keys from (default: trustedkeys.gpg)"
// @Produce json
// @Success 200 {object} gpgKeyListResponse "OK"
// @Failure 400 {object} Error "Bad Request"
-1
View File
@@ -597,7 +597,6 @@ func apiMirrorsUpdate(c *gin.Context) {
if err == nil {
return &task.ProcessReturnValue{Code: http.StatusConflict, Value: nil}, fmt.Errorf("unable to rename: mirror %s already exists", b.Name)
}
remote.Name = b.Name
}
downloader := context.NewDownloader(out)
+1 -1
View File
@@ -1,6 +1,6 @@
module github.com/aptly-dev/aptly
go 1.25.0
go 1.26
require (
github.com/AlekSi/pointer v1.1.0
+3 -3
View File
@@ -2,7 +2,7 @@ FROM debian:trixie-slim
RUN echo 'deb http://deb.debian.org/debian trixie-backports main' > /etc/apt/sources.list.d/backports.list && \
apt-get update -y && apt-get install -y --no-install-recommends curl gnupg bzip2 xz-utils ca-certificates vim procps \
golang-1.25 golang-1.25-go golang-1.25-src \
golang-1.26 golang-1.26-go golang-1.26-src \
make git python3 python3-requests-unixsocket python3-termcolor python3-swiftclient python3-boto3 python3-azure-storage \
g++ python3-etcd3 python3-plyvel graphviz devscripts sudo dh-golang binutils-i686-linux-gnu binutils-aarch64-linux-gnu \
binutils-arm-linux-gnueabihf bash-completion zip ruby-dev lintian npm \
@@ -10,8 +10,8 @@ RUN echo 'deb http://deb.debian.org/debian trixie-backports main' > /etc/apt/sou
gcc-i686-linux-gnu gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu \
faketime dput-ng && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
ln -sf /usr/lib/go-1.25/bin/go /usr/local/bin/go && \
ln -sf /usr/lib/go-1.25/bin/gofmt /usr/local/bin/gofmt
ln -sf /usr/lib/go-1.26/bin/go /usr/local/bin/go && \
ln -sf /usr/lib/go-1.26/bin/gofmt /usr/local/bin/gofmt
RUN useradd -m --shell /bin/bash --home-dir /var/lib/aptly aptly
RUN sed -i 's/#force_color_prompt=yes/force_color_prompt=yes/' /var/lib/aptly/.bashrc
-72
View File
@@ -279,78 +279,6 @@ class MirrorsAPITestEditArchiveURL(APITest):
self.check_equal(resp.json()['ArchiveRoot'], 'http://repo.aptly.info/system-tests/ftp.ch.debian.org/debian/')
class MirrorsAPITestRename(APITest):
"""
PUT /api/mirrors/:name - Rename mirror via update endpoint
"""
def check(self):
mirror_name = self.random_name()
mirror_desc = {'Name': mirror_name,
'ArchiveURL': 'http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/',
'IgnoreSignatures': True,
'Distribution': 'wheezy',
'Components': ['main'],
'Architectures': ['amd64']}
resp = self.post("/api/mirrors", json=mirror_desc)
self.check_equal(resp.status_code, 201)
# Rename the mirror via PUT
new_name = self.random_name()
resp = self.put_task("/api/mirrors/" + mirror_name, json={'Name': new_name, 'IgnoreSignatures': True})
self.check_task(resp)
# Old name should no longer exist
resp = self.get("/api/mirrors/" + mirror_name)
self.check_equal(resp.status_code, 404)
# New name should exist with correct data
resp = self.get("/api/mirrors/" + new_name)
self.check_equal(resp.status_code, 200)
self.check_subset({'Name': new_name,
'ArchiveRoot': 'http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/',
'Distribution': 'wheezy'}, resp.json())
class MirrorsAPITestRenameConflict(APITest):
"""
PUT /api/mirrors/:name - Rename mirror to an already existing name should fail with 409
"""
def check(self):
mirror_name_a = self.random_name()
mirror_name_b = self.random_name()
mirror_desc_a = {'Name': mirror_name_a,
'ArchiveURL': 'http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/',
'IgnoreSignatures': True,
'Distribution': 'wheezy',
'Components': ['main'],
'Architectures': ['amd64']}
mirror_desc_b = {'Name': mirror_name_b,
'ArchiveURL': 'http://repo.aptly.info/system-tests/packagecloud.io/varnishcache/varnish30/debian/',
'IgnoreSignatures': True,
'Distribution': 'wheezy',
'Components': ['main'],
'Architectures': ['amd64']}
resp = self.post("/api/mirrors", json=mirror_desc_a)
self.check_equal(resp.status_code, 201)
resp = self.post("/api/mirrors", json=mirror_desc_b)
self.check_equal(resp.status_code, 201)
# Try to rename mirror A to mirror B's name — should fail with 409
resp = self.put("/api/mirrors/" + mirror_name_a, json={'Name': mirror_name_b, 'IgnoreSignatures': True})
self.check_equal(resp.status_code, 409)
self.check_in('unable to rename', resp.json()['error'])
# Mirror A should still exist under its original name
resp = self.get("/api/mirrors/" + mirror_name_a)
self.check_equal(resp.status_code, 200)
self.check_subset({'Name': mirror_name_a}, resp.json())
class MirrorsAPITestEditFlatMirrorUdebs(APITest):
"""
POST /api/mirrors/{name} - Edit flat mirror with udebs (should fail)