跳转到主要内容

使用Artifactory作为后端服务的Ansible Galaxy代理

项目描述

Test codecov

galactory

galactory是一个用于Artifactory的Ansible Galaxy代理。

使用Artifactory通用仓库作为其后端,galactory实现了Galaxy API(v2 & v3)的有限子集,以便安装和发布集合。

它还可以设置成透明地代理上游Galaxy服务器,将拉取的工件存储在Artifactory中,从那时起作为本地工件提供服务。这有助于避免在繁忙的CI系统上的限制错误,并允许内部/私有集合声明对上游集合的依赖(依赖项将仅从安装集合的同一Galaxy服务器安装)。

致谢

本项目深受amanda的启发。

Artifactory兼容性

galactory的所有功能都应与免费的Artifactory OSS兼容。请报告任何似乎需要Pro许可证的使用情况。

如何使用

目前还没有适当的文档。以下为帮助输出。

强调配置的部分如下:

--开头的参数(例如:--listen-addr)也可以在配置文件中设置(例如:/etc/galactory.d/*.conf~/.galactory/*.conf或通过-c指定)。配置文件语法允许

如果在一个以上的地方指定了参数,则命令行值覆盖环境变量,环境变量覆盖配置文件值,配置文件值覆盖默认值。

默认值 < 配置 < 环境变量 < 命令行(最后找到的值优先)

usage: python -m galactory [-h] [-c CONFIG] [--listen-addr LISTEN_ADDR]
                           [--listen-port LISTEN_PORT] [--server-name SERVER_NAME]
                           [--preferred-url-scheme PREFERRED_URL_SCHEME]
                           --artifactory-path ARTIFACTORY_PATH
                           [--artifactory-api-key ARTIFACTORY_API_KEY]
                           [--artifactory-access-token ARTIFACTORY_ACCESS_TOKEN]
                           [--use-galaxy-key] [--use-galaxy-auth]
                           [--galaxy-auth-type {api_key,access_token}] [--prefer-configured-key]
                           [--prefer-configured-auth] [--publish-skip-configured-key]
                           [--publish-skip-configured-auth] [--log-file LOG_FILE]
                           [--log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}] [--log-headers]
                           [--log-body] [--proxy-upstream PROXY_UPSTREAM]
                           [-npns NO_PROXY_NAMESPACE] [--cache-minutes CACHE_MINUTES]
                           [--cache-read CACHE_READ] [--cache-write CACHE_WRITE]
                           [--use-property-fallback]
                           [--health-check-custom-text HEALTH_CHECK_CUSTOM_TEXT]
                           [--api-version {v2,v3}] [--upload-format {base64,raw,auto}]

galactory is a partial Ansible Galaxy proxy that uploads and downloads collections, using an
Artifactory generic repository as its backend.

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        The path to a config file. [env var: GALACTORY_CONFIG]
  --listen-addr LISTEN_ADDR
                        The IP address to listen on. [env var: GALACTORY_LISTEN_ADDR]
  --listen-port LISTEN_PORT
                        The TCP port to listen on. [env var: GALACTORY_LISTEN_PORT]
  --server-name SERVER_NAME
                        The host name and port of the server, as seen from clients. Used for
                        generating links. [env var: GALACTORY_SERVER_NAME]
  --preferred-url-scheme PREFERRED_URL_SCHEME
                        Sets the preferred scheme to use when constructing URLs. Defaults to
                        the request scheme, but is unaware of reverse proxies.
                        [env var: GALACTORY_PREFERRED_URL_SCHEME]
  --artifactory-path ARTIFACTORY_PATH
                        The URL of the path in Artifactory where collections are stored.
                        [env var: GALACTORY_ARTIFACTORY_PATH]
  --artifactory-api-key ARTIFACTORY_API_KEY
                        If set, is the API key used to access Artifactory. If set with artifactory-access-token, this
                        value will not be used.
                        [env var: GALACTORY_ARTIFACTORY_API_KEY]
  --artifactory-access-token ARTIFACTORY_ACCESS_TOKEN
                        If set, is the Access Token used to access Artifactory. If set with artifactory-api-key, this
                        value will be used and the API key will be ignored.
                        [env var: GALACTORY_ARTIFACTORY_ACCESS_TOKEN]
  --use-galaxy-key      If set, uses the Galaxy token sent in the request as the Artifactory auth. DEPRECATED: This
                        option will be removed in v0.11.0. Please use --use-galaxy-auth going forward.
                        [env var: GALACTORY_USE_GALAXY_KEY]
  --use-galaxy-auth     If set, uses the Galaxy token sent in the request as the Artifactory auth.
                        [env var: GALACTORY_USE_GALAXY_AUTH]
  --galaxy-auth-type {api_key,access_token}
                        Auth received via a Galaxy request should be interpreted as this type of auth.
                        [env var: GALACTORY_GALAXY_AUTH_TYPE]
  --prefer-configured-key
                        If set, prefer the confgured Artifactory auth over the Galaxy token.
                        DEPRECATED: This option will be removed in v0.11.0.
                        Please use --prefer-configured-auth going forward.
                        [env var: GALACTORY_PREFER_CONFIGURED_KEY]
  --prefer-configured-auth
                        If set, prefer the confgured Artifactory auth over the Galaxy token.
                        [env var: GALACTORY_PREFER_CONFIGURED_AUTH]
  --publish-skip-configured-key
                        If set, publish endpoint will not use configured auth, only auth included in a Galaxy
                        request.
                        DEPRECATED: This option will be removed in v0.11.0.
                        Please use --publish-skip-configured-auth going forward.
                        [env var: GALACTORY_PUBLISH_SKIP_CONFIGURED_KEY]
  --publish-skip-configured-auth
                        If set, publish endpoint will not use configured auth, only auth included in a Galaxy
                        request.
                        [env var: GALACTORY_PUBLISH_SKIP_CONFIGURED_AUTH]
  --log-file LOG_FILE   If set, logging will go to this file instead of the console.
                        [env var: GALACTORY_LOG_FILE]
  --log-level {DEBUG,INFO,WARNING,ERROR,CRITICAL}
                        The desired logging level. [env var: GALACTORY_LOG_LEVEL]
  --log-headers         Log the headers of every request (DEBUG level only).
                        [env var: GALACTORY_LOG_HEADERS]
  --log-body            Log the body of every request (DEBUG level only).
                        [env var: GALACTORY_LOG_BODY]
  --proxy-upstream PROXY_UPSTREAM
                        If set, then find, pull and cache results from the specified galaxy server
                        in addition to local. [env var: GALACTORY_PROXY_UPSTREAM]
  -npns NO_PROXY_NAMESPACE, --no-proxy-namespace NO_PROXY_NAMESPACE
                        Requests for this namespace should never be proxied. Can be specified
                        multiple times. [env var: GALACTORY_NO_PROXY_NAMESPACE]
  --cache-minutes CACHE_MINUTES
                        The time period that a cache entry should be considered valid.
                        [env var: GALACTORY_CACHE_MINUTES]
  --cache-read CACHE_READ
                        Look for upsteam caches and use their values.
                        [env var: GALACTORY_CACHE_READ]
  --cache-write CACHE_WRITE
                        Populate the upstream cache in Artifactory. Should be false when no auth is
                        provided or the auth has no permission to write.
                        [env var: GALACTORY_CACHE_WRITE]
  --use-property-fallback
                        Set properties of an uploaded collection in a separate request after publshinng.
                        Requires a Pro license of Artifactory. This feature is a workaround for an
                        Artifactory proxy configuration error and may be removed in a future version.
                        [env var: GALACTORY_USE_PROPERTY_FALLBACK]
  --health-check-custom-text HEALTH_CHECK_CUSTOM_TEXT
                        Sets custom_text field for health check endpoint responses.
                        [env var: GALACTORY_HEALTH_CHECK_CUSTOM_TEXT]
  --api-version {v2,v3}
                        The API versions to serve. Can be set to limit functionality to specific versions only.
                        Defaults to all supported versions.
                        [env var: GALACTORY_API_VERSION]
  --upload-format {base64,raw,auto}
                        Galaxy accepts the uploaded collection tarball as either raw bytes or base64 encoded.
                        Ansible 2.9 uploads raw bytes, later versions upload base64. By default galactory will
                        try to auto-detect. Use this option to turn off auto-detection and force a specific format.
                        [env var: GALACTORY_UPLOAD_FORMAT]

Args that start with '--' (eg. --listen-addr) can also be set in a config file
(/etc/galactory.d/*.conf or ~/.galactory/*.conf or specified via -c). Config file syntax allows:
key=value, flag=true, stuff=[a,b,c] (for details, see syntax at https://goo.gl/R74nmi). If an arg
is specified in more than one place, then commandline values override environment variables which
override config file values which override defaults.

安装

python3 -m pip install galactory

容器

最新标记的版本

docker run --rm ghcr.io/briantist/galactory:latest --help

main上的最新提交

docker run --rm ghcr.io/briantist/galactory:main --help

项目详情


下载文件

下载您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

galactory-0.11.2.tar.gz (66.9 kB 查看散列

上传时间

构建分布

galactory-0.11.2-py3-none-any.whl (64.7 kB 查看散列

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面