Commit Graph

114 Commits

Author SHA1 Message Date
Ximon Eighteen
4cf57ae84d govet: compose literal uses unkeyed fields 2022-01-27 09:30:14 +01:00
Ximon Eighteen
ef2541776b govet: compose literal uses unkeyed fields 2022-01-27 09:30:14 +01:00
Ximon Eighteen
5342e549cd govet: compose literal uses unkeyed fields 2022-01-27 09:30:14 +01:00
Ximon Eighteen
e2d1e9a7df govet: compose literal uses unkeyed fields 2022-01-27 09:30:14 +01:00
Lorenzo Bolla
b281819cba Make truthy function less surprising 2022-01-27 09:30:14 +01:00
Lorenzo Bolla
6826efc723 Fix pure-go unittests
So they can run on e.g. LXC containers as root, or other conceivable setups.
2022-01-27 09:30:14 +01:00
Lorenzo Bolla
8c94973cf9 Fix indentation 2022-01-27 09:30:14 +01:00
Lorenzo Bolla
ff51c46915 More informative return value for task.Process 2022-01-27 09:30:14 +01:00
Lorenzo Bolla
0914cd16af Use global async flag as fallback on per-request flag
This way, if no pre-request flag is specified, the globally configured default
is used.
2022-01-27 09:30:14 +01:00
Lorenzo Bolla
9b28d8984f Configurable background task execution 2022-01-27 09:30:14 +01:00
André Roth
209b030502 gpg: fix downloading multiple keys
each key needs to be provided as separate argument to gpg1 --recv-keys
2022-01-27 09:30:14 +01:00
Lorenzo Bolla
5a65ce6adb mirror: add more logging 2022-01-27 09:30:14 +01:00
Lorenzo Bolla
79a7cf864e mirror: interrupt goroutine when done
This should avoid deadlocking when context is destroyed.
2022-01-27 09:30:14 +01:00
Lorenzo Bolla
19f7b0fe8d mirror: increase logging for easier debugging 2022-01-27 09:30:14 +01:00
André Roth
2b7bb24c92 api gpg: show gpg command 2022-01-27 09:30:14 +01:00
Lorenzo Bolla
faf2d588b1 Use verifier from context 2022-01-27 09:30:14 +01:00
André Roth
8e02a03170 fix gpg keys 2022-01-27 09:30:14 +01:00
André Roth
d13de0464e api: allow renaming repos 2022-01-27 09:30:14 +01:00
Oliver Sauder
b4efe6a810 Add db cleanup api 2022-01-27 09:30:14 +01:00
Oliver Sauder
f09a273ad7 Add publish output progress counting remaining number of packages 2022-01-27 09:30:14 +01:00
Oliver Sauder
b0ab8f417d Added gpg api so mirror updates are fully functional from api 2022-01-27 09:30:14 +01:00
Oliver Sauder
d7ccf95499 Added mirror api based on task list 2022-01-27 09:30:14 +01:00
Oliver Sauder
6ab5e60833 Add task api and resource locking ability 2022-01-27 09:30:14 +01:00
Oliver Sauder
1e7731c317 Removed obsolete RWMutexes 2022-01-27 09:30:14 +01:00
Oliver Sauder
208a2151c1 every go routine needs to have its own collection factory
this is needed so concurrent reads and writes are possible.
2022-01-27 09:30:14 +01:00
Andrey Smirnov
77d7c3871a Consistently use transactions to update database
For any action which is multi-step (requires updating more than 1 DB
key), use transaction to make update atomic.

Also pack big chunks of updates (importing packages for importing and
mirror updates) into single transaction to improve aptly performance and
get some isolation.

Note that still layers up (Collections) provide some level of isolation,
so this is going to shine with the future PRs to remove collection
locks.

Spin-off of #459
2019-08-11 00:11:53 +03:00
Andrey Smirnov
2c91bcdc30 Bump Go versions for Travis, fix tests
Replace gometalinter with golangci-lint.

Fix system tests (wheezy is gone, replace with stretch).

Fix linter warnings.
2019-07-04 00:16:12 +03:00
Oliver Sauder
f1882cfe2c Expose repo include through API 2018-06-19 15:39:09 +02:00
Andrey Smirnov
b8c5303fdb Fix paths after repository transfer to aptly-dev 2018-04-18 21:19:43 +03:00
Harald Sitter
75c4d6da3b properly expose AcquireByHash through the api
- new publish calls can now enable AcquireByHash by right away (previously
  one would have had to create a new publishing endpoint and then
  explicitly switch it to AcquireByHash)
