Skip to content

Commit 523ee54

Browse files
committed
xbps/repositories/custom.md: document creating a repository
- xbps/repositories/signing.md was merged into custom.md with minor modifications - signing.md is now redirected to custom.md - incorporates @camoz's change to show using 4096-bit RSA keys for signing closes void-linux#641
1 parent 71abbd4 commit 523ee54

File tree

4 files changed

+81
-38
lines changed

4 files changed

+81
-38
lines changed

book.toml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ theme = "src/theme"
1010
[output.html.redirect]
1111
"/about-this-handbook.html" = "/about/about-this-handbook.html"
1212
"/config/man.html" = "/config/package-documentation/man.html"
13+
"/xbps/repositories/signing.html" = "/xbps/repositories/custom.html"
1314

1415
[output.latex]
1516
optional = true

src/SUMMARY.md

-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
- [Using Tor Mirrors](./xbps/repositories/mirrors/tor.md)
7777
- [Restricted Packages](./xbps/repositories/restricted.md)
7878
- [Custom Repositories](./xbps/repositories/custom.md)
79-
- [Signing Repositories](./xbps/repositories/signing.md)
8079
- [Troubleshooting XBPS](./xbps/troubleshooting/index.md)
8180
- [Common Issues](./xbps/troubleshooting/common-issues.md)
8281
- [Static XBPS](./xbps/troubleshooting/static.md)

src/xbps/repositories/custom.md

+80-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,90 @@ For example, to define a remote repository:
2222
# echo 'repository=http://my.domain.com/repo' > /etc/xbps.d/my-remote-repo.conf
2323
```
2424

25-
Remote repositories need to be [signed](./signing.md).
25+
Remote repositories need to be [signed](#signing-repositories-and-packages).
2626
[xbps-install(1)](https://man.voidlinux.org/xbps-install.1) refuses to install
2727
packages from remote repositories if they are not signed.
2828

2929
To define a local repository:
3030

3131
```
32-
# echo 'repository=/path/to/repo' > /etc/xbps.d/my-local-repo.conf
32+
# echo 'repository=/path/to/repository/dir' > /etc/xbps.d/my-local-repo.conf
3333
```
34+
35+
## Signing repositories and packages
36+
37+
Remote repositories **must** be signed. Local repositories do not need to be
38+
signed.
39+
40+
The private key for signing packages needs to be a PEM-encoded RSA key. The key
41+
can be generated with either
42+
[ssh-keygen(1)](https://man.voidlinux.org/ssh-keygen.1) or
43+
[openssl(1)](https://man.voidlinux.org/openssl.1):
44+
45+
```
46+
$ ssh-keygen -t rsa -b 4096 -m PEM -f private.pem
47+
```
48+
49+
```
50+
$ openssl genrsa -out private.pem 4096
51+
```
52+
53+
Once the key is generated, the public part of the private key has to be added to
54+
the repository metadata. This step is required only once.
55+
56+
```
57+
$ xbps-rindex --privkey private.pem --sign --signedby "I'm Groot" /path/to/repository/dir
58+
```
59+
60+
Then sign one or more packages with the following command:
61+
62+
```
63+
$ xbps-rindex --privkey private.pem --sign-pkg /path/to/repository/dir/*.xbps
64+
```
65+
66+
> Packages added to the repository index later will not be automatically signed.
67+
> Repeat the previous command to sign newly-added packages.
68+
69+
## Manually maintaining repositories
70+
71+
In many cases, `xbps-src` will handle the creation and addition of packages to a
72+
repository index, but the
73+
[xbps-rindex(1)](https://man.voidlinux.org/xbps-rindex.1) utility can also be
74+
used to manually manage xbps repositories. This can be useful if maintaining a
75+
repository of custom-built packages or using non-default build options.
76+
77+
> When creating a repository for another architecture, prepend `xbps-rindex`
78+
> commands with `XBPS_TARGET_ARCH`. For example: `XBPS_TARGET_ARCH=armv7l-musl
79+
> xbps-rindex ...`
80+
81+
### Adding packages to the repository index
82+
83+
For xbps to know about a package, it must be added to the repository's index.
84+
Packages can be added to the repository index with `--add`:
85+
86+
```
87+
$ xbps-rindex --add /path/to/repository/dir/*.xbps
88+
```
89+
90+
### Cleaning the repository index
91+
92+
When adding new versions of packages, `--remove-obseletes` can be used to purge
93+
the old version from both the repository index and remove the `.xbps` and `.sig`
94+
files from disk:
95+
96+
```
97+
$ xbps-rindex --remove-obseletes /path/to/repository/dir
98+
```
99+
100+
When removing a package from the repository, first remove the files from disk,
101+
then use `--clean` to remove the package from the repository index:
102+
103+
```
104+
$ xbps-rindex --clean /path/to/repository/dir
105+
```
106+
107+
### Serving remote repositories
108+
109+
Remote repositories can be served by any HTTP daemon, like nginx or lighttpd, by
110+
configuring it to serve `/path/to/repository/dir` on the domain and path
111+
desired.

src/xbps/repositories/signing.md

-35
This file was deleted.

0 commit comments

Comments
 (0)