-
-
Notifications
You must be signed in to change notification settings - Fork 377
/
Copy pathaptly.1.ronn.tmpl
581 lines (434 loc) · 19.5 KB
/
aptly.1.ronn.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
{{define "main"}}aptly(1) -- {{.Short}}
=============================================
## SYNOPSIS
Common command format:
`aptly` [<global options>...] <command> <subcommand> [<options>...] <arguments>
aptly has integrated help that matches contents of this manual page, to get help, prepend
`help` to command name:
`aptly` `help` `mirror` `create`
## DESCRIPTION
{{.Long}}
## CONFIGURATION
aptly looks for configuration file first in `~/.aptly.conf` then in `/usr/local/etc/aptly.conf` and `/etc/aptly.conf`. If no config file found (or they are not readable), a new one is created in the
home directory. If `-config=` flag is specified, aptly would use config file at specified location. Also aptly needs root directory for database, package and published repository storage. If not specified, directory defaults to `~/.aptly/`, it will be created if missing.
With aptly version 1.6.0, yaml configuration with inline documentation is
supported and recommended (see `debian/aptly.conf`).
The legacy json configuration is still supported (and also supports comments):
// vim: : filetype=json
// json configuration file with comments
// validate with: sed '/\/\//d' aptly.conf | json_pp
{
// Aptly Configuration File
////////////////////////////
// Root directory for:
// - downloaded packages (`rootDir`/pool)
// - database (`rootDir`/db)
// - published repositories (`rootDir`/public)
"rootDir": "~/.aptly",
// Number of attempts to open database if it's locked by other instance
// * -1 (no retry)
"databaseOpenAttempts": -1,
// Log Level
// * debug
// * info
// * warning
// * error
"logLevel": "info",
// Log Format
// * default (text)
// * json
"logFormat": "default",
// Default Architectures
// empty array defaults to all available architectures
"architectures": [],
// Follow contents of `Suggests:` field when processing dependencies for the package
"dependencyFollowSuggests": false,
// Follow contents of `Recommends:` field when processing dependencies for the package
"dependencyFollowRecommends": false,
// When dependency looks like `package-a | package-b`, follow both variants always
"dependencyFollowAllVariants": false,
// Follow dependency from binary package to source package
"dependencyFollowSource": false,
// Log additional details while resolving dependencies (useful for debugging)
"dependencyVerboseResolve": false,
// Specifies paramaters for short PPA url expansion
// empty defaults to output of `lsb_release` command
"ppaDistributorID": "ubuntu",
// Codename for short PPA url expansion
"ppaCodename": "",
// OBSOLETE
// in aptly up to version 1.0.0, package files were stored in internal package pool
// with MD5-dervied path, since 1.1.0 package pool layout was changed;
// if option is enabled, aptly stops checking for legacy paths;
// by default option is enabled for new aptly installations and disabled when
// upgrading from older versions
"skipLegacyPool": true,
// Aptly Server
////////////////
// Serve published repos as well as API
"serveInAPIMode": false,
// Enable metrics for Prometheus client
"enableMetricsEndpoint": false,
// Enable API documentation on /docs
"enableSwaggerEndpoint": false,
// OBSOLETE: use via url param ?_async=true
"AsyncAPI": false,
// Database
////////////
// Database backend
// Type must be one of:
// * leveldb (default)
// * etcd
"databaseBackend": {
// LevelDB
"type": "leveldb",
// Path to leveldb files
// empty dbPath defaults to `rootDir`/db
"dbPath": ""
// // etcd
// "type": "etcd",
// // URL to db server
// "url": "127.0.0.1:2379"
},
// Mirroring
/////////////
// Downloader
// * "default"
// * "grab" (more robust)
"downloader": "default",
// Number of parallel download threads to use when downloading packages
"downloadConcurrency": 4,
// Limit in kbytes/sec on download speed while mirroring remote repositories
"downloadSpeedLimit": 0,
// Number of retries for download attempts
"downloadRetries": 0,
// Download source packages per default
"downloadSourcePackages": false,
// Signing
///////////
// GPG Provider
// * "internal" (Go internal implementation)
// * "gpg" (External `gpg` utility)
"gpgProvider": "gpg",
// Disable signing of published repositories
"gpgDisableSign": false,
// Disable signature verification of remote repositories
"gpgDisableVerify": false,
// Publishing
//////////////
// Do not publish Contents files
"skipContentsPublishing": false,
// Do not create bz2 files
"skipBz2Publishing": false,
// Storage
///////////
// Filesystem publishing endpoints
//
// aptly defaults to publish to a single publish directory under `rootDir`/public. For
// a more advanced publishing strategy, you can define one or more filesystem endpoints in the
// `FileSystemPublishEndpoints` list of the aptly configuration file. Each endpoint has a name
// and the following associated settings.
//
// In order to publish to such an endpoint, specify the endpoint as `filesystem:endpoint-name`
// with `endpoint-name` as the name given in the aptly configuration file. For example:
//
// `aptly publish snapshot wheezy-main filesystem:test1:wheezy/daily`
//
"FileSystemPublishEndpoints": {
// // Endpoint Name
// "test1": {
// // Directory for publishing
// "rootDir": "/opt/srv/aptly_public",
// // File Link Method for linking files from the internal pool to the published directory
// // * hardlink
// // * symlink
// // * copy
// "linkMethod": "hardlink",
// // File Copare Method for comparing existing links from the internal pool to the published directory
// // Only used when "linkMethod" is set to "copy"
// // * md5 (default: compare md5 sum)
// // * size (compare file size)
// "verifyMethod": "md5"
// }
},
// S3 Endpoint Support
//
// cloud storage). First, publishing
// endpoints should be described in aptly configuration file. Each endpoint has name
// and associated settings.
//
// In order to publish to S3, specify endpoint as `s3:endpoint-name:` before
// publishing prefix on the command line, e.g.:
//
// `aptly publish snapshot wheezy-main s3:test:`
//
"S3PublishEndpoints": {
// // Endpoint Name
// "test": {
// // Amazon region for S3 bucket
// "region": "us-east-1",
// // Bucket name
// "bucket": "test-bucket",
// // Endpoint (optional)
// // When using S3-compatible cloud storage, specify hostname of service endpoint here,
// // region is ignored if endpoint is set (set region to some human-readable name)
// // (should be left blank for real Amazon S3)
// "endpoint": "",
// // Prefix (optional)
// // publishing under specified prefix in the bucket, defaults to
// // no prefix (bucket root)
// "prefix": "",
// // Default ACLs (optional)
// // assign ACL to published files (one of the canned ACLs in Amazon
// // terminology). Useful values: `private` (default), `public-read` (public
// // repository) or `none` (don't set ACL). Public repositories could be consumed by `apt` using
// // HTTP endpoint (Amazon bucket should be configured for "website hosting"),
// // for private repositories special apt S3 transport is required.
// "acl": "private",
// // Credentials (optional)
// // Amazon credentials to access S3 bucket. If not supplied,
// // environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
// // are used.
// "awsAccessKeyID": "",
// "awsSecretAccessKey": "",
// // Storage Class (optional)
// // Amazon S3 storage class, defaults to `STANDARD`. Other values
// // available: `REDUCED_REDUNDANCY` (lower price, lower redundancy)
// "storageClass": "STANDARD",
// // Encryption Method (optional)
// // Server-side encryption method, defaults to none. Currently
// // the only available encryption method is `AES256`
// "encryptionMethod": "none",
// // Plus Workaround (optional)
// // Workaround misbehavior in apt and Amazon S3 for files with `+` in filename by
// // creating two copies of package files with `+` in filename: one original
// // and another one with spaces instead of plus signs
// // With `plusWorkaround` enabled, package files with plus sign
// // would be stored twice. aptly might not cleanup files with spaces when published
// // repository is dropped or updated (switched) to new version of repository (snapshot)
// "plusWorkaround": false,
// // Disable MultiDel (optional)
// // For S3-compatible cloud storages which do not support `MultiDel` S3 API,
// // enable this setting (file deletion would be slower with this setting enabled)
// "disableMultiDel": false,
// // ForceSig2 (optional)
// // Disable Signature V4 support, useful with non-AWS S3-compatible object stores
// // which do not support SigV4, shouldn't be enabled for AWS
// "forceSigV2": false,
// // ForceVirtualHostedStyle (optional)
// // Disable path style visit, useful with non-AWS S3-compatible object stores
// // which only support virtual hosted style
// "forceVirtualHostedStyle": false,
// // Debug (optional)
// // Enables detailed request/response dump for each S3 operation
// "debug": false
// }
},
// Swift Endpoint Support
//
// aptly could be configured to publish repository directly to OpenStack Swift. First,
// publishing endpoints should be described in aptly configuration file. Each endpoint
// has name and associated settings.
//
// In order to publish to Swift, specify endpoint as `swift:endpoint-name:` before
// publishing prefix on the command line, e.g.:
//
// `aptly publish snapshot jessie-main swift:test:`
//
"SwiftPublishEndpoints": {
// Endpoint Name
// "test": {
// // Container Name
// "container": "taylor1",
// // Prefix (optional)
// // Publish under specified prefix in the container, defaults to no prefix (container root)
// "prefix": "",
// // Credentials (optional)
// // OpenStack credentials to access Keystone. If not supplied, environment variables `OS_USERNAME` and `OS_PASSWORD` are used
// "osname": "",
// "password": "",
// // Tenant (optional)
// // OpenStack tenant name and id (in order to use v2 authentication)
// "tenant": "",
// "tenantid": "",
// // Auth URL (optional)
// // Full url of Keystone server (including port, and version).
// // Example `http://identity.example.com:5000/v2.0`
// "authurl": ""
// }
},
// Azure Endpoint Support
//
// aptly can be configured to publish repositories directly to Microsoft Azure Blob
// Storage. First, publishing endpoints should be described in the aptly
// configuration file. Each endpoint has its name and associated settings.
"AzurePublishEndpoints": {
// // Endpoint Name
// "test": {
// // Container Name
// "container": "container1",
// // Prefix (optional)
// // Publishing under specified prefix in the container, defaults to no prefix (container root)
// "prefix": "",
// // Credentials
// // Azure storage account access key to access blob storage
// "accountName": "",
// "accountKey": "",
// // Endpoint URL
// // See: Azure documentation https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string
// // defaults to "https://<accountName>.blob.core.windows.net"
// "endpoint": ""
// }
},
// Package Pool
// Location for storing downloaded packages
// Type must be one of:
// * local
// * azure
"packagePoolStorage": {
// Local Pool
"type": "local",
// Local Pool Path
// empty path defaults to `rootDir`/pool
"path": ""
// // Azure Azure Blob Storage Pool
// "type": "azure",
// "container": "pool1",
// // Prefix (optional)
// // Publishing under specified prefix in the container, defaults to no prefix (container root)
// "prefix": "",
// // Credentials
// // Azure storage account access key to access blob storage
// "accountName": "",
// "accountKey": "",
// // Endpoint URL
// // See: Azure documentation https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string
// // defaults to "https://<accountName>.blob.core.windows.net"
// "endpoint": ""
}
// End of config
}
## PACKAGE QUERY
Some commands accept package queries to identify list of packages to process.
Package query syntax almost matches `reprepro` query language. Query consists of
the following simple terms:
* direct package reference:
reference to exaclty one package. Format is identical to the way aptly lists packages in
show commands with `-with-packages` flag: `name_version_arch`,
e.g.: `libmysqlclient18_5.5.35-rel33.0-611.squeeze_amd64`
* dependency condition:
syntax follows Debian dependency specification: package_name followed by optional version specification
and architecture limit, e.g: `mysql-client (>= 3.6)`.
* query against package fields:
syntax is the same as for dependency conditions, but instead of package name field name is used, e.g:
`Priority (optional)`.
Supported fields:
* all field names from Debian package control files are supported except for `Filename`, `MD5sum`,
`SHA1`, `SHA256`, `Size`, `Files`, `Checksums-SHA1`, `Checksums-SHA256`.
* `$Source` is a name of source package (for binary packages)
* `$SourceVersion` is a version of source package
* `$Architecture` is `Architecture` for binary packages and `source` for source packages,
when matching with equal (`=`) operator, package with `any` architecture matches all architectures
but `source`.
* `$Version` has the same value as `Version`, but comparison operators use Debian
version precedence rules
* `$PackageType` is `deb` for binary packages and `source` for source packages
Operators:
* `=`:
strict match, default operator is no operator is given
* `>=`, `<=`, `=`, `>>` (strictly greater), `<<` (strictly less):
lexicographical comparison for all fields and special rules when comparing package versions
* `%`:
pattern matching, like shell patterns, supported special symbols are: `[^]?*`, e.g.:
`$Version (% 3.5-*)`
* `~`:
regular expression matching, e.g.:
`Name (~ .*-dev)`
Simple terms could be combined into more complex queries using operators `,` (and), `|` (or) and
`!` (not), parentheses `()` are used to change operator precedence. Match value could be
enclosed in single (`'`) or double (`"`) quotes if required to resolve ambiguity, quotes
inside quoted string should escaped with slash (`\`).
Examples:
* `mysql-client`:
matches package mysql-client of any version and architecture (including source), also
matches packages that `Provide:` `mysql-client`.
* `mysql-client (>= 3.6)`:
matches package mysql-client with version greater or equal to 3.6. Valid operators for
version are: `>=`, `<=`, `=`, `>>` (strictly greater), `<<` (strictly less).
* `mysql-client {i386}`:
matches package `mysql-client` on architecture `i386`, architecture `all` matches all architectures but source.
* `mysql-client (>= 3.6) {i386}`:
version and architecture conditions combined.
* `libmysqlclient18_5.5.35-rel33.0-611.squeeze_amd64`:
direct package reference.
* `$Source (nginx)`:
all binary packages with `nginx` as source package.
* `!Name (~ .*-dev), mail-transport, $Version (>= 3.5)`:
matches all packages that provide `mail-transport` with name that has no suffix `-dev` and
with version greater or equal to `3.5`.
When specified on command line, query may have to be quoted according to shell rules, so that it stays single argument:
`aptly repo import percona stable 'mysql-client (>= 3.6)'`
## PACKAGE DISPLAY FORMAT
Some aptly commands (`aptly mirror search`, `aptly package search`, ...) support `-format` flag
which allows to customize how search results are printed. Golang templates are used to specify
display format, with all package stanza fields available to template. In addition to package stanza
fields aptly provides:
* `Key`:
internal aptly package ID, unique for all packages in aptly
(combination of `ShortKey` and `FilesHash`).
* `FilesHash`:
hash that includes MD5 of all packages files.
* `ShortKey`:
package ID, which is unique in single list (mirror, repo, snapshot, ...), but not unique
in whole aptly package collection.
For example, default aptly display format could be presented with the following template:
`{{"{{"}}.Package{{"}}"}}_{{"{{"}}.Version{{"}}"}}_{{"{{"}}.Architecture{{"}}"}}`. To display package name with dependencies:
`{{"{{"}}.Package{{"}}"}} | {{"{{"}}.Depends{{"}}"}}`. More information on Golang template syntax: http://godoc.org/text/template
## GLOBAL OPTIONS
{{template "options" .}}
{{template "command" findCommand . "mirror"}}
{{template "command" findCommand . "repo"}}
{{template "command" findCommand . "snapshot"}}
{{template "command" findCommand . "publish"}}
{{template "command" findCommand . "package"}}
{{template "command" findCommand . "db"}}
{{template "command" findCommand . "serve"}}
{{template "command" findCommand . "api"}}
{{template "command" findCommand . "graph"}}
{{template "command" findCommand . "config"}}
{{template "command" findCommand . "task"}}
{{template "command" findCommand . "config"}}
## ENVIRONMENT
If environment variable `HTTP_PROXY` is set `aptly` would use its value
to proxy all HTTP requests.
## RETURN VALUES
`aptly` exists with:
* 0:
success
* 1:
general failure
* 2:
command parse failure
## AUTHORS
{{authors}}
{{end}}
{{/* command list */}}
{{define "command"}}
{{if .Runnable}}
## {{toUpper .Short}}
{{capitalize .Parent.FullSpacedName}} {{capitalize .UsageLine}}
{{.Long}}
{{if allFlags .Flag | len}}
Options:
{{template "options" .}}
{{end}}
{{end}}
{{range .Subcommands}}{{template "command" .}}{{end}}
{{end}}
{{/* options layout */}}
{{define "options"}}
{{range allFlags .Flag}}
* -`{{.Name}}`{{if ne .DefValue "false"}}={{.DefValue}}{{end}}:
{{.Usage}}
{{end}}
{{end}}