Migration gitea => forgejo

This commit is contained in:
Thomas Legay 2023-06-12 15:30:48 +02:00
parent 797dff685b
commit a7592a2b38
15 changed files with 42 additions and 34 deletions

View file

@ -51,7 +51,7 @@ To enter in temporary filesystem
- [crfpp](./ressources/crfpp) - [crfpp](./ressources/crfpp)
- [element-web](./ressources/element-web) - [element-web](./ressources/element-web)
- [flame](./ressources/flame) - [flame](./ressources/flame)
- [gitea](./ressources/gitea) - [forgejo](./ressources/forgejo)
- [glpi](./ressources/glpi) - [glpi](./ressources/glpi)
- [gotify](./ressources/gotify) - [gotify](./ressources/gotify)
- [grocy](./ressources/grocy) - [grocy](./ressources/grocy)

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/bash
base_package_upgrade(){ base_package_upgrade(){
apt update apt update
@ -38,7 +38,7 @@ configure_depot_nodejs() {
} }
install_go() { install_go() {
GO_VERSION=1.20.4 GO_VERSION=1.20.5
[ ! "$1" == "" ] && GO_VERSION=$1 [ ! "$1" == "" ] && GO_VERSION=$1
PATH=$PATH:/usr/local/go/bin PATH=$PATH:/usr/local/go/bin
if [ ! "$(go version)" == "go version go${GO_VERSION} linux/amd64" ] ; if [ ! "$(go version)" == "go version go${GO_VERSION} linux/amd64" ] ;

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/bash
LANGUAGE=C LANGUAGE=C
LC_ALL=C LC_ALL=C
LANG=C LANG=C
@ -47,7 +47,7 @@ zdebmaker_inject(){
zdebmaker_getDep zdebmaker_getDep
sudo mount cache/${APP} ${MOUNT_PATH}/${APP}/ sudo mount cache/${APP} ${MOUNT_PATH}/${APP}/
[ -d ${MOUNT_PATH}/${APP}/tmp/dist ] && sudo rm -fr ${MOUNT_PATH}/${APP}/tmp/dist/ [ -d ${MOUNT_PATH}/${APP}/tmp/dist ] && sudo rm -fr ${MOUNT_PATH}/${APP}/tmp/dist/
sudo mkdir ${MOUNT_PATH}/${APP}/tmp/dist/ sudo mkdir -p ${MOUNT_PATH}/${APP}/tmp/dist/
[ -d ${MOUNT_PATH}/${APP}/tmp/src ] && sudo rm -rf ${MOUNT_PATH}/${APP}/tmp/src/ [ -d ${MOUNT_PATH}/${APP}/tmp/src ] && sudo rm -rf ${MOUNT_PATH}/${APP}/tmp/src/
sudo mkdir -p ${MOUNT_PATH}/${APP}/tmp/src sudo mkdir -p ${MOUNT_PATH}/${APP}/tmp/src
sudo echo . /tmp/src/exec_in_chroot.sh | sudo tee ${MOUNT_PATH}/${APP}/root/.bashrc sudo echo . /tmp/src/exec_in_chroot.sh | sudo tee ${MOUNT_PATH}/${APP}/root/.bashrc

View file

@ -1,9 +1,9 @@
#### gitea #### gitea
##### Information ##### Information
Site : https://gitea.io Site : https://codeberg.org/forgejo/forgejo
Source : https://github.com/go-gitea/gitea/ Source : https://codeberg.org/forgejo/forgejo
##### Install ##### Install
@ -11,9 +11,9 @@ Source : https://github.com/go-gitea/gitea/
apt install -y wget ca-certificates apt install -y wget ca-certificates
wget -qO - https://deb.lgy.fr/install.sh | bash wget -qO - https://deb.lgy.fr/install.sh | bash
apt-get update apt-get update
apt-get install -y gitea apt-get install -y forgejo
systemctl enable --now gitea systemctl enable --now forgejo
#configuration with http://<ip>:3000 #configuration with http://<ip>:3000
``` ```

View file

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
VERSION=1.19.3 VERSION=1.19.3-0
APP=gitea APP=forgejo
DEPOT=https://github.com/go-gitea/gitea.git DEPOT=https://codeberg.org/forgejo/forgejo
GIT_VERSION=v${VERSION} GIT_VERSION=v${VERSION}
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M) DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bullseye DEBIAN_VERSION_CODENAME=bookworm
IMAGE_SIZE=6 IMAGE_SIZE=6
PACKAGE_DEPENDENCY="build-essential nodejs" PACKAGE_DEPENDENCY="build-essential nodejs"
@ -28,8 +28,16 @@ build() {
makedeb(){ makedeb(){
PATH_DEB=/tmp/src/rootfs PATH_DEB=/tmp/src/rootfs
mkdir -p \
${PATH_DEB}/etc/${APP}/ \
${PATH_DEB}/usr/bin/ \
${PATH_DEB}/usr/lib/systemd/system/ \
${PATH_DEB}/var/lib/gitea/
cp ${PATH_DEB}/gitea.service ${PATH_DEB}/usr/lib/systemd/system/
cp /tmp/${APP}/gitea ${PATH_DEB}/usr/bin/ cp /tmp/${APP}/gitea ${PATH_DEB}/usr/bin/
cp /tmp/${APP}/custom/conf/app.example.ini ${PATH_DEB}/etc/gitea/app.ini ln -s /usr/bin/gitea ${PATH_DEB}/usr/bin/forgejo
cp /tmp/${APP}/custom/conf/app.example.ini ${PATH_DEB}/etc/${APP}/app.ini
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
} }

View file

@ -0,0 +1 @@
/etc/forgejo/app.ini

View file

@ -1,8 +1,8 @@
Package: gitea Package: forgejo
Version: %VERSION% Version: %VERSION%
Section: contrib Section: contrib
Priority: optional Priority: optional
Architecture: all Architecture: all
Depends: git Depends: git
Maintainer: Thomas Legay <thomas@lgy.fr> Maintainer: Thomas Legay <thomas@lgy.fr>
Description: gitea Description: forgejo

View file

@ -0,0 +1,6 @@
#!/bin/bash
id forgejo &> /dev/null || useradd forgejo -r -s /bin/false -d /var/lib/forgejo/
chown -R forgejo:forgejo /var/lib/forgejo/
chown forgejo:forgejo /etc/forgejo/app.ini

View file

@ -1,5 +1,5 @@
[Unit] [Unit]
Description=Gitea (Git with a cup of tea) Description=Forgejo
After=syslog.target After=syslog.target
After=network.target After=network.target
@ -12,22 +12,22 @@ After=network.target
#LimitNOFILE=65535 #LimitNOFILE=65535
RestartSec=2s RestartSec=2s
Type=simple Type=simple
User=gitea User=forgejo
Group=gitea Group=forgejo
WorkingDirectory=/var/lib/gitea/ WorkingDirectory=/var/lib/forgejo/
# If using Unix socket: tells systemd to create the /run/gitea folder, which will contain the gitea.sock file # If using Unix socket: tells systemd to create the /run/forgejo folder, which will contain the forgejo.sock file
# (manually creating /run/gitea doesn't work, because it would not persist across reboots) # (manually creating /run/forgejo doesn't work, because it would not persist across reboots)
#RuntimeDirectory=gitea #RuntimeDirectory=forgejo
ExecStart=/usr/bin/gitea web --config /etc/gitea/app.ini ExecStart=/usr/bin/forgejo web --config /etc/forgejo/app.ini
Restart=always Restart=always
Environment=USER=gitea HOME=/var/lib/gitea/ GITEA_WORK_DIR=/var/lib/gitea/ Environment=USER=forgejo HOME=/var/lib/forgejo/ FORGEJO_WORK_DIR=/var/lib/forgejo/ GITEA_WORK_DIR=/var/lib/forgejo/
# If you install Git to directory prefix other than default PATH (which happens # If you install Git to directory prefix other than default PATH (which happens
# for example if you install other versions of Git side-to-side with # for example if you install other versions of Git side-to-side with
# distribution version), uncomment below line and add that prefix to PATH # distribution version), uncomment below line and add that prefix to PATH
# Don't forget to place git-lfs binary on the PATH below if you want to enable # Don't forget to place git-lfs binary on the PATH below if you want to enable
# Git LFS support # Git LFS support
# If you want to bind Gitea to a port below 1024, uncomment # If you want to bind forgejo to a port below 1024, uncomment
# the two values below, or use socket activation to pass Gitea its ports as above # the two values below, or use socket activation to pass forgejo its ports as above
### ###
#CapabilityBoundingSet=CAP_NET_BIND_SERVICE #CapabilityBoundingSet=CAP_NET_BIND_SERVICE
#AmbientCapabilities=CAP_NET_BIND_SERVICE #AmbientCapabilities=CAP_NET_BIND_SERVICE

View file

@ -1 +0,0 @@
/etc/gitea/app.ini

View file

@ -1,6 +0,0 @@
#!/bin/bash
id gitea &> /dev/null || useradd gitea -r -s /bin/false -d /var/lib/gitea/
chown -R gitea:gitea /var/lib/gitea/
chown gitea:gitea /etc/gitea/app.ini