### Install Helm Chart Source: https://forgejo.org/docs/latest/user/packages/helm Install a Helm chart from the registry by first adding the repository, updating it, and then installing the chart with a specified name. ```bash helm repo add --username {username} --password {password} {repo} https://forgejo.example.com/api/packages/{owner}/helm helm repo update helm install {name} {repo}/{chart} ``` -------------------------------- ### GET /api/packages/{owner}/go Source: https://forgejo.org/docs/latest/user/packages/go Installs a Go package by configuring the GOPROXY environment variable to point to the Forgejo registry. ```APIDOC ## GET /api/packages/{owner}/go ### Description Instructs the Go toolchain to use the Forgejo registry as a proxy to install packages. ### Method GET ### Endpoint https://forgejo.example.com/api/packages/{owner}/go ### Parameters #### Path Parameters - **owner** (string) - Required - The owner of the package. ### Request Example GOPROXY=https://forgejo.example.com/api/packages/{owner}/go go install {package_name}@{package_version} ### Response #### Success Response (200) - **Content** (binary) - Returns the requested Go package module files. ``` -------------------------------- ### Install RPM Package Source: https://forgejo.org/docs/latest/user/packages/rpm Standard dnf commands to install packages from the configured registry. ```bash dnf install {package_name} dnf install {package_name}-{package_version}.{architecture} ``` -------------------------------- ### Enable and Start Forgejo Service Source: https://forgejo.org/docs/latest/admin/installation/binary Enables the Forgejo systemd service to start automatically on boot and then starts the service immediately. This makes Forgejo operational. ```bash sudo systemctl enable forgejo.service sudo systemctl start forgejo.service ``` -------------------------------- ### Install ALT Package Source: https://forgejo.org/docs/latest/user/packages/alt Install packages from the configured ALT registry using `apt-get`. You can install the latest version or a specific version. ```bash # use latest version apt-get install {package_name} # use specific version apt-get install {package_name}-{package_version} ``` -------------------------------- ### Install a Package Source: https://forgejo.org/docs/latest/user/packages/rpm Commands to install a package from the Forgejo RPM registry using `dnf`. ```APIDOC ## Install a Package To install a package from the RPM registry, execute the following commands: ```bash # use latest version dnf install {package_name} # use specific version dnf install {package_name}-{package_version}.{architecture} ``` ### Parameters #### Path Parameters - **package_name** (string) - Required - The name of the package to install. - **package_version** (string) - Optional - The specific version of the package to install. - **architecture** (string) - Optional - The architecture of the package to install. ``` -------------------------------- ### Install Maven Package Command Source: https://forgejo.org/docs/latest/user/packages/maven Command to install Maven packages from the configured registry. ```bash mvn install ``` -------------------------------- ### Install a Chef Package Source: https://forgejo.org/docs/latest/user/packages/chef Use this command to install a Chef package from the registry. You can optionally specify the package version. ```bash knife supermarket install {package_name} ``` ```bash knife supermarket install {package_name} {package_version} ``` -------------------------------- ### Install Alpine Package Source: https://forgejo.org/docs/latest/user/packages/alpine Instructions on how to install packages from the configured Forgejo Alpine registry using `apk`. ```APIDOC ## Install Alpine Package Install a package from the Alpine registry using the `apk` package manager. ### Usage To install the latest version of a package: ```bash apk add {package_name} ``` To install a specific version of a package: ```bash apk add {package_name}={package_version} ``` ``` -------------------------------- ### Install a Debian Package Source: https://forgejo.org/docs/latest/user/packages/debian How to install packages from the Forgejo Debian registry using the `apt` package manager. ```APIDOC ## Install a Debian Package To install a package from the Debian registry, use the `apt` command: ```bash # Install the latest version apt install {package_name} # Install a specific version apt install {package_name}={package_version} ``` ``` -------------------------------- ### Start Forgejo Web Server Source: https://forgejo.org/docs/latest/admin/command-line Use this command to start the Forgejo web server. It handles all other necessary components. Options allow customization of paths, configuration files, and ports. ```bash forgejo web [options] ``` -------------------------------- ### Concrete Example of workflow_call Outputs Source: https://forgejo.org/docs/latest/user/actions/reference A complete example demonstrating how to define and use outputs from a job within a `workflow_call` event. ```yaml on: workflow_call: outputs: output1: value: ${{ jobs.callee.outputs.job-output }} jobs: callee: runs-on: docker outputs: job-output: ${{ steps.stepwithoutput.outputs.myvalue }} steps: - id: stepwithoutput run: | echo "myvalue=outputvalue1" >> $FORGEJO_OUTPUT ``` -------------------------------- ### Install Composer Package Source: https://forgejo.org/docs/latest/user/packages/composer Commands to install a package from the configured Forgejo registry using the Composer CLI. ```bash composer require {package_name} ``` ```bash composer require {package_name}:{package_version} ``` -------------------------------- ### Install R Packages from Registry Source: https://forgejo.org/docs/latest/user/packages/cran Use the standard R install.packages command to retrieve and install packages hosted on your configured Forgejo registry. ```R install.packages("testpackage") ``` -------------------------------- ### Install Package Source: https://forgejo.org/docs/latest/user/packages/cran Install an R package from the Forgejo CRAN registry. ```APIDOC ## Install Package ### Description Installs an R package from the configured Forgejo CRAN registry. ### Usage Use the `install.packages()` function in R, ensuring the Forgejo registry is configured in your `.Rprofile`. ### Parameters #### Package Name - **package_name** (string) - Required - The name of the package to install. ### Example ```R install.packages("testpackage") ``` ``` -------------------------------- ### Example Forgejo Workflow for Docker Build Source: https://forgejo.org/docs/latest/admin/actions/docker-access This workflow demonstrates a basic Docker build process within a Forgejo action. It checks out the code and then attempts to build a Docker image. This example will fail without proper Docker daemon access configuration. ```yaml name: Docker Build on: push: branches: [main] jobs: build: runs-on: docker steps: - uses: actions/checkout@v6 - run: docker build -t my-app . ``` -------------------------------- ### Install Debian Package using Apt Source: https://forgejo.org/docs/latest/user/packages/debian Installs a Debian package from the configured Forgejo registry using the apt package manager. Supports installing the latest version or a specific version of a package. ```bash # use latest version apt install {package_name} # use specific version apt install {package_name}={package_version} ``` -------------------------------- ### Install NuGet Package Source: https://forgejo.org/docs/latest/user/packages/nuget Installs a specified NuGet package from the configured Forgejo feed source. You need to provide the package name, version, and the source name. ```bash dotnet add package --source {source_name} --version {package_version} {package_name} ``` ```bash dotnet add package --source forgejo --version 1.0.0 test_package ``` -------------------------------- ### Install Forgejo Runner inside LXC Container Source: https://forgejo.org/docs/latest/admin/actions/installation/binary This snippet shows how to enter the created LXC container, install necessary packages like Docker, download the Forgejo Runner binary, and prepare for its execution. ```bash lxc-helpers.sh lxc_container_run forgejo-runners -- sudo --user debian bash sudo apt-get install docker.io wget gnupg2 wget -O forgejo-runner https://code.forgejo.org/forgejo/runner/releases/download/v12.7.3/forgejo-runner-12.7.3-linux-amd64 ... ``` -------------------------------- ### Install npm Package Source: https://forgejo.org/docs/latest/user/packages/npm Install a package from the Forgejo package registry by providing the package name. This is the standard command for adding a dependency to your project. ```bash npm install {package_name} ``` ```bash npm install @test/test_package ``` -------------------------------- ### Create and Start LXC Container for Forgejo Runner Source: https://forgejo.org/docs/latest/admin/actions/installation/binary These commands clone the LXC helpers, copy them to the system, and then create, start, and prepare a new LXC container named 'myrunner' for the Forgejo Runner. ```bash git clone https://code.forgejo.org/forgejo/lxc-helpers sudo cp -a lxc-helpers/lxc-helpers{,-lib}.sh /usr/local/bin lxc-helpers.sh lxc_container_create myrunner lxc-helpers.sh lxc_container_start myrunner lxc-helpers.sh lxc_container_user_install myrunner 1000 debian ``` -------------------------------- ### Install Conan Package Source: https://forgejo.org/docs/latest/user/packages/conan Download a Conan package from the configured remote. Provide the remote name and the recipe to install. This command retrieves the specified package and its dependencies. ```bash conan install --remote={remote} {recipe} ``` ```bash conan install --remote=forgejo ConanPackage/1.2@forgejo/final ``` -------------------------------- ### Legacy Settings Override Example Source: https://forgejo.org/docs/latest/admin/storage This example shows how legacy settings for avatar upload paths are overridden by their modern replacements. Avatar files will be stored using the path defined in the [avatar] section. ```ini [picture] AVATAR_UPLOAD_PATH = /legacy_path [avatar] PATH = /avatar_path ``` -------------------------------- ### Accessing Runner OS Source: https://forgejo.org/docs/latest/user/actions/reference Example of accessing runner information, specifically the operating system, using the runner context. ```bash echo ${{ runner.os }} ``` -------------------------------- ### Start Forgejo Service Source: https://forgejo.org/docs/latest/admin/installation/binary After completing the app.ini configuration, restart the Forgejo service to apply all the changes. ```bash sudo systemctl start forgejo.service ``` -------------------------------- ### GET /api/packages/{owner}/rubygems Source: https://forgejo.org/docs/latest/user/packages/rubygems Endpoint for installing RubyGems packages using Bundler or the gem CLI. ```APIDOC ## GET /api/packages/{owner}/rubygems ### Description Allows users to install packages from the Forgejo registry using standard Ruby tools like Bundler or the gem command. ### Method GET ### Endpoint https://forgejo.example.com/api/packages/{owner}/rubygems ### Parameters #### Path Parameters - **owner** (string) - Required - The owner of the package repository. ### Request Example (Bundler) ```ruby source "https://forgejo.example.com/api/packages/testuser/rubygems" do gem "test_package" end ``` ### Request Example (gem CLI) ```bash gem install --host https://forgejo.example.com/api/packages/testuser/rubygems test_package ``` ### Response #### Success Response (200) - **package** (binary) - The requested .gem file stream. ``` -------------------------------- ### View Make Help Source: https://forgejo.org/docs/latest/contributor/from-source Display all available Make routines and their descriptions. ```bash $ make help ``` -------------------------------- ### Specifying Action Inputs Source: https://forgejo.org/docs/latest/user/actions/actions This example demonstrates how to provide inputs to an action, such as `actions/checkout`. Inputs like `ref`, `path`, and `show-progress` are configured using the `with` key. ```yaml - name: Check out the repository uses: actions/checkout@v6 with: ref: my-feature-branch path: some/subdirectory show-progress: true ``` -------------------------------- ### GET /api/packages/{owner}/maven Source: https://forgejo.org/docs/latest/user/packages/maven Endpoint for resolving and installing Maven package dependencies from the Forgejo registry. ```APIDOC ## GET /api/packages/{owner}/maven ### Description Retrieves package metadata and artifacts for dependency resolution during build processes. ### Method GET ### Endpoint https://forgejo.example.com/api/packages/{owner}/maven ### Parameters #### Path Parameters - **owner** (string) - Required - The owner of the package registry. ### Request Example com.test.package test_project 1.0.0 ### Response #### Success Response (200) - **artifact** (binary) - The requested package file. ``` -------------------------------- ### Example app.ini Configuration Section Source: https://forgejo.org/docs/latest/admin/setup/recommendations Illustrates how to define a configuration section and set a feature value in the app.ini file. ```ini [section.part] ENABLE_FEATURE_XY = new_value ``` -------------------------------- ### GET /api/packages/{owner}/vagrant/{package_name} Source: https://forgejo.org/docs/latest/user/packages/vagrant Endpoint used by the Vagrant CLI to discover and install packages from the registry. ```APIDOC ## GET /api/packages/{owner}/vagrant/{package_name} ### Description Provides the metadata required for Vagrant to install a box. This is typically consumed via the `vagrant box add` command. ### Method GET ### Endpoint https://forgejo.example.com/api/packages/{owner}/vagrant/{package_name} ### Parameters #### Path Parameters - **owner** (string) - Required - The owner of the package. - **package_name** (string) - Required - The name of the package. ### Request Example vagrant box add "https://forgejo.example.com/api/packages/testuser/vagrant/test_system" ### Response #### Success Response (200) - **Body** (binary) - Returns the box metadata or file for installation. ``` -------------------------------- ### Define Job Dependencies Source: https://forgejo.org/docs/latest/user/actions/reference Specifies that a job must wait for other jobs to complete successfully before it can start. This example requires the 'lint' job to finish first. ```yaml --- jobs: lint: steps: - run: echo linting the code build: needs: - lint steps: - run: echo only run after linting ``` -------------------------------- ### Run Docker commands within an LXC container Source: https://forgejo.org/docs/latest/admin/actions/docker-access This example demonstrates how to install Docker and run Docker commands inside a job container configured to use LXC. Ensure your Forgejo Runner is set up with an LXC label like `bookworm-lxc`. ```yaml name: Test Action on: pull_request: jobs: check-1: runs-on: bookworm-lxc steps: - run: apt update && apt --quiet install --yes -qq docker.io - run: docker ps -a - run: docker run --rm -it ubuntu echo "Hello, world!" ``` -------------------------------- ### MinIO Storage Configuration Example Source: https://forgejo.org/docs/latest/admin/setup/storage This configuration sets up the default storage to use MinIO and specifies settings for the LFS subsystem. It demonstrates overriding default paths for LFS objects. ```ini [storage] STORAGE_TYPE = minio SERVE_DIRECT = false MINIO_ENDPOINT = garage:9000 MINIO_ACCESS_KEY_ID = [redacted] MINIO_SECRET_ACCESS_KEY = [redacted] MINIO_BUCKET = forgejo MINIO_BUCKET_LOOKUP = auto MINIO_LOCATION = us-east-1 MINIO_USE_SSL = false MINIO_INSECURE_SKIP_VERIFY = false MINIO_CHECKSUM_ALGORITHM = md5 [lfs] STORAGE_TYPE = minio MINIO_BASE_PATH = nonstandardlfs/ SERVE_DIRECT = false MINIO_ENDPOINT = minio:9000 MINIO_ACCESS_KEY_ID = [redacted] MINIO_SECRET_ACCESS_KEY = [redacted] MINIO_BUCKET = forgejo MINIO_BUCKET_LOOKUP = auto MINIO_LOCATION = us-east-1 MINIO_USE_SSL = false MINIO_INSECURE_SKIP_VERIFY = false ``` -------------------------------- ### Install RubyGems Package using gem install Source: https://forgejo.org/docs/latest/user/packages/rubygems Install a RubyGems package directly from the Forgejo registry using the `gem install` command. Specify the registry host URL and the package name. This command is a direct alternative to using Bundler for package installation. ```bash gem install --host https://forgejo.example.com/api/packages/{owner}/rubygems {package_name} ``` ```bash gem install --host https://forgejo.example.com/api/packages/testuser/rubygems test_package ``` -------------------------------- ### MinIO Storage Configuration Example Source: https://forgejo.org/docs/latest/admin/storage This configuration demonstrates how to set up MinIO as the storage type for both general storage and LFS objects. It includes common MinIO settings and a specific base path for LFS. ```ini [storage] STORAGE_TYPE = minio SERVE_DIRECT = false MINIO_ENDPOINT = garage:9000 MINIO_ACCESS_KEY_ID = [redacted] MINIO_SECRET_ACCESS_KEY = [redacted] MINIO_BUCKET = forgejo MINIO_BUCKET_LOOKUP = auto MINIO_LOCATION = us-east-1 MINIO_USE_SSL = false MINIO_INSECURE_SKIP_VERIFY = false MINIO_CHECKSUM_ALGORITHM = md5 [lfs] STORAGE_TYPE = minio MINIO_BASE_PATH = nonstandardlfs/ SERVE_DIRECT = false MINIO_ENDPOINT = minio:9000 MINIO_ACCESS_KEY_ID = [redacted] MINIO_SECRET_ACCESS_KEY = [redacted] MINIO_BUCKET = forgejo MINIO_BUCKET_LOOKUP = auto MINIO_LOCATION = us-east-1 MINIO_USE_SSL = false MINIO_INSECURE_SKIP_VERIFY = false ``` -------------------------------- ### API Pagination Example Source: https://forgejo.org/docs/latest/user/api-usage Shows how to use pagination parameters 'limit' and 'page' for API requests. The 'Link' header provides navigation to next/previous pages, and 'x-total-count' indicates the total number of items. ```bash curl -v "https://forgejo.example.org/api/v1/repos/search?limit=1" ... < link: ; rel="next",; rel="last" ... < x-total-count: 5252 ``` -------------------------------- ### Connect to MySQL/MariaDB Instance Source: https://forgejo.org/docs/latest/admin/installation/database-preparation Connect to the database instance as root to perform administrative actions. You will be prompted for the root password. ```bash mysql -u root -p ``` -------------------------------- ### Prepare Directories for Rootless Image Source: https://forgejo.org/docs/latest/admin/installation/docker Create and set ownership for the data and configuration directories required by the rootless Forgejo image. Ensure the user and group IDs match the container's expected values. ```bash mkdir -p ./forgejo sudo chown -R 1000:1000 ./forgejo mkdir -p ./conf sudo chown -R 1000:1000 ./conf ``` -------------------------------- ### Install Alpine Package Source: https://forgejo.org/docs/latest/user/packages/alpine Installs a package from the configured Alpine registry using the `apk add` command. You can install the latest version or a specific version by appending `={package_version}` to the package name. ```bash # Install latest version apk add {package_name} # Install specific version apk add {package_name}={package_version} ``` -------------------------------- ### Test Forgejo Runner Installation Source: https://forgejo.org/docs/latest/admin/actions/installation/binary Tests the installation by checking the Forgejo Runner version. ```bash $ forgejo-runner -v forgejo-runner version v12.7.3 ``` -------------------------------- ### Inspect Source Code Allocation Lines Source: https://forgejo.org/docs/latest/admin/troubleshooting/profiling Example output from the pprof list command showing memory allocation at specific source code lines within the chi router. ```go . . 253: if segTyp == ntRegexp { . 1MB 254: rex, err := regexp.Compile(segRexpat) . . 255: if err != nil { . . 256: panic(fmt.Sprintf("chi: invalid regexp pattern '%s' in route param", segRexpat)) . . 257: } . . 258: child.prefix = segRexpat . . 259: child.rex = rex . . 260: } ``` -------------------------------- ### Install Podman on Debian/Ubuntu Source: https://forgejo.org/docs/latest/admin/actions/installation/binary Installs the Podman package on Debian-based systems (e.g., Debian 13, Ubuntu). ```bash sudo apt install podman ``` -------------------------------- ### Install RubyGems Package with Bundler Source: https://forgejo.org/docs/latest/user/packages/rubygems Install a RubyGems package from the Forgejo registry using Bundler. Add a `source` block to your `Gemfile` specifying the Forgejo registry URL and the desired package name, then run `bundle install`. This method is useful for managing project dependencies. ```ruby source "https://forgejo.example.example.com/api/packages/{owner}/rubygems" do gem "{package_name}" end ``` ```ruby source "https://forgejo.example.com/api/packages/testuser/rubygems" do gem "test_package" end ``` ```bash bundle install ``` -------------------------------- ### Copy and Make Forgejo Binary Executable Source: https://forgejo.org/docs/latest/admin/installation/binary Copies the downloaded Forgejo binary to the system's PATH and sets execute permissions. Ensure the binary name matches your downloaded file. ```bash sudo cp forgejo-x.y.z-linux-amd64 /usr/local/bin/forgejo sudo chmod 755 /usr/local/bin/forgejo ``` -------------------------------- ### Start Forgejo Podman Service Source: https://forgejo.org/docs/latest/admin/installation/docker Commands to reload the systemd daemon and start the Forgejo service after configuring Podman unit files. ```bash sudo systemctl daemon-reload sudo systemctl start forgejo ``` -------------------------------- ### Run Tests with gotestsum Summary Source: https://forgejo.org/docs/latest/contributor/testing Enable the use of gotestsum for clearer test result summaries when running make test. Ensure gotestsum is installed separately. ```bash USE_GOTESTSUM=yes make test ``` -------------------------------- ### Install Maven Package using Maven Source: https://forgejo.org/docs/latest/user/packages/maven This XML snippet shows how to add a dependency to your pom.xml to install a Maven package from the Forgejo registry. ```xml com.test.package test_project 1.0.0 ``` -------------------------------- ### Connect Existing Local Project to Forgejo Source: https://forgejo.org/docs/latest/user/first-repository Explains how to initialize a local directory as a Git repository and link it to a remote Forgejo repository using git remote add. ```bash cd my-project git init git remote add origin https://codeberg.org/knut/foobar ``` -------------------------------- ### Using Step Outputs Source: https://forgejo.org/docs/latest/user/actions/reference Demonstrates how to set and use outputs from a previous step. Outputs are defined by writing to the $FORGEJO_OUTPUT environment variable. ```yaml - id: mystep run: echo 'check=good' >> $FORGEJO_OUTPUT - run: test ${{ steps.mystep.outputs.check }} = good ``` -------------------------------- ### Install Package from Forgejo Registry Source: https://forgejo.org/docs/latest/user/packages/pub Installs a specific Dart package from the Forgejo registry by specifying the hosted-url. Supports both latest and specific version tagging. ```bash dart pub add {package_name} --hosted-url=https://forgejo.example.com/api/packages/{owner}/pub/ # Example for latest version dart pub add mypackage --hosted-url=https://forgejo.example.com/api/packages/testuser/pub/ # Example for specific version dart pub add mypackage:1.0.8 --hosted-url=https://forgejo.example.com/api/packages/testuser/pub/ ``` -------------------------------- ### Install Maven Package using Gradle Source: https://forgejo.org/docs/latest/user/packages/maven This code snippet shows how to add a dependency in Gradle Groovy to install a Maven package from the Forgejo registry. ```groovy implementation "com.test.package:test_project:1.0.0" ``` -------------------------------- ### Build Forgejo with GNU Guix Source: https://forgejo.org/docs/latest/contributor/from-source Creates a containerized environment with build and test dependencies using GNU Guix. Requires a manifest.scm file. ```bash guix shell -CNF --share=$HOME -m manifest.scm ``` -------------------------------- ### Forgejo Default Merge Message Template Examples Source: https://forgejo.org/docs/latest/user/merge-message-templates Examples demonstrating how to customize merge message titles and bodies using templates. These examples show how to replace the default title, make the body empty, keep the default title while replacing the body, and make the default title empty while replacing the body. ```markdown Merge Title ``` ```markdown Merge Title ``` ```markdown Merge Body ``` ```markdown Merge body ``` -------------------------------- ### action.yml Metadata Example Source: https://forgejo.org/docs/latest/user/actions/actions Defines the name, author, description, inputs, and outputs for a custom action. The `runs` key specifies how the action is executed. ```yaml name: 'Example Action' author: 'Me, I wrote it' description: | A simple action that just takes some input and writes it to a file. inputs: message: description: 'The message to be stored' default: 'default message' outputs: time: description: 'The time when the action was run' runs: ... ``` -------------------------------- ### Install Git and Git LFS on Debian/Ubuntu Source: https://forgejo.org/docs/latest/admin/installation/binary Installs the Git and Git Large File Storage (LFS) packages using the apt package manager. This is a prerequisite for Forgejo. ```bash sudo apt install git git-lfs ``` -------------------------------- ### Creating a Tag with Git Source: https://forgejo.org/docs/latest/user/releases Instructions on how to create a Git tag locally and push it to a remote repository. ```APIDOC ## Creating a Tag with Git ### Description This section describes how to create a Git tag locally and push it to a remote repository. Tags are used to mark specific points in a repository's history, often for releases. ### Local Tag Creation Use the following command in your local repository: ```bash git tag -a -m "" ``` * ``: The name for your tag (e.g., `v1.0.0`). * ``: A message describing the tag. **Note:** You can omit `-m ""` to use an editor for a longer message. ### Pushing Tags to Remote Tags are not pushed automatically with `git push`. You need to push them separately. To push all local tags: ```bash git push --tags ``` To push a specific tag: ```bash git push ``` **Best Practice:** Use Semantic Versioning (e.g., `v1.2.3`) for tag names. ```