🦅 aquila
Your personal flying asset courier
A modular asset server with support for OAuth and multiple file backends, meant for serving game assets but could probably be used for other things too.
I'll write more here soon!
[!CAUTION] This package is in early development
Examples
Simple server + Bevy
Simple client (will publish v1.0 manifest and test.png)
Bevy example (uses v1.0 manifest and test.png)
cargo run --example bevy
AWS S3
You need to set the AWS_REGION, AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env vars and/or use the AWS cli (aws configure).
Set the bucket name
set S3_BUCKET=...
Run the server
cargo run --example s3_server --features "server s3 mock_auth"
Publish v1.0 manifest and test.png
cargo run -p aquila_cli -- publish --dir ./assets --version "v1.0"
Bevy example (uses v1.0 manifest and test.png)
cargo run --example bevy
GitHub auth and JWT Minting (for read-only tokens)
Generate & set JWT secret:
You can use the CLI to generate a secret or provide your own:
Create a GitHub OAuth app
The routes are configurable, you're going to have to make sure the callback route matches (in this case /auth/callback).
Set the client id and secret env vars
SET GITHUB_CLIENT_ID=...
SET GITHUB_CLIENT_SECRET=...
Run the server
You should now be able to log in using a second terminal:
cargo run -p aquila_cli -- login
Now set the token that you get after you've been redirected back to the callback route:
set AQUILA_TOKEN=...
You should have full access now! To mint a read-only public token:
To publish all assets and a manifest:
cargo run -p aquila_cli -- publish --dir ./assets --version "v1.0"
Bevy example (uses v1.0 manifest and test.png)
cargo run --example bevy
CLI
single file test
publish manifest and assets
Bevy
As shown above in the other examples, after publishing a manifest version, you can use the assets in bevy:
Server
test manually
upload
fetch
Notes
Using generics to be able to use native async traits and avoiding dyn + async_trait or Box etc.
I'd be willing to revisit this though if there's a better alternative.
TODO
- add some tests
- add some convenience features like
latestetc. - docker images, nix flakes (a simple server example should be enough)
- meta file support and other bevy asset reader functionality (folders)
- readmes in crate folders
License
Dual-licensed:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)