Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Forgejo to dietpi-software #7071

Merged
merged 9 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/dietpi-software.bash
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Process_Software()
7) aCOMMANDS[i]='ffmpeg -version';;
9) aCOMMANDS[i]='node -v';;
#16) aSERVICES[i]='microblog-pub' aTCP[i]='8007';; Service enters a CPU-intense internal error loop until it has been configured interactively via "microblog-pub configure", hence it is not enabled and started anymore after install but instead as part of "microblog-pub configure"
17) aCOMMANDS[i]='git -v';;
17) aCOMMANDS[i]='git --version';; # from Bookworm on, the shorthand "-v" is supported
28) aSERVICES[i]='vncserver' aTCP[i]='5901';;
29) aSERVICES[i]='xrdp' aTCP[i]='3389';;
30) aSERVICES[i]='nxserver' aTCP[i]='4000';;
Expand Down Expand Up @@ -197,6 +197,7 @@ Process_Software()
172) aSERVICES[i]='wg-quick@wg0' aUDP[i]='51820';;
174) aCOMMANDS[i]='gimp -v';;
176) aSERVICES[i]='mycroft';;
177) aSERVICES[i]='forgejo' aTCP[i]='3000'; (( $arch < 10 )) && aDELAY[i]=30;;
178) aSERVICES[i]='jellyfin' aTCP[i]='8097'; [[ $arch == [23] ]] && aDELAY[i]=300;; # jellyfin[9983]: arm-binfmt-P: ../../target/arm/translate.c:9659: thumb_tr_translate_insn: Assertion `(dc->base.pc_next & 1) == 0' failed. ### jellyfin[9983]: qemu: uncaught target signal 6 (Aborted) - core dumped ### about 5 times
179) aSERVICES[i]='komga' aTCP[i]='2037'; (( $arch == 10 )) && aDELAY[i]=30; (( $arch < 10 )) && aDELAY[i]=300;;
180) aSERVICES[i]='bazarr' aTCP[i]='6767'; (( $arch == 10 )) && aDELAY[i]=30; (( $arch < 10 )) && aDELAY[i]=90;;
Expand Down Expand Up @@ -244,7 +245,7 @@ do
8|33|131|179|206) Process_Software 196;;
32|148|119) Process_Software 128;;
129) Process_Software 88 89 128 webserver;;
49|165) Process_Software 88;;
49|165|177) Process_Software 0 17 88;;
#61) Process_Software 60;; # Cannot be installed in CI
125) Process_Software 194;;
#86|134|185) Process_Software 162;; # Docker does not start in systemd containers (without dedicated network)
Expand Down
1 change: 1 addition & 0 deletions .meta/dietpi-survey_report
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ shopt -s extglob
aSOFTWARE_NAME9_4[i]=${aSOFTWARE_NAME9_3[i]}
aSOFTWARE_NAME9_5[i]=${aSOFTWARE_NAME9_4[i]}
done
aSOFTWARE_NAME9_5[177]='Forgejo'

# Pre-create software counter array so that we can see also software (available in newest version) with 0 installs
for i in "${aSOFTWARE_NAME9_5[@]}"
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
v9.5
(2024-06-08)

New software:
- Forgejo | This Gitea fork has been added to our software library. Read about the background of this fork here: https://forgejo.org/2022-12-15-hello-forgejo/. Many thanks to @Cs137 for requesting and @jcnils for implementing this software option: https://github.com/MichaIng/DietPi/discussions/6133, https://github.com/MichaIng/DietPi/pull/7071

