This commit is contained in:
2024-06-17 17:34:06 +02:00
parent da23315ab9
commit 97b4e2d7b1
409 changed files with 4274 additions and 15396 deletions

136
gitea/CHANGELOG.md Normal file
View File

@@ -0,0 +1,136 @@
## 1.22.0 (01-06-2024)
- Update to latest version from go-gitea/gitea (changelog : https://github.com/go-gitea/gitea/releases)
## 1.21.11 (20-04-2024)
- Update to latest version from go-gitea/gitea (changelog : https://github.com/go-gitea/gitea/releases)
## 1.21.10 (30-03-2024)
- Update to latest version from go-gitea/gitea (changelog : https://github.com/go-gitea/gitea/releases)
## 1.21.9 (23-03-2024)
- Update to latest version from go-gitea/gitea
## 1.21.8 (16-03-2024)
- Update to latest version from go-gitea/gitea
## 1.21.7 (02-03-2024)
- Update to latest version from go-gitea/gitea
## 1.21.6-2 (27-02-2024)
- Minor bugs fixed
## 1.21.6 (24-02-2024)
- Update to latest version from go-gitea/gitea
## 1.21.5 (03-02-2024)
- Update to latest version from go-gitea/gitea
## 1.21.4 (20-01-2024)
- Update to latest version from go-gitea/gitea
## 1.21.3 (23-12-2023)
- Update to latest version from go-gitea/gitea
## 1.21.2 (14-12-2023)
- Update to latest version from go-gitea/gitea
## 1.21.1 (28-11-2023)
- Update to latest version from go-gitea/gitea
## 1.21.0-3 (21-11-2023)
- Minor bugs fixed
## 1.21.0 (15-11-2023)
- Update to latest version from go-gitea/gitea
## 1.20.5 (3-10-2023)
- Update to latest version from go-gitea/gitea
## 1.20.4-4 (23-09-2023)
- Minor bugs fixed
## 1.20.4-2 (09-09-2023)
- Minor bugs fixed
## 1.20.4 (8-09-2023)
- Update to latest version from go-gitea/gitea
## 1.20.3 (21-08-2023)
- Update to latest version from go-gitea/gitea
## 1.20.2 (05-08-2023)
- Update to latest version from go-gitea/gitea
## 1.20.1 (22-07-2023)
- Update to version 1.20.1 from go-gitea/gitea
## 1.20.0-2 (17-07-2023)
- Minor bugs fixed
## 1.20.0 (17-07-2023)
- Update to latest version from go-gitea/gitea
## 1.19.4 (5-07-2023)
- Update to latest version from go-gitea/gitea
## 1.19.3 (5-05-2023)
- Update to latest version from go-gitea/gitea
## 1.19.2 (28-04-2023)
- Update to latest version from go-gitea/gitea
## 1.19.1 (13-04-2023)
- Update to latest version from go-gitea/gitea
## 1.19.0 (24-03-2023)
- Update to latest version from go-gitea/gitea
- Implemented healthcheck
## 1.18.5 (23-02-2023)
- Update to latest version from go-gitea/gitea
## 1.18.4 (20-02-2023)
- Update to latest version from go-gitea/gitea
## 1.18.3 (23-01-2023)
- Update to latest version from go-gitea/gitea
## 1.18.2 (21-01-2023)
- Update to latest version from go-gitea/gitea
## 1.18.1 (19-01-2023)
- Update to latest version from go-gitea/gitea
## 1.18.0 (31-12-2022)
- Update to latest version from go-gitea/gitea
- WARNING : update to supervisor 2022.11 before installing
## 1.17.4 (22-12-2022)
- Update to version 1.17.4 from go-gitea/gitea
## 1.17.3 (17-10-2022)
- Update to version 1.17.3 from go-gitea/gitea
## 1.17.2.1 (26-09-2022)
- fixed error with ssl
## 1.17.2 (07-09-2022)
- Update to version 1.17.2 from go-gitea/gitea
## 1.17.1 (01-09-2022)
- Update to latest version from go-gitea/gitea

105
gitea/Dockerfile Normal file
View File

@@ -0,0 +1,105 @@
#################
# 1 Build Image #
#################
ARG BUILD_FROM=gitea/gitea
FROM ${BUILD_FROM}
##################
# 2 Modify Image #
##################
# Set S6 wait time
ENV S6_CMD_WAIT_FOR_SERVICES=1 \
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \
S6_SERVICES_GRACETIME=0
USER root
##################
# 3 Install apps #
##################
# Add rootfs
COPY rootfs/ /
# Uses /bin for compatibility purposes
# hadolint ignore=DL4005
RUN if [ ! -f /bin/sh ] && [ -f /usr/bin/sh ]; then ln -s /usr/bin/sh /bin/sh; fi && \
if [ ! -f /bin/bash ] && [ -f /usr/bin/bash ]; then ln -s /usr/bin/bash /bin/bash; fi
# Modules
ARG MODULES="00-banner.sh 00-global_var.sh 01-custom_script.sh"
# Automatic modules download
ADD "https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.templates/ha_automodules.sh" "/ha_automodules.sh"
RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh
# Manual apps
ENV PACKAGES=""
# Automatic apps & bashio
ADD "https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.templates/ha_autoapps.sh" "/ha_autoapps.sh"
RUN chmod 744 /ha_autoapps.sh && /ha_autoapps.sh "$PACKAGES" && rm /ha_autoapps.sh
EXPOSE 22 3000
################
# 4 Entrypoint #
################
# Add entrypoint
ENV S6_STAGE2_HOOK=/ha_entrypoint.sh
ADD "https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.templates/ha_entrypoint.sh" "/ha_entrypoint.sh"
# Entrypoint modifications
ADD "https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.templates/ha_entrypoint_modif.sh" "/ha_entrypoint_modif.sh"
RUN chmod 777 /ha_entrypoint.sh /ha_entrypoint_modif.sh && /ha_entrypoint_modif.sh && rm /ha_entrypoint_modif.sh
ENTRYPOINT [ "/ha_entrypoint.sh" ]
############
# 5 Labels #
############
ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_DESCRIPTION
ARG BUILD_NAME
ARG BUILD_REF
ARG BUILD_REPOSITORY
ARG BUILD_VERSION
LABEL \
io.hass.name="${BUILD_NAME}" \
io.hass.description="${BUILD_DESCRIPTION}" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.title="${BUILD_NAME}" \
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
org.opencontainers.image.vendor="Home Assistant Add-ons" \
org.opencontainers.image.authors="alexbelgium (https://github.com/alexbelgium)" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://github.com/alexbelgium" \
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}
#################
# 6 Healthcheck #
#################
ENV HEALTH_PORT="3000" \
HEALTH_URL=""
HEALTHCHECK \
--interval=5s \
--retries=5 \
--start-period=30s \
--timeout=25s \
CMD curl --fail "http://127.0.0.1:${HEALTH_PORT}${HEALTH_URL}" &>/dev/null || exit 1

56
gitea/README.md Normal file
View File

@@ -0,0 +1,56 @@
# Home assistant add-on: Gitea
[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
[![Donate][paypal-badge]](https://www.paypal.com/donate/?hosted_button_id=DZFULJZTP3UQA)
![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fgitea%2Fconfig.json)
![Ingress](https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fgitea%2Fconfig.json)
![Arch](https://img.shields.io/badge/dynamic/json?color=success&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fgitea%2Fconfig.json)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c6cf10bdbba45ecb202d7f579b5be0e)](https://www.codacy.com/gh/Mesteriis/hassio-addons-avm/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Mesteriis/hassio-addons-avm&utm_campaign=Badge_Grade)
[![GitHub Super-Linter](https://img.shields.io/github/actions/workflow/status/Mesteriis/hassio-addons-avm/weekly-supelinter.yaml?label=Lint%20code%20base)](https://github.com/Mesteriis/hassio-addons-avm/actions/workflows/weekly-supelinter.yaml)
[![Builder](https://img.shields.io/github/actions/workflow/status/Mesteriis/hassio-addons-avm/onpush_builder.yaml?label=Builder)](https://github.com/Mesteriis/hassio-addons-avm/actions/workflows/onpush_builder.yaml)
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee%20(no%20paypal)-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white
[paypal-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee%20with%20Paypal-0070BA?logo=paypal&style=flat&logoColor=white
_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_
[![Stargazers repo roster for @Mesteriis/hassio-addons-avm](https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.github/stars2.svg)](https://github.com/Mesteriis/hassio-addons-avm/stargazers)
![downloads evolution](https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/gitea/stats.png)
## About
[Gitea](https://about.gitea.com/) is a painless self-hosted all-in-one software development service, it includes Git hosting, code review, team collaboration, package registry and CI/CD. It is similar to GitHub, Bitbucket and GitLab.
Various tweaks and configuration options addition.
This addon is based on the [docker image](https://hub.docker.com/r/gitea/gitea).
## Configuration
```yaml
certfile: fullchain.pem #ssl certificate, must be located in /ssl
keyfile: privkey.pem #sslkeyfile, must be located in /ssl
ssl: should the app use https or not
APP_NAME: name of the app
DOMAIN: domain to be reached # default : homeassistant.local
ROOT_URL: customize root_url, should not be needed unless specific needs
```
Webui can be found at `<your-ip>:port`.
## Installation
The installation of this add-on is pretty straightforward and not different in
comparison to installing any other Hass.io add-on.
1. [Add my Hass.io add-ons repository][repository] to your Hass.io instance.
1. Install this add-on.
1. Click the `Save` button to store your configuration.
1. Start the add-on.
1. Check the logs of the add-on to see if everything went well.
1. Go to the webui, where you will initialize the app
1. Restart the addon, to apply any option that should be applied
[repository]: https://github.com/Mesteriis/hassio-addons-avm

66
gitea/apparmor.txt Normal file
View File

@@ -0,0 +1,66 @@
#include <tunables/global>
profile gitea_addon flags=(attach_disconnected,mediate_deleted) {
#include <abstractions/base>
capability,
file,
signal,
mount,
umount,
remount,
network udp,
network tcp,
network dgram,
network stream,
network inet,
network inet6,
network netlink raw,
network unix dgram,
capability setgid,
capability setuid,
capability sys_admin,
capability dac_read_search,
# capability dac_override,
# capability sys_rawio,
# S6-Overlay
/init ix,
/run/{s6,s6-rc*,service}/** ix,
/package/** ix,
/command/** ix,
/run/{,**} rwk,
/dev/tty rw,
/bin/** ix,
/usr/bin/** ix,
/usr/lib/bashio/** ix,
/etc/s6/** rix,
/run/s6/** rix,
/etc/services.d/** rwix,
/etc/cont-init.d/** rwix,
/etc/cont-finish.d/** rwix,
/init rix,
/var/run/** mrwkl,
/var/run/ mrwkl,
/dev/i2c-1 mrwkl,
# Files required
/dev/fuse mrwkl,
/dev/sda1 mrwkl,
/dev/sdb1 mrwkl,
/dev/nvme0 mrwkl,
/dev/nvme1 mrwkl,
/dev/mmcblk0p1 mrwkl,
/dev/* mrwkl,
/tmp/** mrkwl,
# Data access
/data/** rw,
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
ptrace (trace,read) peer=docker-default,
# docker daemon confinement requires explict allow rule for signal
signal (receive) set=(kill,term) peer=/usr/bin/docker,
}

9
gitea/build.json Normal file
View File

@@ -0,0 +1,9 @@
{
"build_from": {
"aarch64": "gitea/gitea:latest",
"amd64": "gitea/gitea:latest"
},
"codenotary": {
"signer": "alexandrep.github@gmail.com"
}
}

103
gitea/config.json Normal file
View File

@@ -0,0 +1,103 @@
{
"arch": [
"aarch64",
"amd64"
],
"codenotary": "alexandrep.github@gmail.com",
"description": "Gitea for Home Assistant",
"devices": [
"/dev/dri",
"/dev/dri/card0",
"/dev/dri/card1",
"/dev/dri/renderD128",
"/dev/vchiq",
"/dev/video10",
"/dev/video11",
"/dev/video12",
"/dev/video13",
"/dev/video14",
"/dev/video15",
"/dev/video16",
"/dev/ttyUSB0",
"/dev/sda",
"/dev/sdb",
"/dev/sdc",
"/dev/sdd",
"/dev/sde",
"/dev/sdf",
"/dev/sdg",
"/dev/nvme",
"/dev/nvme0n1p1",
"/dev/nvme0n1p2",
"/dev/nvme0n1p3",
"/dev/nvme1n1p1",
"/dev/nvme1n1p2",
"/dev/nvme1n1p3",
"/dev/nvme2n1p1",
"/dev/nvme2n1p2",
"/dev/nvme3n1p3",
"/dev/mmcblk",
"/dev/fuse",
"/dev/sda1",
"/dev/sdb1",
"/dev/sdc1",
"/dev/sdd1",
"/dev/sde1",
"/dev/sdf1",
"/dev/sdg1",
"/dev/sda2",
"/dev/sdb2",
"/dev/sdc2",
"/dev/sdd2",
"/dev/sde2",
"/dev/sdf2",
"/dev/sdg2",
"/dev/sda3",
"/dev/sdb3",
"/dev/sda4",
"/dev/sdb4",
"/dev/sda5",
"/dev/sda6",
"/dev/sda7",
"/dev/sda8",
"/dev/nvme0",
"/dev/nvme1",
"/dev/nvme2"
],
"image": "ghcr.io/alexbelgium/gitea-{arch}",
"init": false,
"map": [
"addon_config:rw",
"share:rw",
"ssl:rw"
],
"name": "Gitea",
"options": {
"APP_NAME": "Gitea for Homeassistant",
"DOMAIN": "homeassistant.local",
"certfile": "fullchain.pem",
"keyfile": "privkey.pem",
"ssl": false
},
"ports": {
"22/tcp": 2222,
"3000/tcp": 3000
},
"ports_description": {
"22/tcp": "ssh",
"3000/tcp": "Web interface"
},
"schema": {
"APP_NAME": "str?",
"DOMAIN": "str?",
"ROOT_URL": "str?",
"certfile": "str",
"keyfile": "str",
"ssl": "bool"
},
"slug": "gitea",
"udev": true,
"url": "https://github.com/Mesteriis/hassio-addons-avm/tree/master/gitea",
"version": "1.22.0",
"webui": "[PROTO:ssl]://[HOST]:[PORT:3000]"
}

BIN
gitea/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
gitea/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@@ -0,0 +1,74 @@
#!/usr/bin/env bashio
# shellcheck shell=bash
set -e
for file in /data/gitea/conf/app.ini /etc/templates/app.ini; do
if [ ! -f "$file" ]; then
continue
fi
##############
# SSL CONFIG #
##############
# Clean values
sed -i "/PROTOCOL/d" "$file"
sed -i "/CERT_FILE/d" "$file"
sed -i "/KEY_FILE/d" "$file"
# Add ssl
bashio::config.require.ssl
if bashio::config.true 'ssl'; then
PROTOCOL=https
bashio::log.info "ssl is enabled"
sed -i "/server/a PROTOCOL=https" "$file"
sed -i "/server/a CERT_FILE=/ssl/$(bashio::config 'certfile')" "$file"
sed -i "/server/a KEY_FILE=/ssl/$(bashio::config 'keyfile')" "$file"
chmod 744 /ssl/*
else
PROTOCOL=http
sed -i "/server/a PROTOCOL=http" "$file"
fi
##################
# ADAPT ROOT_URL #
##################
if bashio::config.has_value 'ROOT_URL'; then
bashio::log.blue "ROOT_URL set, using value : $(bashio::config 'ROOT_URL')"
else
ROOT_URL="$PROTOCOL://$(bashio::config 'DOMAIN'):$(bashio::addon.port 3000)"
bashio::log.blue "ROOT_URL not set, using extrapolated value : $ROOT_URL"
sed -i "/server/a ROOT_URL=$ROOT_URL" "$file"
fi
####################
# ADAPT PARAMETERS #
####################
for param in APP_NAME DOMAIN ROOT_URL; do
# Remove parameter
sed -i "/$param/d" "$file"
# Define parameter
if bashio::config.has_value "$param"; then
echo "parameter set : $param=$(bashio::config "$param")"
sed -i "/server/a $param = \"$(bashio::config "$param")\"" "$file"
# Allow at setup
sed -i "1a $param=\"$(bashio::config "$param")\"" /etc/s6/gitea/setup
fi
done
done
##############
# LAUNCH APP #
##############
bashio::log.info "Please wait while the app is loading !"
/./usr/bin/entrypoint

BIN
gitea/stats.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

8
gitea/updater.json Normal file
View File

@@ -0,0 +1,8 @@
{
"last_update": "01-06-2024",
"repository": "Mesteriis/hassio-addons-avm",
"slug": "gitea",
"source": "github",
"upstream_repo": "go-gitea/gitea",
"upstream_version": "1.22.0"
}