mirror of
https://git.launchpad.net/~vhaudiquet/+git/flutter-artifacts-proxy
synced 2026-02-12 01:25:53 +00:00
Initial commit
This commit is contained in:
89
README.md
Normal file
89
README.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# Flutter Artifacts Proxy
|
||||
|
||||
A Juju charm that provides an nginx reverse proxy for serving static Flutter artifacts, with automatic fallback to Google's storage servers.
|
||||
|
||||
## Overview
|
||||
|
||||
This charm serves as a proxy for Flutter SDK artifacts, allowing you to host specific files locally while defaulting to Google's official storage for everything else. This is particularly useful for:
|
||||
|
||||
- Hosting custom Flutter builds (e.g., riscv64 architecture)
|
||||
- Providing local caching of Flutter artifacts
|
||||
- Serving custom Flutter engine binaries
|
||||
- Distributing Dart packages
|
||||
|
||||
## Features
|
||||
|
||||
- **Static Content Hosting**: Serve any static files from the `src/static/` directory
|
||||
- **Automatic Fallback**: Files not found locally are proxied to Google's storage
|
||||
|
||||
## Usage
|
||||
|
||||
### Adding Static Content
|
||||
|
||||
Place any files you want to serve in the `src/static/` directory. They will be automatically served by nginx when the charm is deployed.
|
||||
|
||||
Example structure:
|
||||
```
|
||||
src/static/
|
||||
├── index.html # Landing page
|
||||
├── flutter_infra_release/ # Flutter artifacts
|
||||
│ └── flutter/
|
||||
│ └── ${engine_version_hash}/ # Engine version
|
||||
│ ├── dart-sdk-linux-riscv64.zip
|
||||
│ ├── linux-riscv64/
|
||||
│ │ ├── artifacts.zip
|
||||
│ │ ├── font-subset.zip
|
||||
│ │ └── impeller_sdk.zip
|
||||
│ └── linux-riscv64-debug/
|
||||
│ └── linux-riscv64-flutter-gtk.zip
|
||||
```
|
||||
|
||||
### Deployment
|
||||
|
||||
Deploy the charm using Juju:
|
||||
|
||||
```bash
|
||||
juju deploy flutter-artifacts-proxy
|
||||
```
|
||||
|
||||
The charm will automatically:
|
||||
1. Install nginx
|
||||
2. Configure it to serve files from the static directory
|
||||
3. Start the nginx service
|
||||
4. Log all files being served
|
||||
|
||||
## How It Works
|
||||
|
||||
- **Static Files**: Files in `src/static/` are bundled with the charm
|
||||
- **Nginx Configuration**: Nginx is configured to serve from the detected path
|
||||
- **Fallback Proxy**: Requests for files not found locally are redirected to Google's storage
|
||||
|
||||
## Development
|
||||
|
||||
### Building the Charm
|
||||
|
||||
```bash
|
||||
charmcraft pack
|
||||
```
|
||||
|
||||
### Testing
|
||||
|
||||
Run the test suite:
|
||||
|
||||
```bash
|
||||
tox
|
||||
```
|
||||
|
||||
### Contributing
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
|
||||
|
||||
## Resources
|
||||
|
||||
- [Charmhub](https://charmhub.io/flutter-artifacts-proxy)
|
||||
- [Juju Documentation](https://documentation.ubuntu.com/juju/3.6/howto/manage-charms/)
|
||||
- [Flutter Documentation](https://flutter.dev/docs)
|
||||
|
||||
## License
|
||||
|
||||
See [LICENSE](LICENSE) file for details.
|
||||
Reference in New Issue
Block a user