Commit Graph

221 Commits

Author SHA1 Message Date
André Roth
861260198a publish: persist multidist flag 2024-10-08 22:28:12 +02:00
André Roth
d6a156b181 Merge pull request #1162 from aptly-dev/feature/176-snapshot-pull-api
Snapshot Pull API
2024-10-03 23:07:27 +02:00
André Roth
bce54d5878 mirror api: update documentation 2024-10-03 22:39:03 +02:00
André Roth
c35cd783cf swagger: improve doc 2024-10-03 17:46:32 +02:00
André Roth
38ea720fc5 snapshot merge: use proper REST api
- this breaks the existing api, which is only available in CI builds
- improve swagger doc
2024-10-03 17:34:29 +02:00
André Roth
06b2b920da make REST api more restful 2024-10-03 14:51:45 +02:00
André Roth
0bc45c822d swagger: document /api/snapshots/pull 2024-10-03 14:25:46 +02:00
Mauro Regli
af5b04b24f Feature: Add Pull Snapshot API 2024-10-03 14:25:46 +02:00
André Roth
06cbd29d0d add storage API 2024-10-02 18:48:48 +02:00
André Roth
fb538333fa add swagger documentation 2024-10-01 01:07:09 +02:00
André Roth
1d1bd41bb8 add swagger support
- install swaggo
- add swagger config option
2024-10-01 01:07:09 +02:00
Christoph Fiehe
4195ad90bc Allow to add a new component to a published repo
This commit modifies the behavior of the publish switch method in the way, that also new components can be added to an already published repository. It is no longer necessary to drop and recreate the whole publish.

Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
2024-09-24 15:43:27 +02:00
André Roth
37a9fbe530 api: fix OOM with sync tasks
since sync API calls also use tasks internally, this lead to out of memory due to aptly never removing them.
2024-08-03 14:36:04 +02:00
André Roth
fe25414b45 api: repo copy handle package not found
and add tests for error proper handling.
2024-07-24 21:19:47 +02:00
André Roth
49184c9163 fix apiReposCopyPackage getting corrupt file name
it seems c.Params.ByName("file") should not be used
inside maybeRunTaskInBackground, as the content may be corrupted sometimes.
2024-07-24 21:19:47 +02:00
Sylvain Nieuwlandt
11401ca472 [api/copy] create system tests for new copy api endpoint 2024-07-10 16:43:03 +02:00
Valentin BRICE
66429bff45 [api/repos] Add copy API 2024-07-10 16:43:03 +02:00
Sylvain Nieuwlandt
8114786179 Declare the Copy API 2024-07-10 16:43:03 +02:00
André Roth
c1f7e5fe96 handle GpgDisableVerify and ignore-signatures consistently
and be less verbose
2024-07-03 18:08:58 +02:00
André Roth
d16110068c allow not signed mirrors without InRelease file 2024-07-03 18:08:58 +02:00
hudeng
ecc88e7a40 feat: repo and snapshots packages filter api add 'maximumVersion' query parameter support
example: `curl http://localhost:8080/api/repos/test/packages\?maximumVersion\=1`

