Compare commits

1 Commits

Author SHA1 Message Date
b89f10a592 dev leftover 2025-02-22 20:26:29 +01:00
26 changed files with 159 additions and 8 deletions

11
.gitignore vendored Normal file

@ -0,0 +1,11 @@
# Ignore downloaded binaries and verification files
dist/
# Ignore build artifacts
*.deb
build/
tmp/
# Ignore common system files
.DS_Store
*.swp

7
amd64/DEBIAN/control Normal file

@ -0,0 +1,7 @@
Package: gitea
Version: 1.23.4-1
Architecture: amd64
Maintainer: Micha Espey <tracer@24unix.net>
Depends: adduser, ca-certificates, git, openssh-server, gpg, jq
Description: Gitea - Git with a cup of tea
A painless self-hosted Git service.

11
amd64/DEBIAN/postinst Executable file

@ -0,0 +1,11 @@
#!/bin/sh
set -e
# Ensure systemd is aware of the new service file
systemctl daemon-reload
# Enable and start Gitea service
systemctl enable gitea
systemctl restart gitea || true
exit 0

7
amd64/DEBIAN/prerm Executable file

@ -0,0 +1,7 @@
#!/bin/sh
set -e
# Stop the Gitea service before updating/removal
systemctl stop gitea || true
exit 0

@ -0,0 +1,19 @@
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
Requires=mariadb.service
[Service]
RestartSec=2s
Type=simple
User=gitea
Group=gitea
WorkingDirectory=/opt/gitea/
ExecStart=/opt/gitea/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment="GITEA_WORK_DIR=/opt/gitea/gitea"
Environment="GITEA_CUSTOM=/opt/gitea/custom"
[Install]
WantedBy=multi-user.target

BIN
amd64/opt/gitea/bin/gitea Executable file

Binary file not shown.

@ -1,7 +0,0 @@
APT::FTPArchive::Release::Origin "24unix";
APT::FTPArchive::Release::Label "Gitea Debian Repository";
APT::FTPArchive::Release::Suite "stable";
APT::FTPArchive::Release::Codename "stable";
APT::FTPArchive::Release::Architectures "amd64 arm64";
APT::FTPArchive::Release::Components "main";
APT::FTPArchive::Release::Description "Gitea Debian Packages";

7
arm64/DEBIAN/control Normal file

@ -0,0 +1,7 @@
Package: gitea
Version: 1.23.4-1
Architecture: arm64
Maintainer: Micha Espey <tracer@24unix.net>
Depends: adduser, ca-certificates, git, openssh-server, gpg, jq
Description: Gitea - Git with a cup of tea
A painless self-hosted Git service.

11
arm64/DEBIAN/postinst Executable file

@ -0,0 +1,11 @@
#!/bin/sh
set -e
# Ensure systemd is aware of the new service file
systemctl daemon-reload
# Enable and start Gitea service
systemctl enable gitea
systemctl restart gitea || true
exit 0

7
arm64/DEBIAN/prerm Executable file

@ -0,0 +1,7 @@
#!/bin/sh
set -e
# Stop the Gitea service before updating/removal
systemctl stop gitea || true
exit 0

@ -0,0 +1,19 @@
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
Requires=mariadb.service
[Service]
RestartSec=2s
Type=simple
User=gitea
Group=gitea
WorkingDirectory=/opt/gitea/
ExecStart=/opt/gitea/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment="GITEA_WORK_DIR=/opt/gitea/gitea"
Environment="GITEA_CUSTOM=/opt/gitea/custom"
[Install]
WantedBy=multi-user.target

BIN
arm64/opt/gitea/bin/gitea Executable file

Binary file not shown.

60
build.sh Executable file

@ -0,0 +1,60 @@
#!/bin/bash
set -e # Exit on error
# Set Variables
VERSION=$(curl -s https://dl.gitea.com/gitea/version.json | jq -r '.latest.version')
ARCHS=("amd64" "arm64")
GITEA_BASE_URL="https://dl.gitea.com/gitea/${VERSION}"
FILES=("xz" "xz.asc" "xz.sha256" "xz.sha256.asc")
# Download Gitea Binaries and Signatures
for ARCH in "${ARCHS[@]}"; do
echo "Downloading Gitea ${VERSION} for ${ARCH}..."
for FILE in "${FILES[@]}"; do
FILE_NAME="gitea-${VERSION}-linux-${ARCH}.${FILE}"
FILE_URL="${GITEA_BASE_URL}/${FILE_NAME}"
TARGET_FILE="dist/${ARCH}/${FILE_NAME}"
if [[ -f "$TARGET_FILE" ]]; then
echo "✅ File already exists: $TARGET_FILE (Skipping)"
else
echo "⬇️ Downloading: $FILE_URL"
wget -q "$FILE_URL" -O "$TARGET_FILE"
fi
done
done
# Verify GPG Signatures
for ARCH in "${ARCHS[@]}"; do
echo "Verifying GPG signature for ${ARCH}..."
gpg --verify "dist/${ARCH}/gitea-${VERSION}-linux-${ARCH}.xz.asc" "dist/${ARCH}/gitea-${VERSION}-linux-${ARCH}.xz"
gpg --verify "dist/${ARCH}/gitea-${VERSION}-linux-${ARCH}.xz.sha256.asc" "dist/${ARCH}/gitea-${VERSION}-linux-${ARCH}.xz.sha256"
done
# Verify Checksums
for ARCH in "${ARCHS[@]}"; do
echo "Verifying SHA256 checksum for ${ARCH}..."
(cd "dist/${ARCH}" && sha256sum -c gitea-${VERSION}-linux-${ARCH}.xz.sha256)
done
# expand the Gitea binray to the target
for ARCH in "${ARCHS[@]}"; do
xz -dc "dist/${ARCH}/gitea-${VERSION}-linux-${ARCH}.xz" > "${ARCH}/opt/gitea/bin/gitea" || { echo "❌ Extraction failed for ${ARCH}"; exit 1; }
# Verify the extracted file isn't empty
if [[ ! -s "${ARCH}/opt/gitea/bin/gitea" ]]; then
echo "❌ Extracted file is empty for ${ARCH}. Something went wrong!"
exit 1
fi
chmod +x "${ARCH}/opt/gitea/bin/gitea"
done
# Build Debian Packages
for ARCH in "${ARCHS[@]}"; do
echo "Building package for ${ARCH}..."
dpkg-deb --build "${ARCH}" "gitea_${VERSION}_${ARCH}.deb"
done
echo "All packages built successfully:"
ls -lh gitea_${VERSION}_*.deb

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1 +0,0 @@
gitea admin extra