- all json marshals of PublishedRepo now contain AcquireByHash (allows
  inspecting if a given endpoint has AcquireByHash enabled already; also
  enables verification that a switch/update actually applied a
  potential AcquireByHash change
- update all tests to reflect that default state of AcquireByHash
- update creation and switch testing to explicitly toggle AcquireByHash to
  make sure state mutation works as expected
2018-01-15 17:04:05 +01:00
Andrey Smirnov
43ddcd27cb Fix race in API related to LoadComplete()
LoadComplete() modifies object, so it would cause issues if it runs
concurrently with other methods. Uprage mutex locks to write
locks when LoadComplete() is being used.
2017-12-13 12:40:06 +03:00
Andrey Smirnov
d836334767 Merge pull request #682 from tirolerstefan/remove-buildinfo
#679: added *.buildinfo file to processedFile list (will be removed)
2017-12-01 00:23:49 +03:00
Oliver Sauder
092a7ed8f3 Rename AccessByHash to AcquireByHash for consistency with other flags 2017-11-30 09:46:02 +01:00
André Roth
bb2db7e500 Support Acquire-By-Hash for index files
The added "aptly publish repo" option "-access-by-hash" publishes
the index files (Packages*, Sources*) also as hardlinked hashes.
Example:
 /dists/yakkety/main/binary-amd64/by-hash/SHA512/31833ec39acc...
The Release files indicate this with the option "Acquire-By-Hash: yes"

This is used by apt >= 1.2.0 and prevents the "Hash sum mismatch" race
condition between a server side "aptly publish repo" and "apt-get update"
on a client.
See: http://www.chiark.greenend.org.uk/~cjwatson/blog/no-more-hash-sum-mismatch-errors.html

This implementation uses symlinks in the by-hash/*/ directory for keeping
only two versions of the index files and deleting older files
automatically.

Note: this only works with aptly.FileSystemPublishedStorage

Closes: #536

Signed-off-by: André Roth <neolynx@gmail.com>
2017-11-30 09:46:02 +01:00
Stefan Felkel
8a4d866810 #679: added *.buildinfo file to processedFile list (will be removed, afterwards) 2017-11-24 14:23:26 +01:00
Andrey Smirnov
3756db2491 Upgrade gin-gonic to latest master, fix compatibility issues 2017-09-28 00:33:59 +03:00
Ludovico Cavedon
d6a3917141 Add -skip-cleanup option for publish commands.
Allow skipping unreferenced files cleanup on publish switch/update/drop
via the -skip-cleanup command line option.
Also support API SkipCleanup parameter.

Fixes #570.
2017-08-15 19:08:17 -07:00
Andrey Smirnov
0e9f966dd1 Fix up other code to support new GPG provider structure 2017-07-21 01:01:58 +03:00
Oliver Sauder
e3f1880ad4 Added support for NotAutomatic, ButAutomaticUpgrades and Origin fields 2017-07-05 15:08:02 +02:00
Andrey Smirnov
211ac0501f Rework the way database is open/re-open in aptly
Allow database to be initialized without opening, unify all the
open paths to retry on failure.

In API router make sure open requests are matched with acks in explicit
way.

This also enables re-open attempts in all the aptly commands, so it
should make running aptly CLI much easier now hopefully.

Fix up system tests for oldoldstable ;)
2017-07-05 00:17:48 +03:00
Andrey Smirnov
1be8d39105 Refactor GPG signer/verifier
Goal is to make it easier to plug in another implementation.
2017-05-23 02:54:56 +03:00
Andrey Smirnov
f84672239a Merge pull request #569 from smira/linters-4
Enable goconst & interfacer linters
2017-05-17 15:33:02 +03:00
Andrey Smirnov
470165a419 Enable goconst & interfacer linters 2017-05-17 00:53:10 +03:00
Andrey Smirnov
39d2d273dc Fix possible cause for spurious 500s
When DB fails to be open, aptly was skipping "close" phase, so that next
request considered database to be still open (while it's closed) leading
to panic.

Fixes: #431
2017-05-16 00:42:59 +03:00
Andrey Smirnov
5ce6bf8718 Enable vetshadow linter 2017-05-04 23:00:13 +03:00
Andrey Smirnov
10c096fbb6 Update all other pieces for the CheckumStorage and Verify 2017-04-26 23:17:04 +03:00
Andrey Smirnov
516dd7b044 Switch to gometalinter
Only small amount of required checks is enabled,
plan is to enable more linters as issues are fixed in the code.
2017-03-23 01:51:08 +03:00
Andrey Smirnov
11d828b3b1 Add govet/golint into Travis CI build
Fix current issues
2017-03-22 21:49:16 +03:00
jolo
b0ab39e07f Manually undo unintended changes 2017-01-20 02:19:44 +01:00
jola5
4bf27d1dae Merge branch 'master' into master 2017-01-19 23:07:49 +01:00