Skip to content

Forgejo

Forgejo is a community managed lightweight code hosting solution written in Go. It is published under the MIT license, and is a fork of Gitea.

Report an issue
updated
variables
3
images
1
author
seaswimmerthefsh@gmail.com
sha256
fc27ee20928c

Readme

Forgejo

Forgejo is a community managed lightweight code hosting solution written in Go. It is published under the MIT license.

Supported Versions

You can set the version in Version variable. You can use following values:

latest - latest stable release version - set the version according to this page: https://forgejo.org/releases/

Server Ports

Ports required to run the server in a table format.

Port default
App 3000
SSH 2020

Startup command

./forgejo web -p {{SERVER_PORT}} -c ./app.ini

The parts in blue are filled in by the panel when the server starts, from the variables below.

Docker image

  • Debian ghcr.io/ptero-eggs/yolks:debian

2 contributors

Variables

3 settings

  • Disable SSH

    Disable the SSH feature when it’s not available.

    env
    DISABLE_SSH
    default
    false
    rules
    required|string|in:true,false
    • viewable
  • SSH Port

    SSH port displayed in clone URL.

    env
    SSH_PORT
    default
    2020
    rules
    required|integer|between:1024,65535
    • viewable
  • Version

    Use either `latest` or a specific version, such as `1.21.7-0`.

    env
    VERSION
    default
    latest
    rules
    required|string|max:15
    • viewable
    • editable
Installation script 46 lines container ghcr.io/ptero-eggs/yolks:debian entrypoint bash show
## Forgejo Installscript
## Modified version of the Gitea installscript, see https://github.com/parkervcp/eggs/blob/master/software/gitea/egg-gitea.json

## update system
apt update
apt -y install --no-install-recommends jq curl ca-certificates dnsutils

## Variables
ARCH=$([[ "$(uname -m)" == "x86_64" ]] && echo "amd64" || echo "arm64")
LATEST=$(dig +short release.forgejo.org TXT | grep -oE '([0-9]+\.){2}[0-9]+(-[a-zA-Z0-9]+)*')


cd /mnt/server

## install forgejo
if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then
    echo -e "Downloading Forgejo $LATEST (latest)"
    URL=https://codeberg.org/forgejo/forgejo/releases/download/v${LATEST}/forgejo-${LATEST}-linux-${ARCH}
else
    echo -e "Downloading Forgejo $VERSION"
    URL=https://codeberg.org/forgejo/forgejo/releases/download/v${VERSION}/forgejo-${VERSION}-linux-${ARCH}
fi

echo -e "Download URL: $URL"

curl -sSL -o forgejo $URL

chmod +x forgejo

mkdir -p custom

if [ -f "/mnt/server/custom/app.ini" ]; then
    echo "Config file exists"
else
    echo "[server]
    LOCAL_ROOT_URL = http://${SERVER_IP}:${SERVER_PORT}/
    DOMAIN           = ${SERVER_IP}
    HTTP_PORT        = ${SERVER_PORT}
    ROOT_URL         = http://${SERVER_IP}:${SERVER_PORT}/
    DISABLE_SSH      = ${DISABLE_SSH}
    SSH_PORT         = ${SSH_PORT}" > /mnt/server/custom/app.ini
fi

echo -e "-------------------------------------------------"
echo -e "Installation completed"
echo -e "-------------------------------------------------"