Skip to content

Commit 42d197d

Browse files
committed
Update README for 0.5.0 changes
1 parent efe118b commit 42d197d

1 file changed

Lines changed: 29 additions & 24 deletions

File tree

README.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ at an ostree repository and it will allow Flatpak clients to install
55
apps from the repository over HTTP. Additionally, it has an HTTP API
66
that lets you upload new builds and manage the repository.
77

8-
## Building the server
8+
## Building
99

10-
The server is written in Rust, so you need to have Rust and Cargo
10+
flat-manager is written in Rust, so you need Rust and Cargo
1111
installed. Everything works with the stable version of Rust,
1212
so you can get it from [rustup](https://github.com/rust-lang/rustup.rs)
1313
or your distribution. On Fedora:
@@ -23,18 +23,12 @@ You also need ostree. On Fedora, this is done with:
2323

2424
sudo dnf install ostree-devel
2525

26-
Then build the server by running:
26+
Then build both the server and client by running:
2727

2828
cargo build
2929

30-
## Building the client
31-
32-
flat-manager contains a Python-based client that can be used
33-
to talk to the server. To run this, you need Python 3 as
34-
well as the aiohttp packages, installed via pip or the
35-
distribution packages. On Fedora, this can be installed using:
36-
37-
sudo dnf install python3-aiohttp
30+
This builds both `flat-manager` and `flat-manager-client` since
31+
they're part of the same workspace.
3832

3933
## Configuration
4034

@@ -51,6 +45,15 @@ The source repository contains an `example.env` and an
5145
cp example-config.json config.json
5246
# edit config.json
5347

48+
### GPG keys
49+
50+
The `gpg-key` and `build-gpg-key` config fields accept either a
51+
single string or an array of strings, so you can sign with multiple
52+
GPG keys:
53+
54+
"gpg-key": "KEYID"
55+
"gpg-key": ["KEY1", "KEY2"]
56+
5457
### Hooks
5558

5659
flat-manager can be configured to run hook scripts during the upload
@@ -124,7 +127,7 @@ otherwise performance will be degraded.
124127

125128
## Tokens
126129

127-
All requests to the API require a token. Token are signed with a secret
130+
All requests to the API require a token. Tokens are signed with a secret
128131
that has to be stored on the server. The default configuration contains:
129132

130133
"secret": "c2VjcmV0"
@@ -140,36 +143,34 @@ could let you do everything, while another would only allow you to
140143
upload builds to a particular build. There is an API to subset
141144
your token for sharing with others (for example sending the above
142145
upload-only token to a builder), but you can also generate a
143-
token with the gentoken command:
146+
token with the `flat-manager-client gentoken` subcommand:
144147

145148
echo -n "secret" | base64 | cargo run --bin flat-manager-client -- gentoken --base64 --secret-file - --name testtoken
146149

147150
The above matches the default secret, so can be used for testing.
148151

149152
Some token privileges are for managing flat-manager and shouldn't be
150-
given to third parties who are just uploading apps. The token privileges
151-
are described in the [`ClaimsScope` enum in `tokens.rs`](https://github.com/flatpak/flat-manager/blob/d1c3d36da7b5779163ff70007c4d2f145cfce664/src/tokens.rs#L21-L46).
153+
given to third parties who are just uploading apps. The token scopes
154+
are: `jobs`, `build`, `upload`, `publish`, `generate`, `download`,
155+
`republish`, `reviewcheck`, and `tokenmanagement`. See the
156+
`ClaimsScope` enum in `common/src/tokens.rs` for details.
152157

153158
The client takes tokens via either the `--token` argument or in the
154159
`REPO_TOKEN` environment variable.
155160

156-
For a production setup, you will also want to generate a token
157-
for `delta-generator`. This can be done by following the above
158-
command with these arguments:
159-
160-
echo -n "secret" | base64 | cargo run --bin flat-manager-client -- gentoken --base64 --secret-file - --name delta-generator --sub delta --scope generate
161-
162161
## Running
163162

164163
To start the server, run:
165164

166165
cargo run --bin flat-manager
167166

168-
It will listen on port 8080 by default.
167+
You can check the version with `flat-manager --version`. The server
168+
listens on port 8080 by default. The number of worker threads can be
169+
overridden with the `ACTIX_WORKERS` environment variable.
169170

170171
To test adding something to the repository, you can try building a
171172
simple app and exporting it to a repository. Use a recent version of
172-
flatpak and flatpak-builer to make sure you can build from Yaml files.
173+
flatpak and flatpak-builder to make sure you can build from Yaml files.
173174
This would normally happen on a different machine than the one serving
174175
the repository, but for testing we can just do it in a subdirectory:
175176

@@ -181,10 +182,14 @@ the repository, but for testing we can just do it in a subdirectory:
181182
Then we can upload it to the repository by doing (assuming the default secret):
182183

183184
export REPO_TOKEN=$(echo -n "secret" | base64 | cargo run --bin flat-manager-client -- gentoken --base64 --secret-file - --name test)
184-
./flat-manager-client push --commit $(./flat-manager-client create http://127.0.0.1:8080 stable) test-build/local-repo
185+
cargo run --bin flat-manager-client -- push --commit $(cargo run --bin flat-manager-client -- create http://127.0.0.1:8080 stable) test-build/local-repo
185186

186187
This will create a new "build", upload the build to it and then "commit" the build.
187188

189+
The client supports these subcommands: `create`, `push`, `commit`,
190+
`publish`, `purge`, `prune`, `create-token`, `follow-job`, and
191+
`gentoken`. Run `flat-manager-client --help` for usage details.
192+
188193
## License
189194

190195
Licensed under either of

0 commit comments

Comments
 (0)