diff --git a/.editorconfig b/.editorconfig index 547304ee3..9d9216d84 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,10 +9,6 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[Makefile] -indent_style = space -indent_size = 4 - [*.{bash,sh}] indent_style = space indent_size = 4 diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 99% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md index 8177b1b55..915019aad 100644 --- a/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -59,8 +59,7 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -devin.kray@gmail.com. +reported to the community leaders responsible for enforcement at contact@buhl.casa. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/.github/ISSUE_TEMPLATE/container-request.yaml b/.github/ISSUE_TEMPLATE/container-request.yaml index d3a020379..40314ad84 100644 --- a/.github/ISSUE_TEMPLATE/container-request.yaml +++ b/.github/ISSUE_TEMPLATE/container-request.yaml @@ -7,8 +7,8 @@ body: - type: markdown attributes: value: | - Doing you due diligence and filling out this form throughly - will gauge how serious your request is. + Doing your due diligence and filling out this form thoroughly + will help determine if your request shall be entertained. - type: input id: application-name diff --git a/.github/actions/collect-changes/action.yaml b/.github/actions/collect-changes/action.yaml deleted file mode 100644 index 4c1f504ad..000000000 --- a/.github/actions/collect-changes/action.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: "Collect changes" -description: "Collects and stores changed files/containers" - -outputs: - changesDetected: - description: "Whether or not changes to containers have been detected" - value: ${{ steps.filter.outputs.addedOrModified }} - addedOrModifiedFiles: - description: "A list of the files changed" - value: ${{ steps.filter.outputs.addedOrModified_files }} - addedOrModifiedImages: - description: "A list of the containers changed" - value: ${{ steps.filter-containers.outputs.addedOrModifiedImages }} - -runs: - using: "composite" - steps: - - name: Collect changed files - uses: dorny/paths-filter@v2 - id: filter - with: - list-files: json - filters: | - addedOrModified: - - added|modified: 'apps/*/**' - - name: Collect changed containers - if: | - steps.filter.outputs.addedOrModified == 'true' - id: filter-containers - shell: bash - run: | - PATHS='${{ steps.filter.outputs.addedOrModified_files }}' - OUTPUT=$(echo $PATHS | jq --raw-output -c 'map(. |= split("/")[1]) | unique') - echo "addedOrModifiedImages=${OUTPUT}" >> $GITHUB_OUTPUT diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 6dc3a3645..1e868d592 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,35 +1,14 @@ { + "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:base", + "config:recommended", "docker:enableMajor", - ":disableRateLimiting", ":dependencyDashboard", - ":semanticCommits", - ":automergeDigest" + ":disableRateLimiting", + ":semanticCommits" ], - "platform": "github", - "username": "rosey-bot[bot]", - "repositories": ["onedr0p/containers"], "onboarding": false, "requireConfig": "optional", - "gitAuthor": "rosey-bot <98030736+rosey-bot[bot]@users.noreply.github.com>", "dependencyDashboardTitle": "Renovate Dashboard 🤖", - "suppressNotifications": ["prIgnoreNotification"], - "commitBodyTable": true, - "packageRules": [ - { - "description": "Auto-merge Github Actions", - "matchDatasources": ["github-tags"], - "automerge": true, - "automergeType": "branch", - "ignoreTests": true, - "matchUpdateTypes": ["minor", "patch"], - "matchPackagePatterns": ["renovatebot/github-action"] - }, - { - "matchDatasources": ["docker"], - "matchUpdateTypes": ["digest"], - "commitMessagePrefix": "📣 " - } - ] + "suppressNotifications": ["prEditedNotification", "prIgnoreNotification"] } diff --git a/.github/scripts/fetch.mjs b/.github/scripts/fetch.mjs deleted file mode 100755 index 3b2dc9d2b..000000000 --- a/.github/scripts/fetch.mjs +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env zx - -// Builds a JSON string what images and their channels to process -// [ -// {"app":"ubuntu", "channel": "focal"}, -// {"app"... -// ] - -$.verbose = false -import { Published } from './published.mjs'; - -let output = [] -for (const path of await glob(['apps/*/metadata.json'])) { - let {app, channels} = await fs.readJson(path); - - for (const channel of channels) { - let publishedVersion = await Published(app, channel.name, channel.stable) - let upstreamVersion = await $`./.github/scripts/upstream.sh ${app} ${channel.name}` - - if (publishedVersion != upstreamVersion.stdout) { - output.push({"app": app, "channel": channel.name}) - } - } -} - -console.log(`::set-output name=changes::${JSON.stringify(output)}`) diff --git a/.github/scripts/fetch.sh b/.github/scripts/fetch.sh deleted file mode 100755 index 7ad24e651..000000000 --- a/.github/scripts/fetch.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env bash -# FIXME: Consider rewriting this in Python3 - -# Overview: -# Builds a JSON string what images and their channels to process -# Outputs: -# [ -# {"app":"ubuntu", "channel": "focal"}, -# {"app":"ubuntu", "channel": "jammy"}, -# {"app"... -# ] - -shopt -s lastpipe - -FETCH_ALL=false -if [ "$1" == "all" ]; then - FETCH_ALL=true -fi - -declare -A app_channel_array -find ./apps -name metadata.json | while read -r metadata; do - declare -a __channels=() - app="$(jq --raw-output '.app' "${metadata}")" - jq --raw-output -c '.channels | .[]' "${metadata}" | while read -r channels; do - channel="$(jq --raw-output '.name' <<< "${channels}")" - stable="$(jq --raw-output '.stable' <<< "${channels}")" - if [ ${FETCH_ALL} == true ]; then - __channels+=("${channel}") - else - published_version=$(./.github/scripts/published.sh "${app}" "${channel}" "${stable}") - upstream_version=$(./.github/scripts/upstream.sh "${app}" "${channel}" "${stable}") - if [[ "${published_version}" != "${upstream_version}" && "${upstream_version}" != "" && "${upstream_version}" != "null" ]]; then - echo "${app}$([[ ! ${stable} == false ]] || echo "-${channel}"):${published_version:-} -> ${upstream_version}" - __channels+=("${channel}") - fi - fi - done - if [[ "${#__channels[@]}" -gt 0 ]]; then - app_channel_array[$app]="${__channels[*]}" - fi -done - -output="[]" -if [[ "${#app_channel_array[@]}" -gt 0 ]]; then - declare -a changes_array=() - for app in "${!app_channel_array[@]}"; do - #shellcheck disable=SC2086 - if [[ -n "${app}" ]]; then - for channel in ${app_channel_array[$app]}; do - changes_array+=("$(jo app="$app" channel="$channel")") - done - fi - done - #shellcheck disable=SC2048,SC2086 - output="$(jo -a ${changes_array[*]})" -fi - -echo "changes=${output}" >> $GITHUB_OUTPUT diff --git a/.github/scripts/json-to-yaml.py b/.github/scripts/json-to-yaml.py new file mode 100644 index 000000000..fedd8172f --- /dev/null +++ b/.github/scripts/json-to-yaml.py @@ -0,0 +1,27 @@ + +import os +import json +import yaml + +def json_to_yaml(subdir, file): + obj = None + + json_file = os.path.join(subdir, file) + with open(json_file) as f: + obj = json.load(f) + + yaml_file = os.path.join(subdir, "metadata.yaml") + with open(yaml_file, "w") as f: + yaml.dump(obj, f) + + os.remove(json_file) + + +if __name__ == "__main__": + + for subdir, dirs, files in os.walk("./apps"): + for f in files: + if f != "metadata.json": + continue + json_to_yaml(subdir, f) + diff --git a/.github/scripts/prepare-matrices.py b/.github/scripts/prepare-matrices.py new file mode 100644 index 000000000..6f9677172 --- /dev/null +++ b/.github/scripts/prepare-matrices.py @@ -0,0 +1,196 @@ +#!/usr/bin/env python3 +import importlib.util +import sys +import os + +import json +import yaml +import requests + +from subprocess import check_output + +from os.path import isfile + +repo_owner = os.environ.get('REPO_OWNER', os.environ.get('GITHUB_REPOSITORY_OWNER')) + +TESTABLE_PLATFORMS = ["linux/amd64"] + +def load_metadata_file_yaml(file_path): + with open(file_path, "r") as f: + return yaml.safe_load(f) + +def load_metadata_file_json(file_path): + with open(file_path, "r") as f: + return json.load(f) + +def get_latest_version_py(latest_py_path, channel_name): + spec = importlib.util.spec_from_file_location("latest", latest_py_path) + latest = importlib.util.module_from_spec(spec) + sys.modules["latest"] = latest + spec.loader.exec_module(latest) + return latest.get_latest(channel_name) + +def get_latest_version_sh(latest_sh_path, channel_name): + out = check_output([latest_sh_path, channel_name]) + return out.decode("utf-8").strip() + +def get_latest_version(subdir, channel_name): + ci_dir = os.path.join(subdir, "ci") + if os.path.isfile(os.path.join(ci_dir, "latest.py")): + return get_latest_version_py(os.path.join(ci_dir, "latest.py"), channel_name) + elif os.path.isfile(os.path.join(ci_dir, "latest.sh")): + return get_latest_version_sh(os.path.join(ci_dir, "latest.sh"), channel_name) + elif os.path.isfile(os.path.join(subdir, channel_name, "latest.py")): + return get_latest_version_py(os.path.join(subdir, channel_name, "latest.py"), channel_name) + elif os.path.isfile(os.path.join(subdir, channel_name, "latest.sh")): + return get_latest_version_sh(os.path.join(subdir, channel_name, "latest.sh"), channel_name) + return None + +def get_published_version(image_name): + r = requests.get( + f"https://api.github.com/users/{repo_owner}/packages/container/{image_name}/versions", + headers={ + "Accept": "application/vnd.github.v3+json", + "Authorization": "token " + os.environ["TOKEN"] + }, + ) + + if r.status_code != 200: + return None + + data = json.loads(r.text) + for image in data: + tags = image["metadata"]["container"]["tags"] + if "rolling" in tags: + tags.remove("rolling") + # Assume the longest string is the complete version number + return max(tags, key=len) + +def get_image_metadata(subdir, meta, forRelease=False, force=False, channels=None): + imagesToBuild = { + "images": [], + "imagePlatforms": [] + } + + if channels is None: + channels = meta["channels"] + else: + channels = [channel for channel in meta["channels"] if channel["name"] in channels] + + + for channel in channels: + version = get_latest_version(subdir, channel["name"]) + if version is None: + continue + + # Image Name + toBuild = {} + if channel.get("stable", False): + toBuild["name"] = meta["app"] + else: + toBuild["name"] = "-".join([meta["app"], channel["name"]]) + + # Skip if latest version already published + if not force: + published = get_published_version(toBuild["name"]) + if published is not None and published == version: + continue + toBuild["published_version"] = published + + toBuild["version"] = version + + # Image Tags + toBuild["tags"] = ["rolling", version] + if meta.get("semantic_versioning", False): + parts = version.split(".")[:-1] + while len(parts) > 0: + toBuild["tags"].append(".".join(parts)) + parts = parts[:-1] + + # Platform Metadata + for platform in channel["platforms"]: + + if platform not in TESTABLE_PLATFORMS and not forRelease: + continue + + toBuild.setdefault("platforms", []).append(platform) + + target_os = platform.split("/")[0] + target_arch = platform.split("/")[1] + + platformToBuild = {} + platformToBuild["name"] = toBuild["name"] + platformToBuild["platform"] = platform + platformToBuild["target_os"] = target_os + platformToBuild["target_arch"] = target_arch + platformToBuild["version"] = version + platformToBuild["channel"] = channel["name"] + + if meta.get("base", False): + platformToBuild["label_type"] ="org.opencontainers.image.base" + else: + platformToBuild["label_type"]="org.opencontainers.image" + + if isfile(os.path.join(subdir, channel["name"], "Dockerfile")): + platformToBuild["dockerfile"] = os.path.join(subdir, channel["name"], "Dockerfile") + platformToBuild["context"] = os.path.join(subdir, channel["name"]) + platformToBuild["goss_config"] = os.path.join(subdir, channel["name"], "goss.yaml") + else: + platformToBuild["dockerfile"] = os.path.join(subdir, "Dockerfile") + platformToBuild["context"] = subdir + platformToBuild["goss_config"] = os.path.join(subdir, "ci", "goss.yaml") + + platformToBuild["goss_args"] = "tail -f /dev/null" if channel["tests"].get("type", "web") == "cli" else "" + + platformToBuild["tests_enabled"] = channel["tests"]["enabled"] and platform in TESTABLE_PLATFORMS + + imagesToBuild["imagePlatforms"].append(platformToBuild) + imagesToBuild["images"].append(toBuild) + return imagesToBuild + +if __name__ == "__main__": + apps = sys.argv[1] + forRelease = sys.argv[2] == "true" + force = sys.argv[3] == "true" + imagesToBuild = { + "images": [], + "imagePlatforms": [] + } + + if apps != "all": + channels=None + apps = apps.split(",") + if len(sys.argv) == 5: + channels = sys.argv[4].split(",") + + for app in apps: + if not os.path.exists(os.path.join("./apps", app)): + print(f"App \"{app}\" not found") + exit(1) + + meta = None + if os.path.isfile(os.path.join("./apps", app, "metadata.yaml")): + meta = load_metadata_file_yaml(os.path.join("./apps", app, "metadata.yaml")) + elif os.path.isfile(os.path.join("./apps", app, "metadata.json")): + meta = load_metadata_file_json(os.path.join("./apps", app, "metadata.json")) + + imageToBuild = get_image_metadata(os.path.join("./apps", app), meta, forRelease, force=force, channels=channels) + if imageToBuild is not None: + imagesToBuild["images"].extend(imageToBuild["images"]) + imagesToBuild["imagePlatforms"].extend(imageToBuild["imagePlatforms"]) + else: + for subdir, dirs, files in os.walk("./apps"): + for file in files: + meta = None + if file == "metadata.yaml": + meta = load_metadata_file_yaml(os.path.join(subdir, file)) + elif file == "metadata.json": + meta = load_metadata_file_json(os.path.join(subdir, file)) + else: + continue + if meta is not None: + imageToBuild = get_image_metadata(subdir, meta, forRelease, force=force) + if imageToBuild is not None: + imagesToBuild["images"].extend(imageToBuild["images"]) + imagesToBuild["imagePlatforms"].extend(imageToBuild["imagePlatforms"]) + print(json.dumps(imagesToBuild)) diff --git a/.github/scripts/published.mjs b/.github/scripts/published.mjs deleted file mode 100644 index 15e3efe6c..000000000 --- a/.github/scripts/published.mjs +++ /dev/null @@ -1,18 +0,0 @@ -export async function Published(app, channel, stable) { - let headers = {} - if (process.env.TOKEN) { - headers = { - Accept: 'application/vnd.github.v3+json', - Authorization: `token ${process.env.TOKEN}` - } - } - app = (stable ? app : `${app}-${channel}`) - let res = await fetch(`https://api.github.com/users/onedr0p/packages/container/${app}/versions`, { headers }) - let data = await res.json() - try { - // Assume first image found and first tag found is the most recent pushed tag - return data[0].metadata.container.tags[0]; - } catch { - console.log(`Error finding published version for ${app}`) - } -} diff --git a/.github/scripts/published.sh b/.github/scripts/published.sh deleted file mode 100755 index 4f45a9b43..000000000 --- a/.github/scripts/published.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -APP="${1}" -CHANNEL="${2}" -STABLE="${3}" -# TOKEN="${TOKEN}" - -if [[ -z "${STABLE}" || "${STABLE}" == false ]]; then - APP="${APP}-${CHANNEL}" -fi - -tags=$( \ - curl -fsSL \ - -H "Accept: application/vnd.github.v3+json" \ - -H "Authorization: token ${TOKEN}" \ - "https://api.github.com/users/onedr0p/packages/container/${APP}/versions" \ - 2>/dev/null -) - -if [[ -z "${tags}" ]]; then - exit 0 -fi - -current_tags=$( \ - jq --compact-output \ - 'map( select( .metadata.container.tags[] | contains("rolling") ) | .metadata.container.tags[] )' \ - <<< "${tags}" \ -) - -tag=$( \ - jq --compact-output \ - 'map( select( index("rolling") | not ) )' \ - <<< "${current_tags}" -) - -printf "%s" "$(jq --raw-output '.[0]' <<< "${tag}")" diff --git a/.github/scripts/render-readme.py b/.github/scripts/render-readme.py new file mode 100644 index 000000000..4bf9a9398 --- /dev/null +++ b/.github/scripts/render-readme.py @@ -0,0 +1,58 @@ +import os +import json +import requests +import yaml + +from jinja2 import Environment, PackageLoader, select_autoescape + +repo_owner = os.environ.get('REPO_OWNER', os.environ.get('GITHUB_REPOSITORY_OWNER')) +repo_name = os.environ.get('REPO_NAME', os.environ.get('GITHUB_REPOSITORY')) + +env = Environment( + loader=PackageLoader("render-readme"), + autoescape=select_autoescape() +) + +def load_metadata_file_yaml(file_path): + with open(file_path, "r") as f: + return yaml.safe_load(f) + +def load_metadata_file_json(file_path): + with open(file_path, "r") as f: + return json.load(f) + +def load_metadata_file(file_path): + if file_path.endswith(".json"): + return load_metadata_file_json(file_path) + elif file_path.endswith(".yaml"): + return load_metadata_file_yaml(file_path) + return None + +if __name__ == "__main__": + base_images = [] + app_images = [] + for subdir, dirs, files in os.walk("./apps"): + for file in files: + if file != "metadata.yaml" and file != "metadata.json": + continue + meta = load_metadata_file(os.path.join(subdir, file)) + for channel in meta["channels"]: + name = "" + if channel.get("stable", False): + name = meta["app"] + else: + name = "-".join([meta["app"], channel["name"]]) + image = { + "name": name, + "channel": channel["name"], + "html_url": f"https://github.com/{repo_name}/pkgs/container/{name}", + "owner": repo_owner + } + if meta["base"]: + base_images.append(image) + else: + app_images.append(image) + + template = env.get_template("README.md.j2") + with open("./README.md", "w") as f: + f.write(template.render(base_images=base_images, app_images=app_images)) diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt new file mode 100644 index 000000000..37641f6aa --- /dev/null +++ b/.github/scripts/requirements.txt @@ -0,0 +1,4 @@ +requests +pyyaml +packaging +jinja2 \ No newline at end of file diff --git a/.github/scripts/templates/README.md.j2 b/.github/scripts/templates/README.md.j2 new file mode 100644 index 000000000..6353fb996 --- /dev/null +++ b/.github/scripts/templates/README.md.j2 @@ -0,0 +1,116 @@ + +
+ + +## Containers + +_An opinionated collection of container images_ + +
+ +
+ +![GitHub Repo stars](https://img.shields.io/github/stars/onedr0p/containers?style=for-the-badge) +![GitHub forks](https://img.shields.io/github/forks/onedr0p/containers?style=for-the-badge) +![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/onedr0p/containers/release-scheduled.yaml?style=for-the-badge&label=Scheduled%20Release) + +
+ +Welcome to our container images, if looking for a container start by [browsing the GitHub Packages page for this repo's packages](https://github.com/onedr0p?tab=packages&repo_name=containers). + +## Mission statement + +The goal of this project is to support [semantically versioned](https://semver.org/), [rootless](https://rootlesscontaine.rs/), and [multiple architecture](https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/) containers for various applications. + +We also try to adhere to a [KISS principle](https://en.wikipedia.org/wiki/KISS_principle), logging to stdout, [one process per container](https://testdriven.io/tips/59de3279-4a2d-4556-9cd0-b444249ed31e/), no [s6-overlay](https://github.com/just-containers/s6-overlay) and all images are built on top of [Alpine](https://hub.docker.com/_/alpine) or [Ubuntu](https://hub.docker.com/_/ubuntu). + +## Tag immutability + +The containers built here do not use immutable tags, as least not in the more common way you have seen from [linuxserver.io](https://fleet.linuxserver.io/) or [Bitnami](https://bitnami.com/stacks/containers). + +We do take a similar approach but instead of appending a `-ls69` or `-r420` prefix to the tag we instead insist on pinning to the sha256 digest of the image, while this is not as pretty it is just as functional in making the images immutable. + +| Container | Immutable | +|----------------------------------------------------|-----------| +| `ghcr.io/onedr0p/sonarr:rolling` | ❌ | +| `ghcr.io/onedr0p/sonarr:3.0.8.1507` | ❌ | +| `ghcr.io/onedr0p/sonarr:rolling@sha256:8053...` | ✅ | +| `ghcr.io/onedr0p/sonarr:3.0.8.1507@sha256:8053...` | ✅ | + +_If pinning an image to the sha256 digest, tools like [Renovate](https://github.com/renovatebot/renovate) support updating the container on a digest or application version change._ + +## Passing arguments to a application + +Some applications do not support defining configuration via environment variables and instead only allow certain config to be set in the command line arguments for the app. To circumvent this, for applications that have an `entrypoint.sh` read below. + +1. First read the Kubernetes docs on [defining command and arguments for a Container](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/). +2. Look up the documentation for the application and find a argument you would like to set. +3. Set the argument in the `args` section, be sure to include `entrypoint.sh` as the first arg and any application specific arguments thereafter. + + ```yaml + args: + - /entrypoint.sh + - --port + - "8080" + ``` + +## Configuration volume + +For applications that need to have persistent configuration data the config volume is hardcoded to `/config` inside the container. This is not able to be changed in most cases. + +## Available Images + +Each Image will be built with a `rolling` tag, along with tags specific to it's version. Available Images Below + +Container | Channel | Image +--- | --- | --- +{% for image in app_images | sort(attribute="name") -%} +[{{ image.name }}]({{ image.html_url }}) | {{ image.channel }} | ghcr.io/{{ image.owner }}/{{ image.name }} +{% endfor %} + +## Contributing + +1. Install [Docker](https://docs.docker.com/get-docker/), [Taskfile](https://taskfile.dev/) & [Cuelang](https://cuelang.org/) +2. Get familiar with the structure of the repositroy +3. Find a similar application in the apps directory +4. Copy & Paste an application and update the directory name +5. Update `metadata.json`, `Dockerfile`, `ci/latest.sh`, `ci/goss.yaml` and make it suit the application build +6. Include any additional files if required +7. Use Taskfile to build and test your image + + ```ruby + task APP=sonarr CHANNEL=main test + ``` + +### Automated tags + +Here's an example of how tags are created in the GitHub workflows, be careful with `metadata.json` as it does affect the outcome of how the tags will be created when the application is built. + +| Application | Channel | Stable | Base | Generated Tag | +|-------------|-----------|---------|---------|-----------------------------| +| `ubuntu` | `focal` | `true` | `true` | `ubuntu:focal-rolling` | +| `ubuntu` | `focal` | `true` | `true` | `ubuntu:focal-19880312` | +| `alpine` | `3.16` | `true` | `true` | `alpine:rolling` | +| `alpine` | `3.16` | `true` | `true` | `alpine:3.16.0` | +| `sonarr` | `develop` | `false` | `false` | `sonarr-develop:3.0.8.1538` | +| `sonarr` | `develop` | `false` | `false` | `sonarr-develop:rolling` | +| `sonarr` | `main` | `true` | `false` | `sonarr:3.0.8.1507` | +| `sonarr` | `main` | `true` | `false` | `sonarr:rolling` | + +## Deprecations + +Containers here can be **deprecated** at any point, this could be for any reason described below. + +1. The upstream application is **no longer actively developed** +2. The upstream application has an **official upstream container** that follows closely to the mission statement described here +3. The upstream application has been **replaced with a better alternative** +4. The **maintenance burden** of keeping the container here **is too bothersome** + +**Note**: Deprecated containers will remained published to this repo for 6 months after which they will be pruned. +## Credits + +A lot of inspiration and ideas are thanks to the hard work of [hotio.dev](https://hotio.dev/) and [linuxserver.io](https://www.linuxserver.io/) contributors. + diff --git a/.github/scripts/upstream.sh b/.github/scripts/upstream.sh deleted file mode 100755 index c39ae3966..000000000 --- a/.github/scripts/upstream.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -APP="${1}" -CHANNEL="${2}" - -if test -f "./apps/${APP}/ci/latest.sh"; then - bash ./apps/"${APP}"/ci/latest.sh "${CHANNEL}" -fi diff --git a/.github/workflows/action-image-build.yaml b/.github/workflows/action-image-build.yaml deleted file mode 100644 index ed08516bc..000000000 --- a/.github/workflows/action-image-build.yaml +++ /dev/null @@ -1,219 +0,0 @@ ---- -name: "Action: Image Build" - -on: - workflow_call: - inputs: - imagesToBuild: - description: |- - Pass a json string with the images and channels to build. e.g.: - [ - { - "app": "sonarr", - "channel": "main" - }, - { - "app": "sonarr", - "channel": "develop" - } - ] - required: false - type: string - default: '' - - pushImages: - required: false - default: 'false' - type: string - - updateMetadata: - required: false - default: 'false' - type: string - - sendNotification: - required: false - default: 'false' - type: string - -jobs: - build-and-test: - name: Build and test - runs-on: ubuntu-latest - if: inputs.imagesToBuild != '' && inputs.imagesToBuild != '[]' - strategy: - matrix: - image: ["${{ fromJson(inputs.imagesToBuild) }}"] - fail-fast: false - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - name: Setup workflow Variables - id: vars - shell: bash - run: |- - container_base=$(jq '.base' ./apps/${{ matrix.image.app }}/metadata.json) - echo "chan_build_date=$(date --rfc-3339=seconds --utc)" >> $GITHUB_OUTPUT - - chan_config=$(jq --arg chan "${{ matrix.image.channel }}" '(.channels | .[] | select(.name == $chan))' ./apps/${{ matrix.image.app }}/metadata.json) - chan_stable=$(jq --raw-output '.stable' <<< "${chan_config}") - - chan_platforms=$(jq --raw-output '.platforms | join(",")' <<< "${chan_config}") && \ - echo "chan_platforms=${chan_platforms}" >> $GITHUB_OUTPUT - chan_tests_enabled=$(jq --raw-output '.tests.enabled' <<< "${chan_config}") && \ - echo "chan_tests_enabled=${chan_tests_enabled}" >> $GITHUB_OUTPUT - chan_tests_type=$(jq --raw-output '.tests.type' <<< "${chan_config}") && \ - echo "chan_tests_type=${chan_tests_type}" >> $GITHUB_OUTPUT - - chan_upstream_version=$(bash ./.github/scripts/upstream.sh "${{ matrix.image.app }}" "${{ matrix.image.channel }}") && \ - echo "chan_upstream_version=${chan_upstream_version}" >> $GITHUB_OUTPUT - - if [[ "${chan_tests_enabled}" == true && "${chan_tests_type}" == "cli" ]]; then - echo "chan_goss_args=tail -f /dev/null" >> $GITHUB_OUTPUT - fi - - if [[ "${container_base}" == true ]]; then - echo "chan_label_type=org.opencontainers.image.base" >> $GITHUB_OUTPUT - else - echo "chan_label_type=org.opencontainers.image" >> $GITHUB_OUTPUT - fi - - if test -f "./apps/${{ matrix.image.app }}/${{ matrix.image.channel }}/Dockerfile"; then - echo "chan_dockerfile=./apps/${{ matrix.image.app }}/${{ matrix.image.channel }}/Dockerfile" >> $GITHUB_OUTPUT - echo "chan_goss_config=./apps/${{ matrix.image.app }}/${{ matrix.image.channel }}/goss.yaml" >> $GITHUB_OUTPUT - else - echo "chan_dockerfile=./apps/${{ matrix.image.app }}/Dockerfile" >> $GITHUB_OUTPUT - echo "chan_goss_config=./apps/${{ matrix.image.app }}/ci/goss.yaml" >> $GITHUB_OUTPUT - fi - - if [[ "${chan_stable}" == true ]]; then - echo "chan_tag_testing=${{ matrix.image.app }}:testingz" >> $GITHUB_OUTPUT - echo "chan_tag_rolling=${{ matrix.image.app }}:rolling" >> $GITHUB_OUTPUT - echo "chan_tag_version=${{ matrix.image.app }}:${chan_upstream_version}" >> $GITHUB_OUTPUT - else - echo "chan_tag_testing=${{ matrix.image.app }}-${{ matrix.image.channel }}:testingz" >> $GITHUB_OUTPUT - echo "chan_tag_rolling=${{ matrix.image.app }}-${{ matrix.image.channel }}:rolling" >> $GITHUB_OUTPUT - echo "chan_tag_version=${{ matrix.image.app }}-${{ matrix.image.channel }}:${chan_upstream_version}" >> $GITHUB_OUTPUT - fi - - - name: Setup Tools - shell: bash - run: sudo apt-get install -y moreutils jo - - - name: Setup CUE - uses: cue-lang/setup-cue@0be332bb74c8a2f07821389447ba3163e2da3bfb - - - name: Setup Goss - if: ${{ steps.vars.outputs.chan_tests_enabled == 'true' }} - uses: e1himself/goss-installation-action@v1.1.0 - with: - version: v0.3.21 - - - name: Validate image metadata - shell: bash - run: cue vet --schema '#Spec' ./apps/${{ matrix.image.app }}/metadata.json ./metadata.rules.cue - - - name: Setup QEMU - uses: docker/setup-qemu-action@v2 - - - name: Setup Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Setup GHCR - if: ${{ inputs.pushImages == 'true' }} - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build container image for testing - uses: docker/build-push-action@v4 - with: - build-args: |- - VERSION=${{ steps.vars.outputs.chan_upstream_version }} - CHANNEL=${{ matrix.image.channel }} - context: . - platforms: linux/amd64 # load does not support muti-arch https://github.com/docker/buildx/issues/290 - file: ${{ steps.vars.outputs.chan_dockerfile }} - load: true - tags: ghcr.io/${{ github.repository_owner }}/${{ steps.vars.outputs.chan_tag_testing }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Run Goss tests - id: dgoss - if: ${{ steps.vars.outputs.chan_tests_enabled == 'true' }} - shell: bash - env: - CONTAINER_RUNTIME: docker - GOSS_FILE: ${{ steps.vars.outputs.chan_goss_config }} - GOSS_OPTS: --retry-timeout 60s --sleep 2s --color --format documentation - GOSS_SLEEP: 2 - GOSS_FILES_STRATEGY: cp - CONTAINER_LOG_OUTPUT: goss_container_log_output - run: dgoss run ghcr.io/${{ github.repository_owner }}/${{ steps.vars.outputs.chan_tag_testing }} ${{ steps.vars.outputs.chan_goss_args }} - - - name: Build all platforms - id: release - uses: docker/build-push-action@v3 - with: - build-args: |- - VERSION=${{ steps.vars.outputs.chan_upstream_version }} - CHANNEL=${{ matrix.image.channel }} - labels: |- - ${{ steps.vars.outputs.chan_label_type }}.created="${{ steps.vars.outputs.chan_build_date }}" - ${{ steps.vars.outputs.chan_label_type }}.title="${{ matrix.image.app }} (${{ matrix.image.channel }})" - ${{ steps.vars.outputs.chan_label_type }}.version="${{ steps.vars.outputs.chan_upstream_version }}" - ${{ steps.vars.outputs.chan_label_type }}.authors="Devin Buhl " - ${{ steps.vars.outputs.chan_label_type }}.url="https://github.com/onedr0p/containers/apps/${{ matrix.image.app }}" - ${{ steps.vars.outputs.chan_label_type }}.build.url="https://github.com/onedr0p/containers/actions/runs/${{ github.run_id }}" - ${{ steps.vars.outputs.chan_label_type }}.documentation="https://github.com/onedr0p/containers/apps/${{ matrix.image.app }}/README.md" - ${{ steps.vars.outputs.chan_label_type }}.revision="${{ github.sha }}" - context: . - platforms: ${{ steps.vars.outputs.chan_platforms }} - file: ${{ steps.vars.outputs.chan_dockerfile }} - push: ${{ inputs.pushImages == 'true' }} - tags: |- - ghcr.io/${{ github.repository_owner }}/${{ steps.vars.outputs.chan_tag_rolling }} - ghcr.io/${{ github.repository_owner }}/${{ steps.vars.outputs.chan_tag_version }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Build successful - id: build-success - if: ${{ always() && steps.release.outcome == 'success' }} - run: |- - echo "message=🎉 ${{ matrix.image.app }}-${{ matrix.image.channel }} (${{ steps.vars.outputs.chan_upstream_version }})" >> $GITHUB_OUTPUT - echo "color=0x00FF00" >> $GITHUB_OUTPUT - - - name: Build failed - id: build-failed - if: ${{ always() && (steps.release.outcome == 'failure' || steps.dgoss.outcome == 'failure') }} - run: |- - echo "message=💥 ${{ matrix.image.app }}-${{ matrix.image.channel }} (${{ steps.vars.outputs.chan_upstream_version }})" >> $GITHUB_OUTPUT - echo "color=0xFF0000" >> $GITHUB_OUTPUT - - - name: Send Discord Webhook - uses: sarisia/actions-status-discord@v1 - if: ${{ always() && inputs.sendNotification == 'true' }} - with: - webhook: ${{ secrets.DISCORD_WEBHOOK }} - title: ${{ steps.build-failed.outputs.message || steps.build-success.outputs.message }} - color: ${{ steps.build-failed.outputs.color }} - username: GitHub Actions - - # Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7 - build_success: - name: Build matrix success - runs-on: ubuntu-latest - needs: - - build-and-test - if: ${{ always() }} - steps: - - name: Check build matrix status - if: ${{ (inputs.imagesToBuild != '' && inputs.imagesToBuild != '[]') && (needs.build-and-test.result != 'success') }} - run: exit 1 diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml new file mode 100644 index 000000000..9c5b06cf5 --- /dev/null +++ b/.github/workflows/build-images.yaml @@ -0,0 +1,351 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: "Image Build" + +on: + workflow_call: + inputs: + appsToBuild: + required: false + type: string + default: "" + channelsToBuild: + required: false + type: string + default: "" + pushImages: + required: false + default: false + type: boolean + sendNotifications: + required: false + default: false + type: boolean + force: + required: false + default: true + type: boolean + description: Force rebuild + secrets: + BOT_APP_ID: + description: The App ID of the GitHub App + required: true + BOT_APP_PRIVATE_KEY: + description: The private key of the GitHub App + required: true + +jobs: + prepare: + name: Prepare to Build + runs-on: ubuntu-latest + outputs: + matrices: ${{ steps.prepare-matrices.outputs.matrices }} + steps: + - name: Lowercase repository owner + shell: bash + run: echo "LOWERCASE_REPO_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV + + - name: Generate Token + uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: "${{ secrets.BOT_APP_ID }}" + private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" + + - name: Checkout + uses: actions/checkout@v4 + with: + token: "${{ steps.app-token.outputs.token }}" + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + cache: pip + + - name: Install Python Requirements + shell: bash + run: pip install -r ./.github/scripts/requirements.txt && pip freeze + + - name: Prepare Matrices + id: prepare-matrices + env: + TOKEN: ${{ steps.app-token.outputs.token }} + shell: bash + run: | + if [[ -z "${{ inputs.appsToBuild }}" ]]; then + matrices=$(python ./.github/scripts/prepare-matrices.py "all" "${{ inputs.pushImages }}" "${{ inputs.force }}") + else + if [[ -z "${{ inputs.channelsToBuild }}" ]]; then + matrices=$(python ./.github/scripts/prepare-matrices.py "${{ inputs.appsToBuild }}" "${{ inputs.pushImages }}" "${{ inputs.force }}") + else + matrices=$(python ./.github/scripts/prepare-matrices.py "${{ inputs.appsToBuild }}" "${{ inputs.pushImages }}" "${{ inputs.force }}" "${{ inputs.channelsToBuild }}") + fi + fi + echo "matrices=${matrices}" >> $GITHUB_OUTPUT + echo "${matrices}" + + build-platform-images: + name: Build/Test ${{ matrix.image.name }} (${{ matrix.image.platform }}) + needs: prepare + runs-on: ubuntu-latest + if: ${{ toJSON(fromJSON(needs.prepare.outputs.matrices).imagePlatforms) != '[]' && toJSON(fromJSON(needs.prepare.outputs.matrices).imagePlatforms) != '' }} + strategy: + fail-fast: false + matrix: + image: + ["${{ fromJSON(needs.prepare.outputs.matrices).imagePlatforms }}"] + permissions: + contents: read + packages: write + steps: + - name: Lowercase repository owner + shell: bash + run: echo "LOWERCASE_REPO_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV + + - name: Log Matrix Input + shell: bash + run: | + cat << EOF + ${{ toJSON(matrix.image)}} + EOF + + - name: Validate Matrix Input + shell: bash + run: | + if [[ -z "${{ matrix.image.name }}" ]]; then + echo "image.name is empty" + exit 1 + fi + if [[ -z "${{ matrix.image.version }}" ]]; then + echo "image.version is empty" + exit 1 + fi + if [[ -z "${{ matrix.image.context }}" ]]; then + echo "image.context is empty" + exit 1 + fi + if [[ -z "${{ matrix.image.dockerfile }}" ]]; then + echo "image.dockerfile is empty" + exit 1 + fi + if [[ -z "${{ matrix.image.platform }}" ]]; then + echo "image.platform is empty" + exit 1 + fi + if [[ -z "${{ matrix.image.tests_enabled }}" ]]; then + echo "image.tests_enabled is empty" + exit 1 + fi + echo "${{ matrix.image.name }}" | grep -E "[a-zA-Z0-9_\.\-]+" || "Image Name is invalid" + echo "${{ matrix.image.version }}" | grep -E "[a-zA-Z0-9_\.\-]+" || "Image Version is invalid" + + - name: Generate Token + uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: "${{ secrets.BOT_APP_ID }}" + private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" + + - name: Checkout + uses: actions/checkout@v4 + with: + token: "${{ steps.app-token.outputs.token }}" + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: "${{ github.actor }}" + password: "${{ secrets.GITHUB_TOKEN }}" + + - name: Setup Goss + if: ${{ matrix.image.tests_enabled }} + uses: e1himself/goss-installation-action@v1 + with: + version: latest + + - name: Prepare Build Outputs + id: prepare-build-outputs + shell: bash + run: | + if [[ "${{ inputs.pushImages }}" == "true" ]]; then + image_name="ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/${{ matrix.image.name }}" + outputs="type=image,name=${image_name},push-by-digest=true,name-canonical=true,push=true" + else + image_name="ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/${{ matrix.image.name }}:zztesting" + outputs="type=docker,name=${image_name},push=false" + fi + echo "image_name=${image_name}" >> $GITHUB_OUTPUT + echo "outputs=${outputs}" >> $GITHUB_OUTPUT + + - name: Build Image + uses: docker/build-push-action@v5 + id: build + with: + build-args: |- + VERSION=${{ matrix.image.version }} + REVISION=${{ github.sha }} + CHANNEL=${{ matrix.image.channel }} + # TODO: Use ${{ matrix.image.context }}, requires updates to all dockerfiles :-( + context: . + platforms: ${{ matrix.image.platform }} + file: ${{ matrix.image.dockerfile }} + outputs: ${{ steps.prepare-build-outputs.outputs.outputs }} + cache-from: type=gha + cache-to: type=gha,mode=max + labels: |- + org.opencontainers.image.title=${{ matrix.image.name }} + org.opencontainers.image.url=https://ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/${{ matrix.image.name }} + org.opencontainers.image.version=${{ matrix.image.version }} + org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.vendor=${{ env.LOWERCASE_REPO_OWNER }} + + - name: Run Goss Tests + id: dgoss + if: ${{ matrix.image.tests_enabled }} + env: + CONTAINER_RUNTIME: docker + GOSS_FILE: ${{ matrix.image.goss_config }} + GOSS_OPTS: --retry-timeout 60s --sleep 2s --color --format documentation + GOSS_SLEEP: 2 + GOSS_FILES_STRATEGY: cp + CONTAINER_LOG_OUTPUT: goss_container_log_output + shell: bash + run: | + if [[ '${{ inputs.pushImages }}' == 'true' ]]; then + image_name="${{ steps.prepare-build-outputs.outputs.image_name }}@${{ steps.build.outputs.digest }}" + else + image_name="${{ steps.prepare-build-outputs.outputs.image_name }}" + fi + dgoss run ${image_name} ${{ matrix.image.goss_args }} + + - name: Export Digest + id: export-digest + if: ${{ inputs.pushImages }} + shell: bash + run: | + mkdir -p /tmp/${{ matrix.image.name }}/digests + digest="${{ steps.build.outputs.digest }}" + echo "${{ matrix.image.name }}" > "/tmp/${{ matrix.image.name }}/digests/${digest#sha256:}" + + - name: Upload Digest + if: ${{ inputs.pushImages}} + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.image.name }}-${{ matrix.image.target_os }}-${{ matrix.image.target_arch }} + path: /tmp/${{ matrix.image.name }}/* + if-no-files-found: error + retention-days: 1 + + merge: + name: Merge ${{ matrix.image.name }} + runs-on: ubuntu-latest + needs: ["prepare", "build-platform-images"] + # Always run merge, as the prior matrix is all or nothing. We test for prior step failure + # in the "Test Failed Bit" step. This ensures if one app fails, others can still complete. + if: ${{ always() && inputs.pushImages && toJSON(fromJSON(needs.prepare.outputs.matrices).images) != '[]' && toJSON(fromJSON(needs.prepare.outputs.matrices).images) != '' }} + strategy: + matrix: + image: ["${{ fromJSON(needs.prepare.outputs.matrices).images }}"] + fail-fast: false + steps: + - name: Lowercase repository owner + shell: bash + run: echo "LOWERCASE_REPO_OWNER=${GITHUB_REPOSITORY_OWNER,,}" >> $GITHUB_ENV + + - name: Download Digests + uses: actions/download-artifact@v4 + with: + pattern: "${{ matrix.image.name }}-{linux,darwin}-{amd64,arm64}" + merge-multiple: true + path: /tmp/${{ matrix.image.name }} + + - name: Ensure all platforms were built + id: ensure-platforms + shell: bash + run: | + EXPECTED_COUNT=$(cat << EOF | jq ". | length" + ${{ toJSON(matrix.image.platforms) }} + EOF + ) + ACTUAL_COUNT=$(ls -1 /tmp/${{ matrix.image.name }}/digests | wc -l) + if [[ $EXPECTED_COUNT != $ACTUAL_COUNT ]]; then + echo "Expected $EXPECTED_COUNT platforms, but only found $ACTUAL_COUNT" + echo "Expected: ${{ toJSON(matrix.image.platforms) }}" + echo "Actual: $(cat /tmp/${{ matrix.image.name }}/digests/*)" + exit 1 + fi + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: "${{ github.actor }}" + password: "${{ secrets.GITHUB_TOKEN }}" + + - name: Log Files + working-directory: /tmp/${{ matrix.image.name }}/digests + shell: bash + run: | + ls -la + cat * + + - name: Merge Manifests + id: merge + working-directory: /tmp/${{ matrix.image.name }}/digests + env: + TAGS: ${{ toJSON(matrix.image.tags) }} + shell: bash + run: | + docker buildx imagetools create $(jq -cr '. | map("-t ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/${{matrix.image.name}}:" + .) | join(" ")' <<< "$TAGS") \ + $(printf 'ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/${{ matrix.image.name }}@sha256:%s ' *) + + - name: Inspect image + id: inspect + shell: bash + run: | + docker buildx imagetools inspect ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/${{ matrix.image.name }}:${{ matrix.image.tags[0] }} + + - name: Build successful + id: build-success + if: ${{ always() && steps.merge.outcome == 'success' && steps.inspect.outcome == 'success' }} + shell: bash + run: | + echo "message=🎉 ${{ matrix.image.name }} (${{ matrix.image.tags[0] }})" >> $GITHUB_OUTPUT + echo "color=0x00FF00" >> $GITHUB_OUTPUT + + - name: Build failed + id: build-failed + if: ${{ always() && (steps.merge.outcome == 'failure' || steps.inspect.outcome == 'failure') }} + shell: bash + run: | + echo "message=💥 ${{ matrix.image.name }} (${{ matrix.image.tags[0] }})" >> $GITHUB_OUTPUT + echo "color=0xFF0000" >> $GITHUB_OUTPUT + + - name: Send Discord Webhook + uses: sarisia/actions-status-discord@v1 + if: ${{ always() && inputs.sendNotifications == 'true' }} + with: + webhook: ${{ secrets.DISCORD_WEBHOOK }} + title: ${{ steps.build-failed.outputs.message || steps.build-success.outputs.message }} + color: ${{ steps.build-failed.outputs.color || steps.build-success.outputs.color }} + username: GitHub Actions + + # Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7 + build_success: + name: Build matrix success + runs-on: ubuntu-latest + needs: ["prepare", "merge"] + if: ${{ always() }} + steps: + - name: Check build matrix status + if: ${{ (inputs.appsToBuild != '' && inputs.appsToBuild != '[]') && (needs.merge.result != 'success' && needs.merge.result != 'skipped' && needs.prepare.result != 'success') }} + shell: bash + run: exit 1 diff --git a/.github/workflows/get-changed-images.yaml b/.github/workflows/get-changed-images.yaml new file mode 100644 index 000000000..226bf1558 --- /dev/null +++ b/.github/workflows/get-changed-images.yaml @@ -0,0 +1,47 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: "Get Changed Images" + +on: + workflow_call: + outputs: + addedOrModified: + description: "Whether any files were added or modified" + value: ${{ jobs.get-changed-images.outputs.addedOrModified }} + addedOrModifiedImages: + description: "The images that were added or modified" + value: ${{ jobs.get-changed-images.outputs.addedOrModifiedImages }} + +jobs: + get-changed-images: + name: Get Changed Images + runs-on: ubuntu-latest + outputs: + addedOrModified: "${{ steps.changed-files.outputs.all_changed_and_modified_files_count > 0 }}" + addedOrModifiedImages: "${{ steps.changed-containers.outputs.addedOrModifiedImages }}" + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get Changed Files + id: changed-files + uses: tj-actions/changed-files@v42 + with: + files: apps/** + dir_names: true + dir_names_max_depth: 2 + json: true + escape_json: false + + - if: ${{ steps.changed-files.outputs.all_changed_and_modified_files_count > 0 }} + name: Determine changed images + id: changed-containers + shell: bash + run: | + IMAGES=$( \ + echo '${{ steps.changed-files.outputs.all_changed_and_modified_files }}' \ + | jq --raw-output 'map(sub("^apps/"; "")) | join(",")' \ + ) + echo "addedOrModifiedImages=${IMAGES}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/image-rebuild.yaml b/.github/workflows/image-rebuild.yaml deleted file mode 100644 index 114a51834..000000000 --- a/.github/workflows/image-rebuild.yaml +++ /dev/null @@ -1,68 +0,0 @@ ---- -name: "Image: Rebuild" - -on: - push: - branches: - - main - paths: - - "apps/**" - - "!apps/**/metadata.json" - - "!apps/**/README.md" - -jobs: - get-changes: - name: Collect changes - runs-on: ubuntu-latest - outputs: - addedOrModifiedImages: ${{ steps.collect-changes.outputs.addedOrModifiedImages }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Collect changes - id: collect-changes - uses: ./.github/actions/collect-changes - - generate-build-matrix: - name: Generate matrix for building images - runs-on: ubuntu-latest - needs: ["get-changes"] - outputs: - matrix: ${{ steps.get-changed.outputs.changes }} - if: ${{ needs.get-changes.outputs.addedOrModifiedImages }} != '[]' - steps: - - name: Install tools - run: sudo apt-get install moreutils jo - - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Fetch modified images - id: get-changed - shell: bash - run: | - declare -a changes_array=() - while read -r app - do - while read -r channel - do - change="$(jo app="$app" channel="$channel")" - changes_array+=($change) - done < <(jq -r '.channels[] | .name' "./apps/$app/metadata.json") - done < <(echo '${{ needs.get-changes.outputs.addedOrModifiedImages }}' | jq --raw-output -c '.[]') - - output="$(jo -a ${changes_array[*]})" - echo "changes=${output}" >> $GITHUB_OUTPUT - - images-build: - uses: onedr0p/containers/.github/workflows/action-image-build.yaml@main - needs: - - generate-build-matrix - with: - imagesToBuild: "${{ needs.generate-build-matrix.outputs.matrix }}" - pushImages: "true" - updateMetadata: "true" - secrets: inherit diff --git a/.github/workflows/pr-metadata.yaml b/.github/workflows/pr-metadata.yaml deleted file mode 100644 index 7f05f7dbc..000000000 --- a/.github/workflows/pr-metadata.yaml +++ /dev/null @@ -1,58 +0,0 @@ ---- -name: "Pull Request: Metadata" - -on: - workflow_call: - outputs: - isFork: - description: "Is the PR coming from a forked repo?" - value: ${{ jobs.pr-metadata.outputs.isFork }} - addedOrModified: - description: "Does the PR contain any changes?" - value: ${{ jobs.pr-changes.outputs.addedOrModified }} - addedOrModifiedFiles: - description: "A list of the files changed in this PR" - value: ${{ jobs.pr-changes.outputs.addedOrModifiedFiles }} - addedOrModifiedImages: - description: "A list of the containers changed in this PR" - value: ${{ jobs.pr-changes.outputs.addedOrModifiedImages }} - -jobs: - pr-metadata: - name: Collect PR metadata - runs-on: ubuntu-latest - outputs: - isRenovatePR: ${{ startsWith(steps.branch-name.outputs.current_branch, 'renovate/') }} - isFork: ${{ github.event.pull_request.head.repo.full_name != github.repository }} - steps: - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v6.4 - - - name: Save PR data to file - env: - PR_NUMBER: ${{ github.event.number }} - run: | - echo $PR_NUMBER > pr_number.txt - - - name: Store pr data in artifact - uses: actions/upload-artifact@v3 - with: - name: pr_metadata - path: ./pr_number.txt - retention-days: 5 - - pr-changes: - name: Collect PR changes - runs-on: ubuntu-latest - outputs: - addedOrModified: ${{ steps.collect-changes.outputs.changesDetected }} - addedOrModifiedFiles: ${{ steps.collect-changes.outputs.addedOrModifiedFiles }} - addedOrModifiedImages: ${{ steps.collect-changes.outputs.addedOrModifiedImages }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Collect changes - id: collect-changes - uses: ./.github/actions/collect-changes diff --git a/.github/workflows/pr-validate.yaml b/.github/workflows/pr-validate.yaml index 89de5d276..9f031633d 100644 --- a/.github/workflows/pr-validate.yaml +++ b/.github/workflows/pr-validate.yaml @@ -1,56 +1,29 @@ --- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json name: "Pull Request: Validate" on: pull_request: - branches: - - main + branches: ["main"] + types: ["opened", "synchronize", "reopened"] concurrency: group: ${{ github.head_ref }}-pr-validate cancel-in-progress: true jobs: - pr-metadata: - uses: onedr0p/containers/.github/workflows/pr-metadata.yaml@main + simple-checks: + uses: onedr0p/containers/.github/workflows/simple-checks.yaml@main - generate-build-matrix: - name: Generate matrix for building images - runs-on: ubuntu-latest - needs: ["pr-metadata"] - outputs: - matrix: ${{ steps.get-changed.outputs.changes }} - if: ${{ needs.pr-metadata.outputs.addedOrModifiedImages }} != '[]' - steps: - - name: Install tools - run: sudo apt-get install moreutils jo + get-changed-images: + uses: onedr0p/containers/.github/workflows/get-changed-images.yaml@main - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Fetch modified images - id: get-changed - shell: bash - run: | - declare -a changes_array=() - while read -r app - do - while read -r channel - do - change="$(jo app="$app" channel="$channel")" - changes_array+=($change) - done < <(jq --raw-output -c '.channels[] | .name' "./apps/$app/metadata.json") - done < <(echo '${{ needs.pr-metadata.outputs.addedOrModifiedImages }}' | jq --raw-output -c '.[]') - - output="$(jo -a ${changes_array[*]})" - echo "changes=${output}" >> $GITHUB_OUTPUT - - images-build: - uses: onedr0p/containers/.github/workflows/action-image-build.yaml@main - needs: ["generate-build-matrix"] - with: - imagesToBuild: "${{ needs.generate-build-matrix.outputs.matrix }}" - updateMetadata: "false" + build-images: + needs: ["simple-checks", "get-changed-images"] + if: ${{ needs.get-changed-images.outputs.addedOrModified == 'true' }} + uses: onedr0p/containers/.github/workflows/build-images.yaml@main secrets: inherit + with: + appsToBuild: "${{ needs.get-changed-images.outputs.addedOrModifiedImages }}" + pushImages: false + sendNotifications: false diff --git a/.github/workflows/release-manual.yaml b/.github/workflows/release-manual.yaml deleted file mode 100644 index 5ae52d5e2..000000000 --- a/.github/workflows/release-manual.yaml +++ /dev/null @@ -1,67 +0,0 @@ ---- -name: "Manual Release" - -concurrency: - group: container-release - cancel-in-progress: false - -on: - workflow_dispatch: - inputs: - app: - description: "App (ex: radarr)" - default: "" - required: true - channels: - description: "Channels (ex: master,develop)" - default: "" - required: true - push: - description: "Push" - default: "false" - required: true - -env: - TOKEN: ${{ secrets.TOKEN }} - -jobs: - generate-build-matrix: - name: Generate matrix for building images - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.determine-images.outputs.changes }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install tools - run: sudo apt-get install moreutils jo - - - name: Determine images to build - id: determine-images - shell: bash - run: | - if [ "${{ inputs.app }}" = "ALL" ]; then - ./.github/scripts/fetch.sh all - else - output="[]" - IFS=',' read -a channels <<< "${{ inputs.channels }}" - declare -a images_array=() - for channel in "${channels[@]}"; do - image="$(jo app="${{ inputs.app }}" channel="$channel")" - images_array+=($image) - done - - output="$(jo -a ${images_array[*]})" - echo "changes=${output}" >> $GITHUB_OUTPUT - fi - - images-build: - uses: onedr0p/containers/.github/workflows/action-image-build.yaml@main - if: needs.generate-build-matrix.outputs.matrix != '[]' - needs: ["generate-build-matrix"] - with: - imagesToBuild: "${{ needs.generate-build-matrix.outputs.matrix }}" - pushImages: "${{ github.event.inputs.push }}" - updateMetadata: "${{ github.event.inputs.push }}" - secrets: inherit diff --git a/.github/workflows/release-on-merge.yaml b/.github/workflows/release-on-merge.yaml new file mode 100644 index 000000000..273c807f6 --- /dev/null +++ b/.github/workflows/release-on-merge.yaml @@ -0,0 +1,42 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Release on Merge + +concurrency: + group: container-release + cancel-in-progress: false + +on: + push: + branches: ["main"] + paths: + - "apps/**" + - ".github/scripts/templates/**" + - "!apps/**/metadata.json" + - "!apps/**/metadata.yaml" + - "!apps/**/README.md" + +jobs: + simple-checks: + uses: onedr0p/containers/.github/workflows/simple-checks.yaml@main + + get-changed-images: + needs: ["simple-checks"] + uses: onedr0p/containers/.github/workflows/get-changed-images.yaml@main + + build-images: + needs: ["simple-checks", "get-changed-images"] + if: ${{ needs.get-changed-images.outputs.addedOrModified == 'true' }} + uses: onedr0p/containers/.github/workflows/build-images.yaml@main + secrets: inherit + with: + appsToBuild: "${{ needs.get-changed-images.outputs.addedOrModifiedImages }}" + pushImages: true + sendNotifications: true + + render-readme: + name: Render Readme + needs: build-images + if: ${{ always() && needs.build-images.result != 'failure' }} + uses: ./.github/workflows/render-readme.yaml + secrets: inherit diff --git a/.github/workflows/release-schedule.yaml b/.github/workflows/release-schedule.yaml deleted file mode 100644 index 5f8180841..000000000 --- a/.github/workflows/release-schedule.yaml +++ /dev/null @@ -1,51 +0,0 @@ ---- -name: "Scheduled Release" - -concurrency: - group: container-release - cancel-in-progress: false - -on: - workflow_dispatch: - schedule: - - cron: "0 * * * *" - -env: - TOKEN: ${{ secrets.TOKEN }} - -jobs: - generate-build-matrix: - name: Generate matrix for building images - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.fetch.outputs.changes }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install tools - run: sudo apt-get install moreutils jo - - - name: Generate Token - uses: tibdex/github-app-token@v1 - id: generate-token - with: - app_id: "${{ secrets.BOT_APP_ID }}" - private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" - - - name: Fetch new app versions - id: fetch - run: ./.github/scripts/fetch.sh - env: - TOKEN: "${{ steps.generate-token.outputs.token }}" - - images-build: - uses: onedr0p/containers/.github/workflows/action-image-build.yaml@main - if: needs.generate-build-matrix.outputs.matrix != '[]' - needs: ["generate-build-matrix"] - with: - imagesToBuild: "${{ needs.generate-build-matrix.outputs.matrix }}" - pushImages: "true" - updateMetadata: "true" - sendNotification: "true" - secrets: inherit diff --git a/.github/workflows/release-scheduled.yaml b/.github/workflows/release-scheduled.yaml new file mode 100644 index 000000000..73d3906c0 --- /dev/null +++ b/.github/workflows/release-scheduled.yaml @@ -0,0 +1,48 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: Scheduled Release + +concurrency: + group: container-release + cancel-in-progress: false + +on: + workflow_dispatch: + inputs: + appsToBuild: + description: App(s) to build + required: false + type: string + default: all + force: + description: Force rebuild + type: boolean + default: false + required: true + schedule: + - cron: "0 * * * *" + +jobs: + simple-checks: + name: Simple Checks + uses: onedr0p/containers/.github/workflows/simple-checks.yaml@main + + build-images: + name: Build Images + needs: simple-checks + uses: onedr0p/containers/.github/workflows/build-images.yaml@main + secrets: inherit + permissions: + contents: read + packages: write + with: + appsToBuild: ${{ inputs.appsToBuild }} + force: ${{ inputs.force == true }} + pushImages: true + sendNotifications: true + + render-readme: + name: Render Readme + needs: build-images + uses: ./.github/workflows/render-readme.yaml + secrets: inherit diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml new file mode 100644 index 000000000..fe89bac63 --- /dev/null +++ b/.github/workflows/render-readme.yaml @@ -0,0 +1,55 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: "Render Readme" + +on: + workflow_call: + secrets: + BOT_APP_ID: + description: The App ID of the GitHub App + required: true + BOT_APP_PRIVATE_KEY: + description: The private key of the GitHub App + required: true + +jobs: + render-readme: + name: Render README + runs-on: ubuntu-latest + steps: + - name: Generate Token + uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: "${{ secrets.BOT_APP_ID }}" + private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" + + - name: Checkout + uses: actions/checkout@v4 + with: + token: "${{ steps.app-token.outputs.token }}" + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + cache: pip + + - name: Install Python Requirements + shell: bash + run: pip install -r ./.github/scripts/requirements.txt && pip freeze + + - name: Render README + env: + GITHUB_TOKEN: "${{ steps.app-token.outputs.token }}" + shell: bash + run: python ./.github/scripts/render-readme.py + + - name: Commit Changes + shell: bash + run: | + git config --global user.name "bot-ross" + git config --global user.email "98030736+bot-ross[bot]@users.noreply.github.com" + git add ./README.md + git commit -m "chore: render README.md" || echo "No changes to commit" + git push origin || echo "No changes to push" diff --git a/.github/workflows/renovate-schedule.yaml b/.github/workflows/renovate-schedule.yaml deleted file mode 100644 index 067b5c4c1..000000000 --- a/.github/workflows/renovate-schedule.yaml +++ /dev/null @@ -1,52 +0,0 @@ ---- -name: "Renovate" - -on: - workflow_dispatch: - inputs: - dryRun: - description: "Dry-Run" - default: "false" - required: false - logLevel: - description: "Log-Level" - default: "debug" - required: false - schedule: - - cron: "0 * * * *" - push: - branches: ["main"] - paths: - - ".github/renovate.json5" - - ".github/renovate/**.json5" - -env: - LOG_LEVEL: debug - RENOVATE_DRY_RUN: false - RENOVATE_CONFIG_FILE: .github/renovate.json5 - -jobs: - renovate: - name: Renovate - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - - name: Generate Token - uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0 - id: generate-token - with: - app_id: "${{ secrets.BOT_APP_ID }}" - private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" - - - name: Override default config from dispatch variables - run: | - echo "RENOVATE_DRY_RUN=${{ github.event.inputs.dryRun || env.RENOVATE_DRY_RUN }}" >> "${GITHUB_ENV}" - echo "LOG_LEVEL=${{ github.event.inputs.logLevel || env.LOG_LEVEL }}" >> "${GITHUB_ENV}" - - - name: Renovate - uses: renovatebot/github-action@a659fe27f0a9503a1603320305d635b47301ae28 # v34.157.0 - with: - configurationFile: "${{ env.RENOVATE_CONFIG_FILE }}" - token: "${{ steps.generate-token.outputs.token }}" diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml new file mode 100644 index 000000000..ebe8e3a15 --- /dev/null +++ b/.github/workflows/renovate.yaml @@ -0,0 +1,63 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: "Renovate" + +on: + workflow_dispatch: + inputs: + dryRun: + description: Dry Run + default: "false" + required: false + logLevel: + description: Log Level + default: debug + required: false + version: + description: Renovate version + default: latest + required: false + schedule: + - cron: "0 * * * *" # Every hour + push: + branches: ["main"] + paths: + - .github/renovate.json5 + - .github/renovate/**.json5 + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +env: + LOG_LEVEL: "${{ inputs.logLevel || 'debug' }}" + RENOVATE_AUTODISCOVER: true + RENOVATE_AUTODISCOVER_FILTER: "${{ github.repository }}" + RENOVATE_DRY_RUN: "${{ inputs.dryRun == true }}" + RENOVATE_PLATFORM: github + RENOVATE_PLATFORM_COMMIT: true + WORKFLOW_RENOVATE_VERSION: "${{ inputs.version || 'latest' }}" + +jobs: + renovate: + name: Renovate + runs-on: ubuntu-latest + steps: + - name: Generate Token + uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: "${{ secrets.BOT_APP_ID }}" + private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}" + + - name: Checkout + uses: actions/checkout@v4 + with: + token: "${{ steps.app-token.outputs.token }}" + + - name: Renovate + uses: renovatebot/github-action@v40.1.5 + with: + configurationFile: .github/renovate.json5 + token: "${{ steps.app-token.outputs.token }}" + renovate-version: "${{ env.WORKFLOW_RENOVATE_VERSION }}" diff --git a/.github/workflows/simple-checks.yaml b/.github/workflows/simple-checks.yaml new file mode 100644 index 000000000..623ca12e1 --- /dev/null +++ b/.github/workflows/simple-checks.yaml @@ -0,0 +1,38 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json +name: "Simple Checks" + +on: + workflow_call: + +jobs: + metadata-validation: + name: Validate Image Metadata + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get Changed Files + id: changed-files + uses: tj-actions/changed-files@v42 + with: + files_yaml: | + cue: + - metadata.rules.cue + - apps/**/metadata.json + - apps/**/metadata.yaml + + - name: Setup CUE + if: ${{ steps.changed-files.outputs.cue_any_changed == 'true' }} + uses: cue-lang/setup-cue@v1.0.1 + + # Run against all files to ensure they are tested if the cue schema is changed. + - name: Validate image metadata + if: ${{ steps.changed-files.outputs.cue_any_changed == 'true' }} + shell: bash + run: | + find ./apps/ -name metadata.json | xargs -I {} cue vet --schema '#Spec' {} ./metadata.rules.cue + find ./apps/ -name metadata.yaml | xargs -I {} cue vet --schema '#Spec' {} ./metadata.rules.cue diff --git a/.gitignore b/.gitignore index c4777aae5..39aa0b8fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .goss .private +**/*.pyc diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..2ba39a292 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "*.json5": "jsonc" + } +} diff --git a/README.md b/README.md index 551c1eb20..8ecee1f68 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,25 @@ -# Container images + +
-Welcome to our container images, if looking for a container start by [browsing the container packages](https://github.com/onedr0p?tab=packages&repo_name=containers). + +## Containers + +_An opinionated collection of container images_ + +
+ +
+ +![GitHub Repo stars](https://img.shields.io/github/stars/onedr0p/containers?style=for-the-badge) +![GitHub forks](https://img.shields.io/github/forks/onedr0p/containers?style=for-the-badge) +![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/onedr0p/containers/release-scheduled.yaml?style=for-the-badge&label=Scheduled%20Release) + +
+ +Welcome to our container images, if looking for a container start by [browsing the GitHub Packages page for this repo's packages](https://github.com/onedr0p?tab=packages&repo_name=containers). ## Mission statement @@ -10,9 +29,9 @@ We also try to adhere to a [KISS principle](https://en.wikipedia.org/wiki/KISS_p ## Tag immutability -The containers built here do not use immutable tags, as least not in the more common way you have seen from [linuxserver.io](https://fleet.linuxserver.io/) or [Bitnami](https://bitnami.com/stacks/containers). +The containers built here do not use immutable tags, as least not in the more common way you have seen from [linuxserver.io](https://fleet.linuxserver.io/) or [Bitnami](https://bitnami.com/stacks/containers). -We take do take a similar approach but instead of appending a `-ls69` or `-r420` prefix to the tag we instead insist on pinning to the sha256 digest of the image, while this is not as pretty it is just as functional in making the images immutable. +We do take a similar approach but instead of appending a `-ls69` or `-r420` prefix to the tag we instead insist on pinning to the sha256 digest of the image, while this is not as pretty it is just as functional in making the images immutable. | Container | Immutable | |----------------------------------------------------|-----------| @@ -42,6 +61,41 @@ Some applications do not support defining configuration via environment variable For applications that need to have persistent configuration data the config volume is hardcoded to `/config` inside the container. This is not able to be changed in most cases. +## Available Images + +Each Image will be built with a `rolling` tag, along with tags specific to it's version. Available Images Below + +Container | Channel | Image +--- | --- | --- +[actions-runner](https://github.com/onedr0p/containers/pkgs/container/actions-runner) | stable | ghcr.io/onedr0p/actions-runner +[bazarr](https://github.com/onedr0p/containers/pkgs/container/bazarr) | stable | ghcr.io/onedr0p/bazarr +[home-assistant](https://github.com/onedr0p/containers/pkgs/container/home-assistant) | stable | ghcr.io/onedr0p/home-assistant +[jbops](https://github.com/onedr0p/containers/pkgs/container/jbops) | stable | ghcr.io/onedr0p/jbops +[lidarr](https://github.com/onedr0p/containers/pkgs/container/lidarr) | master | ghcr.io/onedr0p/lidarr +[lidarr-develop](https://github.com/onedr0p/containers/pkgs/container/lidarr-develop) | develop | ghcr.io/onedr0p/lidarr-develop +[lidarr-nightly](https://github.com/onedr0p/containers/pkgs/container/lidarr-nightly) | nightly | ghcr.io/onedr0p/lidarr-nightly +[par2cmdline-turbo](https://github.com/onedr0p/containers/pkgs/container/par2cmdline-turbo) | stable | ghcr.io/onedr0p/par2cmdline-turbo +[plex](https://github.com/onedr0p/containers/pkgs/container/plex) | stable | ghcr.io/onedr0p/plex +[plex-beta](https://github.com/onedr0p/containers/pkgs/container/plex-beta) | beta | ghcr.io/onedr0p/plex-beta +[postgres-init](https://github.com/onedr0p/containers/pkgs/container/postgres-init) | stable | ghcr.io/onedr0p/postgres-init +[prowlarr](https://github.com/onedr0p/containers/pkgs/container/prowlarr) | master | ghcr.io/onedr0p/prowlarr +[prowlarr-develop](https://github.com/onedr0p/containers/pkgs/container/prowlarr-develop) | develop | ghcr.io/onedr0p/prowlarr-develop +[prowlarr-nightly](https://github.com/onedr0p/containers/pkgs/container/prowlarr-nightly) | nightly | ghcr.io/onedr0p/prowlarr-nightly +[qbittorrent](https://github.com/onedr0p/containers/pkgs/container/qbittorrent) | stable | ghcr.io/onedr0p/qbittorrent +[qbittorrent-beta](https://github.com/onedr0p/containers/pkgs/container/qbittorrent-beta) | beta | ghcr.io/onedr0p/qbittorrent-beta +[radarr](https://github.com/onedr0p/containers/pkgs/container/radarr) | master | ghcr.io/onedr0p/radarr +[radarr-develop](https://github.com/onedr0p/containers/pkgs/container/radarr-develop) | develop | ghcr.io/onedr0p/radarr-develop +[radarr-nightly](https://github.com/onedr0p/containers/pkgs/container/radarr-nightly) | nightly | ghcr.io/onedr0p/radarr-nightly +[readarr-develop](https://github.com/onedr0p/containers/pkgs/container/readarr-develop) | develop | ghcr.io/onedr0p/readarr-develop +[readarr-nightly](https://github.com/onedr0p/containers/pkgs/container/readarr-nightly) | nightly | ghcr.io/onedr0p/readarr-nightly +[sabnzbd](https://github.com/onedr0p/containers/pkgs/container/sabnzbd) | stable | ghcr.io/onedr0p/sabnzbd +[sonarr](https://github.com/onedr0p/containers/pkgs/container/sonarr) | main | ghcr.io/onedr0p/sonarr +[sonarr-develop](https://github.com/onedr0p/containers/pkgs/container/sonarr-develop) | develop | ghcr.io/onedr0p/sonarr-develop +[tautulli](https://github.com/onedr0p/containers/pkgs/container/tautulli) | master | ghcr.io/onedr0p/tautulli +[theme-park](https://github.com/onedr0p/containers/pkgs/container/theme-park) | stable | ghcr.io/onedr0p/theme-park +[volsync](https://github.com/onedr0p/containers/pkgs/container/volsync) | stable | ghcr.io/onedr0p/volsync + + ## Contributing 1. Install [Docker](https://docs.docker.com/get-docker/), [Taskfile](https://taskfile.dev/) & [Cuelang](https://cuelang.org/) @@ -81,7 +135,6 @@ Containers here can be **deprecated** at any point, this could be for any reason 4. The **maintenance burden** of keeping the container here **is too bothersome** **Note**: Deprecated containers will remained published to this repo for 6 months after which they will be pruned. - ## Credits A lot of inspiration and ideas are thanks to the hard work of [hotio.dev](https://hotio.dev/) and [linuxserver.io](https://www.linuxserver.io/) contributors. diff --git a/apps/actions-runner/Dockerfile b/apps/actions-runner/Dockerfile new file mode 100644 index 000000000..2a93e9db9 --- /dev/null +++ b/apps/actions-runner/Dockerfile @@ -0,0 +1,32 @@ +ARG VERSION +FROM --platform=amd64 ghcr.io/actions/actions-runner:${VERSION} + +ENV HOMEBREW_NO_ANALYTICS=1 \ + HOMEBREW_NO_ENV_HINTS=1 \ + HOMEBREW_NO_INSTALL_CLEANUP=1 \ + DEBCONF_NONINTERACTIVE_SEEN=true \ + DEBIAN_FRONTEND="noninteractive" \ + APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn + +USER root + +RUN \ + apt-get update && apt-get upgrade -y \ + && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + curl \ + gcc \ + git \ + jo \ + jq \ + moreutils \ + unrar \ + unzip \ + wget \ + zip \ + && rm -rf /var/lib/apt/lists/* + +USER runner + +RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" diff --git a/apps/rclone/ci/goss.yaml b/apps/actions-runner/ci/goss.yaml similarity index 85% rename from apps/rclone/ci/goss.yaml rename to apps/actions-runner/ci/goss.yaml index 686c87c58..bd5294544 100644 --- a/apps/rclone/ci/goss.yaml +++ b/apps/actions-runner/ci/goss.yaml @@ -1,5 +1,5 @@ --- # https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#file file: - /app/rclone: + /usr/bin/git: exists: true diff --git a/apps/actions-runner/ci/latest.sh b/apps/actions-runner/ci/latest.sh new file mode 100755 index 000000000..3381faf01 --- /dev/null +++ b/apps/actions-runner/ci/latest.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +version=$(curl -sX GET "https://api.github.com/repos/actions/runner/releases/latest" | jq --raw-output '.tag_name') +version="${version#*v}" +version="${version#*release-}" +printf "%s" "${version}" diff --git a/apps/actions-runner/metadata.yaml b/apps/actions-runner/metadata.yaml new file mode 100644 index 000000000..b4ba87d7d --- /dev/null +++ b/apps/actions-runner/metadata.yaml @@ -0,0 +1,11 @@ +--- +app: actions-runner +base: false +semantic_versioning: true +channels: + - name: stable + platforms: ["linux/amd64"] + stable: true + tests: + enabled: true + type: cli diff --git a/apps/alpine/Dockerfile b/apps/alpine/Dockerfile index d4aae37dd..e9456acdf 100644 --- a/apps/alpine/Dockerfile +++ b/apps/alpine/Dockerfile @@ -1,5 +1,5 @@ ARG VERSION -FROM public.ecr.aws/docker/library/alpine:3.17 as builder +FROM docker.io/library/alpine:3.19 as builder ARG VERSION ARG TARGETOS ARG TARGETARCH @@ -16,9 +16,9 @@ ENV PATH $GOPATH/bin:$PATH RUN \ apk add --no-cache go upx \ && go install -ldflags="-s -w" github.com/drone/envsubst/cmd/envsubst@latest \ - && upx --ultra-brute /go/bin/envsubst + && upx /go/bin/envsubst -FROM public.ecr.aws/docker/library/alpine:${VERSION} +FROM docker.io/library/alpine:${VERSION} ARG VERSION ARG CHANNEL ARG TARGETPLATFORM @@ -35,21 +35,10 @@ USER root #hadolint ignore=DL3018 RUN \ apk add --no-cache \ - # 656 kB # 1.28 MB # 632 kB - ca-certificates bash bind-tools \ - # 256 kB # 156 kB # 40 kB - curl iputils jo \ - # 564 kB # 200 kB # 316 kB - jq moreutils nano \ - # 76 kB - pv \ - # 36 kB # 3.3 MB # 320 kB - tini tzdata unzip \ - # 16 kB # 480 kB - util-linux wget \ - && \ - # 264 kB - apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main unrar + ca-certificates catatonit bash \ + bind-tools coreutils curl iputils jo \ + jq moreutils nano pv tzdata unzip \ + util-linux wget #hadolint ignore=DL3018 RUN \ @@ -66,9 +55,10 @@ RUN \ && ln -s /usr/bin/nano /usr/local/bin/nano \ && ln -s /usr/bin/nano /usr/local/bin/neovim \ && ln -s /usr/bin/nano /usr/local/bin/emacs \ + && ln -s /usr/bin/catatonit /sbin/tini \ && rm -rf /tmp/* VOLUME ["/config"] COPY ./apps/alpine/scripts /scripts COPY --from=builder /go/bin/envsubst /usr/local/bin/envsubst -ENTRYPOINT ["/sbin/tini", "--"] +ENTRYPOINT ["/usr/bin/catatonit", "--"] diff --git a/apps/alpine/metadata.json b/apps/alpine/metadata.json deleted file mode 100644 index 7e140f420..000000000 --- a/apps/alpine/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "alpine", - "base": true, - "channels": [ - { - "name": "3.17", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "cli" - } - } - ] -} diff --git a/apps/alpine/metadata.yaml b/apps/alpine/metadata.yaml new file mode 100644 index 000000000..a85498886 --- /dev/null +++ b/apps/alpine/metadata.yaml @@ -0,0 +1,10 @@ +--- +app: alpine +base: true +channels: + - name: "3.19" + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: cli diff --git a/apps/bazarr/Dockerfile b/apps/bazarr/Dockerfile index 968e9f660..02dc2107f 100644 --- a/apps/bazarr/Dockerfile +++ b/apps/bazarr/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 ARG TARGETPLATFORM ARG VERSION @@ -10,6 +10,7 @@ ENV \ PIP_ROOT_USER_ACTION=ignore \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PIP_BREAK_SYSTEM_PACKAGES=1 \ CRYPTOGRAPHY_DONT_BUILD_RUST=1 RUN \ @@ -28,14 +29,16 @@ RUN \ pip install --upgrade pip \ && \ pip install --upgrade \ - gevent-websocket \ - webrtcvad-wheels \ + "webrtcvad-wheels>=2.0.10" \ && apk del --purge .build-deps \ && rm -rf \ /root/.cache \ /root/.cargo \ /tmp/* +# Install unrar +COPY --from=ghcr.io/linuxserver/unrar:7.0.7 /usr/bin/unrar-alpine /usr/bin/unrar + USER kah COPY ./apps/bazarr/entrypoint.sh /entrypoint.sh CMD ["/entrypoint.sh"] diff --git a/apps/bazarr/entrypoint.sh b/apps/bazarr/entrypoint.sh index 1895f1e55..8e85ed7f5 100755 --- a/apps/bazarr/entrypoint.sh +++ b/apps/bazarr/entrypoint.sh @@ -9,4 +9,5 @@ exec \ /app/bazarr.py \ --no-update \ --config /config \ + --port ${BAZARR__PORT:-6767} \ "$@" diff --git a/apps/bazarr/metadata.json b/apps/bazarr/metadata.json deleted file mode 100644 index b9dca8b87..000000000 --- a/apps/bazarr/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "bazarr", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/bazarr/metadata.yaml b/apps/bazarr/metadata.yaml new file mode 100644 index 000000000..a47c1cdb0 --- /dev/null +++ b/apps/bazarr/metadata.yaml @@ -0,0 +1,11 @@ +--- +app: bazarr +base: false +semantic_versioning: true +channels: + - name: stable + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web diff --git a/apps/cni-plugins/Dockerfile b/apps/cni-plugins/Dockerfile deleted file mode 100644 index 31b07f2dd..000000000 --- a/apps/cni-plugins/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM public.ecr.aws/docker/library/alpine:3.17.2 -USER root -ARG TARGETARCH -ARG VERSION -RUN apk add --no-cache --virtual .build-deps curl \ - && mkdir /plugins \ - && \ - curl -fsSL "https://github.com/containernetworking/plugins/releases/download/v${VERSION}/cni-plugins-linux-${TARGETARCH}-v${VERSION}.tgz" \ - | tar xzf - -C /plugins \ - && apk del --purge .build-deps \ - && rm -rf /tmp/* -CMD cp /plugins/* /host/opt/cni/bin diff --git a/apps/cni-plugins/ci/latest.sh b/apps/cni-plugins/ci/latest.sh deleted file mode 100755 index c505933a7..000000000 --- a/apps/cni-plugins/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version="$(curl -sX GET "https://api.github.com/repos/containernetworking/plugins/releases/latest" | jq --raw-output '.tag_name' 2>/dev/null)" -version="${version#*v}" -version="${version#*release-}" -printf "%s" "${version}" diff --git a/apps/cni-plugins/metadata.json b/apps/cni-plugins/metadata.json deleted file mode 100644 index 55ae07251..000000000 --- a/apps/cni-plugins/metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "app": "cni-plugins", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": false - } - } - ] -} diff --git a/apps/emby/Dockerfile b/apps/emby/Dockerfile deleted file mode 100644 index 349edb3dd..000000000 --- a/apps/emby/Dockerfile +++ /dev/null @@ -1,81 +0,0 @@ -FROM ghcr.io/onedr0p/ubuntu:jammy-20221101@sha256:bf2d52a2e698ab9c2e0a1af7f7b70b9806091c5ca21d9f1a4d1c3809f41e5e93 as builder - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -WORKDIR /tmp - -# hadolint ignore=DL3008,DL3015,SC2039,SC2086 -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') \ - export ARCH='x86_64'; \ - ;; \ - 'linux/arm64') \ - export ARCH='aarch64'; \ - ;; \ - esac \ - && \ - apt-get update -qq \ - && \ - apt-get install -qqy cpio rpm2cpio \ - && \ - mkdir -p /app/emby \ - && \ - curl -fsSL -o emby.rpm \ - "https://github.com/MediaBrowser/Emby.Releases/releases/download/${VERSION}/emby-server-rpm_${VERSION}_${ARCH}.rpm" \ - && \ - rpm2cpio emby.rpm | cpio -i --make-directories \ - && \ - mv -t \ - /app/emby \ - /tmp/opt/emby-server/system/* \ - /tmp/opt/emby-server/lib/* \ - /tmp/opt/emby-server/bin/ff* \ - /tmp/opt/emby-server/etc \ - /tmp/opt/emby-server/extra/lib/* - -FROM ghcr.io/onedr0p/ubuntu:jammy-20221101@sha256:bf2d52a2e698ab9c2e0a1af7f7b70b9806091c5ca21d9f1a4d1c3809f41e5e93 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" - -USER root - -# hadolint ignore=DL3008,DL3015,SC2039,SC2086 -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') \ - export EXTRA_INSTALL_ARG='mesa-va-drivers'; \ - ;; \ - 'linux/arm64') \ - curl -s "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x6587ffd6536b8826e88a62547876ae518cbcf2f2" | apt-key add - \ - && echo "deb http://ppa.launchpad.net/ubuntu-raspi2/ppa-nightly/ubuntu focal main">> /etc/apt/sources.list.d/raspbins.list \ - && \ - export EXTRA_INSTALL_ARG='libomxil-bellagio0 libomxil-bellagio-bin libraspberrypi0'; \ - unset NVIDIA_DRIVER_CAPABILITIES; \ - ;; \ - esac \ - && \ - apt-get update -qq && \ - apt-get install -qqy ${EXTRA_INSTALL_ARG} \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && apt-get autoremove -y \ - && apt-get clean \ - && \ - rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/ \ - && chown -R root:root /app \ - && chmod -R 755 /app \ - && printf "umask %d\n" "${UMASK}" >> /etc/bash.bashrc - -USER kah -COPY --from=builder /app/emby /app/emby -COPY ./apps/emby/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] diff --git a/apps/emby/ci/goss.yaml b/apps/emby/ci/goss.yaml deleted file mode 100644 index 7d047c282..000000000 --- a/apps/emby/ci/goss.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - EmbyServer: - running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -port: - # https://github.com/aelsabbahy/goss/issues/149 - tcp6:8096: - listening: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http -http: - http://localhost:8096/web: - status: 200 diff --git a/apps/emby/ci/latest.sh b/apps/emby/ci/latest.sh deleted file mode 100755 index 2f357674b..000000000 --- a/apps/emby/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -sX GET https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | jq --raw-output '. | .tag_name' 2>/dev/null) -version="${version#*v}" -version="${version#*release-}" -printf "%s" "${version}" diff --git a/apps/emby/entrypoint.sh b/apps/emby/entrypoint.sh deleted file mode 100755 index 49d0ceffe..000000000 --- a/apps/emby/entrypoint.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck disable=SC1091 -test -f "/scripts/umask.sh" && source "/scripts/umask.sh" - -export LD_LIBRARY_PATH="/app/emby" -export FONTCONFIG_PATH="/app/emby/etc/fonts" -if [ -d "/lib/x86_64-linux-gnu" ]; then - export LIBVA_DRIVERS_PATH="/usr/lib/x86_64-linux-gnu/dri:/app/emby/dri" -fi -export SSL_CERT_FILE="/app/emby/etc/ssl/certs/ca-certificates.crt" - -#shellcheck disable=SC2086 -exec \ - /app/emby/EmbyServer \ - -programdata /config \ - -ffdetect /app/emby/ffdetect \ - -ffmpeg /app/emby/ffmpeg \ - -ffprobe /app/emby/ffprobe \ - -restartexitcode 3 \ - "$@" diff --git a/apps/emby/metadata.json b/apps/emby/metadata.json deleted file mode 100644 index 80bc6c261..000000000 --- a/apps/emby/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "emby", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/flood/Dockerfile b/apps/flood/Dockerfile deleted file mode 100644 index da1dd8c42..000000000 --- a/apps/flood/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV FLOOD_OPTION_rundir="/config" \ - FLOOD_OPTION_host="0.0.0.0" \ - FLOOD_OPTION_port="3000" - # For use with rtorrent - # FLOOD_OPTION_allowedpath="/config,/sock,/rc" - # FLOOD_OPTION_rtsocket="/sock/rtorrent.sock" - # FLOOD_OPTION_rtconfig="/rc/rtorrent.rc" - -#hadolint ignore=DL3018 -RUN \ - apk add --no-cache ca-certificates \ - && apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community mediainfo -#hadolint ignore=DL3059 -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') export ARCH='x64' ;; \ - 'linux/arm64') export ARCH='arm64' ;; \ - esac \ - && \ - curl -fsSL -o /app/flood \ - "https://github.com/jesec/flood/releases/download/v${VERSION}/flood-linux-${ARCH}" \ - && chown -R root:root /app \ - && chmod -R 755 /app \ - && rm -rf /tmp/* - -USER kah -COPY ./apps/flood/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] - -LABEL org.opencontainers.image.source="https://github.com/jesec/flood" diff --git a/apps/flood/ci/goss.yaml b/apps/flood/ci/goss.yaml deleted file mode 100644 index 744d9f193..000000000 --- a/apps/flood/ci/goss.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - flood: - running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -port: - # https://github.com/aelsabbahy/goss/issues/149 - tcp:3000: - listening: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http -http: - http://localhost:3000: - status: 200 diff --git a/apps/flood/ci/latest.sh b/apps/flood/ci/latest.sh deleted file mode 100755 index dfd2a4440..000000000 --- a/apps/flood/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -sX GET "https://api.github.com/repos/jesec/flood/releases" | jq --raw-output '.[0].tag_name' 2>/dev/null) -version="${version#*v}" -version="${version#*release-}" -printf "%s" "${version}" diff --git a/apps/flood/entrypoint.sh b/apps/flood/entrypoint.sh deleted file mode 100755 index d0f487cbd..000000000 --- a/apps/flood/entrypoint.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck disable=SC1091 -test -f "/scripts/umask.sh" && source "/scripts/umask.sh" -test -f "/scripts/vpn.sh" && source "/scripts/vpn.sh" - -#shellcheck disable=SC2086 -exec /app/flood "$@" diff --git a/apps/flood/metadata.json b/apps/flood/metadata.json deleted file mode 100644 index 2c77b01c3..000000000 --- a/apps/flood/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "flood", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/home-assistant/Dockerfile b/apps/home-assistant/Dockerfile index b383c5f64..a82ad102e 100644 --- a/apps/home-assistant/Dockerfile +++ b/apps/home-assistant/Dockerfile @@ -1,9 +1,24 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 +ARG VERSION +FROM docker.io/library/alpine:3.19 as builder +ARG VERSION +ARG TARGETOS +ARG TARGETARCH +ARG TARGETVARIANT="" +ARG TARGETPLATFORM +ENV GO111MODULE=on \ + CGO_ENABLED=0 \ + GOOS=${TARGETOS} \ + GOARCH=${TARGETARCH} \ + GOARM=${TARGETVARIANT} \ + GOPATH=/go +ENV PATH $GOPATH/bin:$PATH +#hadolint ignore=DL3018 +RUN \ + apk add --no-cache go upx \ + && go install -ldflags="-s -w" github.com/drone/envsubst/cmd/envsubst@latest \ + && upx /go/bin/envsubst -# https://github.com/linuxserver/docker-homeassistant -# https://github.com/home-assistant/docker -# https://github.com/home-assistant/docker-base -# https://github.com/pypa/pip/issues/10788 +FROM docker.io/library/python:3.12.2-alpine3.19 ARG TARGETPLATFORM ARG VERSION @@ -15,14 +30,24 @@ ENV \ PIP_ROOT_USER_ACTION=ignore \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIPFLAGS="--use-deprecated=legacy-resolver --find-links https://wheels.home-assistant.io/musllinux/" \ + PIP_BREAK_SYSTEM_PACKAGES=1 \ + HOMEASSISTANT_WHEELS="https://wheels.home-assistant.io/musllinux/" \ PYTHONPATH="${PYTHONPATH}:/pip-packages" \ HOME="/config" -ENV HOME_ASSISTANT__HACS_INSTALL="false" +ENV UMASK="0002" \ + TZ="Etc/UTC" WORKDIR /tmp +#hadolint ignore=DL3018 +RUN \ + apk add --no-cache \ + ca-certificates catatonit bash \ + bind-tools coreutils curl iputils jo \ + jq moreutils nano pv tzdata unzip \ + util-linux wget + #hadolint ignore=DL3018 RUN \ apk add --no-cache \ @@ -35,7 +60,7 @@ RUN \ ffmpeg \ git \ libcap \ - libjpeg-turbo \ + libturbojpeg \ libstdc++ \ libxslt \ mariadb-connector-c \ @@ -45,9 +70,10 @@ RUN \ postgresql-libs \ py3-pip \ python3 \ + socat \ tiff -#hadolint ignore=DL3018,DL3013 +#hadolint ignore=DL3018,DL3013,DL3059,DL4006 RUN \ apk add --no-cache --virtual=.build-deps \ autoconf \ @@ -69,6 +95,7 @@ RUN \ pip install --upgrade \ cython \ pip \ + pyparsing \ setuptools \ wheel \ && \ @@ -84,7 +111,7 @@ RUN \ && \ NUMPY_VERSION=$(grep "numpy" requirements_all.txt) \ && \ - pip install ${PIPFLAGS} \ + pip install --find-links "${HOMEASSISTANT_WHEELS}" \ "${NUMPY_VERSION}" \ && \ case "${TARGETPLATFORM}" in \ @@ -98,16 +125,16 @@ RUN \ && \ HOME_ASSISTANT_BASE=$(curl -fsSL "https://raw.githubusercontent.com/home-assistant/core/${VERSION}/build.yaml" | grep "${ARCH}: " | cut -d ":" -f3) \ && \ - pip install ${PIPFLAGS} \ + pip install --no-index --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ --requirement "https://raw.githubusercontent.com/home-assistant/docker/${HOME_ASSISTANT_BASE}/requirements.txt" \ && \ - pip install ${PIPFLAGS} \ + pip install --find-links "${HOMEASSISTANT_WHEELS}" \ --requirement requirements_all.txt \ && \ - pip install ${PIPFLAGS} \ + pip install --only-binary=:all: --find-links "${HOMEASSISTANT_WHEELS}" \ homeassistant=="${VERSION}" \ && \ - pip install ${PIPFLAGS} \ + pip install --find-links "${HOMEASSISTANT_WHEELS}" \ pycups PySwitchbot \ && \ apk del --purge .build-deps \ @@ -117,9 +144,32 @@ RUN \ /root/.cargo \ /tmp/* +#hadolint ignore=DL3018 +RUN \ + addgroup -S kah --gid 568 \ + && adduser -S kah -G kah --uid 568 \ + && \ + mkdir -p /config \ + && chown -R kah:kah /config \ + && chmod -R 775 /config \ + && printf "/bin/bash /scripts/greeting.sh\n" > /etc/profile.d/greeting.sh \ + && printf "umask %d\n" "${UMASK}" > /etc/profile.d/umask.sh \ + && ln -s /usr/bin/vi /usr/local/bin/vi \ + && ln -s /usr/bin/vi /usr/local/bin/vim \ + && ln -s /usr/bin/nano /usr/local/bin/nano \ + && ln -s /usr/bin/nano /usr/local/bin/neovim \ + && ln -s /usr/bin/nano /usr/local/bin/emacs \ + && ln -s /usr/bin/catatonit /sbin/tini \ + && rm -rf /tmp/* + +COPY --from=builder /go/bin/envsubst /usr/local/bin/envsubst +COPY ./apps/home-assistant/scripts /scripts +VOLUME ["/config"] + WORKDIR /app USER kah COPY ./apps/home-assistant/entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/usr/bin/catatonit", "--"] CMD ["/entrypoint.sh"] LABEL org.opencontainers.image.source="https://github.com/home-assistant/core" diff --git a/apps/home-assistant/entrypoint.sh b/apps/home-assistant/entrypoint.sh index dda5033b7..aa4f1bb7d 100755 --- a/apps/home-assistant/entrypoint.sh +++ b/apps/home-assistant/entrypoint.sh @@ -3,11 +3,16 @@ #shellcheck disable=SC1091 test -f "/scripts/umask.sh" && source "/scripts/umask.sh" +# Make sure the config and log directory exist +mkdir -p /config/logs + +# Install HACS if requested if [[ "${HOME_ASSISTANT__HACS_INSTALL}" == "true" ]]; then wget -O - https://get.hacs.xyz | bash - fi exec \ - /usr/bin/hass \ + /usr/local/bin/hass \ --config /config \ + --log-file /config/logs/home-assistant.log \ "$@" diff --git a/apps/home-assistant/metadata.json b/apps/home-assistant/metadata.json deleted file mode 100644 index cc8b38e06..000000000 --- a/apps/home-assistant/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "home-assistant", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/home-assistant/metadata.yaml b/apps/home-assistant/metadata.yaml new file mode 100644 index 000000000..f96174c62 --- /dev/null +++ b/apps/home-assistant/metadata.yaml @@ -0,0 +1,10 @@ +--- +app: home-assistant +base: false +channels: + - name: stable + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web diff --git a/apps/home-assistant/scripts/greeting.sh b/apps/home-assistant/scripts/greeting.sh new file mode 100755 index 000000000..0d220e37e --- /dev/null +++ b/apps/home-assistant/scripts/greeting.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +echo " +You are entering the vicinity of an area adjacent to a location. +The kind of place where there might be a monster, or some kind of weird mirror. +These are just examples; it could also be something much better. +" diff --git a/apps/home-assistant/scripts/umask.sh b/apps/home-assistant/scripts/umask.sh new file mode 100755 index 000000000..bea3cc353 --- /dev/null +++ b/apps/home-assistant/scripts/umask.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +umask "${UMASK:-0002}" diff --git a/apps/jbops/Dockerfile b/apps/jbops/Dockerfile index c63bb0605..d44c55634 100644 --- a/apps/jbops/Dockerfile +++ b/apps/jbops/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 ARG TARGETPLATFORM ARG VERSION @@ -10,6 +10,7 @@ ENV \ PIP_ROOT_USER_ACTION=ignore \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PIP_BREAK_SYSTEM_PACKAGES=1 \ CRYPTOGRAPHY_DONT_BUILD_RUST=1 ENV PLEXAPI_CONFIG_PATH="/config/config.ini" \ diff --git a/apps/jbops/metadata.json b/apps/jbops/metadata.json deleted file mode 100644 index cb95dafba..000000000 --- a/apps/jbops/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "jbops", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "cli" - } - } - ] -} diff --git a/apps/jbops/metadata.yaml b/apps/jbops/metadata.yaml new file mode 100644 index 000000000..e5ab735b1 --- /dev/null +++ b/apps/jbops/metadata.yaml @@ -0,0 +1,11 @@ +--- +app: jbops +base: false +semantic_versioning: true +channels: + - name: stable + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: cli diff --git a/apps/jellyfin/Dockerfile b/apps/jellyfin/Dockerfile deleted file mode 100644 index f8ae2bc38..000000000 --- a/apps/jellyfin/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -FROM ghcr.io/onedr0p/ubuntu:jammy-20221101@sha256:bf2d52a2e698ab9c2e0a1af7f7b70b9806091c5ca21d9f1a4d1c3809f41e5e93 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" - -# hadolint ignore=DL3008,DL3015,SC2086 -RUN \ - apt-get -qq update \ - && \ - apt-get -qq install -y \ - gnupg2 \ - && \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') \ - curl -sL https://repositories.intel.com/graphics/intel-graphics.key | apt-key add - \ - && echo 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu jammy main' > /etc/apt/sources.list.d/intel.list \ - && \ - export ARCH='amd64'; \ - export EXTRA_INSTALL_ARG='intel-media-va-driver-non-free nvidia-opencl-icd-340 i965-va-driver mesa-va-drivers'; \ - ;; \ - 'linux/arm64') \ - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 6587FFD6536B8826E88A62547876AE518CBCF2F2 \ - && echo "deb http://ppa.launchpad.net/ubuntu-raspi2/ppa-nightly/ubuntu focal main" | tee /etc/apt/sources.list.d/raspberrypi.list \ - && \ - export ARCH='arm64'; \ - export EXTRA_INSTALL_ARG='libomxil-bellagio0 libomxil-bellagio-bin libraspberrypi0'; \ - unset NVIDIA_DRIVER_CAPABILITIES; \ - ;; \ - esac \ - && \ - apt-get -qq update \ - && \ - apt-get -qq install -y \ - ca-certificates \ - ${EXTRA_INSTALL_ARG} \ - && \ - curl -fsSL "https://repo.jellyfin.org/ubuntu/jellyfin_team.gpg.key" | apt-key add - && \ - echo "deb [arch=${ARCH}] https://repo.jellyfin.org/ubuntu jammy main" | tee /etc/apt/sources.list.d/jellyfin.list && \ - apt-get -qq update && \ - apt-get -qq install -y \ - jellyfin-server="${VERSION}*" \ - jellyfin-web \ - jellyfin-ffmpeg5 \ - && \ - apt-get remove -y gnupg2 \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && apt-get autoremove -y \ - && apt-get clean \ - && \ - rm -rf \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/ \ - && printf "umask %d\n" "${UMASK}" >> /etc/bash.bashrc - -USER kah -COPY ./apps/jellyfin/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] - -LABEL org.opencontainers.image.source="https://github.com/jellyfin/jellyfin" diff --git a/apps/jellyfin/ci/goss.yaml b/apps/jellyfin/ci/goss.yaml deleted file mode 100644 index 85c69cb7b..000000000 --- a/apps/jellyfin/ci/goss.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - jellyfin: - running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -port: - # https://github.com/aelsabbahy/goss/issues/149 - tcp:8096: - listening: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http -http: - http://localhost:8096/web/index.html: - status: 200 diff --git a/apps/jellyfin/ci/latest.sh b/apps/jellyfin/ci/latest.sh deleted file mode 100755 index bd43c1965..000000000 --- a/apps/jellyfin/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -sX GET "https://api.github.com/repos/jellyfin/jellyfin/releases/latest" | jq --raw-output '. | .tag_name' 2>/dev/null) -version="${version#*v}" -version="${version#*release-}" -printf "%s" "${version}" diff --git a/apps/jellyfin/entrypoint.sh b/apps/jellyfin/entrypoint.sh deleted file mode 100755 index 2bccbce58..000000000 --- a/apps/jellyfin/entrypoint.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck disable=SC1091 -test -f "/scripts/umask.sh" && source "/scripts/umask.sh" - -#shellcheck disable=SC2086 -exec \ - /usr/bin/jellyfin \ - --ffmpeg="/usr/lib/jellyfin-ffmpeg/ffmpeg" \ - --webdir="/usr/share/jellyfin/web" \ - --datadir="/config" \ - --cachedir="/config/cache" \ - "$@" diff --git a/apps/jellyfin/metadata.json b/apps/jellyfin/metadata.json deleted file mode 100644 index a88a84513..000000000 --- a/apps/jellyfin/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "jellyfin", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/kopia/Dockerfile b/apps/kopia/Dockerfile deleted file mode 100644 index fe3cc8798..000000000 --- a/apps/kopia/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV KOPIA_CONFIG_PATH="/config/repository.config" \ - KOPIA_LOG_DIR="/config/logs" \ - KOPIA_CACHE_DIRECTORY="/config/cache" \ - KOPIA_PERSIST_CREDENTIALS_ON_CONNECT="false" \ - KOPIA_CHECK_FOR_UPDATES="false" \ - RCLONE_CONFIG="/config/rclone/rclone.conf" - -#hadolint ignore=DL3018 -RUN apk add --no-cache ca-certificates rclone -#hadolint ignore=DL3059 -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') export ARCH='x64' ;; \ - 'linux/arm64') export ARCH='arm64' ;; \ - esac \ - && \ - curl -fsSL "https://github.com/kopia/kopia/releases/download/v${VERSION}/kopia-${VERSION}-linux-${ARCH}.tar.gz" \ - | tar xzf - -C /usr/bin/ --strip-components=1 \ - && rm -rf /tmp/* - -CMD ["kopia"] - -LABEL org.opencontainers.image.source="https://github.com/kopia/kopia" diff --git a/apps/kopia/ci/goss.yaml b/apps/kopia/ci/goss.yaml deleted file mode 100644 index 363307095..000000000 --- a/apps/kopia/ci/goss.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#file -file: - /usr/bin/kopia: - exists: true diff --git a/apps/kopia/ci/latest.sh b/apps/kopia/ci/latest.sh deleted file mode 100755 index 5b3045a4c..000000000 --- a/apps/kopia/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -sX GET "https://api.github.com/repos/kopia/kopia/releases/latest" | jq --raw-output '.tag_name' 2>/dev/null) -version="${version#*v}" -version="${version#*release-}" -printf "%s" "${version}" diff --git a/apps/kopia/metadata.json b/apps/kopia/metadata.json deleted file mode 100644 index ba79b9368..000000000 --- a/apps/kopia/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "kopia", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "cli" - } - } - ] -} diff --git a/apps/kubernetes/Dockerfile b/apps/kubernetes/Dockerfile deleted file mode 100644 index 5c3d12e4c..000000000 --- a/apps/kubernetes/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL -ARG TARGETARCH -ENV TARGETARCH=${TARGETARCH:-amd64} - -#hadolint ignore=DL3018 -RUN apk add --no-cache ca-certificates openssl -#hadolint ignore=DL3018,DL3059 -RUN \ - curl -fsSL -o /usr/local/bin/kubectl "https://dl.k8s.io/release/v${VERSION}/bin/linux/${TARGETARCH}/kubectl" \ - && chmod +x /usr/local/bin/kubectl - -USER kah -CMD [ "/usr/local/bin/kubectl" ] - -LABEL org.opencontainers.image.source="https://github.com/kubernetes/kubectl" diff --git a/apps/kubernetes/ci/goss.yaml b/apps/kubernetes/ci/goss.yaml deleted file mode 100644 index 3abf291c6..000000000 --- a/apps/kubernetes/ci/goss.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -file: - /usr/local/bin/kubectl: - exists: true diff --git a/apps/kubernetes/ci/latest.sh b/apps/kubernetes/ci/latest.sh deleted file mode 100755 index c4d2d2869..000000000 --- a/apps/kubernetes/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -L -s https://dl.k8s.io/release/stable.txt 2>/dev/null) -version="${version#*v}" -version="${version#*release-}" -printf "%s" "${version}" diff --git a/apps/kubernetes/metadata.json b/apps/kubernetes/metadata.json deleted file mode 100644 index 7769dd8be..000000000 --- a/apps/kubernetes/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "kubernetes", - "base": false, - "channels": [ - { - "name": "kubectl", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "cli" - } - } - ] -} diff --git a/apps/lidarr/Dockerfile b/apps/lidarr/Dockerfile index 639430f7b..cfb582acd 100644 --- a/apps/lidarr/Dockerfile +++ b/apps/lidarr/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 ARG TARGETPLATFORM ARG VERSION @@ -11,7 +11,7 @@ ENV \ LIDARR__ANALYTICS_ENABLED="False" #hadolint ignore=DL3018 -RUN apk add --no-cache ca-certificates chromaprint icu-libs libintl sqlite-libs xmlstarlet +RUN apk add --no-cache ca-certificates chromaprint ffmpeg icu-libs libintl sqlite-libs xmlstarlet #hadolint ignore=DL3059 RUN \ case "${TARGETPLATFORM}" in \ @@ -19,12 +19,14 @@ RUN \ 'linux/arm64') export ARCH='arm64' ;; \ esac \ && \ + mkdir -p /app/bin \ + && \ curl -fsSL "https://lidarr.servarr.com/v1/update/${LIDARR__BRANCH}/updatefile?version=${VERSION}&os=linuxmusl&runtime=netcore&arch=${ARCH}" \ - | tar xzf - -C /app --strip-components=1 \ + | tar xzf - -C /app/bin --strip-components=1 \ && \ rm -rf \ - /app/Lidarr.Update \ - /app/fpcalc \ + /app/bin/Lidarr.Update \ + /app/bin/fpcalc \ && \ printf "UpdateMethod=docker\nBranch=%s\nPackageVersion=%s\nPackageAuthor=[onedr0p](https://github.com/onedr0p)\n" "${LIDARR__BRANCH}" "${VERSION}" > /app/package_info \ && chown -R root:root /app \ diff --git a/apps/lidarr/config.xml.tmpl b/apps/lidarr/config.xml.tmpl index 5e0efcbe3..de345975d 100644 --- a/apps/lidarr/config.xml.tmpl +++ b/apps/lidarr/config.xml.tmpl @@ -3,8 +3,8 @@ ${LIDARR__URL_BASE} ${LIDARR__BRANCH} ${LIDARR__API_KEY} - ${LIDARR__AUTHENTICATION_METHOD:-None} - ${LIDARR__AUTHENTICATION_REQUIRED} + ${LIDARR__AUTHENTICATION_METHOD:-External} + ${LIDARR__AUTHENTICATION_REQUIRED:-DisabledForLocalAddresses} ${LIDARR__INSTANCE_NAME} ${LIDARR__POSTGRES_USER} ${LIDARR__POSTGRES_PASSWORD} @@ -21,4 +21,5 @@ BuiltIn ${LIDARR__ANALYTICS_ENABLED} + ${LIDARR__THEME:-auto} diff --git a/apps/lidarr/entrypoint.sh b/apps/lidarr/entrypoint.sh index d8525c1d5..149497e74 100755 --- a/apps/lidarr/entrypoint.sh +++ b/apps/lidarr/entrypoint.sh @@ -19,6 +19,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -39,6 +40,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${LIDARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml [[ -z "${LIDARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${LIDARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml +[[ -z "${LIDARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment @@ -50,7 +52,7 @@ fi #shellcheck disable=SC2086 exec \ - /app/Lidarr \ + /app/bin/Lidarr \ --nobrowser \ --data=/config \ "$@" diff --git a/apps/lidarr/metadata.json b/apps/lidarr/metadata.json deleted file mode 100644 index f4467862e..000000000 --- a/apps/lidarr/metadata.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "app": "lidarr", - "base": false, - "channels": [ - { - "name": "master", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "develop", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "nightly", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/lidarr/metadata.yaml b/apps/lidarr/metadata.yaml new file mode 100644 index 000000000..389d75126 --- /dev/null +++ b/apps/lidarr/metadata.yaml @@ -0,0 +1,23 @@ +--- +app: lidarr +base: false +semantic_versioning: true +channels: + - name: master + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web + - name: develop + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web + - name: nightly + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web diff --git a/apps/navidrome/Dockerfile b/apps/navidrome/Dockerfile deleted file mode 100644 index 30da4d782..000000000 --- a/apps/navidrome/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV ND_MUSICFOLDER=/music \ - ND_DATAFOLDER=/config \ - ND_SCANINTERVAL=1m \ - ND_TRANSCODINGCACHESIZE=100MB \ - ND_SESSIONTIMEOUT=30m \ - ND_LOGLEVEL=info \ - ND_PORT=4533 - -#hadolint ignore=DL3018 -RUN apk add --no-cache ca-certificates ffmpeg -#hadolint ignore=DL3059 -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') export ARCH='x86_64' ;; \ - 'linux/arm64') export ARCH='arm64' ;; \ - esac \ - && \ - curl -fsSL "https://github.com/navidrome/navidrome/releases/download/v${VERSION}/navidrome_${VERSION}_Linux_${ARCH}.tar.gz" \ - | tar xzf - -C /app \ - && rm /app/LICENSE /app/README.md \ - && chown -R root:root /app \ - && chmod -R 755 /app \ - && rm -rf /tmp/* - -USER kah -COPY ./apps/navidrome/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] - -LABEL org.opencontainers.image.source="https://github.com/navidrome/navidrome" diff --git a/apps/navidrome/ci/goss.yaml b/apps/navidrome/ci/goss.yaml deleted file mode 100644 index a63049a1c..000000000 --- a/apps/navidrome/ci/goss.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - navidrome: - running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -port: - # https://github.com/aelsabbahy/goss/issues/149 - tcp6:4533: - listening: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http -http: - http://localhost:4533: - status: 200 diff --git a/apps/navidrome/ci/latest.sh b/apps/navidrome/ci/latest.sh deleted file mode 100755 index 55f74994b..000000000 --- a/apps/navidrome/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -sX GET "https://api.github.com/repos/navidrome/navidrome/releases/latest" | jq --raw-output '. | .tag_name' 2>/dev/null) -version="${version#*v}" -version="${version#*release-}" -printf "%s" "${version}" diff --git a/apps/navidrome/entrypoint.sh b/apps/navidrome/entrypoint.sh deleted file mode 100755 index 5d2e57289..000000000 --- a/apps/navidrome/entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck disable=SC1091 -test -f "/scripts/umask.sh" && source "/scripts/umask.sh" - -#shellcheck disable=SC2086 -exec \ - /app/navidrome \ - --datafolder /config \ - "$@" diff --git a/apps/navidrome/metadata.json b/apps/navidrome/metadata.json deleted file mode 100644 index 6ef35a7d9..000000000 --- a/apps/navidrome/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "navidrome", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/par2cmdline-turbo/Dockerfile b/apps/par2cmdline-turbo/Dockerfile new file mode 100644 index 000000000..47dc5851c --- /dev/null +++ b/apps/par2cmdline-turbo/Dockerfile @@ -0,0 +1,25 @@ +FROM docker.io/library/alpine:3.19 as build +ARG TARGETARCH +ARG VERSION +WORKDIR /tmp +ENV LDFLAGS="-static" +RUN \ + apk add --no-cache \ + autoconf \ + automake \ + build-base \ + curl \ + linux-headers \ + musl-dev \ + && \ + curl -fsSL "https://github.com/animetosho/par2cmdline-turbo/archive/refs/tags/v${VERSION}.tar.gz" \ + | tar xzf - -C /tmp --strip-components 1 \ + && ./automake.sh \ + && ./configure \ + && make \ + && make install + +FROM scratch +COPY --from=build /usr/local/bin/par2 /usr/local/bin/par2 +RUN /usr/local/bin/par2 --help +CMD ["/usr/local/bin/par2"] diff --git a/apps/par2cmdline-turbo/ci/latest.sh b/apps/par2cmdline-turbo/ci/latest.sh new file mode 100755 index 000000000..ce8a95914 --- /dev/null +++ b/apps/par2cmdline-turbo/ci/latest.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +version="$(curl -sX GET "https://api.github.com/repos/animetosho/par2cmdline-turbo/releases/latest" | jq --raw-output '.tag_name' 2>/dev/null)" +version="${version#*v}" +version="${version#*release-}" +printf "%s" "${version}" diff --git a/apps/par2cmdline-turbo/metadata.yaml b/apps/par2cmdline-turbo/metadata.yaml new file mode 100644 index 000000000..4a9e10d1b --- /dev/null +++ b/apps/par2cmdline-turbo/metadata.yaml @@ -0,0 +1,9 @@ +--- +app: par2cmdline-turbo +base: false +channels: + - name: stable + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: false diff --git a/apps/plex/Dockerfile b/apps/plex/Dockerfile index c2a26a776..b61c8a6e0 100644 --- a/apps/plex/Dockerfile +++ b/apps/plex/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onedr0p/ubuntu:jammy-20221101@sha256:bf2d52a2e698ab9c2e0a1af7f7b70b9806091c5ca21d9f1a4d1c3809f41e5e93 +FROM ghcr.io/onedr0p/ubuntu:jammy-20231004@sha256:6e060e90482632408063d0fbb4b616c77914ef10eaa6b089a00de5815471006c ARG TARGETPLATFORM ARG VERSION @@ -27,9 +27,10 @@ RUN \ apt-get -qq update \ && \ apt-get -qq install -y \ + ca-certificates \ + libusb-dev \ uuid-runtime \ xmlstarlet \ - ca-certificates \ && \ curl -fsSL -o /tmp/plex.deb \ "${PLEX_DOWNLOAD}/${VERSION}/debian/plexmediaserver_${VERSION}_${ARCH}.deb" \ @@ -50,6 +51,5 @@ RUN \ WORKDIR "${PLEX_MEDIA_SERVER_HOME}" USER kah -COPY ./apps/plex/plex-preferences.sh /scripts/plex-preferences.sh COPY ./apps/plex/entrypoint.sh /entrypoint.sh CMD ["/entrypoint.sh"] diff --git a/apps/plex/amd/Dockerfile b/apps/plex/amd/Dockerfile deleted file mode 100644 index 18a1416d0..000000000 --- a/apps/plex/amd/Dockerfile +++ /dev/null @@ -1,136 +0,0 @@ -FROM alpine:edge AS builder -RUN apk add --no-cache \ - autoconf \ - automake \ - binutils \ - cmake \ - curl \ - dpkg \ - file \ - g++ \ - gcc \ - git \ - libc6-compat \ - libdrm-dev \ - libtool \ - libxshmfence \ - linux-headers \ - make \ - mesa-va-gallium \ - musl-dev \ - nghttp2-dev \ - pkgconfig \ - xxd - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -FROM builder AS amd - -WORKDIR /tmp/amd - -RUN ls -la /usr/lib/ - -RUN apk add xf86-video-amdgpu linux-firmware-amdgpu --no-cache --update-cache \ - && apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing libva-utils \ - && mkdir -p "/output/usr/bin" \ - && cp -a /usr/bin/vainfo "/output/usr/bin" \ - && mkdir -p "/output/usr/lib" \ - && cp -a /usr/lib/libX*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libwayland*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libva*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libdrm*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libbsd*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libxshmfence*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libxcb*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libffi*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libLLVM*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libzstd*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libexpat*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libelf*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libstdc++*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libgcc_s*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libmd*.so* "/output/usr/lib" \ - && cp -a /usr/lib/libxml2*.so* "/output/usr/lib" \ - && mkdir -p "/output/usr/lib/dri" \ - && cp -a /usr/lib/dri/*.so* "/output/usr/lib/dri" \ - && mkdir -p "/output/usr/share/libdrm" \ - && cp -a /usr/share/libdrm/* "/output/usr/share/libdrm" \ - && cp -a /lib/ld-musl-x86_64.so.1 "/output/usr/lib" \ - && cp -a /lib/libz*.so* "/output/usr/lib" - - -FROM ghcr.io/onedr0p/ubuntu:jammy-20221101@sha256:bf2d52a2e698ab9c2e0a1af7f7b70b9806091c5ca21d9f1a4d1c3809f41e5e93 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" \ - PLEX_DOWNLOAD="https://downloads.plex.tv/plex-media-server-new" \ - PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/config/Library/Application Support" \ - PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver" \ - PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS="6" \ - PLEX_MEDIA_SERVER_USER="kah" \ - PLEX_MEDIA_SERVER_INFO_VENDOR="Docker" \ - PLEX_MEDIA_SERVER_INFO_DEVICE="Docker Container (onedr0p)" - -# hadolint ignore=DL3008,DL3015,SC2039,SC2086 -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') \ - export ARCH='amd64'; \ - ;; \ - 'linux/arm64') \ - export ARCH='arm64'; \ - ;; \ - esac \ - && \ - apt-get -qq update \ - && \ - apt-get -qq install -y \ - uuid-runtime \ - xmlstarlet \ - ca-certificates \ - mesa-va-drivers \ - vainfo \ - mesa-vdpau-drivers \ - libdrm-amdgpu1 \ - libavutil56 \ - && \ - curl -fsSL -o /tmp/plex.deb \ - "${PLEX_DOWNLOAD}/${VERSION}/debian/plexmediaserver_${VERSION}_${ARCH}.deb" \ - && \ - dpkg -i --force-confold /tmp/plex.deb \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && apt-get autoremove -y \ - && apt-get clean \ - && \ - rm -rf \ - /etc/default/plexmediaserver \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/ \ - && chown -R root:root /app \ - && chmod -R 755 "${PLEX_MEDIA_SERVER_HOME}" \ - && printf "umask %d\n" "${UMASK}" >> /etc/bash.bashrc - -# Copy lib files -COPY --from=amd /output/usr/lib/dri/*.so* /usr/lib/plexmediaserver/lib/dri/ -COPY --from=amd /output/usr/lib/ld-musl-x86_64.so.1 /usr/lib/plexmediaserver/lib/ -COPY --from=amd /output/usr/lib/libdrm*.so* /usr/lib/plexmediaserver/lib/ -COPY --from=amd /output/usr/lib/libelf*.so* /usr/lib/plexmediaserver/lib/ -COPY --from=amd /output/usr/lib/libffi*.so* /usr/lib/plexmediaserver/lib/ -COPY --from=amd /output/usr/lib/libgcc_s*.so* /usr/lib/plexmediaserver/lib/ -COPY --from=amd /output/usr/lib/libLLVM*.so* /usr/lib/plexmediaserver/lib/ -COPY --from=amd /output/usr/lib/libstdc++*.so* /usr/lib/plexmediaserver/lib/ -COPY --from=amd /output/usr/lib/libva*.so* /usr/lib/plexmediaserver/lib/ -COPY --from=amd /output/usr/lib/libxml2*.so* /usr/lib/plexmediaserver/lib/ -COPY --from=amd /output/usr/lib/libz*.so.* /usr/lib/plexmediaserver/lib/ -COPY --from=amd /output/usr/lib/libzstd*.so* /usr/lib/plexmediaserver/lib/ - - - -WORKDIR "${PLEX_MEDIA_SERVER_HOME}" -USER kah -COPY ./apps/plex/plex-preferences.sh /scripts/plex-preferences.sh -COPY ./apps/plex/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] diff --git a/apps/plex/amd/goss.yaml b/apps/plex/amd/goss.yaml deleted file mode 100644 index 37e4cc729..000000000 --- a/apps/plex/amd/goss.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -port: - # https://github.com/aelsabbahy/goss/issues/149 - tcp6:32400: - listening: true diff --git a/apps/plex/ci/latest.sh b/apps/plex/ci/latest.sh index 588e290e1..28af6b955 100755 --- a/apps/plex/ci/latest.sh +++ b/apps/plex/ci/latest.sh @@ -14,10 +14,6 @@ if [[ "${channel}" == "stable" ]]; then version=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' | jq -r '.computer.Linux.version') fi -if [[ "${channel}" == "amd" ]]; then - version=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' | jq -r '.computer.Linux.version') -fi - version="${version#*v}" version="${version#*release-}" printf "%s" "${version}" diff --git a/apps/plex/entrypoint.sh b/apps/plex/entrypoint.sh index 25d829d94..0a0d953d9 100755 --- a/apps/plex/entrypoint.sh +++ b/apps/plex/entrypoint.sh @@ -2,15 +2,116 @@ #shellcheck disable=SC1091 test -f "/scripts/umask.sh" && source "/scripts/umask.sh" -test -f "/scripts/plex-preferences.sh" && source "/scripts/plex-preferences.sh" #shellcheck disable=SC2155 export PLEX_MEDIA_SERVER_INFO_MODEL=$(uname -m) #shellcheck disable=SC2155 export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=$(uname -r) -[[ -f "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}/Plex Media Server/plexmediaserver.pid" ]] && \ - rm -f "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}/Plex Media Server/plexmediaserver.pid" +function getPref { + local key="$1" + xmlstarlet sel -T -t -m "/Preferences" -v "@${key}" -n "${prefFile}" +} + +function setPref { + local key="$1" + local value="$2" + count="$(xmlstarlet sel -t -v "count(/Preferences/@${key})" "${prefFile}")" + count=$((count + 0)) + if [[ $count -gt 0 ]]; then + xmlstarlet ed --inplace --update "/Preferences/@${key}" -v "${value}" "${prefFile}" + else + xmlstarlet ed --inplace --insert "/Preferences" --type attr -n "${key}" -v "${value}" "${prefFile}" + fi +} + +prefFile="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}/Plex Media Server/Preferences.xml" + +# Create empty Preferences.xml file if it doesn't exist already +if [ ! -e "${prefFile}" ]; then + echo "Creating pref shell" + mkdir -p "$(dirname "${prefFile}")" + cat > "${prefFile}" <<-EOF + + +EOF +fi + +# Setup Server's client identifier +serial="$(getPref "MachineIdentifier")" +if [[ -z "${serial}" ]]; then + serial="$(cat /proc/sys/kernel/random/uuid)" + setPref "MachineIdentifier" "${serial}" +fi +clientId="$(getPref "ProcessedMachineIdentifier")" +if [[ -z "${clientId}" ]]; then + clientId="$(echo -n "${serial}- Plex Media Server" | sha1sum | cut -b 1-40)" + setPref "ProcessedMachineIdentifier" "${clientId}" +fi + +# Get server token and only turn claim token into server token if we have former but not latter. +token="$(getPref "PlexOnlineToken")" +if [[ -n "${PLEX_CLAIM_TOKEN}" ]] && [[ -z "${token}" ]]; then + echo "Attempting to obtain server token from claim token..." + loginInfo="$(curl -fsSL -X POST \ + -H 'X-Plex-Client-Identifier: '"${clientId}" \ + -H 'X-Plex-Product: Plex Media Server'\ + -H 'X-Plex-Version: 1.1' \ + -H 'X-Plex-Provides: server' \ + -H 'X-Plex-Platform: Linux' \ + -H 'X-Plex-Platform-Version: 1.0' \ + -H 'X-Plex-Device-Name: PlexMediaServer' \ + -H 'X-Plex-Device: Linux' \ + "https://plex.tv/api/claim/exchange?token=${PLEX_CLAIM_TOKEN}")" + token="$(echo "$loginInfo" | sed -n 's/.*\(.*\)<\/authentication-token>.*/\1/p')" + + if [[ "$token" ]]; then + echo "Token obtained successfully!" + setPref "PlexOnlineToken" "${token}" + fi +fi + +# Set other preferences +[[ -n "${ADVERTISE_IP}" ]] && PLEX_ADVERTISE_URL=${ADVERTISE_IP} +if [[ -n "${PLEX_ADVERTISE_URL}" ]]; then + echo "Setting customConnections to: ${PLEX_ADVERTISE_URL}" + setPref "customConnections" "${PLEX_ADVERTISE_URL}" +fi + +[[ -n "${ALLOWED_NETWORKS}" ]] && PLEX_NO_AUTH_NETWORKS=${ALLOWED_NETWORKS} +if [[ -n "${PLEX_NO_AUTH_NETWORKS}" ]]; then + echo "Setting allowedNetworks to: ${PLEX_NO_AUTH_NETWORKS}" + setPref "allowedNetworks" "${PLEX_NO_AUTH_NETWORKS}" +fi + +# Set transcoder directory if not yet set +if [[ -z "$(getPref "TranscoderTempDirectory")" ]]; then + echo "Setting TranscoderTempDirectory to: /transcode" + setPref "TranscoderTempDirectory" "/transcode" +fi + +# Parse list of all exported variables that start with PLEX_PREFERENCE_ +# The format of which is PLEX_PREFERENCE_="Key=Value" +# Where Key is the EXACT key to use in the Plex Preference file +# And Value is the EXACT value to use in the Plex Preference file for that key. +# Please note it looks like many of the key's are camelCase in some fashion. +# Additionally there are likely some preferences where environment variable injection +# doesn't really work for. +for var in "${!PLEX_PREFERENCE_@}"; do + value="${!var}" + PreferenceValue="${value#*=}" + PreferenceKey="${value%=*}" + setPref "${PreferenceKey}" "${PreferenceValue}" +done + +# Remove pid file +rm -f "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}/Plex Media Server/plexmediaserver.pid" + +# Purge Codecs folder +if [[ "${PLEX_PURGE_CODECS}" == "true" ]]; then + echo "Purging Codecs folder..." + find "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}/Plex Media Server/Codecs" -mindepth 1 -not -name '.device-id' -print -delete +fi #shellcheck disable=SC2086 exec \ diff --git a/apps/plex/metadata.json b/apps/plex/metadata.json deleted file mode 100644 index 949ae1dfa..000000000 --- a/apps/plex/metadata.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "app": "plex", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "beta", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "amd", - "platforms": [ - "linux/amd64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/plex/metadata.yaml b/apps/plex/metadata.yaml new file mode 100644 index 000000000..20998bc4c --- /dev/null +++ b/apps/plex/metadata.yaml @@ -0,0 +1,16 @@ +--- +app: plex +base: false +channels: + - name: stable + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web + - name: beta + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web diff --git a/apps/plex/plex-preferences.sh b/apps/plex/plex-preferences.sh deleted file mode 100755 index ca775ad0b..000000000 --- a/apps/plex/plex-preferences.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash - -# This file is based off of the official 40-plex-first-run -# Here: https://github.com/plexinc/pms-docker/blob/master/root/etc/cont-init.d/40-plex-first-run -# It should live in /etc/cont-init.d/ - -# If we are debugging, enable trace -if [ "${DEBUG,,}" = "true" ]; then - set -x -fi - -function getPref { - local key="${1}" - xmlstarlet sel -T -t -m "/Preferences" -v "@${key}" -n "${prefFile}" -} - -function setPref { - local key="${1}" - local value="${2}" - count="$(xmlstarlet sel -t -v "count(/Preferences/@${key})" "${prefFile}")" - count=$(($count + 0)) - if [[ $count > 0 ]]; then - xmlstarlet ed --inplace --update "/Preferences/@${key}" -v "${value}" "${prefFile}" - else - xmlstarlet ed --inplace --insert "/Preferences" --type attr -n "${key}" -v "${value}" "${prefFile}" - fi -} - -prefFile="${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}/Plex Media Server/Preferences.xml" - -# Create empty shell pref file if it doesn't exist already -if [ ! -e "${prefFile}" ]; then - echo "Creating pref shell" - mkdir -p "$(dirname "${prefFile}")" - cat > "${prefFile}" <<-EOF - - -EOF -fi - -# Setup Server's client identifier -serial="$(getPref "MachineIdentifier")" -if [ -z "${serial}" ]; then - serial="$(uuidgen)" - setPref "MachineIdentifier" "${serial}" -fi -clientId="$(getPref "ProcessedMachineIdentifier")" -if [ -z "${clientId}" ]; then - clientId="$(echo -n "${serial}- Plex Media Server" | sha1sum | cut -b 1-40)" - setPref "ProcessedMachineIdentifier" "${clientId}" -fi - -# Get server token and only turn claim token into server token if we have former but not latter. -token="$(getPref "PlexOnlineToken")" -if [ ! -z "${PLEX_CLAIM}" ] && [ -z "${token}" ]; then - echo "Attempting to obtain server token from claim token" - loginInfo="$(curl -X POST \ - -H 'X-Plex-Client-Identifier: '${clientId} \ - -H 'X-Plex-Product: Plex Media Server'\ - -H 'X-Plex-Version: 1.1' \ - -H 'X-Plex-Provides: server' \ - -H 'X-Plex-Platform: Linux' \ - -H 'X-Plex-Platform-Version: 1.0' \ - -H 'X-Plex-Device-Name: PlexMediaServer' \ - -H 'X-Plex-Device: Linux' \ - "https://plex.tv/api/claim/exchange?token=${PLEX_CLAIM}")" - token="$(echo "$loginInfo" | sed -n 's/.*\(.*\)<\/authentication-token>.*/\1/p')" - - if [ "$token" ]; then - echo "Token obtained successfully" - setPref "PlexOnlineToken" "${token}" - fi -fi - -if [ -n "${ADVERTISE_IP}" ]; then - setPref "customConnections" "${ADVERTISE_IP}" -fi - -if [ -n "${ALLOWED_NETWORKS}" ]; then - setPref "allowedNetworks" "${ALLOWED_NETWORKS}" -fi - -# Set transcoder temp if not yet set -if [ -z "$(getPref "TranscoderTempDirectory")" ]; then - setPref "TranscoderTempDirectory" "/transcode" -fi - -# Parse list of all exported variables that start with PLEX_PREFERENCE_ -# The format of which is PLEX_PREFERENCE_="Key=Value" -# Where Key is the EXACT key to use in the Plex Preference file -# And Value is the EXACT value to use in the Plex Preference file for that key. -# Please note it looks like many of the key's are camelCase in some fashion. -# Additionally there are likely some preferences where environment variable injection -# doesn't really work for. -for var in "${!PLEX_PREFERENCE_@}"; do - value="${!var}" - PreferenceValue="${value#*=}" - PreferenceKey="${value%=*}" - setPref "${PreferenceKey}" "${PreferenceValue}" -done - -echo "Plex Media Server preferences updated" diff --git a/apps/postgres-init/Dockerfile b/apps/postgres-init/Dockerfile new file mode 100644 index 000000000..940364049 --- /dev/null +++ b/apps/postgres-init/Dockerfile @@ -0,0 +1,16 @@ +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 + +ARG TARGETPLATFORM +ARG VERSION +ARG CHANNEL + +#hadolint ignore=DL3018 +RUN apk add --no-cache ca-certificates postgresql16-client~"${VERSION}" + +USER kah + +COPY ./apps/postgres-init/entrypoint.sh /entrypoint.sh + +CMD ["/entrypoint.sh"] + +LABEL org.opencontainers.image.source="https://github.com/postgres/postgres" diff --git a/apps/postgres-init/README.md b/apps/postgres-init/README.md new file mode 100644 index 000000000..1137e4acb --- /dev/null +++ b/apps/postgres-init/README.md @@ -0,0 +1 @@ +# postgres-init diff --git a/apps/postgres-init/ci/goss.yaml b/apps/postgres-init/ci/goss.yaml new file mode 100644 index 000000000..ee5485e4f --- /dev/null +++ b/apps/postgres-init/ci/goss.yaml @@ -0,0 +1,4 @@ +--- +file: + /usr/libexec/postgresql16/psql: + exists: true diff --git a/apps/postgres-initdb/ci/latest.sh b/apps/postgres-init/ci/latest.sh similarity index 75% rename from apps/postgres-initdb/ci/latest.sh rename to apps/postgres-init/ci/latest.sh index eb8fae7cb..ec41a5cac 100755 --- a/apps/postgres-initdb/ci/latest.sh +++ b/apps/postgres-init/ci/latest.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -version=$(curl -sX GET "https://pkgs.alpinelinux.org/packages?name=postgresql14-client&branch=v3.17&arch" | grep -oP '(?<=)[^<]*' 2>/dev/null) +version=$(curl -sX GET "https://pkgs.alpinelinux.org/packages?name=postgresql16-client&branch=v3.19&arch" | grep -oP '(?<=)[^<]*' 2>/dev/null) version="${version%%_*}" version="${version%%-*}" printf "%s" "${version}" diff --git a/apps/postgres-init/entrypoint.sh b/apps/postgres-init/entrypoint.sh new file mode 100755 index 000000000..3e1f345c7 --- /dev/null +++ b/apps/postgres-init/entrypoint.sh @@ -0,0 +1,69 @@ +#!/usr/bin/env bash + +# This is most commonly set to the user 'postgres' +export INIT_POSTGRES_SUPER_USER=${INIT_POSTGRES_SUPER_USER:-postgres} +export INIT_POSTGRES_PORT=${INIT_POSTGRES_PORT:-5432} + +if [[ -z "${INIT_POSTGRES_HOST}" || + -z "${INIT_POSTGRES_SUPER_PASS}" || + -z "${INIT_POSTGRES_USER}" || + -z "${INIT_POSTGRES_PASS}" || + -z "${INIT_POSTGRES_DBNAME}" +]]; then + printf "\e[1;32m%-6s\e[m\n" "Invalid configuration - missing a required environment variable" + [[ -z "${INIT_POSTGRES_HOST}" ]] && printf "\e[1;32m%-6s\e[m\n" "INIT_POSTGRES_HOST: unset" + [[ -z "${INIT_POSTGRES_SUPER_PASS}" ]] && printf "\e[1;32m%-6s\e[m\n" "INIT_POSTGRES_SUPER_PASS: unset" + [[ -z "${INIT_POSTGRES_USER}" ]] && printf "\e[1;32m%-6s\e[m\n" "INIT_POSTGRES_USER: unset" + [[ -z "${INIT_POSTGRES_PASS}" ]] && printf "\e[1;32m%-6s\e[m\n" "INIT_POSTGRES_PASS: unset" + [[ -z "${INIT_POSTGRES_DBNAME}" ]] && printf "\e[1;32m%-6s\e[m\n" "INIT_POSTGRES_DBNAME: unset" + exit 1 +fi + +# These env are for the psql CLI +export PGHOST="${INIT_POSTGRES_HOST}" +export PGUSER="${INIT_POSTGRES_SUPER_USER}" +export PGPASSWORD="${INIT_POSTGRES_SUPER_PASS}" +export PGPORT="${INIT_POSTGRES_PORT}" + +until pg_isready; do + printf "\e[1;32m%-6s\e[m\n" "Waiting for Host '${PGHOST}' on port '${PGPORT}' ..." + sleep 1 +done + +user_exists=$(\ + psql \ + --tuples-only \ + --csv \ + --command "SELECT 1 FROM pg_roles WHERE rolname = '${INIT_POSTGRES_USER}'" +) + +if [[ -z "${user_exists}" ]]; then + printf "\e[1;32m%-6s\e[m\n" "Create User ${INIT_POSTGRES_USER} ..." + createuser ${INIT_POSTGRES_USER_FLAGS} "${INIT_POSTGRES_USER}" +fi + +printf "\e[1;32m%-6s\e[m\n" "Update password for user ${INIT_POSTGRES_USER} ..." +psql --command "alter user \"${INIT_POSTGRES_USER}\" with encrypted password '${INIT_POSTGRES_PASS}';" + +for dbname in ${INIT_POSTGRES_DBNAME}; do + database_exists=$(\ + psql \ + --tuples-only \ + --csv \ + --command "SELECT 1 FROM pg_database WHERE datname = '${dbname}'" + ) + if [[ -z "${database_exists}" ]]; then + printf "\e[1;32m%-6s\e[m\n" "Create Database ${dbname} ..." + createdb --owner "${INIT_POSTGRES_USER}" "${dbname}" + database_init_file="/initdb/${dbname}.sql" + if [[ -f "$(database_init_file)" ]]; then + printf "\e[1;32m%-6s\e[m\n" "Initialize Database ..." + psql \ + --dbname "${dbname}" \ + --echo-all \ + --file "$(database_init_file)" + fi + fi + printf "\e[1;32m%-6s\e[m\n" "Update User Privileges on Database ..." + psql --command "grant all privileges on database \"${dbname}\" to \"${INIT_POSTGRES_USER}\";" +done diff --git a/apps/postgres-init/metadata.yaml b/apps/postgres-init/metadata.yaml new file mode 100644 index 000000000..65bc6c580 --- /dev/null +++ b/apps/postgres-init/metadata.yaml @@ -0,0 +1,11 @@ +--- +app: postgres-init +base: false +semantic_versioning: true +channels: + - name: stable + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: cli diff --git a/apps/postgres-initdb/Dockerfile b/apps/postgres-initdb/Dockerfile deleted file mode 100644 index 9f6f4b58d..000000000 --- a/apps/postgres-initdb/Dockerfile +++ /dev/null @@ -1,21 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV POSTGRES_SUPER_USER="postgres" \ - POSTGRES_RESET="false" \ - POSTGRES_USER_RESET="false" \ - POSTGRES_RESET_CONFIRM="NO" - -#hadolint ignore=DL3018 -RUN apk add --no-cache ca-certificates postgresql14-client~"${VERSION}" - -USER kah - -COPY ./apps/postgres-initdb/entrypoint.sh /entrypoint.sh - -CMD ["/entrypoint.sh"] - -LABEL org.opencontainers.image.source="https://github.com/postgres/postgres" diff --git a/apps/postgres-initdb/README.md b/apps/postgres-initdb/README.md deleted file mode 100644 index 60fb748c8..000000000 --- a/apps/postgres-initdb/README.md +++ /dev/null @@ -1 +0,0 @@ -# postgres-initdb diff --git a/apps/postgres-initdb/ci/goss.yaml b/apps/postgres-initdb/ci/goss.yaml deleted file mode 100644 index b732d3a95..000000000 --- a/apps/postgres-initdb/ci/goss.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -file: - /usr/libexec/postgresql14/psql: - exists: true diff --git a/apps/postgres-initdb/entrypoint.sh b/apps/postgres-initdb/entrypoint.sh deleted file mode 100755 index f6a6ea346..000000000 --- a/apps/postgres-initdb/entrypoint.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env bash - -export PGHOST="${POSTGRES_HOST}" -export PGUSER="${POSTGRES_SUPER_USER}" -export PGPASSWORD="${POSTGRES_SUPER_PASS}" - -if [[ -z "${PGHOST}" || -z "${PGHOST}" || -z "${PGPASSWORD}" || -z "${POSTGRES_USER}" || -z "${POSTGRES_PASS}" || -z "${POSTGRES_DB}" ]]; then - printf "\e[1;32m%-6s\e[m\n" "Invalid configuration ..." - exit 1 -fi - -until pg_isready; do - printf "\e[1;32m%-6s\e[m\n" "Waiting for Host '${PGHOST}' ..." - sleep 1 -done - -if [[ "${POSTGRES_USER_RESET}" == "true" && "${POSTGRES_RESET_CONFIRM}" == "YES" ]]; then - printf "\e[1;32m%-6s\e[m\n" "Drop User ${POSTGRES_USER} ..." - dropuser "${POSTGRES_USER}" -fi - -user_exists=$(\ - psql \ - --tuples-only \ - --csv \ - --command "SELECT 1 FROM pg_roles WHERE rolname = '${POSTGRES_USER}'" - ) - -if [[ -z "${user_exists}" ]]; then - printf "\e[1;32m%-6s\e[m\n" "Create User ${POSTGRES_USER} ..." - createuser ${POSTGRES_USER_FLAGS} "${POSTGRES_USER}" - printf "\e[1;32m%-6s\e[m\n" "Update User Password ..." - psql --command "alter user \"${POSTGRES_USER}\" with encrypted password '${POSTGRES_PASS}';" -fi - -for init_db in ${POSTGRES_DB} -do - if [[ "${POSTGRES_RESET}" == "true" && "${POSTGRES_RESET_CONFIRM}" == "YES" ]]; then - printf "\e[1;32m%-6s\e[m\n" "Drop Database ${init_db} ..." - dropdb "${init_db}" - fi - - database_exists=$(\ - psql \ - --tuples-only \ - --csv \ - --command "SELECT 1 FROM pg_database WHERE datname = '${init_db}'" - ) - - if [[ -z "${database_exists}" ]]; then - printf "\e[1;32m%-6s\e[m\n" "Create Database ${init_db} ..." - createdb --owner "${POSTGRES_USER}" "${init_db}" - fi - - printf "\e[1;32m%-6s\e[m\n" "Update User Privileges on Database ..." - psql --command "grant all privileges on database \"${init_db}\" to \"${POSTGRES_USER}\";" -done diff --git a/apps/postgres-initdb/metadata.json b/apps/postgres-initdb/metadata.json deleted file mode 100644 index dead5a892..000000000 --- a/apps/postgres-initdb/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "postgres-initdb", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "cli" - } - } - ] -} diff --git a/apps/prowlarr/Dockerfile b/apps/prowlarr/Dockerfile index 0404c0cdb..d7ac3c5cf 100644 --- a/apps/prowlarr/Dockerfile +++ b/apps/prowlarr/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 ARG TARGETPLATFORM ARG VERSION @@ -19,11 +19,13 @@ RUN \ 'linux/arm64') export ARCH='arm64' ;; \ esac \ && \ + mkdir -p /app/bin \ + && \ curl -fsSL "https://prowlarr.servarr.com/v1/update/${PROWLARR__BRANCH}/updatefile?version=${VERSION}&os=linuxmusl&runtime=netcore&arch=${ARCH}" \ - | tar xzf - -C /app --strip-components=1 \ + | tar xzf - -C /app/bin --strip-components=1 \ && \ rm -rf \ - /app/Prowlarr.Update \ + /app/bin/Prowlarr.Update \ && \ printf "UpdateMethod=docker\nBranch=%s\nPackageVersion=%s\nPackageAuthor=[onedr0p](https://github.com/onedr0p)\n" "${PROWLARR__BRANCH}" "${VERSION}" > /app/package_info \ && chown -R root:root /app \ diff --git a/apps/prowlarr/config.xml.tmpl b/apps/prowlarr/config.xml.tmpl index 7056187ac..aac35be46 100644 --- a/apps/prowlarr/config.xml.tmpl +++ b/apps/prowlarr/config.xml.tmpl @@ -21,4 +21,5 @@ BuiltIn ${PROWLARR__ANALYTICS_ENABLED} + ${PROWLARR__THEME:-auto} diff --git a/apps/prowlarr/entrypoint.sh b/apps/prowlarr/entrypoint.sh index 884f35c11..69a7041dd 100755 --- a/apps/prowlarr/entrypoint.sh +++ b/apps/prowlarr/entrypoint.sh @@ -19,6 +19,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -39,6 +40,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${PROWLARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml [[ -z "${PROWLARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${PROWLARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml +[[ -z "${PROWLARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment @@ -50,7 +52,7 @@ fi #shellcheck disable=SC2086 exec \ - /app/Prowlarr \ + /app/bin/Prowlarr \ --nobrowser \ --data=/config \ "$@" diff --git a/apps/prowlarr/metadata.json b/apps/prowlarr/metadata.json deleted file mode 100644 index fee6c39ad..000000000 --- a/apps/prowlarr/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "app": "prowlarr", - "base": false, - "channels": [ - { - "name": "develop", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "nightly", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/prowlarr/metadata.yaml b/apps/prowlarr/metadata.yaml new file mode 100644 index 000000000..7e9133c64 --- /dev/null +++ b/apps/prowlarr/metadata.yaml @@ -0,0 +1,23 @@ +--- +app: prowlarr +base: false +semantic_versioning: true +channels: + - name: master + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web + - name: develop + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web + - name: nightly + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web diff --git a/apps/qbittorrent/Dockerfile b/apps/qbittorrent/Dockerfile index 2ffe3b974..4fe91b3e3 100644 --- a/apps/qbittorrent/Dockerfile +++ b/apps/qbittorrent/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 ARG TARGETPLATFORM ARG VERSION diff --git a/apps/qbittorrent/metadata.json b/apps/qbittorrent/metadata.json deleted file mode 100644 index 2fb48136c..000000000 --- a/apps/qbittorrent/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "app": "qbittorrent", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "beta", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/qbittorrent/metadata.yaml b/apps/qbittorrent/metadata.yaml new file mode 100644 index 000000000..9777b658b --- /dev/null +++ b/apps/qbittorrent/metadata.yaml @@ -0,0 +1,17 @@ +--- +app: qbittorrent +base: false +semantic_versioning: true +channels: + - name: stable + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web + - name: beta + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web diff --git a/apps/radarr/Dockerfile b/apps/radarr/Dockerfile index 84603ac38..a5761c4af 100644 --- a/apps/radarr/Dockerfile +++ b/apps/radarr/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 ARG TARGETPLATFORM ARG VERSION @@ -19,11 +19,13 @@ RUN \ 'linux/arm64') export ARCH='arm64' ;; \ esac \ && \ + mkdir -p /app/bin \ + && \ curl -fsSL "https://radarr.servarr.com/v1/update/${RADARR__BRANCH}/updatefile?version=${VERSION}&os=linuxmusl&runtime=netcore&arch=${ARCH}" \ - | tar xzf - -C /app --strip-components=1 \ + | tar xzf - -C /app/bin --strip-components=1 \ && \ rm -rf \ - /app/Radarr.Update \ + /app/bin/Radarr.Update \ && \ printf "UpdateMethod=docker\nBranch=%s\nPackageVersion=%s\nPackageAuthor=[onedr0p](https://github.com/onedr0p)\n" "${RADARR__BRANCH}" "${VERSION}" > /app/package_info \ && chown -R root:root /app \ diff --git a/apps/radarr/config.xml.tmpl b/apps/radarr/config.xml.tmpl index a09ace62f..a1c0e2eaf 100644 --- a/apps/radarr/config.xml.tmpl +++ b/apps/radarr/config.xml.tmpl @@ -3,8 +3,8 @@ ${RADARR__URL_BASE} ${RADARR__BRANCH} ${RADARR__API_KEY} - ${RADARR__AUTHENTICATION_METHOD:-None} - ${RADARR__AUTHENTICATION_REQUIRED} + ${RADARR__AUTHENTICATION_METHOD:-External} + ${RADARR__AUTHENTICATION_REQUIRED:-DisabledForLocalAddresses} ${RADARR__INSTANCE_NAME} ${RADARR__POSTGRES_USER} ${RADARR__POSTGRES_PASSWORD} @@ -21,4 +21,5 @@ BuiltIn ${RADARR__ANALYTICS_ENABLED} + ${RADARR__THEME:-auto} diff --git a/apps/radarr/entrypoint.sh b/apps/radarr/entrypoint.sh index 8c60afc78..8f4c11cbd 100755 --- a/apps/radarr/entrypoint.sh +++ b/apps/radarr/entrypoint.sh @@ -5,40 +5,42 @@ test -f "/scripts/umask.sh" && source "/scripts/umask.sh" # Discover existing configuration settings for backwards compatibility if [[ -f /config/config.xml ]]; then - current_log_level="$(xmlstarlet sel -t -v "//LogLevel" -nl /config/config.xml)" - current_url_base="$(xmlstarlet sel -t -v "//UrlBase" -nl /config/config.xml)" - current_branch="$(xmlstarlet sel -t -v "//Branch" -nl /config/config.xml)" current_analytics_enabled="$(xmlstarlet sel -t -v "//AnalyticsEnabled" -nl /config/config.xml)" current_api_key="$(xmlstarlet sel -t -v "//ApiKey" -nl /config/config.xml)" current_authentication_method="$(xmlstarlet sel -t -v "//AuthenticationMethod" -nl /config/config.xml)" current_authentication_required="$(xmlstarlet sel -t -v "//AuthenticationRequired" -nl /config/config.xml)" + current_branch="$(xmlstarlet sel -t -v "//Branch" -nl /config/config.xml)" current_instance_name="$(xmlstarlet sel -t -v "//InstanceName" -nl /config/config.xml)" - current_postgres_user="$(xmlstarlet sel -t -v "//PostgresUser" -nl /config/config.xml)" - current_postgres_password="$(xmlstarlet sel -t -v "//PostgresPassword" -nl /config/config.xml)" - current_postgres_port="$(xmlstarlet sel -t -v "//PostgresPort" -nl /config/config.xml)" + current_log_level="$(xmlstarlet sel -t -v "//LogLevel" -nl /config/config.xml)" current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" - current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" + current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" + current_postgres_password="$(xmlstarlet sel -t -v "//PostgresPassword" -nl /config/config.xml)" + current_postgres_port="$(xmlstarlet sel -t -v "//PostgresPort" -nl /config/config.xml)" + current_postgres_user="$(xmlstarlet sel -t -v "//PostgresUser" -nl /config/config.xml)" + current_url_base="$(xmlstarlet sel -t -v "//UrlBase" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables envsubst < /app/config.xml.tmpl > /config/config.xml # Override configuation values from existing config.xml if there are no RADARR__ variables set -[[ -z "${RADARR__LOG_LEVEL}" && -n "${current_log_level}" ]] && xmlstarlet edit --inplace --update //LogLevel -v "${current_log_level}" /config/config.xml -[[ -z "${RADARR__URL_BASE}" && -n "${current_url_base}" ]] && xmlstarlet edit --inplace --update //UrlBase -v "${current_url_base}" /config/config.xml -[[ -z "${RADARR__BRANCH}" && -n "${current_branch}" ]] && xmlstarlet edit --inplace --update //Branch -v "${current_branch}" /config/config.xml [[ -z "${RADARR__ANALYTICS_ENABLED}" && -n "${current_analytics_enabled}" ]] && xmlstarlet edit --inplace --update //AnalyticsEnabled -v "${current_analytics_enabled}" /config/config.xml [[ -z "${RADARR__API_KEY}" && -n "${current_api_key}" ]] && xmlstarlet edit --inplace --update //ApiKey -v "${current_api_key}" /config/config.xml [[ -z "${RADARR__AUTHENTICATION_METHOD}" && -n "${current_authentication_method}" ]] && xmlstarlet edit --inplace --update //AuthenticationMethod -v "${current_authentication_method}" /config/config.xml [[ -z "${RADARR__AUTHENTICATION_REQUIRED}" && -n "${current_authentication_required}" ]] && xmlstarlet edit --inplace --update //AuthenticationRequired -v "${current_authentication_required}" /config/config.xml +[[ -z "${RADARR__BRANCH}" && -n "${current_branch}" ]] && xmlstarlet edit --inplace --update //Branch -v "${current_branch}" /config/config.xml [[ -z "${RADARR__INSTANCE_NAME}" && -n "${current_instance_name}" ]] && xmlstarlet edit --inplace --update //InstanceName -v "${current_instance_name}" /config/config.xml -[[ -z "${RADARR__POSTGRES_USER}" && -n "${current_postgres_user}" ]] && xmlstarlet edit --inplace --update //PostgresUser -v "${current_postgres_user}" /config/config.xml -[[ -z "${RADARR__POSTGRES_PASSWORD}" && -n "${current_postgres_password}" ]] && xmlstarlet edit --inplace --update //PostgresPassword -v "${current_postgres_password}" /config/config.xml -[[ -z "${RADARR__POSTGRES_PORT}" && -n "${current_postgres_port}" ]] && xmlstarlet edit --inplace --update //PostgresPort -v "${current_postgres_port}" /config/config.xml +[[ -z "${RADARR__LOG_LEVEL}" && -n "${current_log_level}" ]] && xmlstarlet edit --inplace --update //LogLevel -v "${current_log_level}" /config/config.xml [[ -z "${RADARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml -[[ -z "${RADARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${RADARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml +[[ -z "${RADARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml +[[ -z "${RADARR__POSTGRES_PASSWORD}" && -n "${current_postgres_password}" ]] && xmlstarlet edit --inplace --update //PostgresPassword -v "${current_postgres_password}" /config/config.xml +[[ -z "${RADARR__POSTGRES_PORT}" && -n "${current_postgres_port}" ]] && xmlstarlet edit --inplace --update //PostgresPort -v "${current_postgres_port}" /config/config.xml +[[ -z "${RADARR__POSTGRES_USER}" && -n "${current_postgres_user}" ]] && xmlstarlet edit --inplace --update //PostgresUser -v "${current_postgres_user}" /config/config.xml +[[ -z "${RADARR__URL_BASE}" && -n "${current_url_base}" ]] && xmlstarlet edit --inplace --update //UrlBase -v "${current_url_base}" /config/config.xml +[[ -z "${RADARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment @@ -50,7 +52,7 @@ fi #shellcheck disable=SC2086 exec \ - /app/Radarr \ + /app/bin/Radarr \ --nobrowser \ --data=/config \ "$@" diff --git a/apps/radarr/metadata.json b/apps/radarr/metadata.json deleted file mode 100644 index 1ce1be2bb..000000000 --- a/apps/radarr/metadata.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "app": "radarr", - "base": false, - "channels": [ - { - "name": "master", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "develop", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "nightly", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "zeus", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/radarr/metadata.yaml b/apps/radarr/metadata.yaml new file mode 100644 index 000000000..1329a802f --- /dev/null +++ b/apps/radarr/metadata.yaml @@ -0,0 +1,23 @@ +--- +app: radarr +base: false +semantic_versioning: true +channels: + - name: master + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web + - name: develop + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web + - name: nightly + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web diff --git a/apps/radarr/zeus/Dockerfile b/apps/radarr/zeus/Dockerfile deleted file mode 100644 index e0bcf454c..000000000 --- a/apps/radarr/zeus/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV \ - RADARR__INSTANCE_NAME="Radarr" \ - RADARR__BRANCH="${CHANNEL}" \ - RADARR__PORT="7878" \ - RADARR__ANALYTICS_ENABLED="False" - -#hadolint ignore=DL3018 -RUN apk add --no-cache ca-certificates icu-libs libintl sqlite-libs xmlstarlet -#hadolint ignore=DL3059 -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') export ARCH='x64' ;; \ - 'linux/arm64') export ARCH='arm64' ;; \ - esac \ - && \ - curl -fsSL "https://radarr.servarr.com/v1/update/${RADARR__BRANCH}/updatefile?version=${VERSION}&os=linuxmusl&runtime=netcore&arch=${ARCH}" \ - | tar xzf - -C /app --strip-components=1 \ - && \ - rm -rf \ - /app/Radarr.Update \ - && \ - printf "UpdateMethod=docker\nBranch=%s\nPackageVersion=%s\nPackageAuthor=[onedr0p](https://github.com/onedr0p)\n" "${RADARR__BRANCH}" "${VERSION}" > /app/package_info \ - && chown -R root:root /app \ - && chmod -R 755 /app \ - && rm -rf /tmp/* - -USER kah - -COPY ./apps/radarr/zeus/config.xml.tmpl /app/config.xml.tmpl -COPY ./apps/radarr/zeus/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] - -LABEL org.opencontainers.image.source="https://github.com/Radarr/Radarr" diff --git a/apps/radarr/zeus/config.xml.tmpl b/apps/radarr/zeus/config.xml.tmpl deleted file mode 100644 index ec998d05f..000000000 --- a/apps/radarr/zeus/config.xml.tmpl +++ /dev/null @@ -1,24 +0,0 @@ - - ${RADARR__ANALYTICS_ENABLED} - ${RADARR__API_KEY} - ${RADARR__AUTHENTICATION_METHOD:-External} - ${RADARR__AUTHENTICATION_REQUIRED:-0} - * - ${RADARR__BRANCH} - False - ${RADARR__INSTANCE_NAME} - False - ${RADARR__LOG_LEVEL:-info} - ${RADARR__PORT} - ${RADARR__POSTGRES_HOST} - ${RADARR__POSTGRES_LOG_DB} - ${RADARR__POSTGRES_MAIN_DB} - ${RADARR__POSTGRES_PASSWORD} - ${RADARR__POSTGRES_PORT:-5432} - ${RADARR__POSTGRES_USER} - - - 6969 - BuiltIn - ${RADARR__URL_BASE} - diff --git a/apps/radarr/zeus/entrypoint.sh b/apps/radarr/zeus/entrypoint.sh deleted file mode 100755 index e82de70bb..000000000 --- a/apps/radarr/zeus/entrypoint.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck disable=SC1091 -test -f "/scripts/umask.sh" && source "/scripts/umask.sh" - -# Discover existing configuration settings for backwards compatibility -if [[ -f /config/config.xml ]]; then - current_analytics_enabled="$(xmlstarlet sel -t -v "//AnalyticsEnabled" -nl /config/config.xml)" - current_api_key="$(xmlstarlet sel -t -v "//ApiKey" -nl /config/config.xml)" - current_authentication_method="$(xmlstarlet sel -t -v "//AuthenticationMethod" -nl /config/config.xml)" - current_authentication_required="$(xmlstarlet sel -t -v "//AuthenticationRequired" -nl /config/config.xml)" - current_branch="$(xmlstarlet sel -t -v "//Branch" -nl /config/config.xml)" - current_instance_name="$(xmlstarlet sel -t -v "//InstanceName" -nl /config/config.xml)" - current_log_level="$(xmlstarlet sel -t -v "//LogLevel" -nl /config/config.xml)" - current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" - current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" - current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" - current_postgres_password="$(xmlstarlet sel -t -v "//PostgresPassword" -nl /config/config.xml)" - current_postgres_port="$(xmlstarlet sel -t -v "//PostgresPort" -nl /config/config.xml)" - current_postgres_user="$(xmlstarlet sel -t -v "//PostgresUser" -nl /config/config.xml)" - current_url_base="$(xmlstarlet sel -t -v "//UrlBase" -nl /config/config.xml)" -fi - -# Update config.xml with environment variables -envsubst < /app/config.xml.tmpl > /config/config.xml - -# Override configuation values from existing config.xml if there are no RADARR__ variables set -[[ -z "${RADARR__ANALYTICS_ENABLED}" && -n "${current_analytics_enabled}" ]] && xmlstarlet edit --inplace --update //AnalyticsEnabled -v "${current_analytics_enabled}" /config/config.xml -[[ -z "${RADARR__API_KEY}" && -n "${current_api_key}" ]] && xmlstarlet edit --inplace --update //ApiKey -v "${current_api_key}" /config/config.xml -[[ -z "${RADARR__AUTHENTICATION_METHOD}" && -n "${current_authentication_method}" ]] && xmlstarlet edit --inplace --update //AuthenticationMethod -v "${current_authentication_method}" /config/config.xml -[[ -z "${RADARR__AUTHENTICATION_REQUIRED}" && -n "${current_authentication_required}" ]] && xmlstarlet edit --inplace --update //AuthenticationRequired -v "${current_authentication_required}" /config/config.xml -[[ -z "${RADARR__BRANCH}" && -n "${current_branch}" ]] && xmlstarlet edit --inplace --update //Branch -v "${current_branch}" /config/config.xml -[[ -z "${RADARR__INSTANCE_NAME}" && -n "${current_instance_name}" ]] && xmlstarlet edit --inplace --update //InstanceName -v "${current_instance_name}" /config/config.xml -[[ -z "${RADARR__LOG_LEVEL}" && -n "${current_log_level}" ]] && xmlstarlet edit --inplace --update //LogLevel -v "${current_log_level}" /config/config.xml -[[ -z "${RADARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml -[[ -z "${RADARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml -[[ -z "${RADARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml -[[ -z "${RADARR__POSTGRES_PASSWORD}" && -n "${current_postgres_password}" ]] && xmlstarlet edit --inplace --update //PostgresPassword -v "${current_postgres_password}" /config/config.xml -[[ -z "${RADARR__POSTGRES_PORT}" && -n "${current_postgres_port}" ]] && xmlstarlet edit --inplace --update //PostgresPort -v "${current_postgres_port}" /config/config.xml -[[ -z "${RADARR__POSTGRES_USER}" && -n "${current_postgres_user}" ]] && xmlstarlet edit --inplace --update //PostgresUser -v "${current_postgres_user}" /config/config.xml -[[ -z "${RADARR__URL_BASE}" && -n "${current_url_base}" ]] && xmlstarlet edit --inplace --update //UrlBase -v "${current_url_base}" /config/config.xml - -# BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism -# have been omited because their configuration is not really needed in a container environment - -if [[ "${RADARR__LOG_LEVEL}" == "debug" || "${current_log_level}" == "debug" ]]; then - echo "Starting with the following configuration..." - xmlstarlet format --omit-decl /config/config.xml -fi - -#shellcheck disable=SC2086 -exec \ - /app/Radarr \ - --nobrowser \ - --data=/config \ - "$@" diff --git a/apps/radarr/zeus/goss.yaml b/apps/radarr/zeus/goss.yaml deleted file mode 100644 index 60d02693a..000000000 --- a/apps/radarr/zeus/goss.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - Radarr: - running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -port: - # https://github.com/aelsabbahy/goss/issues/149 - tcp6:7878: - listening: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http -http: - http://localhost:7878: - status: 200 - timeout: 5000 diff --git a/apps/rclone/Dockerfile b/apps/rclone/Dockerfile deleted file mode 100644 index c3c32056e..000000000 --- a/apps/rclone/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -#hadolint ignore=DL3018 -RUN apk add --no-cache ca-certificates pigz rclone~"${VERSION}" tar zstd -#hadolint ignore=DL3059 -RUN chown -R root:root /usr/bin/rclone \ - && chmod -R 755 /usr/bin/rclone \ - && ln -s /usr/bin/rclone /app/rclone \ - && rm -rf /tmp/* - -CMD ["/app/rclone"] - -LABEL org.opencontainers.image.source="https://github.com/rclone/rclone" diff --git a/apps/rclone/ci/latest.sh b/apps/rclone/ci/latest.sh deleted file mode 100755 index 641cf7d1b..000000000 --- a/apps/rclone/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -sX GET "https://pkgs.alpinelinux.org/packages?name=rclone&branch=v3.17&arch" | grep -oP '(?<=)[^<]*' 2>/dev/null) -version="${version%%_*}" -version="${version%%-*}" -printf "%s" "${version}" diff --git a/apps/rclone/metadata.json b/apps/rclone/metadata.json deleted file mode 100644 index 1b9d954d9..000000000 --- a/apps/rclone/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "rclone", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "cli" - } - } - ] -} diff --git a/apps/readarr/Dockerfile b/apps/readarr/Dockerfile index cba20fb00..394341e30 100644 --- a/apps/readarr/Dockerfile +++ b/apps/readarr/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 ARG TARGETPLATFORM ARG VERSION @@ -19,11 +19,13 @@ RUN \ 'linux/arm64') export ARCH='arm64' ;; \ esac \ && \ + mkdir -p /app/bin \ + && \ curl -fsSL "https://readarr.servarr.com/v1/update/${READARR__BRANCH}/updatefile?version=${VERSION}&os=linuxmusl&runtime=netcore&arch=${ARCH}" \ - | tar xzf - -C /app --strip-components=1 \ + | tar xzf - -C /app/bin --strip-components=1 \ && \ rm -rf \ - /app/Readarr.Update \ + /app/bin/Readarr.Update \ && \ printf "UpdateMethod=docker\nBranch=%s\nPackageVersion=%s\nPackageAuthor=[onedr0p](https://github.com/onedr0p)\n" "${READARR__BRANCH}" "${VERSION}" > /app/package_info \ && chown -R root:root /app \ diff --git a/apps/readarr/config.xml.tmpl b/apps/readarr/config.xml.tmpl index a8e1d9bd0..544fe5cb7 100644 --- a/apps/readarr/config.xml.tmpl +++ b/apps/readarr/config.xml.tmpl @@ -22,4 +22,5 @@ BuiltIn ${READARR__ANALYTICS_ENABLED} + ${READARR__THEME:-auto} diff --git a/apps/readarr/entrypoint.sh b/apps/readarr/entrypoint.sh index 306c7204a..309fca7df 100755 --- a/apps/readarr/entrypoint.sh +++ b/apps/readarr/entrypoint.sh @@ -20,6 +20,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" current_postgres_cache_db="$(xmlstarlet sel -t -v "//PostgresCacheDb" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -41,6 +42,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${READARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${READARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml [[ -z "${READARR__POSTGRES_CACHE_DB}" && -n "${current_postgres_cache_db}" ]] && xmlstarlet edit --inplace --update //PostgresCacheDb -v "${current_postgres_cache_db}" /config/config.xml +[[ -z "${READARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment @@ -52,7 +54,7 @@ fi #shellcheck disable=SC2086 exec \ - /app/Readarr \ + /app/bin/Readarr \ --nobrowser \ --data=/config \ "$@" diff --git a/apps/readarr/metadata.json b/apps/readarr/metadata.json deleted file mode 100644 index 798224146..000000000 --- a/apps/readarr/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "app": "readarr", - "base": false, - "channels": [ - { - "name": "develop", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "nightly", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/readarr/metadata.yaml b/apps/readarr/metadata.yaml new file mode 100644 index 000000000..9919dcdf1 --- /dev/null +++ b/apps/readarr/metadata.yaml @@ -0,0 +1,17 @@ +--- +app: readarr +base: false +semantic_versioning: true +channels: + - name: develop + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web + - name: nightly + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web diff --git a/apps/rtorrent/Dockerfile b/apps/rtorrent/Dockerfile deleted file mode 100644 index 1f12e6119..000000000 --- a/apps/rtorrent/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL -ARG TARGETARCH -ENV TARGETARCH=${TARGETARCH:-amd64} - -ENV RTORRENT__DEFAULT_CONFIG="true" \ - RTORRENT__CONFIG_FILE="/config/rtorrent.rc" \ - RTORRENT__SOCKET="/sock/rtorrent.sock" \ - RTORRENT__BT_PORT="50415" - -#hadolint ignore=DL3018 -RUN apk add --no-cache ca-certificates -#hadolint ignore=DL3059 -RUN curl -fsSL -o /app/rtorrent \ - "https://github.com/jesec/rtorrent/releases/download/v${VERSION}/rtorrent-linux-${TARGETARCH}" \ - && chown -R root:root /app \ - && chmod -R 755 /app \ - && mkdir -p "$(dirname "${RTORRENT__SOCKET}")" \ - && chown -R kah:kah "$(dirname "${RTORRENT__SOCKET}")" \ - && chmod -R 775 "$(dirname "${RTORRENT__SOCKET}")" \ - && rm -rf /tmp/* - -USER kah -COPY ./apps/rtorrent/rtorrent.rc /app/rtorrent.rc -COPY ./apps/rtorrent/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] - -LABEL org.opencontainers.image.source="https://github.com/jesec/rtorrent" diff --git a/apps/rtorrent/README.md b/apps/rtorrent/README.md deleted file mode 100644 index 8c7725981..000000000 --- a/apps/rtorrent/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# rtorrent - -## Custom environment configuration - -This container support setting certain custom enviroment variables with the use of [drone/envsubst](https://github.com/drone/envsubst). - -| Name | Default | -|--------------------------|-----------------------| -| RTORRENT__BT_PORT | `50415` | -| RTORRENT__CONFIG_FILE | `/config/rtorrent.rc` | -| RTORRENT__DEFAULT_CONFIG | `true` | -| RTORRENT__SOCKET | `/sock/rtorrent.sock` | diff --git a/apps/rtorrent/ci/goss.yaml b/apps/rtorrent/ci/goss.yaml deleted file mode 100644 index 64602291c..000000000 --- a/apps/rtorrent/ci/goss.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - rtorrent: - running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -port: - # https://github.com/aelsabbahy/goss/issues/149 - tcp6:50415: - listening: true diff --git a/apps/rtorrent/ci/latest.sh b/apps/rtorrent/ci/latest.sh deleted file mode 100755 index 5c8055840..000000000 --- a/apps/rtorrent/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -sX GET "https://api.github.com/repos/jesec/rtorrent/releases" | jq --raw-output '.[0].tag_name' 2>/dev/null) -version="${version#*v}" -version="${version#*release-}" -printf "%s" "${version}" diff --git a/apps/rtorrent/entrypoint.sh b/apps/rtorrent/entrypoint.sh deleted file mode 100755 index 193c4c4e1..000000000 --- a/apps/rtorrent/entrypoint.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck disable=SC1091 -test -f "/scripts/umask.sh" && source "/scripts/umask.sh" -test -f "/scripts/vpn.sh" && source "/scripts/vpn.sh" - -if [[ "${RTORRENT__DEFAULT_CONFIG}" == "true" && ! -f "${RTORRENT__CONFIG_FILE}" ]]; then - cp /app/rtorrent.rc "${RTORRENT__CONFIG_FILE}" -fi - -args+=("try_import=${RTORRENT__CONFIG_FILE}") -args+=("system.daemon.set=true") -args+=("encoding.add=utf8") -args+=("system.umask.set=0002") -args+=("session.use_lock.set=no") -args+=("network.scgi.open_local=${RTORRENT__SOCKET}") -args+=("network.port_range.set=${RTORRENT__BT_PORT}-${RTORRENT__BT_PORT}") - -printf -v joined_args "%s," "${args[@]}" - -#shellcheck disable=SC2086 -exec \ - /app/rtorrent \ - -n \ - -o "${joined_args%,}" \ - "$@" diff --git a/apps/rtorrent/metadata.json b/apps/rtorrent/metadata.json deleted file mode 100644 index 6d592401f..000000000 --- a/apps/rtorrent/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "rtorrent", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/rtorrent/rtorrent.rc b/apps/rtorrent/rtorrent.rc deleted file mode 100644 index e054c9b31..000000000 --- a/apps/rtorrent/rtorrent.rc +++ /dev/null @@ -1,57 +0,0 @@ -# -# Refs: -# https://github.com/jesec/rtorrent/blob/master/doc/rtorrent.rc -# https://rtorrent-docs.readthedocs.io/en/latest/cookbook.html -# https://wiki.archlinux.org/title/RTorrent -# - -## Define directories -method.insert = cfg.basedir, private|const|string, (cat, "/config/") -method.insert = cfg.session, private|const|string, (cat, (cfg.basedir), "session/") -method.insert = cfg.download, private|const|string, (cat, (cfg.basedir), "download/") - -## Create defined directories -fs.mkdir.recursive = (cat,(cfg.basedir)) -fs.mkdir = (cat, (cfg.session)) -fs.mkdir = (cat, (cfg.download)) - -## Set default paths -system.cwd.set = (directory.default) -directory.default.set = (cat, (cfg.download)) -session.path.set = (cat, (cfg.session)) - -## Set last started time -method.insert = system.startup_time, value|const, (system.time) - -## Set the path to an items data, and the path to its session file. -method.insert = d.data_path, simple,"if=(d.is_multi_file),(cat, (d.directory), /),(cat, (d.directory), /, (d.name))" -method.insert = d.session_file, simple, "cat=(session.path), (d.hash), .torrent" - -## Configuration -pieces.memory.max.set = 1024M -throttle.max_uploads.set = 100 -throttle.max_uploads.global.set = 250 -throttle.min_peers.normal.set = 20 -throttle.max_peers.normal.set = 60 -throttle.min_peers.seed.set = 30 -throttle.max_peers.seed.set = 80 -trackers.numwant.set = 80 -protocol.encryption.set = allow_incoming,try_outgoing,enable_retry -network.http.max_open.set = 50 -network.http.dns_cache_timeout.set = 25 -network.max_open_files.set = 600 -network.max_open_sockets.set = 300 -network.xmlrpc.size_limit.set = 4M - -## Disable tracker-less torrent and UDP tracker support -dht.mode.set = disable -protocol.pex.set = no -trackers.use_udp.set = no - -## Log all messages to stdout -method.insert = cfg.logfile, private|const|string, (cat, "/dev/stdout") -log.open_file = "log", (cfg.logfile) -log.add_output = "info", "log" -log.add_output = "warn", "log" -log.add_output = "critical", "log" -log.add_output = "torrent_info", "log" diff --git a/apps/sabnzbd/Dockerfile b/apps/sabnzbd/Dockerfile index 562e082de..2189003c8 100644 --- a/apps/sabnzbd/Dockerfile +++ b/apps/sabnzbd/Dockerfile @@ -1,5 +1,4 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 ARG TARGETPLATFORM ARG VERSION ARG CHANNEL @@ -10,10 +9,12 @@ ENV \ PIP_ROOT_USER_ACTION=ignore \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PIP_BREAK_SYSTEM_PACKAGES=1 \ CRYPTOGRAPHY_DONT_BUILD_RUST=1 ENV SABNZBD__PORT=8080 +# Download source RUN \ curl -fsSL "https://github.com/sabnzbd/sabnzbd/releases/download/${VERSION}/SABnzbd-${VERSION}-src.tar.gz" \ | tar xzf - -C /app --strip-components=1 \ @@ -22,7 +23,7 @@ RUN \ && chmod -R 755 /app \ && rm -rf /tmp/* -#hadolint ignore=DL3018,DL3013 +# Install sabnzbd RUN \ # Keep py3-pip installed \ @@ -30,7 +31,6 @@ RUN \ ca-certificates \ python3 \ py3-pip \ - par2cmdline \ p7zip \ && \ apk add --no-cache --virtual=.build-deps \ @@ -50,6 +50,15 @@ RUN \ /root/.cargo \ /tmp/* +# Install par2cmdline-turbo +COPY --from=ghcr.io/onedr0p/par2cmdline-turbo:1.1.1 /usr/local/bin/par2 /usr/local/bin/par2 +RUN ln -s /usr/local/bin/par2 /usr/local/bin/par2create \ + && ln -s /usr/local/bin/par2 /usr/local/bin/par2repair \ + && ln -s /usr/local/bin/par2 /usr/local/bin/par2verify + +# Install unrar +COPY --from=ghcr.io/linuxserver/unrar:7.0.7 /usr/bin/unrar-alpine /usr/bin/unrar + USER kah COPY ./apps/sabnzbd/sabnzbd.ini /app/sabnzbd.ini COPY ./apps/sabnzbd/entrypoint.sh /entrypoint.sh diff --git a/apps/sabnzbd/README.md b/apps/sabnzbd/README.md index e778fd6c6..3a516e9e2 100644 --- a/apps/sabnzbd/README.md +++ b/apps/sabnzbd/README.md @@ -6,6 +6,7 @@ This container support setting certain custom enviroment variables with the use | Name | Default | |---------------------------------|---------| +| SABNZBD__PORT | | | SABNZBD__API_KEY | | | SABNZBD__NZB_KEY | | | SABNZBD__HOST_WHITELIST_ENTRIES | | diff --git a/apps/sabnzbd/ci/goss.yaml b/apps/sabnzbd/ci/goss.yaml index bbd4b3858..fbc074084 100644 --- a/apps/sabnzbd/ci/goss.yaml +++ b/apps/sabnzbd/ci/goss.yaml @@ -14,3 +14,17 @@ port: http: http://localhost:8080/sabnzbd: status: 200 + +# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#file +file: + /usr/local/bin/par2: + exists: true + /usr/local/bin/par2create: + exists: true + filetype: symlink + /usr/local/bin/par2repair: + exists: true + filetype: symlink + /usr/local/bin/par2verify: + exists: true + filetype: symlink diff --git a/apps/sabnzbd/metadata.json b/apps/sabnzbd/metadata.json deleted file mode 100644 index 9b7f88000..000000000 --- a/apps/sabnzbd/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "sabnzbd", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/sabnzbd/metadata.yaml b/apps/sabnzbd/metadata.yaml new file mode 100644 index 000000000..3be72aadc --- /dev/null +++ b/apps/sabnzbd/metadata.yaml @@ -0,0 +1,11 @@ +--- +app: sabnzbd +base: false +semantic_versioning: true +channels: + - name: stable + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web diff --git a/apps/sonarr/Dockerfile b/apps/sonarr/Dockerfile index 675030d19..8a5316223 100644 --- a/apps/sonarr/Dockerfile +++ b/apps/sonarr/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onedr0p/ubuntu:jammy-20221101@sha256:bf2d52a2e698ab9c2e0a1af7f7b70b9806091c5ca21d9f1a4d1c3809f41e5e93 +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 ARG TARGETPLATFORM ARG VERSION @@ -10,41 +10,27 @@ ENV \ SONARR__PORT="8989" \ SONARR__ANALYTICS_ENABLED="False" -# hadolint ignore=DL3008,DL3015,SC2086 +#hadolint ignore=DL3018 +RUN apk add --no-cache ca-certificates icu-libs libintl sqlite-libs xmlstarlet +#hadolint ignore=DL3059 RUN \ - apt-get -qq update \ - && apt-get -qq install -y gnupg \ + case "${TARGETPLATFORM}" in \ + 'linux/amd64') export ARCH='x64' ;; \ + 'linux/arm64') export ARCH='arm64' ;; \ + esac \ && \ - apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \ - && echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official.list \ - && apt-get -qq update \ + mkdir -p /app/bin \ && \ - apt-get -qq install -y \ - ca-certificates \ - mono-complete \ - ca-certificates-mono \ - libmediainfo0v5 \ - xmlstarlet \ + curl -fsSL "https://services.sonarr.tv/v1/update/${SONARR__BRANCH}/download?version=${VERSION}&os=linuxmusl&runtime=netcore&arch=${ARCH}" \ + | tar xzf - -C /app/bin --strip-components=1 \ && \ - curl -fsSL "https://download.sonarr.tv/v3/${SONARR__BRANCH}/${VERSION}/Sonarr.${SONARR__BRANCH}.${VERSION}.linux.tar.gz" \ - | tar xzf - -C /app --strip-components=1 \ + rm -rf \ + /app/bin/Sonarr.Update \ && \ printf "UpdateMethod=docker\nBranch=%s\nPackageVersion=%s\nPackageAuthor=[onedr0p](https://github.com/onedr0p)\n" "${SONARR__BRANCH}" "${VERSION}" > /app/package_info \ - && \ - gpgconf --kill all \ - && apt-get remove -y gnupg \ - && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - && apt-get autoremove -y \ - && apt-get clean \ - && \ - rm -rf \ - /app/Sonarr.Update \ - /tmp/* \ - /var/lib/apt/lists/* \ - /var/tmp/ \ && chown -R root:root /app \ && chmod -R 755 /app \ - && printf "umask %d\n" "${UMASK}" >> /etc/bash.bashrc + && rm -rf /tmp/* USER kah @@ -52,4 +38,4 @@ COPY ./apps/sonarr/config.xml.tmpl /app/config.xml.tmpl COPY ./apps/sonarr/entrypoint.sh /entrypoint.sh CMD ["/entrypoint.sh"] -LABEL org.opencontainers.image.source="https://github.com/Sonarr/Sonarr" +LABEL org.opencontainers.image.title="${SONARR__INSTANCE_NAME} (${SONARR__BRANCH})" diff --git a/apps/sonarr/ci/goss.yaml b/apps/sonarr/ci/goss.yaml index 8b7f069f9..fc684b46b 100644 --- a/apps/sonarr/ci/goss.yaml +++ b/apps/sonarr/ci/goss.yaml @@ -1,13 +1,13 @@ --- # https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process process: - mono: + Sonarr: running: true # https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port port: # https://github.com/aelsabbahy/goss/issues/149 - tcp:8989: + tcp6:8989: listening: true # https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http diff --git a/apps/sonarr/ci/latest.sh b/apps/sonarr/ci/latest.sh index 90a4d9b92..e16e4c953 100755 --- a/apps/sonarr/ci/latest.sh +++ b/apps/sonarr/ci/latest.sh @@ -1,12 +1,6 @@ #!/usr/bin/env bash channel=$1 - -if [[ "${channel}" == "develop" ]]; then - version=$(curl -sX GET "https://services.sonarr.tv/v1/download/${channel}?version=4.0" | jq --raw-output '.version' 2>/dev/null) -else - version=$(curl -sX GET "https://services.sonarr.tv/v1/download/${channel}?version=3" | jq --raw-output '.version' 2>/dev/null) -fi - +version=$(curl -sX GET "https://services.sonarr.tv/v1/download/${channel}?version=4.0" | jq --raw-output '.version' 2>/dev/null) version="${version#*v}" version="${version#*release-}" printf "%s" "${version}" diff --git a/apps/sonarr/config.xml.tmpl b/apps/sonarr/config.xml.tmpl index acab4a6b0..d0d7eef38 100644 --- a/apps/sonarr/config.xml.tmpl +++ b/apps/sonarr/config.xml.tmpl @@ -3,8 +3,8 @@ ${SONARR__URL_BASE} ${SONARR__BRANCH} ${SONARR__API_KEY} - ${SONARR__AUTHENTICATION_METHOD:-None} - ${SONARR__AUTHENTICATION_REQUIRED} + ${SONARR__AUTHENTICATION_METHOD:-External} + ${SONARR__AUTHENTICATION_REQUIRED:-DisabledForLocalAddresses} ${SONARR__INSTANCE_NAME} ${SONARR__POSTGRES_USER} ${SONARR__POSTGRES_PASSWORD} @@ -21,4 +21,5 @@ BuiltIn ${SONARR__ANALYTICS_ENABLED} + ${SONARR__THEME:-auto} diff --git a/apps/sonarr/develop/Dockerfile b/apps/sonarr/develop/Dockerfile deleted file mode 100644 index 64e611a6a..000000000 --- a/apps/sonarr/develop/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV \ - SONARR__INSTANCE_NAME="Sonarr" \ - SONARR__BRANCH="${CHANNEL}" \ - SONARR__PORT="8989" \ - SONARR__ANALYTICS_ENABLED="False" - -#hadolint ignore=DL3018 -RUN apk add --no-cache ca-certificates icu-libs libintl sqlite-libs xmlstarlet -#hadolint ignore=DL3059 -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') export ARCH='x64' ;; \ - 'linux/arm64') export ARCH='arm64' ;; \ - esac \ - && \ - curl -fsSL "https://download.sonarr.tv/v4/${SONARR__BRANCH}/${VERSION}/Sonarr.${SONARR__BRANCH}.${VERSION}.linux-musl-${ARCH}.tar.gz" \ - | tar xzf - -C /app --strip-components=1 \ - && \ - rm -rf \ - /app/Sonarr.Update \ - && \ - printf "UpdateMethod=docker\nBranch=%s\nPackageVersion=%s\nPackageAuthor=[onedr0p](https://github.com/onedr0p)\n" "${SONARR__BRANCH}" "${VERSION}" > /app/package_info \ - && chown -R root:root /app \ - && chmod -R 755 /app \ - && rm -rf /tmp/* - -USER kah - -COPY ./apps/sonarr/${SONARR__BRANCH}/config.xml.tmpl /app/config.xml.tmpl -COPY ./apps/sonarr/${SONARR__BRANCH}/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] - -LABEL org.opencontainers.image.title="${SONARR__INSTANCE_NAME} (${SONARR__BRANCH})" diff --git a/apps/sonarr/develop/config.xml.tmpl b/apps/sonarr/develop/config.xml.tmpl deleted file mode 100644 index 064e93db7..000000000 --- a/apps/sonarr/develop/config.xml.tmpl +++ /dev/null @@ -1,24 +0,0 @@ - - ${SONARR__LOG_LEVEL:-info} - ${SONARR__URL_BASE} - ${SONARR__BRANCH} - ${SONARR__API_KEY} - ${SONARR__AUTHENTICATION_METHOD:-External} - ${SONARR__AUTHENTICATION_REQUIRED:-DisabledForLocalAddresses} - ${SONARR__INSTANCE_NAME} - ${SONARR__POSTGRES_USER} - ${SONARR__POSTGRES_PASSWORD} - ${SONARR__POSTGRES_PORT:-5432} - ${SONARR__POSTGRES_HOST} - ${SONARR__POSTGRES_MAIN_DB} - ${SONARR__POSTGRES_LOG_DB} - ${SONARR__PORT} - * - False - False - 6969 - - - BuiltIn - ${SONARR__ANALYTICS_ENABLED} - diff --git a/apps/sonarr/develop/entrypoint.sh b/apps/sonarr/develop/entrypoint.sh deleted file mode 100755 index bd784afce..000000000 --- a/apps/sonarr/develop/entrypoint.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck disable=SC1091 -test -f "/scripts/umask.sh" && source "/scripts/umask.sh" - -# Discover existing configuration settings for backwards compatibility -if [[ -f /config/config.xml ]]; then - current_log_level="$(xmlstarlet sel -t -v "//LogLevel" -nl /config/config.xml)" - current_url_base="$(xmlstarlet sel -t -v "//UrlBase" -nl /config/config.xml)" - current_branch="$(xmlstarlet sel -t -v "//Branch" -nl /config/config.xml)" - current_analytics_enabled="$(xmlstarlet sel -t -v "//AnalyticsEnabled" -nl /config/config.xml)" - current_api_key="$(xmlstarlet sel -t -v "//ApiKey" -nl /config/config.xml)" - current_authentication_method="$(xmlstarlet sel -t -v "//AuthenticationMethod" -nl /config/config.xml)" - current_authentication_required="$(xmlstarlet sel -t -v "//AuthenticationRequired" -nl /config/config.xml)" - current_instance_name="$(xmlstarlet sel -t -v "//InstanceName" -nl /config/config.xml)" - current_postgres_user="$(xmlstarlet sel -t -v "//PostgresUser" -nl /config/config.xml)" - current_postgres_password="$(xmlstarlet sel -t -v "//PostgresPassword" -nl /config/config.xml)" - current_postgres_port="$(xmlstarlet sel -t -v "//PostgresPort" -nl /config/config.xml)" - current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" - current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" - current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" -fi - -# Update config.xml with environment variables -envsubst < /app/config.xml.tmpl > /config/config.xml - -# Override configuation values from existing config.xml if there are no SONARR__ variables set -[[ -z "${SONARR__LOG_LEVEL}" && -n "${current_log_level}" ]] && xmlstarlet edit --inplace --update //LogLevel -v "${current_log_level}" /config/config.xml -[[ -z "${SONARR__URL_BASE}" && -n "${current_url_base}" ]] && xmlstarlet edit --inplace --update //UrlBase -v "${current_url_base}" /config/config.xml -[[ -z "${SONARR__BRANCH}" && -n "${current_branch}" ]] && xmlstarlet edit --inplace --update //Branch -v "${current_branch}" /config/config.xml -[[ -z "${SONARR__ANALYTICS_ENABLED}" && -n "${current_analytics_enabled}" ]] && xmlstarlet edit --inplace --update //AnalyticsEnabled -v "${current_analytics_enabled}" /config/config.xml -[[ -z "${SONARR__API_KEY}" && -n "${current_api_key}" ]] && xmlstarlet edit --inplace --update //ApiKey -v "${current_api_key}" /config/config.xml -[[ -z "${SONARR__AUTHENTICATION_METHOD}" && -n "${current_authentication_method}" ]] && xmlstarlet edit --inplace --update //AuthenticationMethod -v "${current_authentication_method}" /config/config.xml -[[ -z "${SONARR__AUTHENTICATION_REQUIRED}" && -n "${current_authentication_required}" ]] && xmlstarlet edit --inplace --update //AuthenticationRequired -v "${current_authentication_required}" /config/config.xml -[[ -z "${SONARR__INSTANCE_NAME}" && -n "${current_instance_name}" ]] && xmlstarlet edit --inplace --update //InstanceName -v "${current_instance_name}" /config/config.xml -[[ -z "${SONARR__POSTGRES_USER}" && -n "${current_postgres_user}" ]] && xmlstarlet edit --inplace --update //PostgresUser -v "${current_postgres_user}" /config/config.xml -[[ -z "${SONARR__POSTGRES_PASSWORD}" && -n "${current_postgres_password}" ]] && xmlstarlet edit --inplace --update //PostgresPassword -v "${current_postgres_password}" /config/config.xml -[[ -z "${SONARR__POSTGRES_PORT}" && -n "${current_postgres_port}" ]] && xmlstarlet edit --inplace --update //PostgresPort -v "${current_postgres_port}" /config/config.xml -[[ -z "${SONARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml -[[ -z "${SONARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml -[[ -z "${SONARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml - -# BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism -# have been omited because their configuration is not really needed in a container environment - -if [[ "${SONARR__LOG_LEVEL}" == "debug" || "${current_log_level}" == "debug" ]]; then - echo "Starting with the following configuration..." - xmlstarlet format --omit-decl /config/config.xml -fi - -#shellcheck disable=SC2086 -exec \ - /app/Sonarr \ - --nobrowser \ - --data=/config \ - "$@" diff --git a/apps/sonarr/develop/goss.yaml b/apps/sonarr/develop/goss.yaml deleted file mode 100644 index fc684b46b..000000000 --- a/apps/sonarr/develop/goss.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - Sonarr: - running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -port: - # https://github.com/aelsabbahy/goss/issues/149 - tcp6:8989: - listening: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http -http: - http://localhost:8989: - status: 200 diff --git a/apps/sonarr/entrypoint.sh b/apps/sonarr/entrypoint.sh index 6dfb694e2..22e6ca7a7 100755 --- a/apps/sonarr/entrypoint.sh +++ b/apps/sonarr/entrypoint.sh @@ -19,6 +19,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -39,6 +40,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${SONARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml [[ -z "${SONARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${SONARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml +[[ -z "${SONARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment @@ -50,8 +52,7 @@ fi #shellcheck disable=SC2086 exec \ - /usr/bin/mono --debug \ - /app/Sonarr.exe \ - --nobrowser \ - --data=/config \ - "$@" + /app/bin/Sonarr \ + --nobrowser \ + --data=/config \ + "$@" diff --git a/apps/sonarr/metadata.json b/apps/sonarr/metadata.json deleted file mode 100644 index 50a905ddf..000000000 --- a/apps/sonarr/metadata.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "app": "sonarr", - "base": false, - "channels": [ - { - "name": "main", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - }, - { - "name": "develop", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": false, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/sonarr/metadata.yaml b/apps/sonarr/metadata.yaml new file mode 100644 index 000000000..93bd60b0c --- /dev/null +++ b/apps/sonarr/metadata.yaml @@ -0,0 +1,17 @@ +--- +app: sonarr +base: false +semantic_versioning: true +channels: + - name: main + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web + - name: develop + platforms: ["linux/amd64", "linux/arm64"] + stable: false + tests: + enabled: true + type: web diff --git a/apps/tautulli/Dockerfile b/apps/tautulli/Dockerfile index b32418b0c..a21b232b7 100644 --- a/apps/tautulli/Dockerfile +++ b/apps/tautulli/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 +FROM ghcr.io/onedr0p/alpine:rolling@sha256:3fbc581cb0fe29830376161ae026e2a765dcc11e1747477fe9ebf155720b8638 ARG TARGETPLATFORM ARG VERSION @@ -10,6 +10,7 @@ ENV \ PIP_ROOT_USER_ACTION=ignore \ PIP_NO_CACHE_DIR=1 \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PIP_BREAK_SYSTEM_PACKAGES=1 \ CRYPTOGRAPHY_DONT_BUILD_RUST=1 ENV TAUTULLI_DOCKER="True" diff --git a/apps/tautulli/metadata.json b/apps/tautulli/metadata.json deleted file mode 100644 index 1489f32a5..000000000 --- a/apps/tautulli/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "tautulli", - "base": false, - "channels": [ - { - "name": "master", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/tautulli/metadata.yaml b/apps/tautulli/metadata.yaml new file mode 100644 index 000000000..3d9b67de3 --- /dev/null +++ b/apps/tautulli/metadata.yaml @@ -0,0 +1,11 @@ +--- +app: tautulli +base: false +semantic_versioning: true +channels: + - name: master + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web diff --git a/apps/theme-park/Dockerfile b/apps/theme-park/Dockerfile index 6c89d9f54..0e834a1f5 100644 --- a/apps/theme-park/Dockerfile +++ b/apps/theme-park/Dockerfile @@ -1,4 +1,4 @@ -FROM nginxinc/nginx-unprivileged:1.23.3 +FROM nginxinc/nginx-unprivileged:1.25.4 ARG TARGETPLATFORM ARG VERSION @@ -13,7 +13,7 @@ RUN \ && \ apt-get install -qqy --no-install-recommends --no-install-suggests python3 \ && \ - curl -fsSL "https://github.com/GilbN/theme.park/archive/${VERSION}.tar.gz" \ + curl -fsSL "https://github.com/themepark-dev/theme.park/archive/${VERSION}.tar.gz" \ | tar xzf - -C /tmp --strip-components 1 \ && \ python3 /tmp/themes.py \ @@ -35,4 +35,4 @@ USER nginx WORKDIR ${NGINX_WEB_ROOT} -LABEL org.opencontainers.image.source="https://github.com/GilbN/theme.park" +LABEL org.opencontainers.image.source="https://github.com/themepark-dev/theme.park" diff --git a/apps/theme-park/ci/latest.sh b/apps/theme-park/ci/latest.sh index d72b4ed04..c2fdef162 100755 --- a/apps/theme-park/ci/latest.sh +++ b/apps/theme-park/ci/latest.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -version=$(curl -sX GET "https://api.github.com/repos/GilbN/theme.park/releases/latest" | jq --raw-output '. | .tag_name' 2>/dev/null) +version=$(curl -sX GET "https://api.github.com/repos/themepark-dev/theme.park/releases/latest" | jq --raw-output '. | .tag_name' 2>/dev/null) version="${version#*v}" version="${version#*release-}" printf "%s" "${version}" diff --git a/apps/theme-park/metadata.json b/apps/theme-park/metadata.json deleted file mode 100644 index 697a2bd7b..000000000 --- a/apps/theme-park/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "theme-park", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/theme-park/metadata.yaml b/apps/theme-park/metadata.yaml new file mode 100644 index 000000000..62ce33d2c --- /dev/null +++ b/apps/theme-park/metadata.yaml @@ -0,0 +1,11 @@ +--- +app: theme-park +base: false +semantic_versioning: true +channels: + - name: stable + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: web diff --git a/apps/tvheadend/Dockerfile b/apps/tvheadend/Dockerfile deleted file mode 100644 index 86a6f4a42..000000000 --- a/apps/tvheadend/Dockerfile +++ /dev/null @@ -1,328 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 as builder - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV ARGTABLE_VER="2.13" -ENV XMLTV_VER="v1.1.2" -ENV HOME="/config" - -COPY ./apps/tvheadend/patches/ /tmp/patches/ - -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') export EXTRA_PACKAGES='libva-dev' ;; \ - 'linux/arm64') export EXTRA_PACKAGES='' ;; \ - esac \ - && \ - apk add --no-cache \ - ${EXTRA_PACKAGES} \ - autoconf \ - automake \ - bsd-compat-headers \ - bzip2 \ - cmake \ - coreutils \ - curl \ - ffmpeg4-dev \ - file \ - findutils \ - g++ \ - gcc \ - gettext-dev \ - git \ - gnu-libiconv-dev \ - gzip \ - jq \ - libcurl \ - libdvbcsa-dev \ - libgcrypt-dev \ - libhdhomerun-dev \ - libtool \ - libvpx-dev \ - libxml2-dev \ - libxslt-dev \ - linux-headers \ - make \ - openssl-dev \ - opus-dev \ - patch \ - pcre2-dev \ - perl-archive-zip \ - perl-boolean \ - perl-capture-tiny \ - perl-cgi \ - perl-compress-raw-zlib \ - perl-date-manip \ - perl-datetime \ - perl-datetime-format-strptime \ - perl-datetime-timezone \ - perl-dbd-sqlite \ - perl-dbi \ - perl-dev \ - perl-digest-sha1 \ - perl-doc \ - perl-file-slurp \ - perl-file-temp \ - perl-file-which \ - perl-getopt-long \ - perl-html-parser \ - perl-html-tree \ - perl-http-cookies \ - perl-io \ - perl-io-html \ - perl-io-socket-ssl \ - perl-io-stringy \ - perl-json \ - perl-json-xs \ - perl-libwww \ - perl-lingua-en-numbers-ordinate \ - perl-lingua-preferred \ - perl-list-moreutils \ - perl-lwp-useragent-determined \ - perl-module-build \ - perl-module-pluggable \ - perl-net-ssleay \ - perl-parse-recdescent \ - perl-path-class \ - perl-scalar-list-utils \ - perl-term-progressbar \ - perl-term-readkey \ - perl-test-exception \ - perl-test-requires \ - perl-timedate \ - perl-try-tiny \ - perl-unicode-string \ - perl-xml-libxml \ - perl-xml-libxslt \ - perl-xml-parser \ - perl-xml-sax \ - perl-xml-treepp \ - perl-xml-twig \ - perl-xml-writer \ - pkgconf \ - pngquant \ - python3 \ - sdl12-compat-dev \ - tar \ - uriparser-dev \ - wget \ - x264-dev \ - x265-dev \ - zlib-dev - -RUN \ - rm -rf /usr/include/iconv.h \ - && cp /usr/include/gnu-libiconv/iconv.h /usr/include/iconv.h - -RUN \ - curl -fsSL https://cpanmin.us | perl - App::cpanminus \ - && cpanm --installdeps /tmp/patches - -WORKDIR /tmp/xmltv -RUN \ - git clone --branch "${XMLTV_VER}" --depth 1 https://github.com/XMLTV/xmltv.git . \ - && sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_latex \ - && sed "s/use POSIX 'tmpnam';//" -i filter/tv_to_text \ - && sed "s/\(lib\/set_share_dir.pl';\)/.\/\1/" -i grab/it/tv_grab_it.PL \ - && sed "s/\(filter\/Grep.pm';\)/.\/\1/" -i filter/tv_grep.PL \ - && sed "s/\(lib\/XMLTV.pm.in';\)/.\/\1/" -i lib/XMLTV.pm.PL \ - && sed "s/\(lib\/Ask\/Term.pm';\)/.\/\1/" -i Makefile.PL \ - && export PERL5LIB="$(pwd)" \ - && echo -e "yes" | perl Makefile.PL PREFIX=/usr/ INSTALLDIRS=vendor \ - && make -j $(nproc) \ - && make test \ - && make DESTDIR=/tmp/xmltv-build install - -WORKDIR /tmp/tvheadend -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') export EXTRA_OPTS='--enable-vaapi' ;; \ - 'linux/arm64') export EXTRA_OPTS='' ;; \ - esac \ - && \ - git clone https://github.com/tvheadend/tvheadend.git . \ - && \ - if [ -n "${VERSION}" ]; then \ - NUMBER_COMMITS_TO_REVERT=$(( $(git rev-list --count --first-parent HEAD) - $(echo "${VERSION}" | cut -d "." -f3) )); \ - git checkout "master~${NUMBER_COMMITS_TO_REVERT}"; \ - fi \ - && \ - ./configure \ - `#Encoding` \ - --disable-ffmpeg_static \ - --disable-libfdkaac_static \ - --disable-libtheora_static \ - --disable-libopus_static \ - --disable-libvorbis_static \ - --disable-libvpx_static \ - --disable-libx264_static \ - --disable-libx265_static \ - --disable-libfdkaac \ - --enable-libopus \ - --enable-libvorbis \ - --enable-libvpx \ - --enable-libx264 \ - --enable-libx265 \ - \ - `#Options` \ - --disable-avahi \ - --disable-dbus_1 \ - --disable-bintray_cache \ - --disable-execinfo \ - --disable-hdhomerun_static \ - --enable-hdhomerun_client \ - --enable-libav \ - --enable-pngquant \ - --enable-trace \ - ${EXTRA_OPTS} \ - --infodir=/usr/share/info \ - --localstatedir=/var \ - --mandir=/usr/share/man \ - --prefix=/usr \ - --python=python3 \ - --sysconfdir=/config \ - && make -j $(nproc) \ - && make DESTDIR=/tmp/tvheadend-build install - -WORKDIR /tmp/argtable -RUN \ - ARGTABLE_VER1="${ARGTABLE_VER//./-}" \ - && \ - curl -fsSL "https://sourceforge.net/projects/argtable/files/argtable/argtable-${ARGTABLE_VER}/argtable${ARGTABLE_VER1}.tar.gz" \ - | tar xzf - -C . --strip-components=1 \ - && cp /tmp/patches/config.* . \ - && ./configure --prefix=/usr \ - && make -j $(nproc) \ - && make check \ - && make DESTDIR=/tmp/argtable-build install \ - && cp -pr /tmp/argtable-build/usr/* /usr/ - -WORKDIR /tmp/comskip -RUN \ - git clone --depth 1 https://github.com/erikkaashoek/Comskip . \ - && ./autogen.sh \ - && ./configure --bindir=/usr/bin --sysconfdir=/config/comskip \ - && make -j $(nproc) \ - && make DESTDIR=/tmp/comskip-build install - -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -ENV HOME="/config" - -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') export EXTRA_PACKAGES='libva libva-intel-driver intel-media-driver' ;; \ - 'linux/arm64') export EXTRA_PACKAGES='' ;; \ - esac \ - && \ - apk add --no-cache \ - ${EXTRA_PACKAGES} \ - bsd-compat-headers \ - bzip2 \ - curl \ - ffmpeg4 \ - ffmpeg4-libs \ - gnu-libiconv \ - gzip \ - libcrypto1.1 \ - libcurl \ - libdvbcsa \ - libhdhomerun-libs \ - libssl1.1 \ - libvpx \ - libxml2 \ - libxslt \ - linux-headers \ - openssl \ - opus \ - pcre2 \ - perl \ - perl-archive-zip \ - perl-boolean \ - perl-capture-tiny \ - perl-cgi \ - perl-compress-raw-zlib \ - perl-date-manip \ - perl-datetime \ - perl-datetime-format-strptime \ - perl-datetime-timezone \ - perl-dbd-sqlite \ - perl-dbi \ - perl-digest-sha1 \ - perl-doc \ - perl-file-slurp \ - perl-file-temp \ - perl-file-which \ - perl-getopt-long \ - perl-html-parser \ - perl-html-tree \ - perl-http-cookies \ - perl-io \ - perl-io-html \ - perl-io-socket-ssl \ - perl-io-stringy \ - perl-json \ - perl-json-xs \ - perl-libwww \ - perl-lingua-en-numbers-ordinate \ - perl-lingua-preferred \ - perl-list-moreutils \ - perl-lwp-useragent-determined \ - perl-module-build \ - perl-module-pluggable \ - perl-net-ssleay \ - perl-parse-recdescent \ - perl-path-class \ - perl-scalar-list-utils \ - perl-term-progressbar \ - perl-term-readkey \ - perl-test-exception \ - perl-test-requires \ - perl-timedate \ - perl-try-tiny \ - perl-unicode-string \ - perl-xml-libxml \ - perl-xml-libxslt \ - perl-xml-parser \ - perl-xml-sax \ - perl-xml-treepp \ - perl-xml-twig \ - perl-xml-writer \ - py3-requests \ - python3 \ - tar \ - uriparser \ - wget \ - x264 \ - x265 \ - zlib - -RUN \ - mkdir -p /app/picons \ - && curl -fsSL "https://lsio-ci.ams3.digitaloceanspaces.com/picons/picons.tar.bz2" \ - | tar xjf - -C /app/picons \ - && \ - chown -R root:root /app \ - && chmod -R 755 /app \ - && rm -rf /tmp/* - -COPY ./apps/tvheadend/bin /usr/bin/ -COPY --from=builder /tmp/argtable-build/usr/ /usr/ -COPY --from=builder /tmp/comskip-build/usr/ /usr/ -COPY --from=builder /tmp/tvheadend-build/usr/ /usr/ -COPY --from=builder /tmp/xmltv-build/usr/ /usr/ -COPY --from=builder /usr/local/share/man/ /usr/local/share/man/ -COPY --from=builder /usr/local/share/perl5/ /usr/local/share/perl5/ - -USER kah -COPY ./apps/tvheadend/defaults /app/defaults -COPY ./apps/tvheadend/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] - -LABEL org.opencontainers.image.source="https://github.com/tvheadend/tvheadend" diff --git a/apps/tvheadend/bin/tv_grab_file b/apps/tvheadend/bin/tv_grab_file deleted file mode 100755 index d3e25ea3b..000000000 --- a/apps/tvheadend/bin/tv_grab_file +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -dflag= -vflag= -cflag= -if (( $# < 1 )) -then - cat /config/data/*.xml - exit 0 -fi - -for arg -do - delim="" - case "$arg" in - #translate --gnu-long-options to -g (short options) - --description) args="${args}-d ";; - --version) args="${args}-v ";; - --capabilities) args="${args}-c ";; - #pass through anything else - *) [[ "${arg:0:1}" == "-" ]] || delim="\"" - args="${args}${delim}${arg}${delim} ";; - esac -done - -#Reset the positional parameters to the short options -eval set -- $args - -while getopts "dvc" option -do - case $option in - d) dflag=1;; - v) vflag=1;; - c) cflag=1;; - \?) printf "unknown option: -%s\n" $OPTARG - printf "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0) - exit 2 - ;; - esac >&2 -done - -if [ "$dflag" ] -then - printf "XML file grabber\n" -fi -if [ "$vflag" ] -then - printf "0.1\n" -fi -if [ "$cflag" ] -then - printf "baseline\n" -fi - -exit 0 - diff --git a/apps/tvheadend/bin/tv_grab_url b/apps/tvheadend/bin/tv_grab_url deleted file mode 100755 index cd3286c8c..000000000 --- a/apps/tvheadend/bin/tv_grab_url +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -dflag= -vflag= -cflag= - -if (( $# < 1 )) -then - exit 0 -fi - -OPTARG="" -URL=$1 - -for arg -do - delim="" - case "$arg" in - #translate --gnu-long-options to -g (short options) - --description) args="${args}-d ";; - --version) args="${args}-v ";; - --capabilities) args="${args}-c ";; - #pass through anything else - *) if [ "${arg:0:1}" == "-" ] || delim="\"" - then - args="${args}${delim}${arg}${delim} " - else - OPTARG=${arg} - fi - esac -done - -#Reset the positional parameters to the short options -eval set -- $args - -while getopts "dvc" option -do - case $option in - d) dflag=1;; - v) vflag=1;; - c) cflag=1;; - \?) printf "unknown option: -%s\n" $OPTARG - printf "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0) - exit 2 - ;; - esac >&2 -done - -if [ "$dflag" ] -then - printf "XMLTV URL grabber\n" - exit 0 -fi -if [ "$vflag" ] -then - printf "0.1\n" - exit 0 -fi -if [ "$cflag" ] -then - printf "baseline\n" - exit 0 -fi - -curl -s "$URL" - -exit 0 diff --git a/apps/tvheadend/bin/tv_grab_wg b/apps/tvheadend/bin/tv_grab_wg deleted file mode 100755 index 1225f31bf..000000000 --- a/apps/tvheadend/bin/tv_grab_wg +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -dflag= -vflag= -cflag= -qflag= -if (( $# < 1 )) -then - cat /config/data/*.xml - exit 0 -fi - -for arg -do - delim="" - case "$arg" in - #translate --gnu-long-options to -g (short options) - --description) args="${args}-d ";; - --version) args="${args}-v ";; - --capabilities) args="${args}-c ";; - --quiet) args="${args}-q ";; - - #pass through anything else - *) [[ "${arg:0:1}" == "-" ]] || delim="\"" - args="${args}${delim}${arg}${delim} ";; - esac -done - -#Reset the positional parameters to the short options -eval set -- $args - -while getopts "dvcq" option -do - case $option in - d) dflag=1;; - v) vflag=1;; - c) cflag=1;; - q) qflag=1;; - \?) printf "unknown option: -%s\n" $OPTARG - printf "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0) - exit 2 - ;; - esac >&2 -done - -if [ "$dflag" ] -then - printf "WebGrab+Plus XML file grabber\n" -fi -if [ "$vflag" ] -then - printf "0.2\n" -fi -if [ "$cflag" ] -then - printf "baseline\n" -fi -if [ "$qflag" ] -then - printf "" -fi - -exit 0 diff --git a/apps/tvheadend/ci/goss.yaml b/apps/tvheadend/ci/goss.yaml deleted file mode 100644 index 4db30a0f2..000000000 --- a/apps/tvheadend/ci/goss.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - tvheadend: - running: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port -port: - # https://github.com/aelsabbahy/goss/issues/149 - tcp:9981: - listening: true - -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http -http: - http://localhost:9981: - status: 200 diff --git a/apps/tvheadend/ci/latest.sh b/apps/tvheadend/ci/latest.sh deleted file mode 100755 index 5364695a5..000000000 --- a/apps/tvheadend/ci/latest.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -git clone --quiet https://github.com/tvheadend/tvheadend.git /tmp/tvheadend -pushd /tmp/tvheadend > /dev/null || exit -version=$(git rev-list --count --first-parent HEAD) -popd > /dev/null || exit -rm -rf /tmp/tvheadend -printf "4.3.%d" "${version}" diff --git a/apps/tvheadend/defaults/7a5edfbe189851e5b1d1df19c93962f0 b/apps/tvheadend/defaults/7a5edfbe189851e5b1d1df19c93962f0 deleted file mode 100644 index 722ee4f50..000000000 --- a/apps/tvheadend/defaults/7a5edfbe189851e5b1d1df19c93962f0 +++ /dev/null @@ -1,38 +0,0 @@ -{ - "enabled": true, - "name": "", - "profile": "22f637a89b4dec0d67e3107ee88ee4c5", - "cache": 2, - "retention-days": 2147483646, - "removal-days": 2147483647, - "clone": true, - "rerecord-errors": 10, - "warm-time": 30, - "pre-extra-time": 0, - "post-extra-time": 0, - "epg-update-window": 86400, - "epg-running": true, - "autorec-maxcount": 0, - "autorec-maxsched": 0, - "storage": "/recordings/", - "storage-mfree": 1000, - "storage-mused": 0, - "file-permissions": "0755", - "charset": "UTF-8", - "tag-files": true, - "skip-commercials": true, - "pathname": "$t/$t -$ e -$ s$n.$x", - "directory-permissions": "0775", - "day-dir": false, - "channel-dir": false, - "title-dir": true, - "channel-in-title": false, - "date-in-title": false, - "time-in-title": false, - "episode-in-title": false, - "subtitle-in-title": false, - "omit-title": false, - "clean-title": false, - "whitespace-in-title": false, - "windows-compatible-filenames": true -} diff --git a/apps/tvheadend/defaults/comskip.ini.org b/apps/tvheadend/defaults/comskip.ini.org deleted file mode 100644 index 1ba60466a..000000000 --- a/apps/tvheadend/defaults/comskip.ini.org +++ /dev/null @@ -1,81 +0,0 @@ -; See comskip.txt in the distribution zip file for many settable parameters, read manual.html, tuning.html and debugwindow.html for how to tune and debug comskip -edl_mode=3 ; the mode specified in the generated edl file, 0=cut, 3=commercial break -mkv_time_offset=30.0 ; offset in seconds, to work around what appears to be an xbmc or ffmpeg bug -always_keep_first_seconds=2 ; xbmc/vdpau has a bug that causes a segfault if we don't keep the start of the stream, I'll fix that when I get a chance -detect_method=255 ;1=black frame, 2=logo, 4=scene change, 8=fuzzy logic, 16=closed captions, 32=aspect ration, 64=silence, 128=cutscenes, 255=all -validate_silence=1 ; Default, set to 0 to force using this clues if selected above. -validate_uniform=1 ; Default, set to 0 to force using this clues (like pure white frames) if blackframe is selected above. -validate_scenechange=1 ; Default, set to 0 to force using this clues if selected above. -verbose=10 ;show a lot of extra info, level 5 is also OK, set to 0 to disable -max_brightness=60 ;frame not black if any pixels checked are greater than this (scale 0 to 255) -test_brightness=40 ;frame not pure black if any pixels checked are greater than this, will check average brightness (scale 0 to 255) -max_avg_brightness=25 ;maximum average brightness for a dim frame to be considered black (scale 0 to 255) 0 means autosetting -max_commercialbreak=600 ;maximum length in seconds to consider a segment a commercial break -min_commercialbreak=25 ;minimum length in seconds to consider a segment a commercial break -max_commercial_size=125 ;maximum time in seconds for a single commercial or multiple commercials if no breaks in between -min_commercial_size=4 ;mimimum time in seconds for a single commercial -min_show_segment_length=250 ; any segment longer than this will be scored towards show. -non_uniformity=500 ; Set to 0 to disable cutpoints based on uniform frames -max_volume=500 ; any frame with sound volume larger than this will not be regarded as black frame -min_silence=12 ; Any deep silence longer than this amount of frames is a possible cutpoint -ticker_tape=0 ; Amount of pixels from bottom to ignore in all processing -logo_at_bottom=0 ; Set to 1 to search only for logo at the lower half of the video, do not combine with subtitle setting -punish=0 ; Compare to average for sum of 1=brightness, 2=uniform 4=volume, 8=silence, 16=schange, set to 0 to disable -punish_threshold=1.3 ; Multiply when amount is above average * punish_threshold -punish_modifier=2 ; When above average * threshold multiply score by this value -intelligent_brightness=0 ; Set to 1 to use a USA specific algorithm to tune some of the settings, not adviced outside the USA -logo_percentile=0.92 ; if more then this amount of logo is found then logo detection will be disabled -logo_threshold=0.775 -punish_no_logo=1 ; Default, set to 0 to avoid show segments without logo to be scored towards commercial -aggressive_logo_rejection=0 -connect_blocks_with_logo=0 ; set to 1 if you want successive blocks with logo on the transition to be regarded as connected, set to 0 to disable -logo_filter=0 ; set the size of the filter to apply to bad logo detection, 4 seems to be a good value. -logo_max_percentage_of_screen=0.9 -subtitles=1 -cut_on_ar_change=1 ; set to 1 if you want to cut also on aspect ratio changes when logo is present, set to 2 to force cuts on aspect ratio changes. set to 0 to disable -delete_show_after_last_commercial=0 ; set to 1 if you want to delete the last block if its a show and after a commercial -delete_show_before_or_after_current=0 ; set to 1 if you want to delete the previous and the next show in the recording, this can lead to the deletion of trailers of next show -delete_block_after_commercial=0 ;set to max size of block in seconds to be discarded, set to 0 to disable -remove_before=0 ; amount of seconds of show to be removed before ALL commercials -remove_after=0 ; amount of seconds of show to be removed after ALL commercials -shrink_logo=0 ; Reduce the duration of the logo with this amount of seconds -after_logo=0 ; set to number of seconds after logo disappears comskip should start to search for silence to insert an additional cutpoint -padding=0 -ms_audio_delay=5 -volume_slip=40 -skip_b_frames=0 ; Set to 1 to force Comskip to skip frames for higher processing speed. -max_repair_size=200 ; Will repair maximum 200 missing MPEG frames in the timeline, set to 0 to disable repairing for players that don't use PTS. -disable_heuristics=4 bit pattern for disabling heuristics, adding 1 disables heristics 1, adding 2 disables heristics 2, adding 4 disables heristics 3, 255 disables all heuristics -delete_logo_file=0 ; set to 1 if you want comskip to tidy up after finishing -output_framearray=0 ; create a big excel file for detailed analysis, set to 0 to disable -output_data=0 ; create a dump of the user data channel, used for CC and XDS (such as V-Chip info). Can be use together with output_framearray to remote debug CC decoding -output_videoredo=0 -output_womble=0 -output_mls=0 ; set to 1 if you want MPeg Video Wizard bookmark file output -output_cuttermaran=0 -output_mpeg2schnitt=0 -output_mpgtx=0 -output_dvrcut=0 -output_zoomplayer_chapter=0 -output_zoomplayer_cutlist=0 -output_edl=0 -output_dvrmstb=0 ; Set to 1 if you're running DVRMS-Toolbox -output_edlx=0 -output_vcf=0 -output_bsplayer=0 -output_btv=0 ; set to 1 if you want Beyond TV chapter cutlist output -output_projectx=0 ; set to 1 if you want ProjectX cutlist output (Xcl) -output_avisynth=0 -output_vdr=1 ; set to 1 if you want XBMC to skipping commercials -output_demux=0 ; set to 1 if you want comskip to demux the mpeg file while scanning -sage_framenumber_bug=0 -sage_minute_bug=0 -live_tv=0 ; set to 1 if you use parallelprocessing and need the output while recording -live_tv_retries=4 ; change to 16 when using live_tv in BTV, used for mpeg PS and TS -dvrms_live_tv_retries=300 ; only used for dvr_ms -standoff=0 ; change to 8000000 when using live_tv in BTV -cuttermaran_options="cut=\"true\" unattended=\"true\" muxResult=\"false\" snapToCutPoints=\"true\" closeApp=\"true\"" -mpeg2schnitt_options="mpeg2schnitt.exe /S /E /R25 /Z %2 %1" -avisynth_options="LoadPlugin(\"MPEG2Dec3.dll\") \nMPEG2Source(\"%s\")\n" -dvrcut_options="dvrcut \"%s.dvr-ms\" \"%s_clean.dvr-ms\" " -windowtitle="Comskip - %s" diff --git a/apps/tvheadend/defaults/config b/apps/tvheadend/defaults/config deleted file mode 100644 index 26789ddc3..000000000 --- a/apps/tvheadend/defaults/config +++ /dev/null @@ -1,7 +0,0 @@ -{ - "prefer_picon": true, - "chiconpath": "file:///app/picons/%C.png", - "piconpath": "file:///app/picons/", - "piconscheme": 0, - "chiconscheme": 2 -} diff --git a/apps/tvheadend/entrypoint.sh b/apps/tvheadend/entrypoint.sh deleted file mode 100755 index 9fba2371d..000000000 --- a/apps/tvheadend/entrypoint.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck disable=SC1091 -test -f "/scripts/umask.sh" && source "/scripts/umask.sh" - -mkdir -p /config/comskip - -[[ ! -f /config/dvr/config ]] && \ - (mkdir -p /config/dvr/config && cp /app/defaults/7a5edfbe189851e5b1d1df19c93962f0 /config/dvr/config/7a5edfbe189851e5b1d1df19c93962f0) -[[ ! -f /config/comskip/comskip.ini ]] && \ - (cp /app/defaults/comskip.ini.org /config/comskip/comskip.ini) -[[ ! -f /config/config ]] && \ - (cp /app/defaults/config /config/config) - -#shellcheck disable=SC2086 -exec \ - /usr/bin/tvheadend -C \ - -c /config \ - "$@" diff --git a/apps/tvheadend/metadata.json b/apps/tvheadend/metadata.json deleted file mode 100644 index 7e3a2642f..000000000 --- a/apps/tvheadend/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "tvheadend", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/tvheadend/patches/config.guess b/apps/tvheadend/patches/config.guess deleted file mode 100644 index 69ed3e573..000000000 --- a/apps/tvheadend/patches/config.guess +++ /dev/null @@ -1,1466 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2017 Free Software Foundation, Inc. - -timestamp='2017-03-05' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess -# -# Please send patches to . - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2017 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "${UNAME_SYSTEM}" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval $set_cc_for_build - cat <<-EOF > $dummy.c - #include - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ - echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown - ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in - earm*) - os=netbsdelf - ;; - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in - earm*) - expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE=alpha ;; - "EV4.5 (21064)") - UNAME_MACHINE=alpha ;; - "LCA4 (21066/21068)") - UNAME_MACHINE=alpha ;; - "EV5 (21164)") - UNAME_MACHINE=alphaev5 ;; - "EV5.6 (21164A)") - UNAME_MACHINE=alphaev56 ;; - "EV5.6 (21164PC)") - UNAME_MACHINE=alphapca56 ;; - "EV5.7 (21164PC)") - UNAME_MACHINE=alphapca57 ;; - "EV6 (21264)") - UNAME_MACHINE=alphaev6 ;; - "EV6.7 (21264A)") - UNAME_MACHINE=alphaev67 ;; - "EV6.8CB (21264C)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8AL (21264B)") - UNAME_MACHINE=alphaev68 ;; - "EV6.8CX (21264D)") - UNAME_MACHINE=alphaev68 ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE=alphaev69 ;; - "EV7 (21364)") - UNAME_MACHINE=alphaev7 ;; - "EV7.9 (21364A)") - UNAME_MACHINE=alphaev79 ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH=i386 - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH=x86_64 - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 - 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH=hppa2.0n ;; - 64) HP_ARCH=hppa2.0w ;; - '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = hppa2.0w ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH=hppa2.0w - else - HP_ARCH=hppa64 - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in - amd64) - UNAME_PROCESSOR=x86_64 ;; - i386) - UNAME_PROCESSOR=i586 ;; - esac - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; - mips64el:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} - exit ;; - or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; - x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configure will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - fi - elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 - fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = x86; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - NSX-?:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = 386; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; - amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; -esac - -cat >&2 </dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/apps/tvheadend/patches/config.sub b/apps/tvheadend/patches/config.sub deleted file mode 100644 index 40ea5dfe1..000000000 --- a/apps/tvheadend/patches/config.sub +++ /dev/null @@ -1,1836 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2017 Free Software Foundation, Inc. - -timestamp='2017-04-02' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see . -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches to . -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2017 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | cloudabi*-eabi* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia16 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | wasm32 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | wasm32-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - nsx-tandem) - basic_machine=nsx-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - wasm32) - basic_machine=wasm32-unknown - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* | -sortix* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -ios) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - pru-*) - os=-elf - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/apps/tvheadend/patches/cpanfile b/apps/tvheadend/patches/cpanfile deleted file mode 100644 index 9c0cf4544..000000000 --- a/apps/tvheadend/patches/cpanfile +++ /dev/null @@ -1,23 +0,0 @@ -requires 'perl' => '5.24.0'; - -# perl packages for tvheadend x86 -requires 'Data::Dump' ; -requires 'DateTime::Format::ISO8601' ; -requires 'DateTime::Format::SQLite' ; -requires 'Encode' ; -requires 'File::HomeDir' ; -requires 'File::Path' ; -requires 'HTML::Entities' ; -requires 'HTML::TableExtract' ; -requires 'HTTP::Cache::Transparent' => ">= 1.3, != 1.4" ; -requires 'inc' ; -requires 'JSON::PP' ; -requires 'LWP::Simple' ; -requires 'LWP::UserAgent' ; -requires 'PerlIO::gzip' ; -requires 'SOAP::Lite' ; -requires 'Storable' ; -requires 'Unicode::UTF8simple' ; -requires 'version' ; -requires 'WWW::Mechanize' ; -requires 'XML::DOM' ; diff --git a/apps/ubuntu/Dockerfile b/apps/ubuntu/Dockerfile index 2cbd1e2e1..ffc5cb7a4 100644 --- a/apps/ubuntu/Dockerfile +++ b/apps/ubuntu/Dockerfile @@ -1,5 +1,5 @@ ARG VERSION -FROM public.ecr.aws/docker/library/alpine:3.17 as builder +FROM docker.io/library/alpine:3.19 as builder ARG VERSION ARG TARGETOS ARG TARGETARCH @@ -16,9 +16,9 @@ ENV PATH $GOPATH/bin:$PATH RUN \ apk add --no-cache go upx \ && go install -ldflags="-s -w" github.com/drone/envsubst/cmd/envsubst@latest \ - && upx --ultra-brute /go/bin/envsubst + && upx /go/bin/envsubst -FROM public.ecr.aws/docker/library/ubuntu:${VERSION} +FROM docker.io/library/ubuntu:${VERSION} ARG VERSION ARG CHANNEL ARG TARGETPLATFORM @@ -63,6 +63,8 @@ RUN \ apt-get install -y \ bash \ ca-certificates \ + catatonit \ + coreutils \ curl \ dnsutils \ iputils-ping \ @@ -71,10 +73,8 @@ RUN \ locales \ moreutils \ pv \ - tini \ tzdata \ vim-tiny \ - unrar \ unzip \ wget \ && \ @@ -83,6 +83,7 @@ RUN \ && ln -s /usr/bin/vim.tiny /usr/local/bin/vim \ && ln -s /usr/bin/vim.tiny /usr/local/bin/nano \ && ln -s /usr/bin/vim.tiny /usr/local/bin/emacs \ + && ln -s /usr/bin/catatonit /usr/bin/tini \ && chown -R kah:kah /app \ && \ printf "/bin/bash /scripts/greeting.sh\n" >> /etc/bash.bashrc \ @@ -102,4 +103,4 @@ VOLUME ["/config"] COPY ./apps/ubuntu/scripts /scripts COPY --from=builder /go/bin/envsubst /usr/local/bin/envsubst -ENTRYPOINT [ "/usr/bin/tini", "--" ] +ENTRYPOINT [ "/usr/bin/catatonit", "--" ] diff --git a/apps/ubuntu/metadata.json b/apps/ubuntu/metadata.json deleted file mode 100644 index 4593c9846..000000000 --- a/apps/ubuntu/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "ubuntu", - "base": true, - "channels": [ - { - "name": "jammy", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "cli" - } - } - ] -} diff --git a/apps/ubuntu/metadata.yaml b/apps/ubuntu/metadata.yaml new file mode 100644 index 000000000..738b0e44d --- /dev/null +++ b/apps/ubuntu/metadata.yaml @@ -0,0 +1,10 @@ +--- +app: ubuntu +base: true +channels: + - name: jammy + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: true + type: cli diff --git a/apps/udp-broadcast-relay-redux/Dockerfile b/apps/udp-broadcast-relay-redux/Dockerfile deleted file mode 100644 index 2d8cf2480..000000000 --- a/apps/udp-broadcast-relay-redux/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM public.ecr.aws/docker/library/alpine:3.17.2 AS builder -ARG VERSION - -WORKDIR /build - -# hadolint ignore=DL4006,DL3018 -RUN \ - apk add --no-cache \ - gcc \ - git \ - musl-dev \ - linux-headers \ - && git clone https://github.com/udp-redux/udp-broadcast-relay-redux.git . \ - && if [ -n "$VERSION" ]; then \ - NUMBER_COMMITS_TO_REVERT=$(( $(git rev-list --count --first-parent HEAD) - $(echo "${VERSION}" | cut -d "." -f3) )); \ - git checkout "master~$NUMBER_COMMITS_TO_REVERT"; \ - fi \ - && gcc -g main.c -o udp-broadcast-relay-redux - -FROM public.ecr.aws/docker/library/alpine:3.17.2 -WORKDIR /app -RUN \ - apk add --no-cache \ - bash -COPY --from=builder /build/udp-broadcast-relay-redux . -COPY ./apps/udp-broadcast-relay-redux/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] diff --git a/apps/udp-broadcast-relay-redux/ci/latest.sh b/apps/udp-broadcast-relay-redux/ci/latest.sh deleted file mode 100755 index 3f2991fa3..000000000 --- a/apps/udp-broadcast-relay-redux/ci/latest.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -git clone --quiet https://github.com/udp-redux/udp-broadcast-relay-redux.git /tmp/udp-broadcast-relay-redux -pushd /tmp/udp-broadcast-relay-redux > /dev/null || exit -version=$(git rev-list --count --first-parent HEAD) -popd > /dev/null || exit -rm -rf /tmp/udp-broadcast-relay-redux -printf "1.0.%d" "${version}" diff --git a/apps/udp-broadcast-relay-redux/entrypoint.sh b/apps/udp-broadcast-relay-redux/entrypoint.sh deleted file mode 100755 index 86bc29e64..000000000 --- a/apps/udp-broadcast-relay-redux/entrypoint.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -set -e - -args=() - -if [ -z "$SEPARATOR" ]; then - SEPARATOR=", " -fi - -if [ -n "$CFG_ID" ]; then - args+=('--id') - args+=("$CFG_ID") -fi - -if [ -n "$CFG_PORT" ]; then - args+=('--port') - args+=("$CFG_PORT") -fi - -if [ -n "$CFG_DEV" ]; then - IFS="${SEPARATOR}" read -r -a devices <<< "${CFG_DEV}" - for element in "${devices[@]}" - do - args+=('--dev') - args+=("$element") - done -fi - -if [ -n "$CFG_MULTICAST" ]; then - args+=('--multicast') - args+=("$CFG_MULTICAST") -fi - -if [ -n "$CFG_SOURCE_IP" ]; then - args+=('-s') - args+=("$CFG_SOURCE_IP") -fi - -if [ -n "$CFG_TARGET_IP" ]; then - args+=('-t') - args+=("$CFG_TARGET_IP") -fi - -/app/udp-broadcast-relay-redux ${args[@]} diff --git a/apps/udp-broadcast-relay-redux/metadata.json b/apps/udp-broadcast-relay-redux/metadata.json deleted file mode 100644 index def60974a..000000000 --- a/apps/udp-broadcast-relay-redux/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "udp-broadcast-relay-redux", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "cli" - } - } - ] -} diff --git a/apps/unpackerr/Dockerfile b/apps/unpackerr/Dockerfile deleted file mode 100644 index 59a603743..000000000 --- a/apps/unpackerr/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM ghcr.io/onedr0p/alpine:rolling@sha256:5d973006bf93ba66e38758694dfed6df091a13e712b6a075f7ed7bb6fd8c2189 - -ARG TARGETPLATFORM -ARG VERSION -ARG CHANNEL - -#hadolint ignore=DL3018 -RUN apk add --no-cache ca-certificates -#hadolint ignore=DL3059 -RUN \ - case "${TARGETPLATFORM}" in \ - 'linux/amd64') export ARCH='amd64' ;; \ - 'linux/arm64') export ARCH='arm64' ;; \ - esac \ - && \ - curl -fsSL "https://github.com/Unpackerr/unpackerr/releases/download/v${VERSION}/unpackerr.${ARCH}.linux.gz" \ - -o /tmp/unpackerr.gz \ - && gzip -dc < /tmp/unpackerr.gz > /app/unpackerr \ - && chown -R root:root /app \ - && chmod -R 755 /app \ - && rm -rf /tmp/* - -USER kah -COPY ./apps/unpackerr/entrypoint.sh /entrypoint.sh -CMD ["/entrypoint.sh"] - -LABEL org.opencontainers.image.source="https://github.com/Unpackerr/unpackerr" diff --git a/apps/unpackerr/ci/goss.yaml b/apps/unpackerr/ci/goss.yaml deleted file mode 100644 index 95a8dd4fd..000000000 --- a/apps/unpackerr/ci/goss.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process -process: - unpackerr: - running: true diff --git a/apps/unpackerr/ci/latest.sh b/apps/unpackerr/ci/latest.sh deleted file mode 100755 index 524928d35..000000000 --- a/apps/unpackerr/ci/latest.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -version=$(curl -sX GET "https://api.github.com/repos/Unpackerr/unpackerr/releases/latest" | jq --raw-output '. | .tag_name' 2>/dev/null) -version="${version#*v}" -version="${version#*release-}" -printf "%s" "${version}" diff --git a/apps/unpackerr/entrypoint.sh b/apps/unpackerr/entrypoint.sh deleted file mode 100755 index d4b648141..000000000 --- a/apps/unpackerr/entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -#shellcheck disable=SC1091 -test -f "/scripts/umask.sh" && source "/scripts/umask.sh" - -#shellcheck disable=SC2086 -exec \ - /app/unpackerr \ - -c /config/unpackerr.conf \ - "$@" diff --git a/apps/unpackerr/metadata.json b/apps/unpackerr/metadata.json deleted file mode 100644 index 9b91f8c13..000000000 --- a/apps/unpackerr/metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "app": "unpackerr", - "base": false, - "channels": [ - { - "name": "stable", - "platforms": [ - "linux/amd64", - "linux/arm64" - ], - "stable": true, - "tests": { - "enabled": true, - "type": "web" - } - } - ] -} diff --git a/apps/volsync/Dockerfile b/apps/volsync/Dockerfile new file mode 100644 index 000000000..e5ef2bf44 --- /dev/null +++ b/apps/volsync/Dockerfile @@ -0,0 +1,50 @@ +ARG VERSION +FROM docker.io/library/alpine:3.19 as builder +ARG VERSION +ARG TARGETOS +ARG TARGETARCH +ARG TARGETVARIANT="" +ARG TARGETPLATFORM +ENV GO111MODULE=on \ + CGO_ENABLED=0 \ + GOOS=${TARGETOS} \ + GOARCH=${TARGETARCH} \ + GOARM=${TARGETVARIANT} \ + GOPATH=/go +ENV PATH $GOPATH/bin:$PATH +#hadolint ignore=DL3018 +RUN \ + apk add --no-cache git go upx \ + && go install -a -ldflags "-X=main.volsyncVersion=v${VERSION}" github.com/backube/volsync@v${VERSION} \ + && upx /go/bin/volsync + +FROM docker.io/library/alpine:3.19.1 +ARG TARGETPLATFORM +ARG VERSION +ARG CHANNEL + +RUN \ + apk add --no-cache \ + acl \ + bash \ + ca-certificates \ + curl \ + tzdata \ + && \ + curl -fsSL "https://github.com/backube/volsync/archive/refs/tags/v${VERSION}.tar.gz" \ + | tar xzf - -C /tmp --strip-components=1 \ + && mkdir -p /mover-rclone \ + && cp /tmp/mover-rclone/active.sh /mover-rclone/ \ + && chmod a+rx /mover-rclone/*.sh \ + && mkdir -p /mover-restic \ + && cp /tmp/mover-restic/entry.sh /mover-restic/ \ + && chmod a+rx /mover-restic/*.sh \ + && rm -rf /tmp/* + +COPY --from=docker.io/rclone/rclone:1.66.0 /usr/local/bin/rclone /usr/local/bin/rclone +COPY --from=docker.io/restic/restic:0.16.4 /usr/bin/restic /usr/local/bin/restic +COPY --from=builder /go/bin/volsync /manager + +ENTRYPOINT ["/bin/bash"] + +LABEL org.opencontainers.image.source="https://github.com/backube/volsync" diff --git a/apps/volsync/README.md b/apps/volsync/README.md new file mode 100644 index 000000000..03fddfd4d --- /dev/null +++ b/apps/volsync/README.md @@ -0,0 +1 @@ +# volsync diff --git a/apps/udp-broadcast-relay-redux/ci/goss.yaml b/apps/volsync/ci/goss.yaml similarity index 64% rename from apps/udp-broadcast-relay-redux/ci/goss.yaml rename to apps/volsync/ci/goss.yaml index ed39a79f5..f62b12c42 100644 --- a/apps/udp-broadcast-relay-redux/ci/goss.yaml +++ b/apps/volsync/ci/goss.yaml @@ -1,5 +1,7 @@ --- # https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#file file: - /app/udp-broadcast-relay-redux: + /manager: + exists: true + /usr/local/bin/restic: exists: true diff --git a/apps/volsync/ci/latest.sh b/apps/volsync/ci/latest.sh new file mode 100755 index 000000000..1579b4a20 --- /dev/null +++ b/apps/volsync/ci/latest.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +version="$(curl -sX GET "https://api.github.com/repos/backube/volsync/releases/latest" | jq --raw-output '.tag_name' 2>/dev/null)" +version="${version#*v}" +version="${version#*release-}" +printf "%s" "${version}" diff --git a/apps/volsync/metadata.yaml b/apps/volsync/metadata.yaml new file mode 100644 index 000000000..728b52bbe --- /dev/null +++ b/apps/volsync/metadata.yaml @@ -0,0 +1,11 @@ +--- +app: volsync +base: false +semantic_versioning: true +channels: + - name: stable + platforms: ["linux/amd64", "linux/arm64"] + stable: true + tests: + enabled: false + type: cli diff --git a/metadata.rules.cue b/metadata.rules.cue index b144c359a..271416af2 100644 --- a/metadata.rules.cue +++ b/metadata.rules.cue @@ -1,18 +1,20 @@ #Spec: { - app: #NonEmptyString - base: bool - channels: [...#Channels] + app: #AcceptableAppName + base: bool + semantic_versioning?: bool + channels: [...#Channels] } #Channels: { - name: #NonEmptyString - platforms: [...#AcceptedPlatforms] - stable: bool - tests: { - enabled: bool - type?: =~"^(cli|web)$" - } + name: #AcceptableChannelName + platforms: [...#AcceptedPlatforms] + stable: bool + tests: { + enabled: bool + type?: =~"^(cli|web)$" + } } -#NonEmptyString: string & !="" -#AcceptedPlatforms: "linux/amd64" | "linux/arm64" +#AcceptableAppName: string & !="" & =~"^[a-zA-Z0-9_-]+$" +#AcceptableChannelName: string & !="" & =~"^[a-zA-Z0-9._-]+$" +#AcceptedPlatforms: "linux/amd64" | "linux/arm64" \ No newline at end of file