{"id":26849525,"url":"https://github.com/bmann/compute-starter-kit-rust-static-content","last_synced_at":"2025-03-30T21:36:25.422Z","repository":{"id":283778553,"uuid":"633690775","full_name":"bmann/compute-starter-kit-rust-static-content","owner":"bmann","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-28T04:14:10.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T20:58:38.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmann.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-28T04:14:07.000Z","updated_at":"2023-04-28T04:14:13.000Z","dependencies_parsed_at":"2025-03-22T06:15:54.318Z","dependency_job_id":"ffec6b91-7561-4dec-8f31-96758558605b","html_url":"https://github.com/bmann/compute-starter-kit-rust-static-content","commit_stats":null,"previous_names":["bmann/compute-starter-kit-rust-static-content"],"tags_count":0,"template":false,"template_full_name":"fastly/compute-starter-kit-rust-static-content","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmann%2Fcompute-starter-kit-rust-static-content","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmann%2Fcompute-starter-kit-rust-static-content/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmann%2Fcompute-starter-kit-rust-static-content/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmann%2Fcompute-starter-kit-rust-static-content/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmann","download_url":"https://codeload.github.com/bmann/compute-starter-kit-rust-static-content/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246385411,"owners_count":20768668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-30T21:36:24.824Z","updated_at":"2025-03-30T21:36:25.413Z","avatar_url":"https://github.com/bmann.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Static Content Starter Kit for Rust\n\n[![Deploy to Fastly](https://deploy.edgecompute.app/button)](https://deploy.edgecompute.app/deploy)\n\nSpeed up your websites with a Compute@Edge environment that demonstrates serving content from a static bucket, redirects, security and performance headers, and a 404 page.\n\n**For more details about this and other starter kits for Compute@Edge, see the [Fastly developer hub](https://developer.fastly.com/solutions/starters)**\n\n## Features\n\n * Prefix the backend bucket hostname with your bucket prefix\n * Serve a 404 page if the requested page is not found\n * Remove extra headers sent by your storage provider, such as `x-goog-*`\n * Add Content Security Policy and other security-related headers\n * Respond to CORS preflight requests\n * Redirect requests for directories to index.html\n * Serve robots.txt\n * Authenticate requests to the origin with AWS Signature Version 4\n * Add caching policy to content\n * Strip query strings\n * Add `Link: rel=preload` header to pre-fetch critical assets like fonts\n\n## Usage\n\nWhen deploying your project, you will be prompted to configure the `bucket_origin` backend. You can enter your bucket host here, or just hit enter to accept the defaults if you want to experiment with our mock backend:\n\n```plain\nConfigure a backend called 'bucket_origin'\n\nHostname or IP address: [mock-s3.edgecompute.app]\nPort: [443]\n```\n\nIf your content is already in a bucket which is public to the internet, or in a private bucket which supports AWSv4-compatible authentication, you can get started right away by modifying `src/config.rs`. The values you will need to set are:\n\n * `BACKEND_NAME` - This should match the name of your storage backend in the Fastly UI.\n * `BUCKET_NAME` - The name of the bucket you want to access.\n * `BUCKET_HOST` - The hostname of the storage service, e.g. `storage.googleapis.com`, excluding your bucket prefix.\n\nFor private buckets, set these values also:\n\n * `BUCKET_SERVICE` - The service, as defined in your provider's AWSv4 docs, that you are using. `s3` for S3 or `storage` for GCS.\n * `BUCKET_REGION` - The region, as defined in your provider's AWSv4 docs, that you are using. `auto` is fine for GCS.\n\nOptionally, you can update these values to configure the default functionality of the starter kit:\n\n * `ALLOWED_HEADERS` - The headers that you want to allow from the origin to be passed to the user. This means headers such as `x-goog-metadata` will be removed by default.\n * `ASSET_REGEX` - The regex used to determine assets to be preloaded for a given response body. Defaults to files in `/assets/`.\n * `CONTENT_SECURITY_POLICY` - The value of the `Content-Security-Policy` header used to determine origins that resources can be loaded from.\n\nIf your bucket requires authentication, you will need to create an [edge dictionary](https://docs.fastly.com/en/guides/about-edge-dictionaries) named `bucket_auth` with the following values:\n\n * `access_key_id` - The HMAC access key ID for your service account with read access.\n * `secret_access_key` - The HMAC secret key for your service account with read access.\n\n In addition to this, you will need to update the `Cargo.toml` to replace `default = []` with `default = [\"auth\"]`. This will include the dependencies required to generate signed requests in your package.\n\n## Understanding the code\n\nThis starter is feature-packed, and requires some extra dependencies on top of the [`fastly`](https://docs.rs/fastly) crate to handle signing requests for S3/GCS. If you are using a public bucket for your origin, these dependencies will not be included.\n\nThis starter includes implementations of common patterns explained in our [using Compute@Edge](/learning/compute/rust/) and [VCL migration](/learning/compute/migrate/) guides. Any of the code you see here can be modified or built upon to suit your project's needs.\n\nTo learn more about how Fastly communicates with your bucket host, read the [Integrating third party services as backends](https://developer.fastly.com/learning/integrations/backends/) guide. This is based on a VCL service, but you can utilise many of the same patterns with the help of the [VCL migration](/learning/compute/migrate/) guide.\n\n## Security issues\n\nPlease see our [SECURITY.md](SECURITY.md) for guidance on reporting security-related issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmann%2Fcompute-starter-kit-rust-static-content","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmann%2Fcompute-starter-kit-rust-static-content","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmann%2Fcompute-starter-kit-rust-static-content/lists"}