Skip to content

Commit 0007076

Browse files
committed
feat: add cleanuparr
1 parent 1f92d7d commit 0007076

File tree

5 files changed

+133
-0
lines changed

5 files changed

+133
-0
lines changed

apps/cleanuparr/Dockerfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
FROM alpine AS cloner
2+
3+
ARG VERSION
4+
ARG DOTNET_VERSION="9.0.8"
5+
6+
RUN mkdir -p /app && \
7+
apk add --update --no-cache wget && \
8+
wget -O /tmp/cleanuparr.zip https://github.com/Cleanuparr/Cleanuparr/releases/download/v${VERSION}/Cleanuparr-${VERSION}-linux-amd64.zip && \
9+
unzip -o /tmp/cleanuparr.zip -d /app && \
10+
mv /app/*/* /app/ 2>/dev/null || true && \
11+
chmod +x /app/Cleanuparr && \
12+
rm -rf /tmp/cleanuparr*
13+
14+
FROM ghcr.io/ipromknight/ubuntu:rolling
15+
16+
ARG DOTNET_VERSION="9.0.8"
17+
18+
RUN apt-get update \
19+
&& apt-get install -y --no-install-recommends \
20+
ca-certificates \
21+
curl \
22+
gosu \
23+
\
24+
libc6 \
25+
libgcc-s1 \
26+
libicu66 \
27+
libssl1.1 \
28+
libstdc++6 \
29+
tzdata \
30+
&& rm -rf /var/lib/apt/lists/*
31+
32+
RUN dotnet_archive=dotnet-runtime-${DOTNET_VERSION}-linux-x64.tar.gz \
33+
\
34+
&& curl --fail --show-error --location \
35+
--remote-name https://builds.dotnet.microsoft.com/dotnet/Runtime/${DOTNET_VERSION}/${dotnet_archive} \
36+
&& mkdir -p /usr/share/dotnet \
37+
&& tar --gzip --extract --no-same-owner --file ${dotnet_archive} --directory /usr/share/dotnet \
38+
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \
39+
&& rm \
40+
${dotnet_archive}
41+
42+
LABEL org.opencontainers.image.title="Cleanuparr"
43+
44+
WORKDIR /app
45+
COPY --from=cloner /app .
46+
COPY --chmod=0755 ./apps/cleanuparr/promknight-entrypoint.sh /promknight-entrypoint.sh
47+
ENV PUID=568 \
48+
PGID=568 \
49+
UMASK=022 \
50+
TZ=Etc/UTC \
51+
HTTP_PORTS=11011 \
52+
DOTNET_USE_POLLING_FILE_WATCHER=true
53+

apps/cleanuparr/ci/goss.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
process:
3+
Cleanuparr:
4+
running: true
5+
6+
http:
7+
http://localhost:11011:
8+
status: 200

apps/cleanuparr/ci/latest.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
AUTH="Authorization: token ${GH_PAT:-${TOKEN:-}}"
3+
version=$(curl -sLf -H "$AUTH" https://api.github.com/repos/Cleanuparr/Cleanuparr/releases/latest | jq --raw-output '. | .tag_name')
4+
version="${version#*v}"
5+
printf "%s" "${version}"

apps/cleanuparr/metadata.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"app": "cleanuparr",
3+
"base": false,
4+
"channels": [
5+
{
6+
"name": "main",
7+
"platforms": [
8+
"linux/amd64"
9+
],
10+
"stable": true,
11+
"tests": {
12+
"enabled": true,
13+
"type": "web"
14+
}
15+
}
16+
]
17+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cat << "EOF"
6+
7+
▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▌
8+
▐ ▌
9+
▐ ██▓███ ██▀███ ▒█████ ███▄ ▄███▓ ██ ▄█▀ ███▄ █ ██▓ ▄████ ██░ ██ ▄▄▄█████▓ ▌
10+
▐ ▓██░ ██▒▓██ ▒ ██▒▒██▒ ██▒▓██▒▀█▀ ██▒ ██▄█▒ ██ ▀█ █ ▓██▒ ██▒ ▀█▒▓██░ ██▒▓ ██▒ ▓▒ ▌
11+
▐ ▓██░ ██▓▒▓██ ░▄█ ▒▒██░ ██▒▓██ ▓██░▓███▄░ ▓██ ▀█ ██▒▒██▒▒██░▄▄▄░▒██▀▀██░▒ ▓██░ ▒░ ▌
12+
▐ ▒██▄█▓▒ ▒▒██▀▀█▄ ▒██ ██░▒██ ▒██ ▓██ █▄ ▓██▒ ▐▌██▒░██░░▓█ ██▓░▓█ ░██ ░ ▓██▓ ░ ▌
13+
▐ ▒██▒ ░ ░░██▓ ▒██▒░ ████▓▒░▒██▒ ░██▒▒██▒ █▄▒██░ ▓██░░██░░▒▓███▀▒░▓█▒░██▓ ▒██▒ ░ ▌
14+
▐ ▒▓▒░ ░ ░░ ▒▓ ░▒▓░░ ▒░▒░▒░ ░ ▒░ ░ ░▒ ▒▒ ▓▒░ ▒░ ▒ ▒ ░▓ ░▒ ▒ ▒ ░░▒░▒ ▒ ░░ ▌
15+
▐ ░▒ ░ ░▒ ░ ▒░ ░ ▒ ▒░ ░ ░ ░░ ░▒ ▒░░ ░░ ░ ▒░ ▒ ░ ░ ░ ▒ ░▒░ ░ ░ ▌
16+
▐ ░░ ░░ ░ ░ ░ ░ ▒ ░ ░ ░ ░░ ░ ░ ░ ░ ▒ ░░ ░ ░ ░ ░░ ░ ░ ▌
17+
▐ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▌
18+
▐ ▌
19+
▐ Cleanuparr ▌
20+
▐▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▌
21+
22+
EOF
23+
24+
# Create group if it doesn't exist
25+
if ! getent group "$PGID" > /dev/null 2>&1; then
26+
echo "Creating group with GID $PGID"
27+
groupadd -g "$PGID" appgroup
28+
fi
29+
30+
# Create user if it doesn't exist
31+
if ! getent passwd "$PUID" > /dev/null 2>&1; then
32+
echo "Creating user with UID $PUID"
33+
useradd -u "$PUID" -g "$PGID" -s /bin/bash -M appuser
34+
fi
35+
36+
# Change ownership of app directory if not running as root
37+
if [ "$PUID" != "0" ] || [ "$PGID" != "0" ]; then
38+
mkdir -p /config || true
39+
chown -R "$PUID:$PGID" /app
40+
chown -R "$PUID:$PGID" /config
41+
fi
42+
43+
# Execute the main command as the specified user
44+
if [ "$PUID" = "0" ] && [ "$PGID" = "0" ]; then
45+
# Running as root, no need for gosu
46+
exec /app/Cleanuparr "$@"
47+
else
48+
# Use gosu to drop privileges
49+
exec gosu "$PUID:$PGID" /app/Cleanuparr "$@"
50+
fi

0 commit comments

Comments
 (0)