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)
- [element-web](./ressources/element-web)
- [flame](./ressources/flame)
- [gitea](./ressources/gitea)
- [forgejo](./ressources/forgejo)
- [glpi](./ressources/glpi)
- [gotify](./ressources/gotify)
- [grocy](./ressources/grocy)

View File

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

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/bash
LANGUAGE=C
LC_ALL=C
LANG=C
@ -47,7 +47,7 @@ zdebmaker_inject(){
zdebmaker_getDep
sudo mount cache/${APP} ${MOUNT_PATH}/${APP}/
[ -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/
sudo mkdir -p ${MOUNT_PATH}/${APP}/tmp/src
sudo echo . /tmp/src/exec_in_chroot.sh | sudo tee ${MOUNT_PATH}/${APP}/root/.bashrc

View File

@ -1,9 +1,9 @@
#### gitea
##### 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
@ -11,9 +11,9 @@ Source : https://github.com/go-gitea/gitea/
apt install -y wget ca-certificates
wget -qO - https://deb.lgy.fr/install.sh | bash
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
```

View File

@ -1,11 +1,11 @@
#!/bin/bash
VERSION=1.19.3
APP=gitea
DEPOT=https://github.com/go-gitea/gitea.git
VERSION=1.19.3-0
APP=forgejo
DEPOT=https://codeberg.org/forgejo/forgejo
GIT_VERSION=v${VERSION}
DEB_VERSION=${VERSION}-$(date +%Y%m%d%H%M)
DEBIAN_VERSION_CODENAME=bullseye
DEBIAN_VERSION_CODENAME=bookworm
IMAGE_SIZE=6
PACKAGE_DEPENDENCY="build-essential nodejs"
@ -28,8 +28,16 @@ build() {
makedeb(){
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}/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
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%
Section: contrib
Priority: optional
Architecture: all
Depends: git
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]
Description=Gitea (Git with a cup of tea)
Description=Forgejo
After=syslog.target
After=network.target
@ -12,22 +12,22 @@ After=network.target
#LimitNOFILE=65535
RestartSec=2s
Type=simple
User=gitea
Group=gitea
WorkingDirectory=/var/lib/gitea/
# If using Unix socket: tells systemd to create the /run/gitea folder, which will contain the gitea.sock file
# (manually creating /run/gitea doesn't work, because it would not persist across reboots)
#RuntimeDirectory=gitea
ExecStart=/usr/bin/gitea web --config /etc/gitea/app.ini
User=forgejo
Group=forgejo
WorkingDirectory=/var/lib/forgejo/
# If using Unix socket: tells systemd to create the /run/forgejo folder, which will contain the forgejo.sock file
# (manually creating /run/forgejo doesn't work, because it would not persist across reboots)
#RuntimeDirectory=forgejo
ExecStart=/usr/bin/forgejo web --config /etc/forgejo/app.ini
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
# for example if you install other versions of Git side-to-side with
# 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
# Git LFS support
# If you want to bind Gitea to a port below 1024, uncomment
# the two values below, or use socket activation to pass Gitea its ports as above
# If you want to bind forgejo to a port below 1024, uncomment
# the two values below, or use socket activation to pass forgejo its ports as above
###
#CapabilityBoundingSet=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