5.4 KiB
5.4 KiB
page_title, subcategory, description
| page_title | subcategory | description |
|---|---|---|
| artifactapi_remote_github_alpine Resource - artifactapi | Manages an ArtifactAPI github_alpine remote, a caching proxy for an upstream repository. Exposes a GitHub repository's release .apk assets as an apk repository, synthesising APKINDEX.tar.gz from release metadata. Set base_url to the releases API root (https://api.github.com/repos/{owner}/{repo}) and releases_remote to a generic github.com remote that streams the package bytes; package downloads 302-redirect there. patterns filters which release assets become packages (regex on asset filename). password may hold a token for private repos or higher API rate limits. |
artifactapi_remote_github_alpine (Resource)
Manages an ArtifactAPI github_alpine remote, a caching proxy for an upstream repository. Exposes a GitHub repository's release .apk assets as an apk repository, synthesising APKINDEX.tar.gz from release metadata. Set base_url to the releases API root (https://api.github.com/repos/{owner}/{repo}) and releases_remote to a generic github.com remote that streams the package bytes; package downloads 302-redirect there. patterns filters which release assets become packages (regex on asset filename). password may hold a token for private repos or higher API rate limits.
Example Usage
# Backend generic remote that serves the actual .apk bytes from github.com.
# Its patterns must allowlist the target repo's release-download assets.
resource "artifactapi_remote_generic" "github" {
name = "github"
base_url = "https://github.com"
patterns = [
"acme/tools/releases/download/.*\\.apk$",
]
}
# Metadata-only remote: scans acme/tools releases for .apk assets and serves a
# synthesized apk repo (APKINDEX). Packages are never precached; downloads
# 302-redirect to the "github" remote above.
resource "artifactapi_remote_github_alpine" "acme_tools" {
name = "acme-tools"
base_url = "https://api.github.com/repos/acme/tools"
description = "acme/tools GitHub releases as an apk repo"
releases_remote = artifactapi_remote_generic.github.name
mutable_ttl = 3600
# Optional: restrict which release assets become packages.
patterns = [
".*_x86_64\\.apk$",
".*_noarch\\.apk$",
]
# Optional: token for private repos / higher GitHub API rate limits.
# password = var.github_token
}
Schema
Required
base_url(String) Upstream repository base URL.name(String) Unique name of the remote.
Optional
ban_tags(List of String) Tags to ban (docker only).ban_tags_enabled(Boolean) Enable tag banning (docker only).blocklist(List of String) Paths to always deny (checked before patterns).cache_repodata(Boolean) Cache generated repodata (github_rpm only).check_mutable(Boolean) Enable conditional revalidation for mutable artifacts.description(String) Human-readable description.immutable_patterns(List of String) Override: paths that should be immutable even if the provider would classify as mutable.immutable_ttl(Number) TTL in seconds for immutable artifacts (0 = forever).mirror_strategy(String) Mirror load-balancing strategy across base_url + mirrorlist; only valid on remote rpm/deb/apk (alpine) repos. One of "round_robin" (default) or "least_conn".mirrorlist(List of String) Extra upstream mirror base URLs; only valid on remote rpm/deb/apk (alpine) repos. Requests are load-balanced with failover across base_url + mirrorlist.mutable_patterns(List of String) Override: paths that should be mutable even if the provider would classify as immutable.mutable_ttl(Number) TTL in seconds for mutable artifacts.password(String, Sensitive) Password or token for upstream authentication.patterns(List of String) Paths to proxy (empty = all). This is the allowlist.quarantine_days(Number) Days to quarantine new artifacts whenquarantine_enabledis set.quarantine_enabled(Boolean) Hold newly published upstream artifacts back until they arequarantine_daysold.releases_remote(String) Name of a backend remote that serves the actual download bytes. Used by the terraform remote (download URL rewriting) and the github_rpm/github_deb/github_alpine remotes (302 redirect of .rpm/.deb/.apk downloads to a generic github.com remote).serve_stale(Boolean) Let rpm/deb/alpine virtuals serve this member's last good index while it refreshes.stale_on_error(Boolean) Serve stale cached content when upstream is unreachable.sync_interval(Number) Release re-scan interval in seconds, 0..2592000 (0 = mutable_ttl); github_rpm/github_deb/github_alpine only.upstream_dial_timeout(Number) Upstream TCP connect timeout in seconds (0 = server default).upstream_response_header_timeout(Number) Upstream response-header timeout in seconds (0 = server default).upstream_tls_timeout(Number) Upstream TLS handshake timeout in seconds (0 = server default).username(String, Sensitive) Username for upstream authentication.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# Import by name.
terraform import artifactapi_remote_github_alpine.acme_tools acme-tools