Change-Id: Ie9ffd36146bf017bbb353737f32360f7b73d6b0a
2024-06-24 17:44:40 +02:00
André Roth
1a3cfea348 replace io/ioutil
fixes golangci-lint errors
2024-06-17 11:51:18 +02:00
André Roth
c33141d49b fix golangci-lint and compilation errors 2024-06-17 11:51:18 +02:00
Ryan Gonzalez
810df17009 Clean up temporary files when mirroring
Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-06-17 11:51:18 +02:00
Ryan Gonzalez
19255debb9 Reduce required usage of LocalPackagePool
Several sections of the code *required* a LocalPackagePool, but they
could still perform their operations with a standard PackagePool.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-06-17 11:51:18 +02:00
André Roth
3e1485faf5 queue sync calls 2024-06-15 19:18:14 +02:00
André Roth
787f954833 mirror: do not download already downloaded packages
this change imports downloaded packages into the pool immediately after download.
in case mirroring is aborted and later resumed, already downloaded packages will not be downloaded anymore.
2024-06-15 16:15:23 +02:00
André Roth
e9bdb983c8 tasks: improve log level 2024-06-15 16:15:23 +02:00
Noa Resare
b4cd86aa14 Introduce option multi-dist to the publish commands
This change makes it possible to publish multiple distributions
with packages named the same but with different content by changing
structure of the generated pool hierarchy. The option not enabled
by default as this changes the structure of the output which could
break the expectations of other tools.
2024-06-15 11:27:26 +02:00
Cal Jurgella
4bd26f5977 Enable SkipArchitectureCheck and IgnoreSignatures in mirror API 2024-06-14 14:30:29 +02:00
Ryan Gonzalez
8d09c202db Skip loading reflists when listing published repos
The output doesn't actually depend on the reflists, and loading them for
every published repo starts to take substantial time and memory.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-04-24 17:35:44 +02:00
Ryan Gonzalez
8ab8398c50 Use github.com/saracen/walker for file walk operations
In some local tests w/ a slowed down filesystem, this massively cut down
on the time to clean up a repository by ~3x, bringing a total 'publish
update' time from ~16s to ~13s.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
2024-04-24 16:46:16 +02:00
André Roth
6be4f5e8d0 gpg api: allow self signed and use default gpg version 2024-04-03 10:16:56 +02:00
André Roth
b5b0a52cbe s3 api: get publish root list 2024-04-03 10:14:01 +02:00
André Roth
72a7780054 fix golint complaints 2024-03-06 06:21:36 +01:00
André Roth
d7cc9b89d1 system tests: use repository mirrors on S3 for reproducibility
no direct internet download from apt repositories,
which over time will change or cease to exist.

also migrate to gpg2 on newer ubuntu.
2024-02-05 13:04:45 +01:00
Mauro Regli
40c242f9d1 Fix: Remove Batch from API options, set to true by default, add comments
Fixes: #1106
2023-09-14 10:34:20 +02:00
Crawax
214e9075ad Fix returncode when deleting a mirror with snapshot
When trying to delete a mirror that has snapshot and not providing the
force option, the API should not return a `500
StatusInternalServerError`.
A `403 StatusForbidden` is more appropriate when the condition is
expected by the server.
2023-08-18 14:20:23 +02:00
guoguangwu
847fd90e36 chore: unnecessary use of fmt.Sprintf 2023-07-14 11:35:08 +02:00
Markus Muellner
9c6f896666 add endpoint for listing repos while serving in api mode and add more metrics 2023-03-22 17:22:54 +01:00
Markus Muellner
0fdba29d51 make serving published repos in api mode configurable 2023-03-22 17:22:54 +01:00
Андрей Лухнов
e25ade8af3 Serve api and published repos simultaneously
refs #1017 #975
2023-03-22 17:22:54 +01:00
Mauro Regli
77e02bf7a3 Feature: Add Merge Snapshot API
Is part of Issue #176
2023-03-14 08:38:55 +01:00
Mauro Regli
dbf1ac7867 Fix: Drop Publish returned wrong status code if not found
Deleting a publish that does not exist now results in a status code 404
instead of 500.

Fixes: #1006
2023-03-07 13:46:57 +01:00
Mauro Regli
c187b0d52c Fix: Switch gin mode depending on aptly.EnableDebug
If aptly.EnableDebug is active, we use Debug, otherwise we use
gin.ReleaseMode to remove the annoying nuding messages when running the
api.

fixes: #1103
2023-03-07 13:04:12 +01:00
Markus Muellner
8e62195eb5 implement structured logging 2023-02-20 13:42:50 +01:00
Markus Muellner
ecc41f0c0f replace AbortWithError calls by custom function that sets the content type correctly 2023-01-23 10:42:57 +01:00
Samuel Bachmann
ced5ac7876 return the snapshot in apiSnapshotsCreate
In v1.4.0 it [returned the snapshot](https://github.com/aptly-dev/aptly/blob/v1.4.0/api/snapshot.go#L168), but this was removed (by accident) in v1.5.0. This adds it back.
2022-12-22 15:17:12 +01:00
Markus Muellner
2020ca9971 add ready and healthy probe endpoints 2022-12-12 13:39:07 +01:00
Markus Muellner
352f4e8772 update golangci-lint and replace deprecated calls to io/ioutil 2022-12-12 10:21:39 +01:00