Add containers to repo

This commit is contained in:
Kjeld Schouten
2024-10-07 14:27:10 +02:00
parent 04a1a65418
commit 0b3a98918d
136 changed files with 4164 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
---
labels:
- name: incomplete-template
labeled:
issue:
body: |
:wave: @{{ issue.user.login }}, please follow the template provided.
action: close
locking: lock
lock_reason: resolved
- name: support
labeled:
issue:
body: |
:wave: @{{ issue.user.login }}, we use the issue tracker exclusively
for bug reports and feature requests. However, this issue appears
to be a support request. Please use our support channels
to get help.
- [Docs](https://https://truecharts.org/)
- [Discord](https://discord.gg/tVsPTHWTtr)
action: close
- name: incomplete-docs
labeled:
pr:
body: |
:wave: @{{ pull_request.user.login }}, thanks for taking the time to submit this PR. 🙏🏽
We have noticed that the chart documentation has not been completely updated for this PR.
Could you please make sure that the following items have been updated:
- `version` in `Chart.yaml` has been updated per [semver](http://semver.org/)
- The `artifacthub.io/changes` chart annotation contains a summary of the updates for this new version. See [Artifact Hub documentation](https://artifacthub.io/docs/topics/annotations/helm/#supported-annotations) for more info.
- [Documentation strings](https://github.com/norwoodj/helm-docs#valuesyaml-metadata) have been added to the keys in `values.yaml`.
+364
View File
@@ -0,0 +1,364 @@
{
semanticCommits: "enabled",
extends: ["helpers:pinGitHubActionDigests"],
dependencyDashboard: true,
dependencyDashboardTitle: "Renovate Dashboard 🤖",
suppressNotifications: ["prIgnoreNotification"],
commitMessageTopic: "{{depName}}",
commitMessageExtra: "to {{newVersion}}",
commitMessageSuffix: "",
rebaseWhen: "conflicted",
prConcurrentLimit: 25,
pinDigests: true,
automerge: true,
gitAuthor: "TrueCharts-Admin <bot@truecharts.org>",
packageRules: [
// Setup datasources for github actions
{
matchManagers: ["github-actions"],
commitMessageTopic: "github-action {{depName}} [skip ci]",
automerge: true,
},
{
matchDatasources: ["docker"],
enabled: true,
automerge: true,
matchUpdateTypes: ["major", "minor", "patch", "digest", "pin"],
pinDigests: true,
},
{
matchDatasources: ["docker"],
semanticCommitScope: "images",
separateMinorPatch: true,
automerge: true,
},
// Add labels according to package and update types
{
matchDatasources: ["docker"],
matchUpdateTypes: ["major"],
commitMessagePrefix: "feat(images)!: ",
labels: ["renovate/image", "dep/major", "automerge"],
automerge: true,
},
{
matchDatasources: ["docker"],
matchUpdateTypes: ["minor"],
semanticCommitType: "feat",
labels: ["renovate/image", "dep/minor", "automerge"],
automerge: true,
},
{
matchDatasources: ["docker"],
matchUpdateTypes: ["patch"],
semanticCommitType: "fix",
labels: ["renovate/image", "dep/patch", "automerge"],
automerge: true,
},
{
matchDatasources: ["docker"],
matchUpdateTypes: ["digest"],
semanticCommitType: "fix",
labels: ["renovate/image", "dep/digest", "automerge"],
automerge: true,
},
// matchPackagePatterns
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>14)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackagePatterns: ["^bitnami/postgresql$"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d{4})-(?<minor>\\d{2})-(?<patch>\\d{2})$",
matchPackagePatterns: ["^.*oznu\\/homebridge$"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)-(?<minor>\\d+)-(?<patch>\\d+)$",
matchPackagePatterns: ["^jupyter\\/.+$"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-ubuntu$",
matchPackagePatterns: ["^zabbix\\/zabbix-.*$"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^stable-(?<major>\\d{1})(?<minor>\\d{1})(?<patch>\\d{2}).*$",
matchPackagePatterns: ["^jitsi\\/.*$"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackagePatterns: ["^penpot\\/.*$"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^\\d*-jammy-(?<variant>.+)-v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackagePatterns: ["^.+\\/koush\\/scrypted$"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^version-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-.*$",
matchPackagePatterns: ["^.*linuxserver\\/deluge$"],
automerge: true,
},
// matchPackageNames
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-postgres-tomcat$",
matchPackageNames: ["xwiki"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^version-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackageNames: ["fireflyiii/core"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-\\d+\\.\\d+\\.\\d+$",
matchPackageNames: ["netboxcommunity/netbox"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d{2})(?<minor>\\d{2})(?<patch>\\d{2})$",
matchPackageNames: ["photoprism/photoprism"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackageNames: ["cloudflare/cloudflared"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^version-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackageNames: ["linuxserver/calibre-web"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^version-v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackageNames: ["linuxserver/heimdall"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^postgresql-v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackageNames: ["ghcr.io/umami-software/umami"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^version-v(?<major>\\d+)\\.(?<minor>\\d+)\\.?(?<patch>\\d*)$",
matchPackageNames: ["linuxserver/mylar3"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^[a-z0-9]{9}-v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-go\\d+\\.\\d+\\.\\d+$",
matchPackageNames: ["storjlabs/storagenode"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-php8\\.0-apache$",
matchPackageNames: ["joyqi/typecho"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^v\\.(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackageNames: ["difegue/lanraragi"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^RELEASE\\.(?<major>\\d+)-(?<minor>\\d+)-(?<patch>\\d+)T\\d+-\\d+-\\d+Z$",
matchPackageNames: ["minio/minio"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^RELEASE\\.(?<major>\\d+)-(?<minor>\\d+)-(?<patch>\\d+)T\\d+-\\d+-\\d+Z$",
matchPackageNames: ["minio/mc"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^apache-(?<major>\\d+)\\.(?<minor>\\d+)\\.?(?<patch>\\d*)-prod$",
matchPackageNames: ["kimai/kimai2"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)-(?<minor>\\d+)-(?<patch>\\d+)$",
matchPackageNames: ["rssbridge/rss-bridge"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)-(?<minor>\\d+)-(?<patch>\\d+)$",
matchPackageNames: ["alexta69/metube"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^focal-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackageNames: ["codeproject/senseai-server"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^latest-(?<major>\\d+)-(?<minor>\\d+)-(?<patch>\\d+)$",
matchPackageNames: ["wangqiru/ttrss"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)(-\\d+)?$",
matchPackageNames: ["kiwix/kiwix-serve"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-omnibus$",
matchPackageNames: ["ghcr.io/analogj/scrutiny"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)-(?<minor>\\d+)-(?<patch>\\d+)$",
matchPackageNames: ["diygod/rsshub"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-amd64(nvidia)?$",
matchPackageNames: ["blakeblackshear/frigate"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d{1,4})\\.(?<minor>\\d+)\\.(?<patch>\\d+)$",
matchPackageNames: ["kopia/kopia"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d{4})\\.(?<minor>\\d{1,2})\\.(?<patch>\\d{1,2).*$",
matchPackageNames: ["alicevision/meshroom"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d{4})\\.(?<minor>\\d{1,2})\\.(?<patch>\\d{1,2})$",
matchPackageNames: ["itzg/bungeecord"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^java8-(?<major>\\d{4})\\.(?<minor>\\d{1,2})\\.(?<patch>\\d{1,2})$",
matchPackageNames: ["itzg/bungeecord"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^java11-(?<major>\\d{4})\\.(?<minor>\\d{1,2})\\.(?<patch>\\d{1,2})$",
matchPackageNames: ["itzg/bungeecord"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^java17-(?<major>\\d{4})\\.(?<minor>\\d{1,2})\\.(?<patch>\\d{1,2})$",
matchPackageNames: ["itzg/bungeecord"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d{4})\\.(?<minor>d{1,2})\\.(?<patch>\\d{1,2})(-java\\d{1,2}.*)?$",
matchPackageNames: ["itzg/minecraft-server"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d{4})(?<minor>\\d{2})(?<patch>\\d{2})$",
matchPackageNames: ["ankicommunity/anki-sync-server"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)-jdk17$",
matchPackageNames: ["jenkins/jenkins"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^x64-v(?<major>\\d*)\\.(?<minor>\\d*)\\.(?<patch>\\d*)$",
matchPackageNames: ["housewrecker/gaps"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d*)\\.(?<minor>\\d*)\\.(?<patch>\\d*)-\\d*$",
matchPackageNames: ["sameersbn/apt-cacher-ng"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^release-(?<major>\\d*)\\.(?<minor>\\d*)$",
matchPackageNames: ["mattermost/mattermost-enterprise-edition"],
automerge: true,
},
{
matchDatasources: ["docker"],
versioning: "regex:^(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)-.+$",
matchPackageNames: ["corentinth/it-tools"],
automerge: true,
},
{
matchDatasources: ["docker"],
automerge: true,
matchUpdateTypes: ["major", "minor", "patch", "digest", "pin"],
},
//
// Version strategies
//
// Versioning for linuxserver two-three digit container versions
{
matchPackagePatterns: ["^linuxserver\\/", "^deepquestai\\/"],
versioning: "regex:^(?<compatibility>.*?(\\d+\\.)??)(?<major>\\d+)\\.(?<minor>\\d+)\\.?(?<patch>\\d+)?(-r?p?\\d)?$",
},
{
matchDatasources: ["docker"],
versioning: "loose",
matchPackageNames: [
"ghcr.io/onedr0p/plex",
"ghcr.io/onedr0p/qbittorrent",
"sirfragalot/hyperion.ng",
],
},
{
matchDatasources: ["docker"],
matchPackageNames: [
"quay.io/helmpack/chart-releaser",
"jnorwood/helm-docs",
"quay.io/git-chglog/git-chglog",
],
automerge: false,
matchUpdateTypes: ["major", "minor", "patch", "digest", "pin"],
labels: ["renovate/image", "ci"],
},
],
}
+32
View File
@@ -0,0 +1,32 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 45
# Number of days of inactivity before a stale Issue or Pull Request is closed.
daysUntilClose: 5
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- on-hold
- pinned
# Label to use when marking as stale
staleLabel: stale
issues:
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This Issue has been automatically marked as "stale" because it has not had recent activity (for 45 days). It will be closed if no further activity occurs. Thanks for the feedback.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
pulls:
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This Pull Request has been automatically marked as "stale" because it has not had recent activity (for 45 days). It will be closed if no further activity occurs. Thank you for your contribution.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Pull Request. Do not hesitate to reopen it later if necessary.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30
+21
View File
@@ -0,0 +1,21 @@
#/bin/bash
app="${1}"
if test -f "/apps/${app}/latest-version.sh"; then
version=$(bash "/apps/${app}/latest-version.sh")
if [[ ! -z "${version}" || "${version}" != "null" ]]; then
echo "${version}" | tee "/apps/${app}/VERSION" >/dev/null
echo "App: ${app} using version: ${version}"
fi
fi
if test -f "/apps/${app}/BASE"; then
if test -f "/apps/${app}/latest-base.sh"; then
base=$(bash "/apps/${app}/latest-base.sh")
if [[ ! -z "${base}" || "${base}" != "null" ]]; then
echo "${base}" | tee "/apps/${app}/BASE" >/dev/null
echo "App: ${app} using Base: ${base}"
fi
fi
fi
+353
View File
@@ -0,0 +1,353 @@
name: "Containers: Test-and-Build"
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'apps/**'
- 'base/**'
- ".github/workflows/containers.build.yaml"
pull_request:
paths:
- 'apps/**'
- 'base/**'
- ".github/workflows/containers.build.yaml"
env:
# How long to sleep before running the tests (gives the application time to start)
GOSS_SLEEP: 30
# Number of times to run the goss test
GOSS_ITERATIONS: 3
# Detect which folders in project-root (which contain the containers) contain changes
jobs:
changes:
name: Get changes
runs-on: ubuntu-24.04
outputs:
matrix: "{\"container\": ${{ steps.reduce.outputs.containers }} }"
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: filter
with:
list-files: json
filters: |
changed:
- 'apps/**'
- 'dev/**'
- 'base/**'
- run: echo '${{ toJson(steps.filter.outputs) }}' > changes.json
- id: reduce
run: |
CONTAINERS=$(jq --raw-output '.changed_files | fromjson | .[] |= sub("(?<filepath>(?<first_directory>(?<root1>[/]?)[^/]+/)(?<second_directory>(?<root2>[/]?)[^/]+)(?<extra_paths>.+))"; "\(.second_directory)") | unique' changes.json)
echo ::set-output name=containers::${CONTAINERS}
hadolint:
name: Run hadolint
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: hadolint
uses: reviewdog/action-hadolint@73fec8b28091e5082c19df69815dd749d97b882a # v1.46.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review
filter_mode: diff_context
hadolint_ignore: DL3007
fail_on_error: true
build:
permissions:
actions: read # for detecting the Github Actions environment.
id-token: write # for creating OIDC tokens for signing.
packages: write # for uploading attestations.
name: Build
runs-on: ubuntu-24.04
needs:
- hadolint
- changes
strategy:
matrix: ${{ fromJson(needs.changes.outputs.matrix) }}
fail-fast: false
if: "!contains(github.event.head_commit.message, '[ci-skip]')"
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
# Define if tests and push should be run against which versions/platforms
- name: Prepare
id: prep
run: |
# Make sure we have the latest version in the version file
# To avoid publishing a new container version with an old tag
bash ./.github/update-version-file.sh "${{ matrix.container }}"
if test -f "./apps/${{ matrix.container }}/VERSION"; then
CATEGORY="apps"
VERSION=$(cat ./${CATEGORY}/${{ matrix.container }}/VERSION)
elif test -f "./apps/${{ matrix.container }}/Dockerfile"; then
CATEGORY="apps"
echo ::set-output name=category::${CATEGORY}
VERSION="$(head -1 ./${CATEGORY}/${{ matrix.container }}/Dockerfile | cut -d'@' -f1 | sed 's/^FROM.*://' )"
VERSION=$(echo $VERSION | sed "s/latest-//g")
VERSION=$(echo $VERSION | sed "s/stable-//g")
VERSION=$(echo $VERSION | sed "s/edge-//g")
VERSION=$(echo $VERSION | sed "s/build-//g")
VERSION=$(echo $VERSION | sed "s/cpu-//g")
VERSION=$(echo $VERSION | sed "s/gpu-//g")
VERSION=$(echo $VERSION | sed "s/release-//g")
VERSION=$(echo $VERSION | sed "s/release_//g")
VERSION=$(echo $VERSION | sed "s/version-//g")
VERSION=$(echo $VERSION | sed "s/version_//g")
VERSION=$(echo $VERSION | sed "s/apache-//g")
VERSION=$(echo $VERSION | sed "s/ubuntu-//g")
VERSION=$(echo $VERSION | sed "s/focal-//g")
VERSION=$(echo $VERSION | sed "s/fpm-//g")
VERSION=$(echo $VERSION | sed "s/vaapi-//g")
VERSION=$(echo $VERSION | sed "s/cuda-//g")
VERSION=$(echo $VERSION | sed "s/-centos7//g")
VERSION=$(echo $VERSION | sed "s/java[0-9]*-//g")
VERSION="${VERSION#*V.}"
VERSION="${VERSION#*v.}"
VERSION="${VERSION#*v-}"
VERSION="${VERSION#*v}"
VERSION="${VERSION%-*}"
if (echo "$VERSION" | grep -Pq "^\d+\.\d+$"); then
VERSION="${VERSION}.0"
fi;
else
CATEGORY="base"
VERSION=$(cat ./${CATEGORY}/${{ matrix.container }}/VERSION) || VERSION="$(head -1 ./${CATEGORY}/${{ matrix.container }}/Dockerfile | cut -d'@' -f1 | sed 's/^FROM.*://' )"
VERSION=$(echo $VERSION | sed "s/latest-//g")
VERSION=$(echo $VERSION | sed "s/stable-//g")
VERSION="${VERSION#*V.}"
VERSION="${VERSION#*v.}"
VERSION="${VERSION#*v-}"
VERSION="${VERSION#*v}"
VERSION="${VERSION%-*}"
if (echo "$VERSION" | grep -Pq "^\d+\.\d+$"); then
VERSION="${VERSION}.0"
fi;
fi
echo ::set-output name=category::${CATEGORY}
echo ::set-output name=version::${VERSION}
PLATFORM="linux/amd64"
echo ::set-output name=platform::${PLATFORM}
if test -f "./${CATEGORY}/${{ matrix.container }}/goss.yaml"; then
echo ::set-output name=goss::true
else
echo ::set-output name=goss::false
fi
if [ "${{github.event_name}}" == "pull_request" ]; then
echo ::set-output name=push::false
echo ::set-output name=cache_from::"type=registry,ref=ghcr.io/truecharts/${{ matrix.container }}:buildcache" || echo ::set-output name=cache_from::""
echo ::set-output name=cache_to::""
else
echo ::set-output name=push::true
echo ::set-output name=cache_from::"type=registry,ref=ghcr.io/truecharts/${{ matrix.container }}:buildcache"
echo ::set-output name=cache_to::"type=registry,ref=ghcr.io/truecharts/${{ matrix.container }}:buildcache,mode=max"
fi
- name: Commit and Push Housekeeping
run: |
git config user.name "TrueCharts-Bot"
git config user.email "bot@truecharts.org"
# add only VERSION and BASE files
git add ./apps/${{ matrix.container }}/VERSION ./apps/${{ matrix.container }}/BASE || true
git commit -sm "Update ${{ matrix.container }} version file" || exit 0
git push
- name: Get Time
id: time
uses: nanzm/get-time-action@887e4db9af58ebae64998b7105921b816af77977 # v2.0
with:
timeZone: 1
format: 'YYYYMMDDHHmmss'
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
with:
platforms: amd64
- uses: sigstore/cosign-installer@main
- name: Install Syft
uses: anchore/sbom-action/download-syft@61119d458adab75f756bc0b9e4bde25725f86a7a # v0.17.2
- name: Login to Quay
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
if: github.event_name != 'pull_request'
with:
registry: quay.io
username: ${{ secrets.QUAY_TCCR_USER }}
password: ${{ secrets.QUAY_TCCR_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
# list of Docker images to use as base name for tags
images: |
quay.io/tccr/${{ matrix.container }}
tccr.io/tccr/${{ matrix.container }}
# Install and configure Buildx
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
with:
install: true
version: latest
driver-opts: image=moby/buildkit:latest
# Install the GOSS testing framework
- name: Set up goss/dgoss
uses: e1himself/goss-installation-action@fbb6fb55d3e59c96045b2500eeb8ce0995d99ac1 # v1.2.1
if: ${{ steps.prep.outputs.goss == 'true' }}
with:
version: 'v0.3.16'
# Creates a local build to run tests on
- name: Build and Load local test-container
if: ${{ steps.prep.outputs.goss == 'true' }}
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
with:
build-args: |
VERSION=${{ steps.prep.outputs.version }}
CONTAINER_NAME=${{ matrix.container }}
CONTAINER_VER=${{ steps.prep.outputs.version }}
context: .
file: ./${{ steps.prep.outputs.category }}/${{ matrix.container }}/Dockerfile
load: true
tags: |
tccr.io/tccr/${{ matrix.container }}:test
cache-from: ${{ steps.prep.outputs.cache_from }}
cache-to: ${{ steps.prep.outputs.cache_to }}
# Run GOSS tests if included with the container
- name: Run GOSS tests
if: ${{ steps.prep.outputs.goss == 'true' }}
env:
GOSS_FILE: ./${{ steps.prep.outputs.category }}/${{ matrix.container }}/goss.yaml
run: |
for i in $(seq 1 ${{ env.GOSS_ITERATIONS }}); do
echo "Running GOSS test iteration $i of ${{ env.GOSS_ITERATIONS }}..."
dgoss run tccr.io/tccr/${{ matrix.container }}:test
done
# Push if not a PR, otherwise just test the build process for all requested platforms
- name: Build and Push
id: push
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
with:
build-args: |
VERSION=${{ steps.prep.outputs.version }}
CONTAINER_NAME=${{ matrix.container }}
CONTAINER_VER=${{ steps.prep.outputs.version }}
context: .
platforms: ${{ steps.prep.outputs.platform }}
file: ./${{ steps.prep.outputs.category }}/${{ matrix.container }}/Dockerfile
push: ${{ steps.prep.outputs.push }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: ${{ steps.prep.outputs.cache_from }}
cache-to: ${{ steps.prep.outputs.cache_to }}
tags: |
quay.io/tccr/${{ matrix.container }}:latest
quay.io/tccr/${{ matrix.container }}:v${{ steps.prep.outputs.version }}
quay.io/tccr/${{ matrix.container }}:build${{ steps.time.outputs.time }}
- name: Set quay to Public
if: github.event_name != 'pull_request'
run: |
curl -X POST -H "Content-Type: application/json" -d '{"visibility": "public"}' -H "Authorization: Bearer ${{ secrets.QUAY_TCCR_API_TOKEN }}" "https://quay.io/api/v1/repository/tccr/${{ matrix.container }}/changevisibility"
- name: Sign the images
if: github.event_name != 'pull_request'
run: |
cosign sign quay.io/tccr/${{ matrix.container }}@${{ steps.push.outputs.digest }} -y -a "repo=${{ github.repository }}" -a "workflow=${{ github.workflow }}" -a "ref=${{ github.sha }}"
- name: Verify the pushed tags
if: github.event_name != 'pull_request'
run: |
cosign verify quay.io/tccr/${{ matrix.container }}@${{ steps.push.outputs.digest }} --certificate-oidc-issuer=https://token.actions.githubusercontent.com --certificate-identity=https://github.com/truecharts/containers/.github/workflows/containers.build.yaml@refs/heads/master
- name: Generate SBOM
if: github.event_name != 'pull_request'
run: |
syft "quay.io/tccr/${{ matrix.container }}:v${{ steps.prep.outputs.version }}@${{ steps.push.outputs.digest }}" -o spdx-json=${{ matrix.container }}-sbom-spdx.json
- name: Attach SBOM to image
if: github.event_name != 'pull_request'
run: |
cosign attest --predicate ${{ matrix.container }}-sbom-spdx.json --type spdx "quay.io/tccr/${{ matrix.container }}@${{ steps.push.outputs.digest }}" -y
- name: Verify SBOM attestation
if: github.event_name != 'pull_request'
run: |
cosign verify-attestation quay.io/tccr/${{ matrix.container }}@${{ steps.push.outputs.digest }} --type https://spdx.dev/Document --certificate-oidc-issuer=https://token.actions.githubusercontent.com --certificate-identity=https://github.com/truecharts/containers/.github/workflows/containers.build.yaml@refs/heads/master | jq '.payload |= @base64d | .payload | fromjson'
- name: Generate provenance
id: gen-prov
if: github.event_name != 'pull_request'
run: |
wget https://github.com/slsa-framework/slsa-github-generator/releases/download/v1.5.0/slsa-generator-container-linux-amd64
chmod +x slsa-generator-container-linux-amd64
# Generate a predicate only.
./slsa-generator-container-linux-amd64 generate --predicate="${{ matrix.container }}-predicate.json"
env:
UNTRUSTED_IMAGE: "quay.io/tccr/${{ matrix.container }}"
UNTRUSTED_DIGEST: "${{ steps.push.outputs.digest }}"
GITHUB_CONTEXT: "${{ toJSON(github) }}"
- name: Sign provenance
id: sign-prov
if: github.event_name != 'pull_request'
run: |
cosign attest --predicate="${{ matrix.container }}-predicate.json" \
--type slsaprovenance \
--yes \
"quay.io/tccr/${{ matrix.container }}@${{ steps.push.outputs.digest }}"
env:
COSIGN_EXPERIMENTAL: 1
- name: Verify provenance attestation
if: github.event_name != 'pull_request'
id: verf-prov
run: |
cosign verify-attestation quay.io/tccr/${{ matrix.container }}@${{ steps.push.outputs.digest }} --type slsaprovenance --certificate-oidc-issuer=https://token.actions.githubusercontent.com --certificate-identity=https://github.com/truecharts/containers/.github/workflows/containers.build.yaml@refs/heads/master | jq '.payload |= @base64d | .payload | fromjson'
env:
COSIGN_EXPERIMENTAL: 1
container-build-complete:
needs: [build]
name: Container Build Completed
runs-on: ubuntu-latest
steps:
- name: complete message
run: echo "Container Build and Tests Completed Successfully"
automerge:
needs: [container-build-complete]
if: github.event_name == 'pull_request'
name: Automerge build
runs-on: ubuntu-latest
steps:
- name: automerge
uses: pascalgn/automerge-action@7961b8b5eec56cc088c140b56d864285eabd3f67 # v0.16.4
continue-on-error: true
env:
GITHUB_TOKEN: "${{ secrets.BOT_TOKEN }}"
UPDATE_RETRIES: 12
UPDATE_RETRY_SLEEP: 60000
+36
View File
@@ -0,0 +1,36 @@
name: "Housekeeping"
on:
workflow_dispatch:
push:
branches:
- main
paths:
- ".github/workflows/housekeeping.yaml"
schedule:
- cron: "0 1 * * *"
jobs:
housekeeping:
runs-on: ubuntu-latest
name: "Housekeeping"
steps:
- name: Checkout branch
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- name: Containers - Fetch new application versions
run: |
find ./apps -maxdepth 1 -mindepth 1 -type d -exec basename {} \; | while read app; do
bash ./.github/update-version-file.sh "${app}"
done
- name: Commit and Push Housekeeping
run: |
git config user.name "TrueCharts-Bot"
git config user.email "bot@truecharts.org"
git add --all
git commit -sm "Daily Housekeeping" || exit 0
git push
+36
View File
@@ -0,0 +1,36 @@
name: "Scarf-Processing"
on:
workflow_dispatch:
jobs:
housekeeping:
runs-on: ubuntu-latest
name: "Add to Scarf"
steps:
- name: Checkout branch
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
token: ${{ secrets.BOT_TOKEN }}
- name: Containers - Fetch new application versions
env:
scarf_key: ${{ secrets.SCARF_SECRET }}
run: |
PLAIN='jackett'
ajson="Accept:application/json"
credentials="Authorization: Bearer ${scarf_key}"
CT="Content-Type:application/json"
for group in apps dev mirror base; do
for i in ${group}/*; do
PLAIN=$( echo $i | cut -d'/' -f2 )
data='{"name":"tccr/'${PLAIN}'","backendUrl":"https://quay.io/tccr/'${PLAIN}'","longDescription":"","shortDescription":"example description","website":"https://truecharts.org","libraryType":"docker","publicUrl":"https://tccr.io/tccr/'${PLAIN}'"}'
url="https://scarf.sh/api/v1/packages"
curl --header "$ajson" --header "$credentials" --data "$data" --header "$CT" "$url"
done
done
+25
View File
@@ -0,0 +1,25 @@
---
name: "Schedule: Sync labels"
on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
- cron: "0 * * * *"
jobs:
labels:
name: Sync Labels
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Sync Labels
uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2
with:
config-file: |
https://raw.githubusercontent.com/truecharts/.github/main/.github/labels.yaml
token: "${{ secrets.BOT_TOKEN }}"
delete-other-labels: true
+38
View File
@@ -0,0 +1,38 @@
---
name: "Mark or close stale issues and PRs"
on:
workflow_dispatch:
schedule:
# Run the stalebot every day at 8pm UTC
- cron: "00 20 * * *"
jobs:
stale:
runs-on: ubuntu-24.04
steps:
- name: Check for stale issues and PRs
uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
with:
repo-token: ${{ secrets.BOT_TOKEN }}
days-before-issue-stale: 180
days-before-pr-stale: 180
days-before-close: 14
days-before-pr-close: 14
stale-issue-message: >
This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in two weeks if no further activity occurs.
Thank you for your contributions.
stale-pr-message: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed in two weeks if no further activity occurs.
Thank you for your contributions.
close-issue-message: >
This issue has been automatically closed due to inactivity.
Please re-open if this still requires investigation.
close-pr-message: >
This pull request has been automatically closed due to inactivity.
Please re-open if these changes are still required.
stale-pr-label: "stale"
stale-issue-label: "stale"
exempt-issue-labels: "keepalive"
exempt-pr-labels: "keepalive"
+11
View File
@@ -0,0 +1,11 @@
# See https://pre-commit.com for more information
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: check-merge-conflict
- id: check-case-conflict
+48
View File
@@ -0,0 +1,48 @@
# Container Images
Images are hosted on Quay [here](https://quay.io/organization/truecharts).
Some older images can be found on [GitHub Container Registry](https://github.com/orgs/truecharts/packages?ecosystem=container&visibility=public).
## Mirror
We host a dedicated mirror repostiory, these containers are directly fetched from official and/or trusted sources.
### Purpose
We host our own mirror for a multitude of reasons, which includes:
- Getting around Docker Hub rate-limiting
- Preventing upstream maintainers removing tags from breaking our Apps
- Generating usage metrics
- Applying patches
- Improving code uniformity
- Allowing multi-registry failover
### Adding New Containers
Before a chart can be added to the [truecharts/charts](https://github.com/truecharts/charts) repository, you first need to add a container here to the mirror. If you need help with this process please see the **#development** channel in the [TrueCharts Discord Server](https://discord.gg/tVsPTHWTtr).
#### Step 1: Create a Dockerfile
Copy the contents below and substitute the upstream application owner's name with `<Upstream Owner Name>`, `<Upstream App Name>` with the application name, and `<Upstream Tag>` with the upstream tag's name. Also get the digest value of the app and substitute that in for `<Upstream Digest>`.
``` Update Highlighted Row #1
FROM <Upstream Owner Name>/<Upstream App Name>:<Upstream Tag>@sha256:<Upstream Digest>
LABEL org.opencontainers.image.source=https://github.com/truecharts/containers
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
```
### Step 2: Create a PLATFORM file
Based on the upstream platform, create a file with that value. Typically the value is `linux/amd64`.
### Step 3: Submit a Pull Request
Once all these steps are completed and you verified that they are correct, please submit a pull request to this repository! When finished, you can create your chart in the [truecharts/charts](https://github.com/truecharts/charts) repository.
+40
View File
@@ -0,0 +1,40 @@
ARG ARGO_CD_VERSION="v2.6.15@sha256:834dc238abb0550e94057906f3b22d2d4d737ef410bff0bd1b4eec4017a73d2e"
# https://github.com/argoproj/argo-cd/blob/master/Dockerfile
ARG KSOPS_VERSION="v4.2.1@sha256:55d4d4f8986419bd7f591643175c3d8bd064d3de72ff5678bd81311ee157b60a"
#--------------------------------------------#
#--------Build KSOPS and Kustomize-----------#
#--------------------------------------------#
FROM viaductoss/ksops:$KSOPS_VERSION as ksops-builder
#--------------------------------------------#
#--------Build Custom Argo Image-------------#
#--------------------------------------------#
FROM argoproj/argocd:$ARGO_CD_VERSION
# Switch to root for the ability to perform install
USER root
ARG PKG_NAME=ksops
# Override the default kustomize executable with the Go built version
COPY --from=ksops-builder /go/bin/kustomize /usr/local/bin/kustomize
# Add ksops executable to path
COPY --from=ksops-builder /go/bin/ksops /usr/local/bin/ksops
# Switch back to non-root user
USER argocd
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
linux/amd64
+12
View File
@@ -0,0 +1,12 @@
FROM docker.io/codercom/code-server:4.93.1@sha256:c69e398d1b64589b3b77a7becfd03f4ec524982def20e6bffbb51b1b839e72ba
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/containers"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
linux/amd64
@@ -0,0 +1,51 @@
# hadolint ignore=DL3007
FROM ghcr.io/truecharts/ubuntu:latest@sha256:cbe66cbca1ddd2a82093675067c363af8bbc6713b645bc77cb1706578a01facd
ARG TARGETPLATFORM
ARG VERSION
USER root
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
apt-get -qq update \
&& \
apt-get -qq install -y \
mariadb-client \
&& \
case "${TARGETPLATFORM}" in \
'linux/amd64') export ARCH='linux-x64' ;; \
esac \
&& apt-get remove -y \
jq \
&& 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/ \
&& chmod -R u=rwX,go=rX /app \
&& printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \
&& update-ca-certificates
USER apps
COPY ./apps/db-wait-mariadb/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
1.1.0
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
version="1.1.0"
printf "%s" "${version}"
@@ -0,0 +1,59 @@
# hadolint ignore=DL3007
FROM ghcr.io/truecharts/ubuntu:latest@sha256:cbe66cbca1ddd2a82093675067c363af8bbc6713b645bc77cb1706578a01facd
ARG TARGETPLATFORM
ARG VERSION
USER root
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155,DL4001
RUN \
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg \
&& \
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/kubernetes.list \
&& \
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | apt-key add - \
&& \
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list \
&& \
case "${TARGETPLATFORM}" in \
'linux/amd64') export ARCH='linux-x64' ;; \
esac \
&& \
apt-get -qq update \
&& \
apt-get -qq install -y \
mongodb-mongosh \
&& apt-get remove -y \
jq \
&& 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/ \
&& chmod -R u=rwX,go=rX /app \
&& printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \
&& update-ca-certificates
USER apps
COPY ./apps/db-wait-mongodb/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
1.1.0
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
version="1.1.0"
printf "%s" "${version}"
@@ -0,0 +1,51 @@
# hadolint ignore=DL3007
FROM ghcr.io/truecharts/ubuntu:latest@sha256:cbe66cbca1ddd2a82093675067c363af8bbc6713b645bc77cb1706578a01facd
ARG TARGETPLATFORM
ARG VERSION
USER root
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
apt-get -qq update \
&& \
apt-get -qq install -y \
postgresql-client \
&& \
case "${TARGETPLATFORM}" in \
'linux/amd64') export ARCH='linux-x64' ;; \
esac \
&& apt-get remove -y \
jq \
&& 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/ \
&& chmod -R u=rwX,go=rX /app \
&& printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \
&& update-ca-certificates
USER apps
COPY ./apps/db-wait-postgres/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
1.1.0
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
version="1.1.0"
printf "%s" "${version}"
+51
View File
@@ -0,0 +1,51 @@
# hadolint ignore=DL3007
FROM ghcr.io/truecharts/ubuntu:latest@sha256:cbe66cbca1ddd2a82093675067c363af8bbc6713b645bc77cb1706578a01facd
ARG TARGETPLATFORM
ARG VERSION
USER root
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
apt-get -qq update \
&& \
apt-get -qq install -y \
redis-server \
&& \
case "${TARGETPLATFORM}" in \
'linux/amd64') export ARCH='linux-x64' ;; \
esac \
&& apt-get remove -y \
jq \
&& 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/ \
&& chmod -R u=rwX,go=rX /app \
&& printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \
&& update-ca-certificates
USER apps
COPY ./apps/db-wait-redis/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
1.1.0
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
version="1.1.0"
printf "%s" "${version}"
+1
View File
@@ -0,0 +1 @@
jammy
+27
View File
@@ -0,0 +1,27 @@
ARG TARGETPLATFORM
ARG VERSION
# hadolint ignore=DL3007
FROM freeradius/freeradius-server:${VERSION}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
rm /docker-entrypoint.sh && \
rm -Rf /etc/raddb
VOLUME /etc/raddb
COPY ./apps/freeradius/entrypoint.sh /docker-entrypoint.sh
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
set -e
if [ -f "/etc/raddb/clients.conf" ]; then
echo "Radius config already exists, skipping config copy..."
else
echo "Radius config does not exist, copying..."
cp -Rf /etc/freeradius/* /etc/raddb/
fi
chown -R freerad:freerad /etc/raddb/
# this if will check if the first argument is a flag
# but only works if all arguments require a hyphenated flag
# -v; -SL; -f arg; etc will work, but not arg1 arg2
if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
set -- freeradius -d /etc/raddb "$@"
fi
# check for the expected command
if [ "$1" = 'freeradius' ]; then
shift
exec freeradius -f -d /etc/raddb "$@"
fi
# many people are likely to call "radiusd" as well, so allow that
if [ "$1" = 'radiusd' ]; then
shift
exec freeradius -f -d /etc/raddb "$@"
fi
# else default to run whatever the user wanted like "bash" or "sh"
exec "$@"
+5
View File
@@ -0,0 +1,5 @@
---
port:
udp:1812:
listening: true
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
cat "./base/ubuntu/VERSION"
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
version=$(curl "https://registry.hub.docker.com/v1/repositories/freeradius/freeradius-server/tags" | jq --raw-output '.[].name' | grep -v layer | grep -v alpine | grep -v latest | tail -n1)
version="${version#*v}"
version="${version#*release-}"
echo "${version}"
+12
View File
@@ -0,0 +1,12 @@
FROM ghcr.io/qdm12/gluetun:v3.39.1@sha256:cb9183810872906d600327d29c93b80ce9de1e3e21f188f65b4a70a15afc6e32
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/containers"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
linux/amd64
@@ -0,0 +1,42 @@
name: Create and publish a Docker image
on:
push:
tags:
- "v*.*.*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+2
View File
@@ -0,0 +1,2 @@
output
api-key
+47
View File
@@ -0,0 +1,47 @@
# Stage 1 - Build the Go application
FROM golang:1.23.2-alpine@sha256:9dd2625a1ff2859b8d8b01d8f7822c0f528942fe56cfe7a1e7c38d3b8d72d679 AS builder
# Install necessary build dependencies
RUN apk --no-cache add --update gcc musl-dev
# Create the necessary directories
RUN mkdir -p /build /output
# Set the working directory
WORKDIR /build
# Copy go mod and sum files
COPY apps/kube-sa-proxy/go.mod apps/kube-sa-proxy/go.sum ./
# Download dependencies
RUN go mod download
# Copy the rest of the Go application source code
COPY apps/kube-sa-proxy/cmd/main.go .
COPY apps/kube-sa-proxy/internal/config ./internal/config
COPY apps/kube-sa-proxy/internal/proxy ./internal/proxy
COPY apps/kube-sa-proxy/internal/utils ./internal/utils
# Build the Go application
RUN go build -ldflags "-w -s" -o /output/my-proxy-service .
# Stage 2 - Create the final image
FROM alpine@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d AS runner
# Install necessary runtime dependencies
RUN apk --no-cache add ca-certificates
# Set the working directory
WORKDIR /app
# Copy the binary from the builder stage
COPY --from=builder /output/my-proxy-service .
# Set environment variables
ENV PORT=3000
# Expose the port
EXPOSE $PORT
# Set the default command to run the binary
CMD sh -c "./my-proxy-service"
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program 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 <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+1
View File
@@ -0,0 +1 @@
linux/amd64
+61
View File
@@ -0,0 +1,61 @@
# File Auth Proxy Service
File Auth Proxy Service is a lightweight Go application designed to act as a proxy server, forwarding HTTP requests to a specified target URL while handling authentication using an API key stored in a file. This service dynamically monitors changes to the API key file, ensuring seamless updates without service interruption. With File Auth Proxy Service, you can securely proxy requests while easily managing authentication credentials.
## Features
- Proxy server for HTTP requests
- Authentication with API key stored in a file
- Dynamic monitoring of the API key file for updates
- Lightweight and easy to deploy
## Getting Started
To get started with File Auth Proxy Service, follow these steps:
1. Clone this repository.
2. Build the project using `go build`.
3. Run the executable, specifying the desired port, API file path, proxy target URL, and authentication token header.
```bash
./my-proxy-service -port <port> -api-file <api-file-path> -proxy-target <proxy-target-url> -auth-token-header <auth-token-header-name>
```
## Docker Usage and Environment Variables
To run the File Auth Proxy Service using Docker, use the provided Docker image:
### docker run
The volume can be _ANY_ path like the port can be set to whatever you want; if you change the PORT env, you need to change the internal port too...
```bash
docker run -d -p 3000:3000 \
-v /path/to/local/config:/config \
-e PORT=3000 \
-e API_FILE=/config/api-key \
-e PROXY_TARGET=http://example.com \
-e AUTH_TOKEN_HEADER=authorization \
ghcr.io/xstar97/my-proxy-service:latest
```
### docker-compose
The volume can be _ANY_ path like the port can be set to whatever you want; if you change the PORT env, you need to change the internal port too...
```yaml
version: '3.8'
services:
my-proxy-service:
image: ghcr.io/xstar97/my-proxy-service:latest
ports:
- "3000:3000"
environment:
- PORT=3000
- API_FILE=/config/api-key
- PROXY_TARGET=http://example.com
- AUTH_TOKEN_HEADER=authorization
volumes:
- /path/to/local/config:/config
```
+1
View File
@@ -0,0 +1 @@
v1.30.2
+24
View File
@@ -0,0 +1,24 @@
package main
import (
"flag"
"fmt"
"log"
"net/http"
"my-proxy-service/internal/config"
"my-proxy-service/internal/proxy"
"my-proxy-service/internal/utils"
)
func main() {
flag.Parse()
config.LoadConfig()
go utils.WatchFile()
http.HandleFunc(config.ROUTES.INDEX, proxy.HandleProxy)
http.HandleFunc(config.ROUTES.HEALTH, proxy.HealthCheckHandler)
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", config.Port), nil))
}
+7
View File
@@ -0,0 +1,7 @@
module my-proxy-service
go 1.22
require github.com/fsnotify/fsnotify v1.7.0
require golang.org/x/sys v0.4.0 // indirect
+4
View File
@@ -0,0 +1,4 @@
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -0,0 +1,65 @@
package config
import (
"flag"
"log"
"os"
"strconv"
"sync"
)
// Constants for routes
var ROUTES = struct {
INDEX string
HEALTH string
}{
INDEX: "/",
HEALTH: "/healthz",
}
var (
Port int
ApiFile string
ProxyTarget string
AuthTokenHeader string
AuthTokenPrefix string
CsrfToken string
mutex sync.Mutex
)
func init() {
flag.IntVar(&Port, "port", 3000, "Port to run the proxy server on")
flag.StringVar(&ApiFile, "api-file", "file_to_watch.txt", "Path to the file containing the API key")
flag.StringVar(&ProxyTarget, "proxy-target", "http://example.com", "Target URL for proxying requests")
flag.StringVar(&AuthTokenHeader, "auth-token-header", "authorization", "Header name for authentication token")
flag.StringVar(&AuthTokenPrefix, "auth-token-prefix", "Bearer", "Prefix for authentication token")
flag.StringVar(&CsrfToken, "csrf-token", "", "CSRF TOKEN X-CSRF-TOKEN")
}
func LoadConfig() {
flag.Parse()
setFlagFromEnv("PORT", &Port)
setFlagFromEnv("API_FILE", &ApiFile)
setFlagFromEnv("PROXY_TARGET", &ProxyTarget)
setFlagFromEnv("AUTH_TOKEN_HEADER", &AuthTokenHeader)
setFlagFromEnv("AUTH_TOKEN_PREFIX", &AuthTokenPrefix)
setFlagFromEnv("CSRF_TOKEN", &CsrfToken)
}
func setFlagFromEnv(envVar string, flagValue interface{}) {
if value := os.Getenv(envVar); value != "" {
switch v := flagValue.(type) {
case *int:
val, err := strconv.Atoi(value)
if err != nil {
log.Fatalf("Error parsing %s value: %v", envVar, err)
}
*v = val
case *string:
*v = value
default:
log.Fatalf("Unsupported flag type: %T", v)
}
}
}
@@ -0,0 +1,10 @@
package proxy
import (
"net/http"
)
func HealthCheckHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("healthy"))
}
@@ -0,0 +1,80 @@
package proxy
import (
"crypto/tls"
"fmt"
"io"
"log"
"net/http"
"strings"
"my-proxy-service/internal/config"
"my-proxy-service/internal/utils"
)
func HandleProxy(w http.ResponseWriter, r *http.Request) {
log.Printf("Incoming request: %s %s", r.Method, r.URL)
targetURL := config.ProxyTarget
if r.URL.String() != "/" {
targetURL += r.URL.String()
}
log.Printf("Target URL: %s", targetURL)
req, err := http.NewRequest(r.Method, targetURL, r.Body)
if err != nil {
utils.HandleError(w, err, http.StatusInternalServerError)
return
}
authTokenValue, err := utils.ReadAuthToken()
if err != nil {
utils.HandleError(w, err, http.StatusInternalServerError)
return
}
authTokenValue = strings.TrimSpace(authTokenValue)
if config.AuthTokenPrefix != "" {
authTokenValue = config.AuthTokenPrefix + " " + authTokenValue
}
log.Printf("Token: %s", authTokenValue)
if len(authTokenValue) == 0 {
log.Println("Authentication token is empty")
utils.HandleError(w, fmt.Errorf("authentication token is empty"), http.StatusUnauthorized)
return
}
req.Header.Set(config.AuthTokenHeader, authTokenValue)
if config.CsrfToken != "" {
req.Header.Set("X-CSRF-TOKEN", config.CsrfToken)
}
// Set up a custom transport to skip certificate verification
transport := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true, // Skip certificate verification
},
}
client := &http.Client{Transport: transport}
resp, err := client.Do(req)
if err != nil {
utils.HandleError(w, err, http.StatusInternalServerError)
return
}
defer resp.Body.Close()
log.Printf("Response status: %s", resp.Status)
utils.CopyHeaders(w, resp)
w.WriteHeader(resp.StatusCode)
_, err = io.Copy(w, resp.Body)
if err != nil {
utils.HandleError(w, err, http.StatusInternalServerError)
return
}
}
@@ -0,0 +1,86 @@
package utils
import (
"io/ioutil"
"log"
"sync"
"net/http"
"my-proxy-service/internal/config"
"github.com/fsnotify/fsnotify"
)
var mutex sync.Mutex
func ReadAuthToken() (string, error) {
mutex.Lock()
defer mutex.Unlock()
content, err := ioutil.ReadFile(config.ApiFile)
if err != nil {
return "", err
}
return string(content), nil
}
func CopyHeaders(w http.ResponseWriter, resp *http.Response) {
for key, values := range resp.Header {
for _, value := range values {
w.Header().Add(key, value)
}
}
}
func HandleError(w http.ResponseWriter, err error, code int) {
log.Printf("Error: %v", err)
http.Error(w, err.Error(), code)
}
func WatchFile() {
watcher, err := fsnotify.NewWatcher()
if err != nil {
log.Fatalf("Error creating watcher: %v", err)
}
defer watcher.Close()
err = watcher.Add(config.ApiFile)
if err != nil {
log.Fatalf("Error adding file to watcher: %v", err)
}
for {
select {
case event, ok := <-watcher.Events:
if !ok {
return
}
if event.Op&fsnotify.Write == fsnotify.Write {
log.Println("File modified, updating authentication token...")
if err := handleFileChange(config.ApiFile); err != nil {
log.Printf("Error updating authentication token: %v", err)
}
}
case err, ok := <-watcher.Errors:
if !ok {
return
}
log.Println("Error watching file:", err)
}
}
}
func handleFileChange(filePath string) error {
content, err := ioutil.ReadFile(filePath)
if err != nil {
return err
}
if len(content) == 0 {
log.Println("Warning: Empty file content.")
return nil
}
log.Println("Authentication token updated successfully.")
return nil
}
+34
View File
@@ -0,0 +1,34 @@
FROM tccr.io/truecharts/alpine:v3.18.4@sha256:51c4ca9a8213d3f4026bd560e8aa2de365d275d6cd0298eff2ae20671fef34e9
ARG TARGETPLATFORM
ARG VERSION
# hadolint ignore=DL3002
USER root
# hadolint ignore=DL3018,DL4006
RUN apk update && apk add --no-cache curl git \
&& curl -LO "https://dl.k8s.io/release/${VERSION}/bin/linux/amd64/kubectl" \
&& curl -LO "https://dl.k8s.io/release/${VERSION}/bin/linux/amd64/kubectl.sha256" \
&& echo "$(cat kubectl.sha256) kubectl" | sha256sum -c \
&& install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl \
&& kubectl version --client --output=yaml \
&& curl -fsSL -o cmctl.tar.gz https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cmctl-linux-amd64.tar.gz \
&& tar xzf cmctl.tar.gz \
&& mv cmctl /usr/local/bin \
&& apk del curl
USER apps
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
linux/amd64
+1
View File
@@ -0,0 +1 @@
v1.31.1
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
version=$(curl -L -s https://dl.k8s.io/release/stable.txt)
printf "%s" "${version}"
@@ -0,0 +1,33 @@
FROM tccr.io/tccr/alpine:v3.20.3@sha256:b2b2350a8a843b7f8a0afef968e525900b5c2ae410a8ef0c6461005a06b64ffe
ARG TARGETPLATFORM
ARG VERSION
# hadolint ignore=DL3002
USER root
COPY ./apps/lvm-disk-watcher/includes/watch_lvm.sh /scripts/watch_lvm.sh
# hadolint ignore=DL3018,DL4006
RUN apk update && apk add --no-cache bash lvm2 \
&& apk del curl \
&& mkdir -p /scripts /config \
&& chmod +x /scripts/watch_lvm.sh
USER root
WORKDIR /scripts
ENTRYPOINT ["/bin/bash", "/scripts/watch_lvm.sh"]
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
@@ -0,0 +1 @@
linux/amd64
+1
View File
@@ -0,0 +1 @@
1.1.0
@@ -0,0 +1,111 @@
#!/bin/bash
set -e
config_file="/config/disk-config"
node_name="${NODE_NAME}"
VG_NAME="topolvm_vg"
while true; do
# Function to list all disks
list_disks() {
echo "Executing list_disks function..."
lsblk -dno NAME,TYPE,SIZE || echo "lsblk command failed with exit code $?"
}
echo "Updating LVM setup."
# Print current PVs, VGs and LVs
echo "Current Physical Volumes:"
pvscan
echo "Current Volume Groups:"
vgs
echo "Current Logical Volumes:"
lvs
# Print list of disks
list_disks
# Read configuration for the current node
if [ -f "$config_file" ]; then
echo "Config file found, contents:"
cat "$config_file"
# Fetch disks to watch for the current node
watch_disks=$(grep "^$node_name:" "$config_file" | cut -d ':' -f 2- | xargs)
echo "Configuration found for node $node_name: $watch_disks"
if [ -z "$watch_disks" ]; then
echo "No configuration found for node $node_name. Sleeping."
elif [ "$watch_disks" == "all" ]; then
echo "All disks configured for node $node_name."
watch_disks=$(lsblk -dno NAME,TYPE | grep -v -E 'loop|rom|raid|dm|crypt|tape|usb|floppy|bcm2835_sdhost' | awk '$2=="disk" {print "/dev/" $1}')
elif [ "$watch_disks" == "none" ]; then
echo "No disks configured for node $node_name. Sleeping."
watch_disks=""
fi
# Process each disk configuration for the node
for disk in $watch_disks; do
# Check if the disk is empty
if ! lsblk -n "$disk" | grep -q part; then
echo "Disk $disk has no partitions. Checking for LVM and filesystem signatures."
# Check for existing LVM metadata
if pvs "$disk" &>/dev/null; then
echo "Disk $disk is already part of an LVM setup. Skipping."
continue
fi
# Check for filesystem signatures
if wipefs -n "$disk" | grep -q offset; then
echo "Disk $disk has filesystem signatures. Skipping."
continue
fi
echo "Disk $disk is empty and has no LVM or filesystem signatures. Setting up LVM."
# Wipe existing LVM metadata (just in case)
pvremove -ff -y "$disk" || echo "No existing LVM metadata to remove on $disk."
# Wipe filesystem signatures
wipefs -a "$disk"
# Create LVM PV
pvcreate -ff "$disk"
# Create VG with the disk name (remove /dev/ prefix)
vgcreate "${VG_NAME}" "$disk"
# Create a thin pool (disabled auto metadata update backup), it will create a warning for this
lvcreate -l 100%FREE --chunksize 256 -T -A n -n topolvm_thin ${VG_NAME}
# /sbin/dmeventd: stat failed: No such file or directory. WARNING: Failed to monitor ${VG_NAME}/topolvm_thin.
# will be output as well. When somebody have a fix feel fry to add.
else
echo "Disk $disk has partitions. Skipping."
fi
done
# Check if the VG is already active
vg_active=$(vgdisplay "$VG_NAME" | grep "VG Status" | awk '{print $3}')
if [ "$vg_active" == "available" ]; then
echo "Volume group $VG_NAME is already active."
else
echo "Activating volume group $VG_NAME..."
vgchange -ay "$VG_NAME"
if [ $? -eq 0 ]; then
echo "Volume group $VG_NAME has been activated."
else
echo "Failed to activate volume group $VG_NAME."
fi
fi
else
echo "Configuration file not found. Exiting."
exit 1
fi
sleep 60 # Sleep for 1 minute before checking again
done
+12
View File
@@ -0,0 +1,12 @@
FROM ghcr.io/nicolaka/netshoot:v0.13@sha256:a20c2531bf35436ed3766cd6cfe89d352b050ccc4d7005ce6400adf97503da1b
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/containers"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
linux/amd64
+81
View File
@@ -0,0 +1,81 @@
FROM docker.io/nextcloud:30.0.0-fpm@sha256:88ad5957e747ddceb7641b072c22a0fbf85fe3b7ca9fc63a871d72b14e5d0ae1
# hadolint ignore=DL3008,DL3015,SC2086,SC2155,DL4006
RUN set -ex; \
\
echo "deb http://ftp.debian.org/debian $(cat /etc/os-release | grep VERSION_CODENAME | cut -d= -f2) non-free" >> \
/etc/apt/sources.list.d/intel-graphics.list && \
apt-get update; \
apt-get install -y --no-install-recommends \
jq \
nano \
procps \
ffmpeg \
libheif1 \
smbclient \
libde265-0 \
libfcgi-bin \
heif-gdk-pixbuf \
imagemagick-common \
libmagickcore-6.q16-6-extra \
intel-media-va-driver-non-free \
; \
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libbz2-dev \
libkrb5-dev \
libc-client-dev \
libsmbclient-dev \
libmagickcore-dev \
; \
\
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
docker-php-ext-install \
bz2 \
imap \
; \
pecl install smbclient; \
docker-php-ext-enable smbclient; \
\
# Reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
# Copy occ script to /usr/bin/occ
COPY --chmod=755 ./apps/nextcloud-fpm/scripts/occ /usr/bin/occ
# Copy post-install script to a temp location so we can append it to the entrypoint.sh
COPY --chmod=755 ./apps/nextcloud-fpm/scripts/post-install.sh /tmp/post-install.sh
# Copy the healthcheck
COPY --chmod=755 ./apps/nextcloud-fpm/scripts/healthcheck.sh /healthcheck.sh
# Copy the configure-scripts that will be sourced by the post-install
COPY --chmod=755 ./apps/nextcloud-fpm/configure-scripts /configure-scripts
RUN set -ex; \
sed -i 's/exec "$@"//g' /entrypoint.sh; \
cat /tmp/post-install.sh >> /entrypoint.sh
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/containers"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
linux/amd64
+63
View File
@@ -0,0 +1,63 @@
# Environment Variables
| Variable | Description | App(s) | Config Key(s) | Default | Example |
| -------------------------------------------- | --------------------------------------------------------------------------------------- | :---------------------------: | :------------------------------------------------------------------------------------------------: | :--------------------------------: | :-------------------------------------------------: |
| `NX_RUN_OPTIMIZE` | Runs optimize/repair/migration scripts | | | `true` | `false` |
| `NX_POSTGRES_HOST` | Postgres Database Host | `system` | `dbhost` | `""` | `192.168.1.100` |
| `NX_POSTGRES_NAME` | Postgres Database Name | `system` | `dbname` | `""` | `nextcloud` |
| `NX_POSTGRES_USER` | Postgres Database User | `system` | `dbuser` | `""` | `nextcloud` |
| `NX_POSTGRES_PASSWORD` | Postgres Database Password | `system` | `dbpassword` | `""` | `my-secret` |
| `NX_POSTGRES_PORT` | Postgres Database Port | `system` | `dbport` | `5432` | `5555` |
| `NX_REDIS` | Enable Redis | | | `true` | `false` |
| `NX_REDIS_HOST` | Redis Host | `system` | `redis:host` | `""` | `redis.local` |
| `NX_REDIS_PASS` | Redis Password | `system` | `redis:password` | `""` | `my-secret` |
| `NX_REDIS_PORT` | Redis Port | `system` | `redis:port` | `6379` | `1234` |
| `NX_COLLABORA` | Enable Collabora | | | `false` | `true` |
| `NX_COLLABORA_URL` | Collabora URL | `richdocuments` | `wopi_url` \ `public_wopi_url` | `""` | `https://collabora.example.com` |
| `NX_COLLABORA_ALLOWLIST` | Collabora WOPI Allow List (Comma Separated) | `richdocuments` | `wopi_allowlist` | `""` | `172.16.0.0/12,10.0.0.0/12` |
| `NX_ONLYOFFICE` | Enable OnlyOffice | | | `false` | `true` |
| `NX_ONLYOFFICE_URL` | OnlyOffice URL | `onlyoffice` | `DocumentServerUrl` | `""` | `https://onlyoffice.example.com` |
| `NX_ONLYOFFICE_INTERNAL_URL` | OnlyOffice internal URL | `onlyoffice` | `DocumentServerInternalUrl` | `""` | `http://onlyoffice.ix-onlyoffice.svc.cluster.local` |
| `NX_ONLYOFFICE_NEXTCLOUD_INTERNAL_URL` | Nextcloud's internal URL as OnlyOffice sees it | `onlyoffice` | `StorageUrl` | `""` | `http://nextcloud.ix-nextcloud.svc.cluster.local` |
| `NX_ONLYOFFICE_VERIFY_SSL` | Enable or disable SSL verification when connecting to OnlyOffice document server | `onlyoffice` | `verify_peer_off` | `true` | `false` |
| `NX_ONLYOFFICE_JWT` | OnlyOffice JWT | `onlyoffice` | `jwt_secret` | `""` | `random_string_of_characters` |
| `NX_ONLYOFFICE_JWT_HEADER` | OnlyOffice JWT Header | `onlyoffice` | `jwt_header` | `""` | `Authorization` |
| `NX_CLAMAV` | Enable ClamAV | | | `false` | `true` |
| `NX_CLAMAV_HOST` | ClamAV Host | `files_antivirus` | `av_host` | `""` | `clamav.local` |
| `NX_CLAMAV_PORT` | ClamAV Port | `files_antivirus` | `av_port` | `""` | `3310` |
| `NX_CLAMAV_STREAM_MAX_LENGTH` | ClamAV Stream Max Length | `files_antivirus` | `av_stream_max_length` | `26214400` | `1048576` |
| `NX_CLAMAV_MAX_FILE_SIZE` | ClamAV Max File Size | `files_antivirus` | `av_max_file_size` | `-1` | `1048576` |
| `NX_CLAMAV_INFECTED_ACTION` | ClamAV Infected Action | `files_antivirus` | `av_infected_action` | `only_log` | `delete` |
| `NX_NOTIFY_PUSH` | Enable Nextcloud Push Notifications | `notify_push` | See `NX_NOTIFY_PUSH_URL` | `true` | `false` |
| `NX_NOTIFY_PUSH_ENDPOINT` | Nextcloud Push Notifications URL | `notify_push` | `base_endpoint` | `""` | `https://cloud.example.com/push` |
| `NX_IMAGINARY` | Enable Imaginary | `system` | `preview_imaginary_url` | `true` | `false` |
| `NX_PREVIEWS` | Enable Previews (Forced enabled if Imaginary is enabled) | `system` / `previewgenerator` | `system:enable_previews`, `system:enablePreviewProviders` and see `NX_PREVIEW_`, `NX_JPEG_QUALITY` | `true` | `false` |
| `NX_PREVIEW_PROVIDERS` | Space Separated list of Preview providers (Imaginary is added automatically if enabled) | `system` | `enabledPreviewProviders` | `""` | `JPEG PNG BPM` |
| `NX_PREVIEW_MAX_X` | Maximum width of preview image | `system` | `preview_max_x` | `2048` | `1024` |
| `NX_PREVIEW_MAX_Y` | Maximum height of preview image | `system` | `preview_max_y` | `2048` | `1024` |
| `NX_PREVIEW_MAX_MEMORY` | Maximum memory for preview image | `system` | `preview_max_memory` | `1024` | `512` |
| `NX_PREVIEW_MAX_FILESIZE_IMAGE` | Maximum file size for image previews | `system` | `preview_max_filesize_image` | `50` | `25` |
| `NX_JPEG_QUALITY` | JPEG Quality for previews | `system` / `previewgenerator` | `system:jpeg_quality` / `preview:jpeg_quality` | `60` | `80` |
| `NX_PREVIEW_HEIGHT_SIZES` | Preview height sizes | `previewgenerator` | `heightSizes` | `256` | `512` |
| `NX_PREVIEW_WIDTH_SIZES` | Preview width sizes | `previewgenerator` | `widthSizes` | `256 384` | `512 1024` |
| `NX_PREVIEW_SQUARE_SIZES` | Preview square sizes | `previewgenerator` | `squareSizes` | `32 256` | `64 512` |
| `NX_ACTIVITY_EXPIRE_DAYS` | Expire days for activity app | `system` | `activity_expire_days` | `90` | `60` |
| `NX_TRASH_RETENTION` | Retention time for deleted files | `system` | `trashbin_retention_obligation` | `auto` | `30,60` |
| `NX_VERSION_RETENTION` | Retention time for old versions | `system` | `versions_retention_obligation` | `auto` | `30,60` |
| `NX_DEFAULT_PHONE_REGION` | Default phone region | `system` | `default_phone_region` | `GR` | `US` |
| `NX_SHARED_FOLDER_NAME` | Name of shared folder | `system` | `share_folder_name` | `Shared` | `Common` |
| `NX_MAX_CHUNK_SIZE` | Maximum chunk size | `files` | `max_chunk_size` | `10485760` | `104857600` |
| `NX_LOG_LEVEL` | Log level | `system` | `loglevel` | `2` | `0` |
| `NX_LOG_FILE` | Log file | `system` | `logfile` | `/var/www/html/data/nextcloud.log` | `/logs/nextcloud.log` |
| `NX_LOG_FILE_AUDIT` | Audit log file | `system` | `logfile_file` | `/var/www/html/data/audit.log` | `/logs/audit.log` |
| `NX_LOG_DATE_FORMAT` | Log date format | `system` | `logdateformat` | `d/m/Y H:i:s` | `D d/m/Y H:i:s` |
| `NX_LOG_TIMEZONE` | Log timezone | `system` | `logtimezone` | `$TZ` | `Europe/Athens` |
| `NX_OVERWRITE_HOST` | Overwrite host | `system` | `overwritehost` | `""` | `cloud.example.com` |
| `NX_OVERWRITE_CLI_URL` | Overwrite CLI URL | `system` | `overwrite.cli.url` | `""` | `https://cloud.example.com` |
| `NX_OVERWRITE_PROTOCOL` | Overwrite protocol | `system` | `overwriteprotocol` | `""` | `https` |
| `NX_TRUSTED_DOMAINS` | Space Separated list of Trusted domains | `system` | `trusted_domains` | `""` | `localhost cloud.example.com` |
| `NX_TRUSTED_PROXIES` | Space Separated list of Trusted proxies | `system` | `trusted_proxies` | `""` | `10.0.0.0/8 172.16.0.0./12 192.168.0.0/16` |
| `NX_CONFIG_FILE_PATH` | Absolute path of the `config.php` file, used to determine if NC installed succesfuly | | | `/var/www/html/config/config.php` | `/config/config.php` |
| `NX_FORCE_ENABLE_ALLOW_LOCAL_REMOTE_SERVERS` | Set `allow_local_remote_servers` to `true` | | `allow_local_remote_servers` | `false` | `true` |
> Visit Nextcloud official documentation for more information about each `Config key`
+1
View File
@@ -0,0 +1 @@
30.0.0
@@ -0,0 +1,24 @@
#!/bin/sh
occ_clamav_install() {
echo '## Configuring ClamAV...'
install_app files_antivirus
occ config:app:set files_antivirus av_mode --value="daemon"
occ config:app:set files_antivirus av_host --value="${NX_CLAMAV_HOST:?"NX_CLAMAV_HOST is unset"}"
occ config:app:set files_antivirus av_port --value="${NX_CLAMAV_PORT:-3310}"
occ config:app:set files_antivirus av_stream_max_length --value="${NX_CLAMAV_STREAM_MAX_LENGTH:-26214400}"
occ config:app:set files_antivirus av_max_file_size --value="${NX_CLAMAV_MAX_FILE_SIZE:-"-1"}"
occ config:app:set files_antivirus av_infected_action --value="${NX_CLAMAV_INFECTED_ACTION:-"only_log"}"
}
occ_clamav_remove() {
echo '## Removing ClamAV Configuration...'
remove_app files_antivirus
occ config:app:delete files_antivirus av_mode
occ config:app:delete files_antivirus av_host
occ config:app:delete files_antivirus av_port
occ config:app:delete files_antivirus av_stream_max_length
occ config:app:delete files_antivirus av_max_file_size
occ config:app:delete files_antivirus av_infected_action
}
@@ -0,0 +1,5 @@
#!/bin/sh
occ_cleanups() {
echo '## Making sure Collabora built-in app is not installed...'
remove_app richdocumentscode
}
@@ -0,0 +1,18 @@
#!/bin/sh
occ_collabora_install() {
echo '## Configuring Collabora...'
install_app richdocuments
occ config:app:set richdocuments wopi_url --value="${NX_COLLABORA_URL:?"NX_COLLABORA_URL is unset"}"
occ config:app:set richdocuments public_wopi_url --value="${NX_COLLABORA_URL:?"NX_COLLABORA_URL is unset"}"
occ config:app:set richdocuments wopi_allowlist --value="${NX_COLLABORA_ALLOWLIST:?"NX_COLLABORA_ALLOWLIST is unset"}"
}
occ_collabora_remove() {
echo '## Removing Collabora Configuration...'
remove_app richdocuments
occ config:app:delete richdocuments wopi_url
occ config:app:delete richdocuments public_wopi_url
occ config:app:delete richdocuments wopi_allowlist
}
@@ -0,0 +1,11 @@
#!/bin/sh
occ_database() {
echo '## Configuring Database...'
occ config:system:set dbtype --value="pgsql"
occ config:system:set dbhost --value="${NX_POSTGRES_HOST:?"NX_POSTGRES_HOST is unset"}"
occ config:system:set dbname --value="${NX_POSTGRES_NAME:?"NX_POSTGRES_NAME is unset"}"
occ config:system:set dbuser --value="${NX_POSTGRES_USER:?"NX_POSTGRES_USER is unset"}"
occ config:system:set dbpassword --value="${NX_POSTGRES_PASSWORD:?"NX_POSTGRES_PASSWORD is unset"}"
occ config:system:set dbport --value="${NX_POSTGRES_PORT:-5432}"
}
@@ -0,0 +1,7 @@
#!/bin/sh
occ_expire_retention() {
echo '## Configuring Expiring and Retention Days...'
occ config:system:set activity_expire_days --value="${NX_ACTIVITY_EXPIRE_DAYS:-90}" --type=integer
occ config:system:set trashbin_retention_obligation --value="${NX_TRASH_RETENTION:-auto}"
occ config:system:set versions_retention_obligation --value="${NX_VERSIONS_RETENTION:-auto}"
}
@@ -0,0 +1,14 @@
#!/bin/sh
occ_general() {
echo '## Disabling WebUI Updater...'
occ config:system:set upgrade.disable-web --type=bool --value=true
echo '## Configuring Default Phone Region...'
occ config:system:set default_phone_region --value=${NX_DEFAULT_PHONE_REGION:-GR}
echo '## Configuring "Shared" folder...'
occ config:system:set share_folder --value="${NX_SHARED_FOLDER_NAME:-Shared}"
echo '## Configuring Max Chunk Size for Files...'
occ config:app:set files max_chunk_size --value="${NX_MAX_CHUNKSIZE:-10485760}"
}
@@ -0,0 +1,10 @@
#!/bin/sh
occ_imaginary_install() {
echo '## Configuring Imaginary...'
occ config:system:set preview_imaginary_url --value="${NX_IMAGINARY_URL:?"NX_IMAGINARY_URL is unset"}"
}
occ_imaginary_remove() {
echo '## Removing Imaginary Configuration...'
occ config:system:delete preview_imaginary_url
}
@@ -0,0 +1,11 @@
#!/bin/sh
occ_logging() {
echo '## Configuring Logging...'
occ config:system:set log_type --value="file"
occ config:system:set log_type_audit --value="file"
occ config:system:set loglevel --value="${NX_LOG_LEVEL:-2}"
occ config:system:set logfile --value="${NX_LOG_FILE:-"/var/www/html/data/nextcloud.log"}"
occ config:system:set logfile_audit --value="${NX_LOG_FILE_AUDIT:-"/var/www/html/data/audit.log"}"
occ config:system:set logdateformat --value="${NX_LOG_DATE_FORMAT:-"d/m/Y H:i:s"}"
occ config:system:set logtimezone --value="${NX_LOG_TIMEZONE:-$TZ}"
}
@@ -0,0 +1,16 @@
#!/bin/sh
occ_notify_push_install() {
echo '## Configuring Notify Push...'
install_app notify_push
echo '## Configuring Notify Push Base Endpoint...'
occ config:app:set notify_push base_endpoint --value="${NX_NOTIFY_PUSH_ENDPOINT:?"NX_NOTIFY_PUSH_ENDPOINT is unset"}"
}
occ_notify_push_remove() {
echo '## Removing Notify Push...'
remove_app notify_push
echo '## Removing Notify Push Base Endpoint...'
occ config:app:delete notify_push base_endpoint
}
@@ -0,0 +1,28 @@
#!/bin/sh
occ_onlyoffice_install() {
echo '## Configuring OnlyOffice...'
install_app onlyoffice
occ config:app:set onlyoffice DocumentServerUrl --value="${NX_ONLYOFFICE_URL:?"NX_ONLYOFFICE_URL is unset"}"
occ config:app:set onlyoffice DocumentServerInternalUrl --value="${NX_ONLYOFFICE_INTERNAL_URL:?"NX_ONLYOFFICE_INTERNAL_URL is unset"}"
occ config:app:set onlyoffice StorageUrl --value="${NX_ONLYOFFICE_NEXTCLOUD_INTERNAL_URL:?"NX_ONLYOFFICE_NEXTCLOUD_INTERNAL_URL is unset"}"
if [ "${NX_ONLYOFFICE_VERIFY_SSL:-"true"}" = "false" ]; then
occ config:app:set onlyoffice verify_peer_off --value="true"
else
occ config:app:set onlyoffice verify_peer_off --value="false"
fi
occ config:system:set onlyoffice jwt_secret --value="${NX_ONLYOFFICE_JWT:?"NX_ONLYOFFICE_JWT is unset"}"
occ config:system:set onlyoffice jwt_header --value="${NX_ONLYOFFICE_JWT_HEADER:-"Authorization"}"
}
occ_onlyoffice_remove() {
echo '## Removing OnlyOffice Configuration...'
remove_app onlyoffice
occ config:app:delete onlyoffice DocumentServerUrl
occ config:app:delete onlyoffice DocumentServerInternalUrl
occ config:app:delete onlyoffice StorageUrl
occ config:app:delete onlyoffice verify_peer_off
occ config:system:delete onlyoffice jwt_secret
occ config:system:delete onlyoffice jwt_header
}
@@ -0,0 +1,11 @@
#!/bin/sh
occ_optimize() {
echo '## Applying migrations/repairs/optimizations...'
occ db:add-missing-indices
occ db:add-missing-columns
occ db:add-missing-primary-keys
yes | occ db:convert-filecache-bigint
occ maintenance:mimetype:update-js
occ maintenance:mimetype:update-db
occ maintenance:update:htaccess
}
@@ -0,0 +1,47 @@
#!/bin/sh
occ_preview_generator_install() {
echo '## Configuring Preview Generator...'
install_app previewgenerator
echo '## Configuring Preview Providers...'
[ "${NX_PREVIEW_PROVIDERS:?"NX_PREVIEW_PROVIDERS is unset"}" ]
# Adds Imaginary if enabled
if [ "${NX_IMAGINARY:-"true"}" = "true" ]; then
NX_PREVIEW_PROVIDERS="Imaginary ${NX_PREVIEW_PROVIDERS}"
fi
set_list 'enabledPreviewProviders' "${NX_PREVIEW_PROVIDERS}" 'system' 'OC\Preview\'
echo '## Configuring Preview Generation Configuration...'
occ config:system:set enable_previews --value=true
occ config:system:set jpeg_quality --value="${NX_JPEG_QUALITY:-60}" --type=integer
occ config:system:set preview_max_x --value="${NX_PREVIEW_MAX_X:-2048}" --type=integer
occ config:system:set preview_max_y --value="${NX_PREVIEW_MAX_Y:-2048}" --type=integer
occ config:system:set preview_max_memory --value="${NX_PREVIEW_MAX_MEMORY:-1024}" --type=integer
occ config:system:set preview_max_filesize_image --value="${NX_PREVIEW_MAX_FILESIZE_IMAGE:-50}" --type=integer
occ config:app:set previewgenerator squareSizes --value="${NX_PREVIEW_SQUARE_SIZES:-32 256}"
occ config:app:set previewgenerator widthSizes --value="${NX_PREVIEW_WIDTH_SIZES:-256 384}"
occ config:app:set previewgenerator heightSizes --value="${NX_PREVIEW_HEIGHT_SIZES:-256}"
occ config:app:set preview jpeg_quality --value="${NX_JPEG_QUALITY:-60}"
}
occ_preview_generator_remove() {
echo '## Removing Preview Generator...'
remove_app previewgenerator
echo '## Removing Preview Providers...'
occ config:system:delete enabledPreviewProviders
echo '## Removing Preview Generation Configuration...'
occ config:system:set enable_previews --value=false
occ config:system:delete jpeg_quality
occ config:system:delete preview_max_x
occ config:system:delete preview_max_y
occ config:system:delete preview_max_memory
occ config:system:delete preview_max_filesize_image
occ config:app:delete previewgenerator squareSizes
occ config:app:delete previewgenerator widthSizes
occ config:app:delete previewgenerator heightSizes
occ config:app:delete preview jpeg_quality
}
@@ -0,0 +1,20 @@
#!/bin/sh
occ_redis_install() {
echo '## Configuring Redis...'
occ config:system:set redis host --value="${NX_REDIS_HOST:?"NX_REDIS_HOST is unset"}"
occ config:system:set redis password --value="${NX_REDIS_PASS:?"NX_REDIS_PASS is unset"}"
occ config:system:set redis port --value="${NX_REDIS_PORT:-6379}"
occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
occ config:system:set memcache.distributed --value="\\OC\\Memcache\\Redis"
occ config:system:set memcache.locking --value="\\OC\\Memcache\\Redis"
}
occ_redis_remove() {
echo '## Removing Redis Configuration...'
occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
occ config:system:delete memcache.distributed
occ config:system:delete memcache.locking
occ config:system:delete redis
}
@@ -0,0 +1,37 @@
#!/bin/sh
occ_urls(){
echo '## Configuring Overwrite URLs...'
occ config:system:set overwrite.cli.url --value="${NX_OVERWRITE_CLI_URL:?"NX_OVERWRITE_CLI_URL is unset"}"
occ config:system:set overwritehost --value="${NX_OVERWRITE_HOST:?"NX_OVERWRITE_HOST is unset"}"
occ config:system:set overwriteprotocol --value="${NX_OVERWRITE_PROTOCOL:?"NX_OVERWRITE_PROTOCOL is unset"}"
echo '## Configuring Trusted Domains...'
[ "${NX_TRUSTED_DOMAINS:?"NX_TRUSTED_DOMAINS is unset"}" ]
if [ "${NX_COLLABORA:-"false"}" = "true" ]; then
# Remove http(s):// from NX_COLLABORA_URL
[ "${NX_COLLABORA_URL:?"NX_COLLABORA_URL is unset"}" ]
NX_COLLABORA_DOMAIN="${NX_COLLABORA_URL#*://}"
# Remove /foo (subfolder) from NX_COLLABORA_DOMAIN
NX_COLLABORA_DOMAIN="${NX_COLLABORA_DOMAIN#%/*}"
if [ "${NX_COLLABORA_DOMAIN}" != "${NX_OVERWRITE_HOST}" ]; then
NX_TRUSTED_DOMAINS="${NX_TRUSTED_DOMAINS} ${NX_COLLABORA_DOMAIN}"
fi
fi
if [ "${NX_ONLYOFFICE:-"false"}" = "true" ]; then
# Remove http(s):// from NX_ONLYOFFICE_URL
[ "${NX_ONLYOFFICE_URL:?"NX_ONLYOFFICE_URL is unset"}" ]
NX_ONLYOFFICE_DOMAIN="${NX_ONLYOFFICE_URL#*://}"
# Remove /foo (subfolder) from NX_ONLYOFFICE_DOMAIN
NX_ONLYOFFICE_DOMAIN="${NX_ONLYOFFICE_DOMAIN#%/*}"
if [ "${NX_ONLYOFFICE_DOMAIN}" != "${NX_OVERWRITE_HOST}" ]; then
NX_TRUSTED_DOMAINS="${NX_TRUSTED_DOMAINS} ${NX_ONLYOFFICE_DOMAIN}"
fi
fi
set_list 'trusted_domains' "${NX_TRUSTED_DOMAINS}" 'system'
echo '## Configuring Trusted Proxies...'
set_list 'trusted_proxies' "${NX_TRUSTED_PROXIES:?"NX_TRUSTED_PROXIES is unsed"}" 'system'
}
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
version=$(cat ./apps/nextcloud-fpm/Dockerfile | grep "FROM docker.io/nextcloud:" | cut -d ':' -f2 | cut -d '@' -f1 | cut -d '-' -f1)
printf "%s" "${version}"
@@ -0,0 +1,6 @@
#!/bin/sh
REQUEST_METHOD="GET" \
SCRIPT_NAME="status.php" \
SCRIPT_FILENAME="status.php" \
cgi-fcgi -bind -connect "127.0.0.1:9000" | grep -q '"installed":true' || exit 1
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
uid="$(id -u)"
gid="$(id -g)"
if [ "$uid" = '0' ]; then
user='www-data'
group='www-data'
else
user="$uid"
group="$gid"
fi
run_as() {
if [ "$(id -u)" = 0 ]; then
su -p "$user" -s /bin/bash -c "php /var/www/html/occ $(printf '%q ' "$@")"
else
/bin/bash -c "php /var/www/html/occ $(printf '%q ' "$@")"
fi
}
run_as "$@"
@@ -0,0 +1,224 @@
#!/bin/sh
# Installs the passed application if not already installed
install_app() {
app_name="${1:?"app_name is unset"}"
echo "Installing [$app_name]..."
if occ app:list | grep -wq "$app_name"; then
echo "App [$app_name] is already installed! Skipping..."
return 0
fi
if ! occ app:install "$app_name"; then
echo "Failed to install $app_name..."
exit 1
fi
echo "App [$app_name] installed successfuly!"
}
remove_app() {
app_name="${1:?"app_name is unset"}"
echo "Removing [$app_name]..."
if ! occ app:list | grep -wq "$app_name"; then
echo "App [$app_name] is not installed! Skipping..."
return 0
fi
if ! occ app:remove "$app_name"; then
echo "Failed to remove [$app_name]..."
exit 1
fi
echo "App [$app_name] removed successfuly!"
}
# Sets a space separated values into the specified list, by default for system settings
# Pass a 3rd argument for a different app
set_list() {
list_name="${1:?"list_name is unset"}"
space_delimited_values="${2:?"space_delimited_values is unset"}"
app="${3:-"system"}"
prefix="${4:-""}"
if [ -n "${space_delimited_values}" ]; then
if [ "${app}" != 'system' ]; then
occ config:app:delete "$app" "$list_name"
else
occ config:system:delete "$list_name"
fi
IDX=0
# Replace spaces with newlines so the input can have
# mixed entries of space or new line seperated values
echo "$space_delimited_values" | tr ' ' '\n' | while IFS= read -r value; do
# Skip empty values
if [ -z "$value" ]; then
continue
fi
# Prepend prefix (eg OC\Preview)
if [ -n "${prefix}" ]; then
value="$prefix$value"
fi
if [ "${app}" != 'system' ]; then
occ config:app:set "$app" "$list_name" $IDX --value="$value"
else
occ config:system:set "$list_name" $IDX --value="$value"
fi
IDX=$((IDX+1))
done
fi
}
config_file="${NX_CONFIG_FILE_PATH:-"/var/www/html/config/config.php"}"
if [ ! -f "$config_file" ]; then
echo "Config file [$config_file] is missing. Something went wrong. Exiting in 15 sec..."
# Sleep so people can get to the logs
# And see what happened
sleep 15
exit 1
fi
if ! grep -q "'installed' => true" "$config_file"; then
echo 'Looks like Nextcloud failed to complete installation. Exiting in 15 sec...'
# Sleep so people can get to the logs
# And see what happened
sleep 15
exit 1
fi
echo 'Nextcloud is installed. proceeding with the configuration.'
echo '++++++++++++++++++++++++++++++++++++++++++++++++++'
echo ''
### Source all configure-scripts. ###
for script in /configure-scripts/*.sh; do
echo "Sourcing $script"
. "$script"
done
echo ''
echo 'Executing injected scripts...'
echo '++++++++++++++++++++++++++++++++++++++++++++++++++'
echo ''
### Start Configuring ###
# Configure Redis
if [ "${NX_REDIS:-"true"}" = "true" ]; then
echo '# Redis is enabled.'
occ_redis_install
else
echo '# Redis is disabled.'
occ_redis_remove
fi
# Configure Database
echo ''
occ_database
# Configure General Settings
echo ''
occ_general
# Configure Logging
echo ''
occ_logging
# Configure URLs (Trusted Domains, Trusted Proxies, Overwrites, etc)
echo ''
occ_urls
# Configure Expiration/Retention Days
echo ''
occ_expire_retention
echo ''
if [ "${NX_NOTIFY_PUSH:-"true"}" = "true" ]; then
echo '# Notify Push is enabled.'
occ_notify_push_install
else
echo '# Notify Push is disabled.'
occ_notify_push_remove
fi
echo ''
# If Imaginary is enabled, previews are forced enabled
if [ "${NX_IMAGINARY:-"true"}" = "true" ]; then
NX_PREVIEWS="true"
echo '# Imaginary is enabled.'
occ_imaginary_install
else
echo '# Imaginary is disabled.'
occ_imaginary_remove
fi
echo ''
# If Imaginary is disabled but previews are enabled, configure only previews
if [ "${NX_PREVIEWS:-"true"}" = "true" ] ; then
echo '# Preview Generator is enabled.'
occ_preview_generator_install
else
echo '# Preview Generator is disabled.'
occ_preview_generator_remove
fi
echo ''
if [ "${NX_CLAMAV:-"false"}" = "true" ]; then
echo '# ClamAV is enabled.'
occ_clamav_install
else
echo '# ClamAV is disabled.'
occ_clamav_remove
fi
echo ''
if [ "${NX_COLLABORA:-"false"}" = "true" ]; then
echo '# Collabora is enabled.'
occ_collabora_install
else
echo '# Collabora is disabled.'
occ_collabora_remove
fi
echo ''
if [ "${NX_ONLYOFFICE:-"false"}" = "true" ]; then
echo '# OnlyOffice is enabled.'
occ_onlyoffice_install
else
echo '# OnlyOffice is disabled.'
occ_onlyoffice_remove
fi
if [ "${NX_ONLYOFFICE:-"false"}" = "true" ] || [ "${NX_COLLABORA:-"false"}" = "true" ] || [ "${NX_FORCE_ENABLE_ALLOW_LOCAL_REMOTE_SERVERS:-"false"}" = "true" ]; then
occ config:system:set allow_local_remote_servers --value="true"
else
occ config:system:delete allow_local_remote_servers
fi
occ_cleanups
echo ''
echo '++++++++++++++++++++++++++++++++++++++++++++++++++'
### End Configuring ###
echo '--------------------------------------------------'
echo ''
# Run optimize/repairs/migrations
if [ "${NX_RUN_OPTIMIZE:-"true"}" = "true" ]; then
echo '# Optimize is enabled. Running...'
occ_optimize
else
echo '# Optimize is disabled. Skipping...'
fi
echo ''
echo '--------------------------------------------------'
echo 'Starting Nextcloud PHP-FPM'
exec "$@"
@@ -0,0 +1,34 @@
# https://github.com/nextcloud/all-in-one/tree/main/Containers/imaginary
FROM golang:1.21.5-alpine3.17@sha256:92cb87af996ec6befc85f0aec27e12ead2fab396695fa8a7abff79e021e58195 as go
# hadolint ignore=DL3018
RUN set -ex; \
apk add --no-cache \
vips-jxl \
vips-dev \
vips-heif \
build-base \
vips-magick \
vips-poppler; \
go install github.com/h2non/imaginary@b632dae8cc321452c3f85bcae79c580b1ae1ed84
FROM alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d
# hadolint ignore=DL3018
RUN set -ex; \
apk add --no-cache \
vips \
curl \
tzdata \
vips-jxl \
vips-heif \
vips-magick \
vips-poppler \
ca-certificates
COPY --from=go /go/bin/imaginary /usr/local/bin/imaginary
USER nobody
# https://github.com/h2non/imaginary#memory-issues
ENV MALLOC_ARENA_MAX=2
ENTRYPOINT ["imaginary", "-p", "${PORT:-9000}"]
@@ -0,0 +1 @@
20230401
@@ -0,0 +1,18 @@
#!/bin/bash
curr_dir="$1"
curr_commit="$(cat "$curr_dir/Dockerfile" | grep "go install github.com/h2non/imaginary" | sed -e 's/^[[:space:]]*//' | cut -d ' ' -f3 | cut -d '@' -f2)"
imaginary_commit="$(git ls-remote https://github.com/h2non/imaginary.git refs/heads/master | cut -f1)"
if [ "$imaginary_commit" = "$curr_commit" ]; then
echo 'Already up-to-date'
exit 0
fi
echo "Updating imaginary commit: $imaginary_commit"
sed -re 's/^(.*)go install github.com\/h2non\/imaginary@.+$/\1go install github.com\/h2non\/imaginary@'"$imaginary_commit"'/;' -i "$curr_dir/Dockerfile"
echo 'Updated Dockerfile:'
echo ''
cat "$curr_dir/Dockerfile"
@@ -0,0 +1,36 @@
FROM alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
# hadolint ignore=DL3018
RUN apk add --no-cache ca-certificates curl
# https://github.com/nextcloud/notify_push/releases
ENV NOTIFY_PUSH_VERSION 0.7.0
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -ex; \
arch="x86_64"; \
triplet="unknown-linux-musl"; \
\
wget -q -O /usr/local/bin/notify_push "https://github.com/nextcloud/notify_push/releases/download/v${NOTIFY_PUSH_VERSION}/notify_push-$arch-$triplet"; \
\
chmod +x /usr/local/bin/notify_push; \
notify_push --version
USER nobody
COPY --chmod=775 ./apps/nextcloud-push-notify/scripts/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/containers"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
@@ -0,0 +1 @@
0.7.0
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
notify_push_version="$(
git ls-remote --tags https://github.com/nextcloud/notify_push.git \
| cut -d/ -f3 \
| grep -vE -- '-rc|-b' \
| tr -d '^{}' \
| sed -E 's/^v//' \
| sort -V \
| tail -1
)"
curr_dir=./apps/nextcloud-push-notify
sed -re 's/^ENV NOTIFY_PUSH_VERSION .*$/ENV NOTIFY_PUSH_VERSION '"$notify_push_version"'/;' -i "$curr_dir/Dockerfile"
echo "$notify_push_version"
@@ -0,0 +1,18 @@
#!/bin/ash
[ -n "${NEXTCLOUD_URL:?"WARN: NEXTCLOUD_URL is unset"}" ]
HPB_HOST="${HPB_HOST:-kube.internal.healthcheck}"
echo "Waiting Nextcloud [$NEXTCLOUD_URL] to be installed and ready. Sleeping for 3s..."
until curl -m 5 -k -s -H "Host: $HPB_HOST" "$NEXTCLOUD_URL/status.php" | grep -q '"installed":true'; do
echo "Waiting Nextcloud [$NEXTCLOUD_URL] to be installed and ready. Sleeping for 3s..."
sleep 3
done
echo "Nextcloud [$NEXTCLOUD_URL] replied, it is installed and ready. Starting Notify Push"
if [ -n "${CONFIG_FILE:-}" ]; then
notify_push "$CONFIG_FILE"
else
notify_push "$@"
fi
+59
View File
@@ -0,0 +1,59 @@
# hadolint ignore=DL3007
FROM ghcr.io/truecharts/ubuntu:latest@sha256:cbe66cbca1ddd2a82093675067c363af8bbc6713b645bc77cb1706578a01facd
ARG TARGETPLATFORM
ARG VERSION
USER root
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
apt-get -qq update \
&& \
case "${TARGETPLATFORM}" in \
'linux/amd64') export ARCH='linux-x64' ;; \
esac \
&& \
export URL=$(curl -sX GET https://api.github.com/repos/Ombi-app/Ombi/releases | \
jq -r '.[] | select(.tag_name | contains(env.VERSION)) | .assets[] | select(.browser_download_url | contains(env.ARCH)) | .browser_download_url') \
&& curl -fsSL -o /tmp/ombi.tgz "${URL}" \
&& tar ixzf /tmp/ombi.tgz -C /app \
&& \
rm -rf \
/tmp/ombi.tgz \
&& printf "UpdateMethod=docker\nPackageVersion=%s\nPackageAuthor=[TrueCharts Project](https://truecharts.org)" "${VERSION}" > /app/package_info \
&& apt-get remove -y \
jq \
&& 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/ \
&& chmod -R u=rwX,go=rX /app \
&& printf "umask %d" "${UMASK}" >> /etc/bash.bashrc \
&& update-ca-certificates
USER apps
EXPOSE 3579
COPY ./apps/ombi/entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
4.46.4
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec /app/Ombi --host http://0.0.0.0:3579 --storage /config ${EXTRA_ARGS}
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
version=$(curl -sX GET "https://api.github.com/repos/Ombi-app/Ombi/releases" | jq --raw-output '.[0].tag_name')
version="${version#*v}"
version="${version#*release-}"
printf "%s" "${version}"
+12
View File
@@ -0,0 +1,12 @@
FROM dperson/openvpn-client:latest@sha256:d174047b57d51734143325ad7395210643025e6516ba60a937e9319dbb462293
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/containers"
ARG CONTAINER_NAME
ARG CONTAINER_VER
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
LABEL org.opencontainers.image.documentation="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
+1
View File
@@ -0,0 +1 @@
linux/amd64

Some files were not shown because too many files have changed in this diff Show More