Initialize Git Repository: 'Gitea'
All checks were successful
Gitea (Bookworm) / Gitea [arm64] (push) Successful in 1m1s
Gitea (Bookworm) / Gitea [amd64] (push) Successful in 1m8s
Gitea (Noble) / Gitea [arm64] (push) Successful in 1m12s
Gitea (Noble) / Gitea [amd64] (push) Successful in 1m17s
Gitea (Trixie) / Gitea [arm64] (push) Successful in 1m3s
Gitea (Trixie) / Gitea [amd64] (push) Successful in 1m10s
All checks were successful
Gitea (Bookworm) / Gitea [arm64] (push) Successful in 1m1s
Gitea (Bookworm) / Gitea [amd64] (push) Successful in 1m8s
Gitea (Noble) / Gitea [arm64] (push) Successful in 1m12s
Gitea (Noble) / Gitea [amd64] (push) Successful in 1m17s
Gitea (Trixie) / Gitea [arm64] (push) Successful in 1m3s
Gitea (Trixie) / Gitea [amd64] (push) Successful in 1m10s
This commit is contained in:
1
root/DEBIAN/conffiles
Normal file
1
root/DEBIAN/conffiles
Normal file
@@ -0,0 +1 @@
|
||||
/etc/gitea/app.ini
|
||||
9
root/DEBIAN/control
Normal file
9
root/DEBIAN/control
Normal file
@@ -0,0 +1,9 @@
|
||||
Package: gitea
|
||||
Version: 1.25.4
|
||||
Architecture:
|
||||
Installed-Size:
|
||||
Priority: optional
|
||||
Section: misc
|
||||
Homepage: http://www.privlab.it
|
||||
Maintainer: PrivLab <repository@privlab.it>
|
||||
Description: Gitea DevOps Platform
|
||||
44
root/DEBIAN/postinst
Normal file
44
root/DEBIAN/postinst
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
if [ -d '/run/systemd/system' ]; then
|
||||
/usr/bin/systemctl --system daemon-reload > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
|
||||
case "${1}" in
|
||||
configure)
|
||||
if [ -x '/usr/bin/deb-systemd-helper' ]; then
|
||||
/usr/bin/deb-systemd-helper unmask 'gitea.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
if /usr/bin/deb-systemd-helper --quiet was-enabled 'gitea.service'; then
|
||||
/usr/bin/deb-systemd-helper enable 'gitea.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
else
|
||||
/usr/bin/deb-systemd-helper update-state 'gitea.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
if [ -x '/etc/init.d/gitea' ]; then
|
||||
/usr/sbin/update-rc.d 'gitea' defaults > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
/usr/bin/install --directory --group='git' --mode='750' --owner='git' '/var/lib/gitea'
|
||||
/usr/bin/install --directory --group='git' --mode='750' --owner='git' '/var/log/gitea'
|
||||
/usr/bin/install --directory --group='git' --mode='750' --owner='git' '/var/logrotate/gitea'
|
||||
/usr/bin/chown --quiet --recursive 'git' '/etc/gitea'
|
||||
if [ -x '/usr/bin/deb-systemd-invoke' ]; then
|
||||
/usr/bin/systemctl --system daemon-reload > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
if [ -n "${2}" ]; then
|
||||
_dh_action='restart'
|
||||
else
|
||||
_dh_action='start'
|
||||
fi
|
||||
/usr/bin/deb-systemd-invoke "${_dh_action}" 'gitea.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
36
root/DEBIAN/postrm
Normal file
36
root/DEBIAN/postrm
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
if [ -d '/run/systemd/system' ]; then
|
||||
/usr/bin/systemctl --system daemon-reload > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
|
||||
case "${1}" in
|
||||
remove)
|
||||
if [ -x '/usr/bin/deb-systemd-helper' ]; then
|
||||
/usr/bin/deb-systemd-helper mask 'gitea.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
;;
|
||||
purge)
|
||||
if [ -x '/usr/bin/deb-systemd-helper' ]; then
|
||||
/usr/bin/deb-systemd-helper purge 'gitea.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
/usr/bin/deb-systemd-helper unmask 'gitea.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
if /usr/bin/getent passwd 'gitea' > '/dev/null' 2>&1; then
|
||||
/usr/sbin/deluser 'gitea' > '/dev/null' 2>&1
|
||||
fi
|
||||
if /usr/bin/getent group 'gitea' > '/dev/null' 2>&1; then
|
||||
/usr/sbin/deluser --group 'gitea' > '/dev/null' 2>&1
|
||||
fi
|
||||
/usr/bin/rm --force --recursive '/var/lib/gitea'
|
||||
;;
|
||||
esac
|
||||
|
||||
/usr/bin/rm --force --recursive '/var/log/gitea'
|
||||
/usr/bin/rm --force --recursive '/var/logrotate/gitea'
|
||||
20
root/DEBIAN/preinst
Normal file
20
root/DEBIAN/preinst
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
case "${1}" in
|
||||
install)
|
||||
if ! /usr/bin/getent passwd 'git' > '/dev/null' 2>&1; then
|
||||
/usr/sbin/adduser --quiet \
|
||||
--system \
|
||||
--home '/var/lib/gitea/home' \
|
||||
--shell '/usr/sbin/nologin' \
|
||||
--no-create-home \
|
||||
--group \
|
||||
--disabled-password \
|
||||
--disabled-login \
|
||||
'git' > '/dev/null' 2>&1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
19
root/DEBIAN/prerm
Normal file
19
root/DEBIAN/prerm
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
case "${1}" in
|
||||
remove)
|
||||
if [ -x '/usr/bin/deb-systemd-invoke' ]; then
|
||||
/usr/bin/deb-systemd-invoke stop 'gitea.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
/usr/bin/deb-systemd-invoke disable 'gitea.service' > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
if [ -x '/etc/init.d/gitea' ]; then
|
||||
/usr/sbin/update-rc.d 'gitea' remove > '/dev/null' 2>&1 || \
|
||||
/usr/bin/true
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
2875
root/etc/gitea/app.ini
Normal file
2875
root/etc/gitea/app.ini
Normal file
File diff suppressed because it is too large
Load Diff
114
root/etc/init.d/gitea
Normal file
114
root/etc/init.d/gitea
Normal file
@@ -0,0 +1,114 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: gitea
|
||||
# Required-Start: $local_fs $network $remote_fs
|
||||
# Required-Stop: $local_fs $network $remote_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Private, Fast, Reliable DevOps Platform
|
||||
# Description: A lightweight, self-hosted Git service that provides a
|
||||
# web-based interface for managing Git repositories. It is
|
||||
# designed to be easy to install and configure, making it
|
||||
# accessible for individuals and organizations looking to
|
||||
# host their own version control system. Gitea offers
|
||||
# features such as issue tracking, pull requests, code
|
||||
# reviews, and a built-in wiki, all while maintaining a
|
||||
# user-friendly experience. Its open-source nature allows
|
||||
# for customization and community contributions, making it
|
||||
# a popular choice for developers seeking an alternative to
|
||||
# larger platforms like GitHub or GitLab.
|
||||
|
||||
NAME='gitea'
|
||||
DESC='Gitea DevOps Platform'
|
||||
USER='git'
|
||||
GROUP='git'
|
||||
PIDFOLDER="/run/${NAME}"
|
||||
PIDFILE="${PIDFOLDER}/${NAME}.pid"
|
||||
DAEMON='/usr/sbin/gitea'
|
||||
DAEMON_CONFIG='/etc/gitea/app.ini'
|
||||
DAEMON_OPTS="web --config ${DAEMON_CONFIG}"
|
||||
|
||||
set -e
|
||||
|
||||
secrets() {
|
||||
if [ ! -f '/etc/gitea/internal_token' ]; then
|
||||
/usr/sbin/gitea generate secret INTERNAL_TOKEN > '/etc/gitea/internal_token'
|
||||
/usr/bin/chown "${USER}":"${GROUP}" '/etc/gitea/internal_token'
|
||||
/usr/bin/chmod 0440 '/etc/gitea/internal_token'
|
||||
fi
|
||||
if [ ! -f '/etc/gitea/jwt_secret' ]; then
|
||||
/usr/sbin/gitea generate secret JWT_SECRET > '/etc/gitea/jwt_secret'
|
||||
/usr/bin/chown "${USER}":"${GROUP}" '/etc/gitea/jwt_secret'
|
||||
/usr/bin/chmod 0440 '/etc/gitea/jwt_secret'
|
||||
fi
|
||||
if [ ! -f '/etc/gitea/lfs_jwt_secret' ]; then
|
||||
/usr/sbin/gitea generate secret LFS_JWT_SECRET > '/etc/gitea/lfs_jwt_secret'
|
||||
/usr/bin/chown "${USER}":"${GROUP}" '/etc/gitea/lfs_jwt_secret'
|
||||
/usr/bin/chmod 0440 '/etc/gitea/lfs_jwt_secret'
|
||||
fi
|
||||
if [ ! -f '/etc/gitea/secret_key' ]; then
|
||||
/usr/sbin/gitea generate secret SECRET_KEY > '/etc/gitea/secret_key'
|
||||
/usr/bin/chown "${USER}":"${GROUP}" '/etc/gitea/secret_key'
|
||||
/usr/bin/chmod 0440 '/etc/gitea/secret_key'
|
||||
fi
|
||||
}
|
||||
|
||||
[ -f "${DAEMON_CONFIG}" ]
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
[ -x "${DAEMON}" ]
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
secrets
|
||||
/usr/bin/install --directory --group="${GROUP}" ---mode='0755' --owner="${USER}" "${PIDFOLDER}"
|
||||
log_daemon_msg "Starting ${DESC}" "${NAME}"
|
||||
if /usr/sbin/start-stop-daemon --quiet \
|
||||
--start \
|
||||
--oknodo \
|
||||
--make-pidfile \
|
||||
--pidfile "${PIDFILE}" \
|
||||
--user "${USER}" \
|
||||
--group "${GROUP}" \
|
||||
--exec "${DAEMON}" -- "${DAEMON_OPTS}"; then
|
||||
log_end_msg 0
|
||||
else
|
||||
log_end_msg 1
|
||||
/usr/bin/test -f "${PIDFILE}" && \
|
||||
/usr/bin/rm --force "${PIDFILE}"
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping ${DESC}" "${NAME}"
|
||||
if /usr/sbin/start-stop-daemon --quiet \
|
||||
--stop \
|
||||
--oknodo \
|
||||
--retry 30 \
|
||||
--remove-pidfile \
|
||||
--pidfile "${PIDFILE}" \
|
||||
--user "${USER}" \
|
||||
--group "${GROUP}" \
|
||||
--exec "${DAEMON}"; then
|
||||
/usr/bin/test -f "${PIDFILE}" && \
|
||||
/usr/bin/rm --force "${PIDFILE}"
|
||||
log_end_msg 0
|
||||
else
|
||||
log_end_msg 1
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
"${0}" stop
|
||||
"${0}" start
|
||||
;;
|
||||
status)
|
||||
status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}" && \
|
||||
exit 0 || \
|
||||
exit "${?}"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: /etc/init.d/${NAME} {start|stop|restart|status}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
71
root/etc/logrotate.d/gitea
Normal file
71
root/etc/logrotate.d/gitea
Normal file
@@ -0,0 +1,71 @@
|
||||
/var/log/gitea/*.log {
|
||||
# Truncate the original log file in place after creating a copy,
|
||||
# instead of moving the old log file and optionally creating a
|
||||
# new one. It can be used when some program cannot be told to
|
||||
# close its logfile and thus might continue writing (appending)
|
||||
# to the previous log file forever. Note that there is a very
|
||||
# small time slice between copying the file and truncating it, so
|
||||
# some logging data might be lost. When this option is used, the
|
||||
# create option will have no effect, as the old log file stays in
|
||||
# place.
|
||||
copytruncate
|
||||
|
||||
# Log files are rotated every day.
|
||||
daily
|
||||
|
||||
# Archive old versions of log files adding a daily extension like
|
||||
# YYYYMMDD instead of simply adding a number. The extension may
|
||||
# be configured using the dateformat option.
|
||||
dateext
|
||||
|
||||
# Specify the extension for dateext using the notation similar to
|
||||
# strftime(3) function. Only %Y %m %d and %s specifiers are allowed.
|
||||
# The default value is -%Y%m%d. Note that also the character
|
||||
# separating log name from the extension is part of the dateformat
|
||||
# string. The system clock must be set past Sep 9th 2001 for %s to
|
||||
# work correctly. Note that the datestamps generated by this format
|
||||
# must be lexically sortable (i.e., first the year, then the month
|
||||
# then the day. e.g., 2001/12/01 is ok, but 01/12/2001 is not, since
|
||||
# 01/11/2002 would sort lower while it is later). This is because when
|
||||
# using the rotate option, logrotate sorts all rotated filenames to
|
||||
# find out which logfiles are older and should be removed.
|
||||
dateformat .%Y-%m-%d
|
||||
|
||||
# Use yesterday's instead of today's date to create the dateext
|
||||
# extension, so that the rotated log file has a date in its name that
|
||||
# is the same as the timestamps within it.
|
||||
dateyesterday
|
||||
|
||||
# Postpone compression of the previous log file to the next rotation
|
||||
# cycle. This only has effect when used in combination with compress.
|
||||
# It can be used when some program cannot be told to close its logfile
|
||||
# and thus might continue writing to the previous log file for some time.
|
||||
delaycompress
|
||||
|
||||
# Do not copy the original log file and leave it in place.
|
||||
nocopy
|
||||
|
||||
# New log files are not created.
|
||||
nocreate
|
||||
|
||||
# Don't mail old log files to any address.
|
||||
nomail
|
||||
|
||||
# Do not use shred when deleting old log files.
|
||||
noshred
|
||||
|
||||
# Do not rotate the log if it is empty.
|
||||
notifempty
|
||||
|
||||
# Logs are moved into directory for rotation. The directory must be on the
|
||||
# same physical device as the log file being rotated, and is assumed to be
|
||||
# relative to the directory holding the log file unless an absolute path
|
||||
# name is specified. When this option is used all old versions of the log
|
||||
# end up in directory.
|
||||
olddir /var/logrotate/gitea
|
||||
|
||||
# Log files are rotated count times before being removed or mailed to the
|
||||
# address specified in a mail directive. If count is 0, old versions are
|
||||
# removed rather than rotated.
|
||||
rotate 7
|
||||
}
|
||||
33
root/lib/systemd/system/gitea.service
Normal file
33
root/lib/systemd/system/gitea.service
Normal file
@@ -0,0 +1,33 @@
|
||||
[Unit]
|
||||
Description=Gitea DevOps Platform
|
||||
ConditionPathExists=/etc/gitea/app.ini
|
||||
StartLimitBurst=3
|
||||
StartLimitIntervalSec=60
|
||||
After=network.target network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=on-failure
|
||||
ExecStartPre=/usr/bin/bash -c "umask '226'; /usr/bin/test -f '/etc/gitea/internal_token' || /usr/sbin/gitea generate secret INTERNAL_TOKEN > '/etc/gitea/internal_token'"
|
||||
ExecStartPre=/usr/bin/bash -c "umask '226'; /usr/bin/test -f '/etc/gitea/jwt_secret' || /usr/sbin/gitea generate secret JWT_SECRET > '/etc/gitea/jwt_secret'"
|
||||
ExecStartPre=/usr/bin/bash -c "umask '226'; /usr/bin/test -f '/etc/gitea/lfs_jwt_secret' || /usr/sbin/gitea generate secret LFS_JWT_SECRET > '/etc/gitea/lfs_jwt_secret'"
|
||||
ExecStartPre=/usr/bin/bash -c "umask '226'; /usr/bin/test -f '/etc/gitea/secret_key' || /usr/sbin/gitea generate secret SECRET_KEY > '/etc/gitea/secret_key'"
|
||||
ExecStart=/usr/sbin/gitea web --config /etc/gitea/app.ini
|
||||
ExecStartPost=/usr/bin/sh -c "umask '022'; /usr/bin/pgrep --newest 'gitea' > '/run/gitea/gitea.pid'"
|
||||
ExecStop=/usr/bin/rm --force '/run/gitea/gitea.pid'
|
||||
User=git
|
||||
Group=git
|
||||
PrivateDevices=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=strict
|
||||
ReadWriteDirectories=/etc/gitea
|
||||
ReadWriteDirectories=/var/lib/gitea
|
||||
ReadWriteDirectories=/var/log/gitea
|
||||
RuntimeDirectory=gitea
|
||||
RuntimeDirectoryMode=755
|
||||
RuntimeDirectoryPreserve=yes
|
||||
WorkingDirectory=/var/lib/gitea
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
2
root/usr/lib/sysusers.d/gitea.conf
Normal file
2
root/usr/lib/sysusers.d/gitea.conf
Normal file
@@ -0,0 +1,2 @@
|
||||
g git - -
|
||||
u git - "git" /var/lib/gitea/home /usr/bin/bash
|
||||
Reference in New Issue
Block a user