Enhancements:
- Images | New DietPi images won't contain the "gnupg" package anymore, but "gpg" only, since other features of the suite are not required for our scripts anymore. E.g. "dirmngr" for interacting with keyservers, and "gpg-agent" for key passphrase inputs are hence missing. "gpg" however prints very clear error messages about what is missing. Let us know whether you find one of those GnuPG features too essential to not be pre-installed.
- Radxa ZERO 3 | Onboard WiFi does now work OOTB on early ZERO 3W revisions with AP6212 WiFi chip.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ Links to hardware and software manufacturers, sources and build instructions use
- [Homebridge](https://github.com/homebridge/homebridge)
- [ADS-B Feeder](https://github.com/dirkhh/adsb-feeder-image)
- [Kavita](https://github.com/Kareadita/Kavita)
- [Forgejo](https://codeberg.org/forgejo/forgejo)

---

Expand Down
1 change: 1 addition & 0 deletions dietpi/dietpi-services
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ _EOF_
'urbackupsrv'
'gogs'
'gitea'
'forgejo'
'vaultwarden'
'filebrowser'

Expand Down
71 changes: 69 additions & 2 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ Available commands:
aSOFTWARE_CATX[$software_id]=4
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/cloud/#gogs'
aSOFTWARE_DEPS[$software_id]='17 88 0'
aSOFTWARE_CONFLICTS[$software_id]='165'
aSOFTWARE_CONFLICTS[$software_id]='165 177'
#------------------
software_id=50
aSOFTWARE_NAME[$software_id]='Syncthing'
Expand Down Expand Up @@ -838,10 +838,20 @@ Available commands:
aSOFTWARE_CATX[$software_id]=4
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/cloud/#gitea'
aSOFTWARE_DEPS[$software_id]='17 88 0'
aSOFTWARE_CONFLICTS[$software_id]='49'
aSOFTWARE_CONFLICTS[$software_id]='49 177'
# - RISC-V: Missing binary: https://github.com/go-gitea/gitea/releases
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0
#------------------
software_id=177
aSOFTWARE_NAME[$software_id]='Forgejo'
aSOFTWARE_DESC[$software_id]='Self-hosted lightweight software forge. Fork of Gitea.'
aSOFTWARE_CATX[$software_id]=4
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/cloud/#forgejo'
aSOFTWARE_DEPS[$software_id]='17 88 0'
aSOFTWARE_CONFLICTS[$software_id]='49 165'
# - RISC-V: Missing binary: https://codeberg.org/forgejo/forgejo/releases
aSOFTWARE_AVAIL_G_HW_ARCH[$software_id,11]=0
#------------------
software_id=183
aSOFTWARE_NAME[$software_id]='vaultwarden'
aSOFTWARE_DESC[$software_id]='Unofficial Bitwarden password manager server written in Rust'
Expand Down Expand Up @@ -10630,6 +10640,52 @@ _EOF_
[[ -f '/mnt/dietpi_userdata/gitea/custom/conf/app.ini' ]] && G_CONFIG_INJECT 'RUN_USER[[:blank:]]' 'RUN_USER = gitea' /mnt/dietpi_userdata/gitea/custom/conf/app.ini
fi

if To_Install 177 forgejo # Forgejo
then
# ARMv7: Dedicated binaries are not provided: https://codeberg.org/forgejo/forgejo/releases
case $G_HW_ARCH in
3) local arch='arm64';;
10) local arch='amd64';;
*) local arch='arm-6';;
esac

local fallback_url="https://codeberg.org/forgejo/forgejo/releases/download/v7.0.3/forgejo-7.0.3-linux-$arch.xz"
Download_Install "$(curl -sSfL 'https://codeberg.org/api/v1/repos/forgejo/forgejo/releases/latest' | mawk -v RS=, -F\" "/^\"browser_download_url\":\".*-linux-$arch\.xz\"/{print \$4;exit}")" /mnt/dietpi_userdata/forgejo/forgejo

# User
Create_User -d /mnt/dietpi_userdata/forgejo -s /bin/dash forgejo

# Permissions
G_EXEC chown -R forgejo:forgejo /mnt/dietpi_userdata/forgejo
G_EXEC chmod +x /mnt/dietpi_userdata/forgejo/forgejo

# Database
/boot/dietpi/func/create_mysql_db forgejo forgejo "$GLOBAL_PW"

# Service
cat << '_EOF_' > /etc/systemd/system/forgejo.service
[Unit]
Description=Forgejo (DietPi)
Wants=network-online.target
After=network-online.target mariadb.service

[Service]
User=forgejo
LogsDirectory=forgejo
WorkingDirectory=/mnt/dietpi_userdata/forgejo
ExecStart=/mnt/dietpi_userdata/forgejo/forgejo web

# Hardening
ProtectSystem=full
PrivateDevices=yes
PrivateTmp=yes
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target
_EOF_
fi

if To_Install 163 gmediarender # GMediaRender
then
G_AGI gmediarender
Expand Down Expand Up @@ -13557,6 +13613,17 @@ _EOF_
Remove_Database gitea
fi

if To_Uninstall 177 # Forgejo
then
Remove_Service forgejo 1 1

# Data
[[ -d '/mnt/dietpi_userdata/forgejo' ]] && G_EXEC rm -R /mnt/dietpi_userdata/forgejo
[[ -d '/var/log/forgejo' ]] && G_EXEC rm -R /var/log/forgejo

Remove_Database forgejo
fi

if To_Uninstall 166 # Audiophonics PI-SPC
then
Remove_Service pi-spc
Expand Down