remove moved containers

This commit is contained in:
Kjeld Schouten
2025-10-02 17:24:18 +02:00
parent 084d78d979
commit 80a289e7d4
99 changed files with 0 additions and 3679 deletions
-38
View File
@@ -1,38 +0,0 @@
FROM python:3.13-alpine@sha256:9ba6d8cbebf0fb6546ae71f2a1c14f6ffd2fdab83af7fa5669734ef30ad48844
# Install dependencies
RUN pip install --no-cache-dir requests beautifulsoup4 icalendar pytz
# Create working directory
WORKDIR /app
# Copy code
COPY --chmod=775 ./containers/apps/bfics/includes/balfolk_ical.py /app/balfolk_ical.py
COPY --chmod=775 ./containers/apps/bfics/includes/crontab.txt /app/crontab.txt
# Create output dir for serving
RUN touch /app/balfolk.ics
# Setup cron
RUN apk add --no-cache bash curl busybox-suid && \
echo "#!/bin/sh\ncrond -f -L /dev/stdout" > /start.sh && \
chmod +x /start.sh
# Install cron job
RUN crontab /app/crontab.txt
# Start cron and HTTP server
CMD sh -c "python3 /app/balfolk_ical.py && crond -f -L /dev/stdout & python3 -m http.server 8000 --directory /app"
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
@@ -1 +0,0 @@
0.0.4
@@ -1,307 +0,0 @@
import requests
from bs4 import BeautifulSoup
from icalendar import Calendar, Event
from datetime import datetime, timedelta
import pytz
import re
import uuid
BALFOLK_URL = "https://www.balfolk.nl/agenda/"
def dutch_to_english_date(dutch_date_str):
months = {
"jan": "Jan",
"feb": "Feb",
"mrt": "Mar",
"apr": "Apr",
"mei": "May",
"jun": "Jun",
"jul": "Jul",
"aug": "Aug",
"sep": "Sep",
"okt": "Oct",
"nov": "Nov",
"dec": "Dec"
}
for nl, en in months.items():
dutch_date_str = re.sub(r'\b' + nl + r'\b', en, dutch_date_str, flags=re.IGNORECASE)
return dutch_date_str
def fetch_balfolk_events():
response = requests.get(BALFOLK_URL)
response.raise_for_status()
soup = BeautifulSoup(response.text, "html.parser")
events = []
for li in soup.select("ul#response li.flex-container"):
date_location = li.select_one(".date")
title_link = li.select_one(".title a")
plug_link = li.select_one("a[href^='https://www.plug.events/event/']")
if not date_location or not title_link:
continue
date_loc_text = date_location.text.strip()
title_text = title_link.text.strip()
plug_url = plug_link["href"] if plug_link else None
try:
date_part, location = map(str.strip, date_loc_text.split("|"))
date_clean = " ".join(date_part.split(" ")[1:]) # skip weekday (e.g. "zo 12 okt 2025" → "12 okt 2025")
date_clean = dutch_to_english_date(date_clean)
event_date = datetime.strptime(date_clean, "%d %b %Y")
except Exception as e:
print(f"Skipping event due to date parse error: {e}{date_loc_text}")
continue
events.append({
"date": event_date,
"name": title_text,
"location": location,
"plug_url": plug_url,
})
return events
def replace_year(dt, new_year):
return dt.replace(year=new_year)
def fix_years(start_dt, end_dt):
current_year = datetime.now().year
start_year = start_dt.year
end_year = end_dt.year
if start_year == 1900 and end_year != 1900:
start_dt = replace_year(start_dt, end_year)
elif end_year == 1900 and start_year != 1900:
end_dt = replace_year(end_dt, start_year)
elif start_year == 1900 and end_year == 1900:
start_dt = replace_year(start_dt, current_year)
end_dt = replace_year(end_dt, current_year)
return start_dt, end_dt
def parse_event_datetime(datetime_str):
tz = pytz.timezone("Europe/Amsterdam")
datetime_str = datetime_str.strip()
datetime_str = datetime_str.replace(';', '') # remove semicolon if present
try:
# Case 1: "January 9 4:00 PM - January 12, 2026 (Fri-Mon)"
m = re.match(r'^([A-Za-z]+ \d{1,2} \d{1,2}:\d{2} [AP]M) - ([A-Za-z]+ \d{1,2}, \d{4})(?: \(.+\))?$', datetime_str)
if m:
start_str, end_str = m.groups()
start_naive = datetime.strptime(start_str, "%B %d %I:%M %p")
end_naive = datetime.strptime(end_str, "%B %d, %Y")
end_naive += timedelta(days=1)
start_naive, end_naive = fix_years(start_naive, end_naive)
return tz.localize(start_naive), tz.localize(end_naive)
# Case 2: "November 14 - 17, 2025 (Fri-Mon)"
m_partial_same_month = re.match(r'^([A-Za-z]+) (\d{1,2}) - (\d{1,2}), (\d{4})(?: \(.+\))?$', datetime_str)
if m_partial_same_month:
month, start_day, end_day, year = m_partial_same_month.groups()
start_str = f"{month} {start_day}, {year}"
end_str = f"{month} {end_day}, {year}"
start_naive = datetime.strptime(start_str, "%B %d, %Y")
end_naive = datetime.strptime(end_str, "%B %d, %Y") + timedelta(days=1)
start_naive, end_naive = fix_years(start_naive, end_naive)
return tz.localize(start_naive), tz.localize(end_naive)
# Case 3: Full range with repeated months: "September 10 - November 19, 2025"
m_partial_range = re.match(r'^([A-Za-z]+ \d{1,2}) - ([A-Za-z]+ \d{1,2}, \d{4})(?: \(.+\))?$', datetime_str)
if m_partial_range:
start_date_part, end_date_part = m_partial_range.groups()
end_date_obj = datetime.strptime(end_date_part, "%B %d, %Y")
start_date_str = f"{start_date_part}, {end_date_obj.year}"
start_naive = datetime.strptime(start_date_str, "%B %d, %Y")
end_naive = end_date_obj + timedelta(days=1)
start_naive, end_naive = fix_years(start_naive, end_naive)
return tz.localize(start_naive), tz.localize(end_naive)
# Case 4: Full date ranges: "September 8, 2025 - January 12, 2026"
m_full_range = re.match(r'^([A-Za-z]+ \d{1,2}, \d{4}) - ([A-Za-z]+ \d{1,2}, \d{4})(?: \(.+\))?$', datetime_str)
if m_full_range:
start_str, end_str = m_full_range.groups()
start_naive = datetime.strptime(start_str, "%B %d, %Y")
end_naive = datetime.strptime(end_str, "%B %d, %Y") + timedelta(days=1)
start_naive, end_naive = fix_years(start_naive, end_naive)
return tz.localize(start_naive), tz.localize(end_naive)
# Case 5: Original format with parentheses and time range (AM/PM support)
date_part = datetime_str.split('(')[0].strip()
time_part = datetime_str.split(')')[1].strip()
time_range = [t.strip() for t in time_part.split('-')]
if len(time_range) != 2:
raise ValueError("Invalid time range")
start_time, end_time = time_range
is_am_pm = bool(re.search(r'\bAM\b|\bPM\b', start_time, re.IGNORECASE))
if is_am_pm:
dt_format = "%B %d, %Y %I:%M %p"
else:
dt_format = "%B %d, %Y %H:%M"
start_str = f"{date_part} {start_time}"
end_str = f"{date_part} {end_time}"
start_naive = datetime.strptime(start_str, dt_format)
end_naive = datetime.strptime(end_str, dt_format)
start_naive, end_naive = fix_years(start_naive, end_naive)
return tz.localize(start_naive), tz.localize(end_naive)
except Exception as e:
print(f"Error parsing datetime '{datetime_str}': {e}")
return None, None
def fetch_event_detail(plug_url):
try:
r = requests.get(plug_url)
r.raise_for_status()
soup = BeautifulSoup(r.text, "html.parser")
description_div = soup.find("div", class_="description")
summary_text = ""
if description_div:
p = description_div.find("p")
if p:
for br in p.find_all("br"):
br.replace_with("\n")
summary_text = p.get_text(strip=True, separator="\n")
# Look for detailed schedule
schedule_div = soup.select_one("div.event-schedule")
if schedule_div:
datetimes = []
for h3 in schedule_div.find_all("h3"):
text = h3.get_text(strip=True) # ✅ grabs text from all nested spans
if not text:
continue
start_dt, end_dt = parse_event_datetime(text)
if start_dt and end_dt:
datetimes.append((start_dt, end_dt))
if not datetimes:
print(f"⚠️ Schedule found but no valid date-times parsed for {plug_url}")
return summary_text.strip(), datetimes
# If no schedule was found, fallback to top-level <li> datetime
for li in soup.find_all("li"):
if li.find("i", class_="pi pi-calendar"):
span = li.find("span")
if span:
datetime_str = span.get_text(strip=True)
start_dt, end_dt = parse_event_datetime(datetime_str)
if start_dt and end_dt:
return summary_text.strip(), [(start_dt, end_dt)]
break
return summary_text.strip(), []
except Exception as e:
print(f"❌ Error fetching plug.events details from {plug_url}: {e}")
return None, []
def main():
events = fetch_balfolk_events()
cal = Calendar()
cal.add("prodid", "-//Balfolk Calendar//balfolk.nl//")
cal.add("version", "2.0")
tz = pytz.timezone("Europe/Amsterdam")
for ev in events:
print(f"Processing event: {ev['name']}")
summary = None
dtstart = None
dtend = None
if ev["plug_url"]:
plug_summary, ranges = fetch_event_detail(ev["plug_url"])
summaries = [plug_summary or f"Details not available for {ev['name']}"] * len(ranges)
datetimes = ranges
if not datetimes:
# Fallback: full day event using balfolk.nl date
tz = pytz.timezone("Europe/Amsterdam")
dtstart = tz.localize(datetime(ev["date"].year, ev["date"].month, ev["date"].day))
dtend = dtstart + timedelta(days=1)
datetimes = [(dtstart, dtend)]
summaries = [f"{ev['name']} (details unavailable)"]
for (dtstart, dtend), summary in zip(datetimes, summaries):
event = Event()
event.add("uid", str(uuid.uuid4()))
event.add("summary", ev["name"])
event.add("description", summary)
event.add("dtstart", dtstart)
event.add("dtend", dtend)
event.add("location", ev["location"])
if ev["plug_url"]:
event.add("url", ev["plug_url"])
cal.add_component(event)
with open("balfolk.ics", "wb") as f:
f.write(cal.to_ical())
print("ICS file generated as balfolk.ics")
def validate_ics_file(filename="balfolk.ics"):
print("\nValidating ICS file...\n")
try:
with open(filename, "rb") as f:
cal = Calendar.from_ical(f.read())
errors = 0
for component in cal.walk():
if component.name == "VEVENT":
summary = component.get("summary")
dtstart = component.get("dtstart")
dtend = component.get("dtend")
description = component.get("description")
if not summary:
print("❌ Missing SUMMARY (required)")
errors += 1
if not dtstart:
print(f"❌ Event '{summary}' is missing DTSTART (required)")
errors += 1
if not dtend:
print(f"❌ Event '{summary}' is missing DTEND (required)")
errors += 1
# Optional: warn if description is missing but don't count as error
if not description:
print(f"⚠️ Event '{summary}' is missing DESCRIPTION (optional)")
# Check timezone info on dtstart if present
if dtstart:
if hasattr(dtstart.dt, 'tzinfo'):
if dtstart.dt.tzinfo is None:
print(f"⚠️ Event '{summary}' has naive datetime (no tzinfo)")
elif "Amsterdam" not in str(dtstart.dt.tzinfo):
print(f"⚠️ Event '{summary}' tzinfo is {dtstart.dt.tzinfo}, expected Europe/Amsterdam")
else:
print(f"⚠️ Event '{summary}' DTSTART is not a datetime object")
if errors == 0:
print("✅ ICS validation passed: All required fields present.")
else:
print(f"❌ Validation found {errors} error(s) with required fields.")
except Exception as e:
print(f"❌ Failed to read or parse ICS file: {e}")
if __name__ == "__main__":
main()
validate_ics_file("balfolk.ics")
@@ -1 +0,0 @@
0 * * * * python3 /app/balfolk_ical.py
-1
View File
@@ -1 +0,0 @@
@@ -1,46 +0,0 @@
# hadolint ignore=DL3007
FROM oci.trueforge.org/tccr/alpine:latest@sha256:6dc807ae4f2867cb2d00d061f8f579f1966420ad792c179ac68072ab235109f8
ARG TARGETPLATFORM
ARG VERSION
USER root
SHELL ["/bin/sh", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
apk update && \
apk --no-cache add \
mariadb-client \
&& \
case "${TARGETPLATFORM}" in \
'linux/amd64') export ARCH='linux-x64' ;; \
esac \
&& apk del \
jq \
&& \
rm -rf \
/tmp/* \
/var/cache/apk/* \
&& chmod -R u=rwX,go=rX /app \
&& printf "umask %d" "${UMASK}" >> /etc/profile \
&& update-ca-certificates
USER apps
COPY ./containers/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}"
-106
View File
@@ -1,106 +0,0 @@
Business Source License 1.1
Parameters
Licensor: The TrueCharts Project, it's owner and it's contributors
Licensed Work: The TrueCharts "Blocky" Helm Chart
Additional Use Grant: You may use the licensed work in production, as long
as it is directly sourced from a TrueCharts provided
official repository, catalog or source. You may also make private
modification to the directly sourced licenced work,
when used in production.
The following cases are, due to their nature, also
defined as 'production use' and explicitly prohibited:
- Bundling, including or displaying the licensed work
with(in) another work intended for production use,
with the apparent intend of facilitating and/or
promoting production use by third parties in
violation of this license.
Change Date: 2050-01-01
Change License: 3-clause BSD license
For information about alternative licensing arrangements for the Software,
please contact: legal@truecharts.org
Notice
The Business Source License (this document, or the “License”) is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
“Business Source License” is a trademark of MariaDB Corporation Ab.
-----------------------------------------------------------------------------
Business Source License 1.1
Terms
The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.
Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.
If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.
All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.
You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.
Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.
This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.
MariaDB hereby grants you permission to use this Licenses text to license
your works, and to refer to it using the trademark “Business Source License”,
as long as you comply with the Covenants of Licensor below.
Covenants of Licensor
In consideration of the right to use this Licenses text and the “Business
Source License” name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:
1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where “compatible” means that software provided under the Change License can
be included in a program with software provided under GPL Version 2.0 or a
later version. Licensor may specify additional Change Licenses without
limitation.
2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text “None”.
3. To specify a Change Date.
4. Not to modify this License in any other way.
-1
View File
@@ -1 +0,0 @@
1.1.0
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
@@ -1,4 +0,0 @@
#!/usr/bin/env bash
version="1.1.0"
printf "%s" "${version}"
-113
View File
@@ -1,113 +0,0 @@
# hadolint ignore=DL3007
FROM ubuntu:latest@sha256:353675e2a41babd526e2b837d7ec780c2a05bca0164f7ea5dbbd433d21d166fc
ARG TARGETPLATFORM
ARG VERSION
USER root
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV \
DEBCONF_NONINTERACTIVE_SEEN=true \
DEBIAN_FRONTEND="noninteractive" \
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn \
UMASK="0002" \
TZ="Etc/UTC"
WORKDIR /app
RUN \
set -eux \
&& echo 'APT::Install-Recommends "false";' >/etc/apt/apt.conf.d/00recommends \
&& echo 'APT::Install-Suggests "false";' >>/etc/apt/apt.conf.d/00recommends \
&& echo 'APT::Get::Install-Recommends "false";' >>/etc/apt/apt.conf.d/00recommends \
&& echo 'APT::Get::Install-Suggests "false";' >>/etc/apt/apt.conf.d/00recommends \
&& \
apt-get -qq update \
&& \
apt-get install -y \
bash \
ca-certificates \
curl \
dnsutils \
iputils-ping \
jo \
jq \
gnupg \
locales \
moreutils \
pv \
tini \
nano \
tzdata \
vim-tiny \
unrar \
unzip \
wget \
redis-server \
postgresql-client \
mariadb-client \
libicu74 \
pv \
git \
&& \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \
&& ln -s /usr/bin/vim.tiny /usr/local/bin/vi \
&& ln -s /usr/bin/vim.tiny /usr/local/bin/vim \
&& ln -s /usr/bin/vim.tiny /usr/local/bin/nano \
&& ln -s /usr/bin/vim.tiny /usr/local/bin/emacs
ENV LANG en_US.UTF-8
VOLUME ["/config"]
COPY ./containers/apps/db-wait-mongodb/shim /shim
# 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 \
&& \
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 ./containers/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}"
-106
View File
@@ -1,106 +0,0 @@
Business Source License 1.1
Parameters
Licensor: The TrueCharts Project, it's owner and it's contributors
Licensed Work: The TrueCharts "Blocky" Helm Chart
Additional Use Grant: You may use the licensed work in production, as long
as it is directly sourced from a TrueCharts provided
official repository, catalog or source. You may also make private
modification to the directly sourced licenced work,
when used in production.
The following cases are, due to their nature, also
defined as 'production use' and explicitly prohibited:
- Bundling, including or displaying the licensed work
with(in) another work intended for production use,
with the apparent intend of facilitating and/or
promoting production use by third parties in
violation of this license.
Change Date: 2050-01-01
Change License: 3-clause BSD license
For information about alternative licensing arrangements for the Software,
please contact: legal@truecharts.org
Notice
The Business Source License (this document, or the “License”) is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
“Business Source License” is a trademark of MariaDB Corporation Ab.
-----------------------------------------------------------------------------
Business Source License 1.1
Terms
The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.
Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.
If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.
All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.
You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.
Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.
This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.
MariaDB hereby grants you permission to use this Licenses text to license
your works, and to refer to it using the trademark “Business Source License”,
as long as you comply with the Covenants of Licensor below.
Covenants of Licensor
In consideration of the right to use this Licenses text and the “Business
Source License” name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:
1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where “compatible” means that software provided under the Change License can
be included in a program with software provided under GPL Version 2.0 or a
later version. Licensor may specify additional Change Licenses without
limitation.
2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text “None”.
3. To specify a Change Date.
4. Not to modify this License in any other way.
-1
View File
@@ -1 +0,0 @@
1.2.0
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
@@ -1,4 +0,0 @@
#!/usr/bin/env bash
version="1.1.0"
printf "%s" "${version}"
@@ -1,21 +0,0 @@
#!/usr/bin/env bash
min_seconds="${1:-1}"
max_seconds="${2:-3600}"
seconds="$(shuf -i "${min_seconds}"-"${max_seconds}" -n 1)"
function logz {
msg="${1}"
level="${2:-info}"
printf "\e[1;32m%-6s\e[m\n" "timestamp=\"$(date +"%Y-%m-%dT%H:%M:%S%z")\" level=\"${level}\" msg=\"${msg}\""
}
function datez {
secs="${1}"
printf "%dh%dm%ds" $((secs/3600)) $((secs%3600/60)) $((secs%60))
}
printf "\e[1;32m%-6s\e[m\n" "$(logz "min seconds set to ${min_seconds}" "debug")"
printf "\e[1;32m%-6s\e[m\n" "$(logz "max seconds set to ${max_seconds}" "debug")"
printf "\e[1;32m%-6s\e[m\n" "$(logz "sleeping for $(datez "${seconds}")" "info")"
for ((i=seconds;i>0;i--)); do
printf "\e[1;32m%-6s\e[m\n" "$(logz "sleeping for $(datez "${i}")" "info")"
sleep 1
done
printf "\e[1;32m%-6s\e[m\n" "$(logz "done" "debug")"
@@ -1,20 +0,0 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
echo "---Checking for optional user script---"
if [ -f /custom/user.sh ]; then
echo "---Found optional script, executing---"
chmod +x /custom/user.sh
/custom/user.sh
else
echo "---No optional user script found, continuing---"
fi
echo "---Checking for container script---"
if [ -f /custom/start.sh ]; then
echo "---Found container script, executing---"
chmod +x /custom/start.sh
/custom/start.sh
else
echo "---No container script found, continuing---"
fi
@@ -1,3 +0,0 @@
#!/usr/bin/env bash
umask "${UMASK:-0002}"
@@ -1,10 +0,0 @@
#!/usr/bin/env bash
if [[ "${WAIT_FOR_VPN:-"false"}" == "true" ]]; then
echo "Waiting for VPN to be connected..."
while ! grep -s -q "connected" /shared/vpnstatus; do
echo "VPN not connected"
sleep 2
done
echo "VPN Connected, starting application..."
fi
@@ -1,41 +0,0 @@
# hadolint ignore=DL3007
FROM oci.trueforge.org/tccr/alpine:latest@sha256:6dc807ae4f2867cb2d00d061f8f579f1966420ad792c179ac68072ab235109f8
ARG TARGETPLATFORM
ARG VERSION
USER root
SHELL ["/bin/sh", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
apk update && \
apk --no-cache update && \
apk --no-cache add \
postgresql-client && \
case "${TARGETPLATFORM}" in \
'linux/amd64') export ARCH='linux-x64' ;; \
esac && \
apk del --no-cache jq && \
rm -rf /var/cache/apk/* /tmp/* /var/tmp/* && \
chmod -R u=rwX,go=rX /app && \
printf "umask %d" "${UMASK}" >> /etc/profile
USER apps
COPY ./containers/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}"
-106
View File
@@ -1,106 +0,0 @@
Business Source License 1.1
Parameters
Licensor: The TrueCharts Project, it's owner and it's contributors
Licensed Work: The TrueCharts "Blocky" Helm Chart
Additional Use Grant: You may use the licensed work in production, as long
as it is directly sourced from a TrueCharts provided
official repository, catalog or source. You may also make private
modification to the directly sourced licenced work,
when used in production.
The following cases are, due to their nature, also
defined as 'production use' and explicitly prohibited:
- Bundling, including or displaying the licensed work
with(in) another work intended for production use,
with the apparent intend of facilitating and/or
promoting production use by third parties in
violation of this license.
Change Date: 2050-01-01
Change License: 3-clause BSD license
For information about alternative licensing arrangements for the Software,
please contact: legal@truecharts.org
Notice
The Business Source License (this document, or the “License”) is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
“Business Source License” is a trademark of MariaDB Corporation Ab.
-----------------------------------------------------------------------------
Business Source License 1.1
Terms
The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.
Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.
If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.
All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.
You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.
Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.
This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.
MariaDB hereby grants you permission to use this Licenses text to license
your works, and to refer to it using the trademark “Business Source License”,
as long as you comply with the Covenants of Licensor below.
Covenants of Licensor
In consideration of the right to use this Licenses text and the “Business
Source License” name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:
1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where “compatible” means that software provided under the Change License can
be included in a program with software provided under GPL Version 2.0 or a
later version. Licensor may specify additional Change Licenses without
limitation.
2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text “None”.
3. To specify a Change Date.
4. Not to modify this License in any other way.
-1
View File
@@ -1 +0,0 @@
1.1.0
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
@@ -1,4 +0,0 @@
#!/usr/bin/env bash
version="1.1.0"
printf "%s" "${version}"
-44
View File
@@ -1,44 +0,0 @@
# hadolint ignore=DL3007
FROM oci.trueforge.org/tccr/alpine:latest@sha256:6dc807ae4f2867cb2d00d061f8f579f1966420ad792c179ac68072ab235109f8
ARG TARGETPLATFORM
ARG VERSION
USER root
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN \
apk update && \
apk update && \
apk add --no-cache \
redis \
bash && \
case "${TARGETPLATFORM}" in \
'linux/amd64') export ARCH='linux-x64' ;; \
esac && \
apk del \
jq && \
rm -rf /var/cache/apk/* && \
chmod -R u=rwX,go=rX /app && \
printf "umask %d" "${UMASK}" >> /etc/profile && \
update-ca-certificates
USER apps
COPY ./containers/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}"
-106
View File
@@ -1,106 +0,0 @@
Business Source License 1.1
Parameters
Licensor: The TrueCharts Project, it's owner and it's contributors
Licensed Work: The TrueCharts "Blocky" Helm Chart
Additional Use Grant: You may use the licensed work in production, as long
as it is directly sourced from a TrueCharts provided
official repository, catalog or source. You may also make private
modification to the directly sourced licenced work,
when used in production.
The following cases are, due to their nature, also
defined as 'production use' and explicitly prohibited:
- Bundling, including or displaying the licensed work
with(in) another work intended for production use,
with the apparent intend of facilitating and/or
promoting production use by third parties in
violation of this license.
Change Date: 2050-01-01
Change License: 3-clause BSD license
For information about alternative licensing arrangements for the Software,
please contact: legal@truecharts.org
Notice
The Business Source License (this document, or the “License”) is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
“Business Source License” is a trademark of MariaDB Corporation Ab.
-----------------------------------------------------------------------------
Business Source License 1.1
Terms
The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.
Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.
If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.
All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.
You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.
Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.
This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.
MariaDB hereby grants you permission to use this Licenses text to license
your works, and to refer to it using the trademark “Business Source License”,
as long as you comply with the Covenants of Licensor below.
Covenants of Licensor
In consideration of the right to use this Licenses text and the “Business
Source License” name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:
1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where “compatible” means that software provided under the Change License can
be included in a program with software provided under GPL Version 2.0 or a
later version. Licensor may specify additional Change Licenses without
limitation.
2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text “None”.
3. To specify a Change Date.
4. Not to modify this License in any other way.
-1
View File
@@ -1 +0,0 @@
1.1.0
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
@@ -1,4 +0,0 @@
#!/usr/bin/env bash
version="1.1.0"
printf "%s" "${version}"
-98
View File
@@ -1,98 +0,0 @@
# hadolint ignore=DL3007
FROM mcr.microsoft.com/devcontainers/base:alpine@sha256:1f8a1ea669115b1c87835427e89f6278f58a934a2e3f20eca3af7b6366ee5af2
ARG CLUSTERTOOL_VERSION=2.0.6
ARG CONTAINER_NAME
# hadolint ignore=DL3008,DL3015,SC2086,SC2155
RUN apk update && \
apk --no-cache add \
age bash bind-tools ca-certificates curl direnv fish fzf \
gettext git github-cli helm iputils jq k9s kubectl kustomize \
python3 py3-pip moreutils openssh-client openssl starship yq \
sshfs libc6-compat fuse && \
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
RUN apk add --no-cache \
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
go-task sops
RUN apk add --no-cache \
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing \
cilium-cli kubeconform stern
# Install CLI tools via jpillora scripts
RUN for app in \
"budimanjojo/talhelper!!?as=talhelper&type=script" \
"fluxcd/flux2!!?as=flux&type=script" \
"helmfile/helmfile!!?as=helmfile&type=script" \
"kubecolor/kubecolor!!?as=kubecolor&type=script" \
"kubernetes-sigs/krew!!?as=krew&type=script" \
"siderolabs/talos!!?as=talosctl&type=script"; \
do \
echo "=== Installing ${app} ==="; \
curl -fsSL "https://i.jpillora.com/${app}" | bash; \
done
# Create the completions and conf.d directories explicitly
RUN mkdir -p /home/vscode/.config/fish/completions && \
mkdir -p /home/vscode/.config/fish/conf.d
# Add completions only if the command exists
RUN for tool in cilium flux helm helmfile k9s kubectl kustomize talhelper talosctl; do \
if command -v "$tool" >/dev/null 2>&1; then \
mkdir -p /home/vscode/.config/fish/completions && \
$tool completion fish > "/home/vscode/.config/fish/completions/${tool}.fish" || true; \
fi; \
done && \
gh completion --shell fish > /home/vscode/.config/fish/completions/gh.fish || true && \
stern --completion fish > /home/vscode/.config/fish/completions/stern.fish || true && \
yq shell-completion fish > /home/vscode/.config/fish/completions/yq.fish || true
RUN mkdir -p /home/vscode/.config/fish/conf.d && \
printf '%s\n' \
"if status is-interactive" \
" direnv hook fish | source" \
" starship init fish | source" \
"end" \
> /home/vscode/.config/fish/conf.d/hooks.fish
# Add aliases to fish config
RUN mkdir -p /home/vscode/.config/fish/conf.d && \
printf '%s\n' \
"alias kubectl kubecolor" \
"alias k kubectl" \
"alias task go-task" \
> /home/vscode/.config/fish/conf.d/aliases.fish
# Custom fish prompt
RUN mkdir -p /home/vscode/.config/fish/conf.d && \
echo "set fish_greeting" > /home/vscode/.config/fish/conf.d/fish_greeting.fish
# Setup direnv whitelist
RUN mkdir -p /home/vscode/.config/direnv && \
tee /home/vscode/.config/direnv/direnv.toml > /dev/null <<EOF
[whitelist]
prefix = [ "/workspaces" ]
EOF
# Fix permissions for devcontainer user
RUN chown -R vscode:vscode /home/vscode/
RUN chmod -R 755 /home/vscode/
# Download and set up the clustertool binary
RUN curl -L "https://github.com/trueforge-org/truecharts/releases/download/v${CLUSTERTOOL_VERSION}/clustertool_${CLUSTERTOOL_VERSION}_linux_amd64.tar.gz" -o /tmp/clustertool.tar.gz \
&& tar -xzvf /tmp/clustertool.tar.gz -C /usr/local/bin \
&& chmod +x /usr/local/bin/clustertool \
&& rm /tmp/clustertool.tar.gz
# Maintainer and metadata
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
LABEL org.opencontainers.image.licenses="All-Rights-Reserved"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL org.opencontainers.image.url="https://truecharts.org/docs/charts/${CONTAINER_NAME}"
LABEL org.opencontainers.image.version="${CLUSTERTOOL_VERSION}"
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}"
-106
View File
@@ -1,106 +0,0 @@
Business Source License 1.1
Parameters
Licensor: The TrueCharts Project, it's owner and it's contributors
Licensed Work: The TrueCharts "Blocky" Helm Chart
Additional Use Grant: You may use the licensed work in production, as long
as it is directly sourced from a TrueCharts provided
official repository, catalog or source. You may also make private
modification to the directly sourced licenced work,
when used in production.
The following cases are, due to their nature, also
defined as 'production use' and explicitly prohibited:
- Bundling, including or displaying the licensed work
with(in) another work intended for production use,
with the apparent intend of facilitating and/or
promoting production use by third parties in
violation of this license.
Change Date: 2050-01-01
Change License: 3-clause BSD license
For information about alternative licensing arrangements for the Software,
please contact: legal@truecharts.org
Notice
The Business Source License (this document, or the “License”) is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
“Business Source License” is a trademark of MariaDB Corporation Ab.
-----------------------------------------------------------------------------
Business Source License 1.1
Terms
The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.
Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.
If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.
All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.
You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.
Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.
This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.
MariaDB hereby grants you permission to use this Licenses text to license
your works, and to refer to it using the trademark “Business Source License”,
as long as you comply with the Covenants of Licensor below.
Covenants of Licensor
In consideration of the right to use this Licenses text and the “Business
Source License” name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:
1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where “compatible” means that software provided under the Change License can
be included in a program with software provided under GPL Version 2.0 or a
later version. Licensor may specify additional Change Licenses without
limitation.
2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text “None”.
3. To specify a Change Date.
4. Not to modify this License in any other way.
@@ -1,3 +0,0 @@
#!/usr/bin/env bash
version=$(grep "ARG CLUSTERTOOL_VERSION=" ./containers/apps/devcontainer/Dockerfile | cut -d '=' -f2)
printf "%s" "${version}"
@@ -1,42 +0,0 @@
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Log in to the Container registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # 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@c1e51972afc2121e065aed6d45c65596fe445f3f # v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
-2
View File
@@ -1,2 +0,0 @@
output
api-key
-47
View File
@@ -1,47 +0,0 @@
# Stage 1 - Build the Go application
FROM golang:1.25.1-alpine@sha256:b6ed3fd0452c0e9bcdef5597f29cc1418f61672e9d3a2f55bf02e7222c014abd 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 ./containers/apps/kube-sa-proxy/go.mod ./containers/apps/kube-sa-proxy/go.sum ./
# Download dependencies
RUN go mod download
# Copy the rest of the Go application source code
COPY ./containers/apps/kube-sa-proxy/cmd/main.go .
COPY ./containers/apps/kube-sa-proxy/internal/config ./internal/config
COPY ./containers/apps/kube-sa-proxy/internal/proxy ./internal/proxy
COPY ./containers/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:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1 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
@@ -1,674 +0,0 @@
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
@@ -1 +0,0 @@
linux/amd64
-61
View File
@@ -1,61 +0,0 @@
# 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
@@ -1 +0,0 @@
v1.30.2
-24
View File
@@ -1,24 +0,0 @@
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))
}
-9
View File
@@ -1,9 +0,0 @@
module my-proxy-service
go 1.23.0
toolchain go1.25.1
require github.com/fsnotify/fsnotify v1.9.0
require golang.org/x/sys v0.32.0 // indirect
-12
View File
@@ -1,12 +0,0 @@
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
@@ -1,65 +0,0 @@
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)
}
}
}
@@ -1,10 +0,0 @@
package proxy
import (
"net/http"
)
func HealthCheckHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("healthy"))
}
@@ -1,80 +0,0 @@
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
}
}
@@ -1,86 +0,0 @@
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
@@ -1,34 +0,0 @@
FROM oci.trueforge.org/truecharts/alpine:v3.18.4@sha256:cc37d84517c2d4420c67b618d87b6c88a367ec3afd6f5176ce4f7ae1fe4eeaf8
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
@@ -1 +0,0 @@
linux/amd64
-1
View File
@@ -1 +0,0 @@
v1.31.1
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
@@ -1,4 +0,0 @@
#!/usr/bin/env bash
version=$(curl -L -s https://dl.k8s.io/release/stable.txt)
printf "%s" "${version}"
@@ -1,33 +0,0 @@
FROM oci.trueforge.org/tccr/alpine:v3.22.1@sha256:6dc807ae4f2867cb2d00d061f8f579f1966420ad792c179ac68072ab235109f8
ARG TARGETPLATFORM
ARG VERSION
# hadolint ignore=DL3002
USER root
COPY ./containers/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 lvm2-dmeventd device-mapper-event-libs \
&& 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}"
-106
View File
@@ -1,106 +0,0 @@
Business Source License 1.1
Parameters
Licensor: The TrueCharts Project, it's owner and it's contributors
Licensed Work: The TrueCharts "Blocky" Helm Chart
Additional Use Grant: You may use the licensed work in production, as long
as it is directly sourced from a TrueCharts provided
official repository, catalog or source. You may also make private
modification to the directly sourced licenced work,
when used in production.
The following cases are, due to their nature, also
defined as 'production use' and explicitly prohibited:
- Bundling, including or displaying the licensed work
with(in) another work intended for production use,
with the apparent intend of facilitating and/or
promoting production use by third parties in
violation of this license.
Change Date: 2050-01-01
Change License: 3-clause BSD license
For information about alternative licensing arrangements for the Software,
please contact: legal@truecharts.org
Notice
The Business Source License (this document, or the “License”) is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
“Business Source License” is a trademark of MariaDB Corporation Ab.
-----------------------------------------------------------------------------
Business Source License 1.1
Terms
The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.
Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.
If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.
All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.
You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.
Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.
This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.
MariaDB hereby grants you permission to use this Licenses text to license
your works, and to refer to it using the trademark “Business Source License”,
as long as you comply with the Covenants of Licensor below.
Covenants of Licensor
In consideration of the right to use this Licenses text and the “Business
Source License” name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:
1. To specify as the Change License the GPL Version 2.0 or any later version,
or a license that is compatible with GPL Version 2.0 or a later version,
where “compatible” means that software provided under the Change License can
be included in a program with software provided under GPL Version 2.0 or a
later version. Licensor may specify additional Change Licenses without
limitation.
2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text “None”.
3. To specify a Change Date.
4. Not to modify this License in any other way.
@@ -1 +0,0 @@
linux/amd64
-1
View File
@@ -1 +0,0 @@
1.1.9
@@ -1,110 +0,0 @@
#!/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" || echo "Failed to activate volume group $VG_NAME."
if [ $? -eq 0 ]; then
echo "Volume group $VG_NAME has been activated."
fi
fi
else
echo "Configuration file not found. Exiting."
exit 1
fi
echo "sleeping 60 seconds"
sleep 60 # Sleep for 1 minute before checking again
done
-101
View File
@@ -1,101 +0,0 @@
FROM public.ecr.aws/docker/library/nextcloud:32.0.0-fpm@sha256:601afbf1b540df52b2f86b735c476748e68a3e30e7aa1eb60e0e4791f0da8520
# Adds SURY PHP repository (This is a workaround because IMAP php extension is no longer available in Debian Trixie)
# https://github.com/nextcloud/docker/issues/2456
# https://www.voodoo.business/blog/2025/08/11/trixie-php8-4-imap-missing/
# https://wiki.debian.org/AdditionalPHPVersions (Quotes "The SURY repository is a reputable repository by web hosting professionals worldwide, but IT'S NOT A OFFICIAL DEBIAN REPOSITORY. You have been warned.")
RUN set -ex \
&& apt-get update \
&& apt-get install -y --no-install-recommends gnupg2 lsb-release \
&& echo "deb https://packages.sury.org/php $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list \
&& curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-php.gpg \
\
&& apt-get update \
# Development files for c-client mail API (used by IMAP)
&& apt-get install -y --no-install-recommends libc-client-dev \
&& apt-get dist-clean \
\
# Block the repository completely for future use
&& echo "Package: *" > /etc/apt/preferences.d/99-pin-sury \
&& echo "Pin: origin packages.sury.org" >> /etc/apt/preferences.d/99-pin-sury \
&& echo "Pin-Priority: -1" >> /etc/apt/preferences.d/99-pin-sury
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 \
ocrmypdf \
smbclient \
libde265-0 \
libfcgi-bin \
heif-gdk-pixbuf \
imagemagick-common \
intel-media-va-driver-non-free \
; \
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libbz2-dev \
libkrb5-dev \
libsmbclient-dev \
libmagickcore-dev \
; \
\
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
docker-php-ext-install \
bz2 \
imap \
soap \
; \
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 ./containers/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 ./containers/apps/nextcloud-fpm/scripts/post-install.sh /tmp/post-install.sh
# Copy the healthcheck
COPY --chmod=755 ./containers/apps/nextcloud-fpm/scripts/healthcheck.sh /healthcheck.sh
# Copy the configure-scripts that will be sourced by the post-install
COPY --chmod=755 ./containers/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
@@ -1 +0,0 @@
linux/amd64
-63
View File
@@ -1,63 +0,0 @@
# 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,24 +0,0 @@
#!/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
}
@@ -1,5 +0,0 @@
#!/bin/sh
occ_cleanups() {
echo '## Making sure Collabora built-in app is not installed...'
remove_app richdocumentscode
}
@@ -1,18 +0,0 @@
#!/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
}
@@ -1,11 +0,0 @@
#!/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}"
}
@@ -1,7 +0,0 @@
#!/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}"
}
@@ -1,14 +0,0 @@
#!/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}"
}
@@ -1,10 +0,0 @@
#!/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
}
@@ -1,11 +0,0 @@
#!/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}"
}
@@ -1,16 +0,0 @@
#!/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
}
@@ -1,28 +0,0 @@
#!/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
}
@@ -1,11 +0,0 @@
#!/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
}
@@ -1,47 +0,0 @@
#!/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
}
@@ -1,20 +0,0 @@
#!/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
}
@@ -1,37 +0,0 @@
#!/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'
}
@@ -1,3 +0,0 @@
#!/usr/bin/env bash
version=$(cat ./containers/apps/nextcloud-fpm/Dockerfile | grep "FROM public.ecr.aws/docker/library/nextcloud:" | cut -d ':' -f2 | cut -d '@' -f1 | cut -d '-' -f1)
printf "%s" "${version}"
@@ -1,6 +0,0 @@
#!/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
@@ -1,22 +0,0 @@
#!/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 "$@"
@@ -1,224 +0,0 @@
#!/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 "$@"
@@ -1,35 +0,0 @@
# https://github.com/nextcloud/all-in-one/tree/main/Containers/imaginary
FROM public.ecr.aws/docker/library/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 public.ecr.aws/docker/library/alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
# 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}"]
@@ -1 +0,0 @@
20230401
@@ -1,18 +0,0 @@
#!/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"
@@ -1,36 +0,0 @@
FROM public.ecr.aws/docker/library/alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
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 1.2.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 ./containers/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}"
@@ -1 +0,0 @@
1.2.0
@@ -1,15 +0,0 @@
#!/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"
@@ -1,18 +0,0 @@
#!/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
-24
View File
@@ -1,24 +0,0 @@
# hadolint ignore=DL3007
FROM docker.io/renovate/renovate:41.132.5-full@sha256:b42331254149bfde968caaceb6328b3f5bc0f5bb9caf4bdbf1e9c439473778fa
ARG VERSION
ARG CONTAINER_NAME
ARG CONTAINER_VER
ARG TEST
# Download and set up the clustertool binary
RUN curl -L "https://github.com/trueforge-org/truecharts/releases/download/v${VERSION}/clustertool_${VERSION}_linux_amd64.tar.gz" -o /tmp/clustertool.tar.gz \
&& tar -xzvf /tmp/clustertool.tar.gz -C /usr/local/bin \
&& chmod +x /usr/local/bin/clustertool \
&& rm /tmp/clustertool.tar.gz
# Maintainer and metadata
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
@@ -1 +0,0 @@
2.0.0-BETA-17
@@ -1,2 +0,0 @@
# curl -s "https://api.github.com/repos/truecharts/clustertool/releases/latest" | jq -r '.name' | sed 's/^clustertool-v//'
echo "2.0.0-BETA-17"
-25
View File
@@ -1,25 +0,0 @@
FROM oci.trueforge.org/truecharts/alpine:v3.18.4@sha256:cc37d84517c2d4420c67b618d87b6c88a367ec3afd6f5176ce4f7ae1fe4eeaf8
ARG TARGETPLATFORM
ARG VERSION
# hadolint ignore=DL3002
USER root
# hadolint ignore=DL3018,DL4006
RUN apk update && apk add --no-cache 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
@@ -1 +0,0 @@
linux/amd64
-1
View File
@@ -1 +0,0 @@
1.0.0
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
-3
View File
@@ -1,3 +0,0 @@
#!/usr/bin/env bash
printf "%s" "1.0.0"
View File
-42
View File
@@ -1,42 +0,0 @@
FROM alpine:3.22.1@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
ARG CONTAINER_NAME
ARG CONTAINER_VER
ENV XDG_CONFIG_HOME=/config
ENV UMASK=0002
USER root
SHELL ["/bin/sh", "-o", "pipefail", "-c"]
WORKDIR /app
# hadolint ignore=DL3018
RUN \
apk update && apk add --no-cache jq nano ca-certificates bash util-linux coreutils grep procps git\
&& addgroup apps -g 568 \
&& adduser apps -u 568 -g 568 -D -S -H \
&& mkdir -p /config \
&& chown -R apps:apps /config \
&& chmod -R 775 /config \
&& chown -R apps:apps /app \
&& chmod -R 775 /app \
&& update-ca-certificates
VOLUME [ "/config" ]
USER apps
COPY ./containers/base/alpine/entrypoint.sh /entrypoint.sh
COPY ./containers/base/alpine/shim /etc/profile.d
ENTRYPOINT ["/bin/ash", "--"]
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/containers"
LABEL org.opencontainers.image.version="${CONTAINER_VER}"
LABEL org.opencontainers.image.description="Container for ${CONTAINER_NAME} by TrueCharts"
LABEL org.opencontainers.image.authors="TrueCharts"
-2
View File
@@ -1,2 +0,0 @@
linux/amd64
linux/arm
-7
View File
@@ -1,7 +0,0 @@
#!/bin/sh bash
#shellcheck disable=SC1091
source "/shim/umask.sh"
source "/shim/vpn.sh"
exec "$@"
-12
View File
@@ -1,12 +0,0 @@
#!/bin/sh
echo "
Welcome to a TrueCharts container,
You are entering the vicinity of an area adjacent to a location.
The kind of place where there might be a monster, or some kind of weird mirror.
These are just examples; it could also be something much better.
* Repository: https://github.com/truecharts/containers
* Docs: https://truecharts.org
* Bugs or feature requests should be opened in an GH issue
* Questions should be discussed in Discord
"
-11
View File
@@ -1,11 +0,0 @@
FROM scratch
LABEL org.opencontainers.image.licenses="BSD-3-Clause"
LABEL org.opencontainers.image.title="${CONTAINER_NAME}"
LABEL "maintainer"="TrueCharts <info@truecharts.org>"
LABEL "org.opencontainers.image.source"="https://github.com/truecharts/apps"
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
@@ -1 +0,0 @@
1.0.0