{"id":13587775,"url":"https://github.com/fnichol/iocage-plugin-gitea","last_synced_at":"2025-04-13T08:54:30.610Z","repository":{"id":66119271,"uuid":"181129289","full_name":"fnichol/iocage-plugin-gitea","owner":"fnichol","description":"An iocage plugin for Gitea, a painless self-hosted Git service.","archived":false,"fork":false,"pushed_at":"2020-03-01T23:22:33.000Z","size":27,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T09:57:03.789Z","etag":null,"topics":["freebsd","freenas","freenas-plugin","gitea","iocage","trueos","trueos-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fnichol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-13T06:14:49.000Z","updated_at":"2024-08-04T15:50:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"2abeba90-dc9a-44f3-837f-0b515bbcb097","html_url":"https://github.com/fnichol/iocage-plugin-gitea","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnichol%2Fiocage-plugin-gitea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnichol%2Fiocage-plugin-gitea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnichol%2Fiocage-plugin-gitea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnichol%2Fiocage-plugin-gitea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fnichol","download_url":"https://codeload.github.com/fnichol/iocage-plugin-gitea/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688543,"owners_count":21145763,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["freebsd","freenas","freenas-plugin","gitea","iocage","trueos","trueos-plugin"],"created_at":"2024-08-01T15:06:21.397Z","updated_at":"2025-04-13T08:54:30.588Z","avatar_url":"https://github.com/fnichol.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# iocage-plugin-gitea\n\nAn [iocage][] plugin for [Gitea][], a community managed lightweight code hosting\nsolution written in Go.\n\n[gitea]: https://gitea.io/\n[iocage]: https://github.com/iocage/iocage\n\n|         |                                      |\n| ------: | ------------------------------------ |\n|      CI | [![CI Status][badge-ci-overall]][ci] |\n| License | [![License][badge-license]][license] |\n\n**Table of Contents**\n\n\u003c!-- toc --\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Enabling TLS Mode with an SSL Certificate](#enabling-tls-mode-with-an-ssl-certificate)\n  - [Persisting Data](#persisting-data)\n    - [Initial Setup](#initial-setup)\n    - [Reattaching Data in a New Jail](#reattaching-data-in-a-new-jail)\n- [Configuration](#configuration)\n  - [User Serviceable Configuration](#user-serviceable-configuration)\n  - [`gitea_app_name`](#gitea_app_name)\n  - [`gitea_nginx_mode`](#gitea_nginx_mode)\n  - [`gitea_internal_token`](#gitea_internal_token)\n  - [`gitea_lfs_jwt_secret`](#gitea_lfs_jwt_secret)\n  - [`gitea_oauth2_jwt_secret`](#gitea_oauth2_jwt_secret)\n  - [`gitea_secret_key`](#gitea_secret_key)\n  - [System Configuration](#system-configuration)\n  - [`gitea_domain`](#gitea_domain)\n  - [`gitea_user_home`](#gitea_user_home)\n  - [`gitea_user`](#gitea_user)\n  - [`gitea_work_dir`](#gitea_work_dir)\n- [Code of Conduct](#code-of-conduct)\n- [Issues](#issues)\n- [Contributing](#contributing)\n- [Release History](#release-history)\n- [Authors](#authors)\n- [License](#license)\n\n\u003c!-- tocstop --\u003e\n\n## Installation\n\nThis plugin can be installed via the [fnichol/iocage-plugin-index][index] plugin\ncollection which is not installed on FreeNAS or TrueOS by default. For example,\nto install the plugin with a name of `gitea` and a dedicated IP address:\n\n```console\n$ jail=gitea\n$ ip_addr=10.200.0.110\n\n$ sudo iocage fetch \\\n  -g https://github.com/fnichol/iocage-plugin-index \\\n  -P gitea \\\n  --name $jail \\\n  ip4_addr=\"vnet0|$ip_addr\"\n```\n\n[index]: https://github.com/fnichol/iocage-plugin-index\n\n## Usage\n\n### Enabling TLS Mode with an SSL Certificate\n\nTLS mode is handled by the nginx service which forwards all traffic back to the\nGitea service via a local Unix domain socket. To enable TLS you will need a\npublic SSL certificate (i.e. a `cert.pem` file) and the private server key (i.e.\na `key.pem` file) installed into the nginx configuration directory of the\nplugin's jail. Assuming a running installed plugin called `gitea` with a jail\nmount point of `/mnt/tank/iocage/jails/gitea` in the host system, the following\nwill setup Gitea to run under HTTPS:\n\n```console\n$ jail=gitea\n$ jail_mnt=/mnt/tank/iocage/jails/$jail\n\n$ sudo cp cert.pem key.pem $jail_mnt/root/usr/local/etc/nginx/\n$ sudo chown 0644 $jail_mnt/root/usr/local/etc/nginx/cert.pem\n$ sudo chown 0600 $jail_mnt/root/usr/local/etc/nginx/key.pem\n$ sudo iocage exec $jail plugin config set gitea_nginx_mode https\n$ sudo iocage exec $jail plugin services restart\n```\n\n### Persisting Data\n\nThere are 2 primary directories that contain data in a Gitea jail:\n\n- `/var/db/gitea` All internal state and configuration for Gitea\n- `/usr/local/git` All hosted repository data\n\nA good strategy is to create a ZFS dataset per directory and mount them into the\njail. This way, the jail can be destroyed and later re-created without losing\nthe Gitea configuration or the repository data itself.\n\n#### Initial Setup\n\nTo set this up for the first time, the ZFS datasets will need to be created and\nany initial state in the jail will need to be copied onto the datasets.\n\n```console\n$ jail=gitea\n$ dataset=tank/src/gitea\n$ mnt=/mnt/$dataset\n\n# Create the ZFS datasets on the host system\n$ sudo zfs create $dataset\n$ sudo zfs create $dataset/config\n$ sudo zfs create $dataset/repos\n\n# Stop the Gitea service\n$ sudo iocage exec $jail service gitea stop\n\n# Mount the ZFS dataset for config data \u0026 copy existing data to dataset\n$ sudo iocage exec $jail mv /var/db/gitea /var/db/_gitea\n$ sudo iocage exec $jail mkdir /var/db/gitea\n$ sudo iocage fstab -a $jail \"$mnt/config /var/db/gitea nullfs rw 0 0\"\n$ sudo iocage exec $jail chmod 0750 /var/db/gitea\n$ sudo iocage exec $jail chown git:git /var/db/gitea\n$ sudo iocage exec $jail sh -c \\\n  'tar cf - -C /var/db/_gitea . | tar xpf - -C /var/db/gitea'\n$ sudo iocage exec $jail rm -rf /var/db/_gitea\n\n# Mount the ZFS dataset for repos data \u0026 copy existing data to dataset\n$ sudo iocage exec $jail mv /usr/local/git /usr/local/_git\n$ sudo iocage exec $jail mkdir /usr/local/git\n$ sudo iocage fstab -a $jail \"$mnt/repos /usr/local/git nullfs rw 0 0\"\n$ sudo iocage exec $jail chmod 0755 /usr/local/git\n$ sudo iocage exec $jail chown git:git /usr/local/git\n$ sudo iocage exec $jail sh -c \\\n  'tar cf - -C /usr/local/_git . | tar xpf - -C /usr/local/git'\n$ sudo iocage exec $jail rm -rf /usr/local/_git\n\n# Start the Gitea service\n$ sudo iocage exec $jail service gitea start\n```\n\n#### Reattaching Data in a New Jail\n\nIf you are setting up a fresh new plugin instance and want to re-use the\nconfiguration and repository data from a prior instance, then you can re-attach\nthe existing datasets into the new instance.\n\n```console\n$ jail=gitea_2\n$ dataset=tank/src/gitea\n$ mnt=/mnt/$dataset\n\n# Stop the Gitea service\n$ sudo iocage exec $jail service gitea stop\n\n# Reattach the existing ZFS dataset with the config data\n$ sudo iocage exec $jail rm -rf /var/db/gitea\n$ sudo iocage exec $jail mkdir /var/db/gitea\n$ sudo iocage fstab -a $jail \"$mnt/config /var/db/gitea nullfs rw 0 0\"\n\n# Reattach the existing ZFS dataset with the repos data\n$ sudo iocage exec $jail rm -rf /usr/local/git\n$ sudo iocage exec $jail mkdir /usr/local/git\n$ sudo iocage fstab -a $jail \"$mnt/repos /usr/local/git nullfs rw 0 0\"\n\n# Start the Gitea service\n$ sudo iocage exec $jail service gitea start\n```\n\n## Configuration\n\n### User Serviceable Configuration\n\nThe following configuration is intended to be modified by a plugin user.\n\n### `gitea_app_name`\n\nApplication name, used in the page title.\n([Gitea reference](https://docs.gitea.io/en-us/config-cheat-sheet/#overall-default))\n\n- default: `\"Gitea: Git with a cup of tea\"`\n\nTo change this value, use the installed `plugin` program and restart the\nservices to apply the updated configuration:\n\n```console\n$ plugin config set gitea_app_name \"Gitea: Git with a cup of tea\"\n$ plugin services restart\n```\n\n### `gitea_nginx_mode`\n\nWhether or not TLS is being used for the service. See the TLS section for more\ninformation regarding how to install an SSL certificate.\n\n- default: `\"http\"`\n- valid values: `\"http\"`|`\"https\"`\n\nTo change this value, use the installed `plugin` program and restart the\nservices to apply the updated configuration:\n\n```console\n$ plugin config set gitea_nginx_mode http\n$ plugin services restart\n```\n\n### `gitea_internal_token`\n\nSecret used to validate communication within Gitea binary. This value is\nrandomly generated at install time.\n([Gitea reference](https://docs.gitea.io/en-us/config-cheat-sheet/#security-security))\n\n- default: **generated on install**\n\nTo change this value, use the installed `plugin` program and restart the\nservices to apply the updated configuration:\n\n```console\n$ plugin config set gitea_internal_token \\\n  \"`gitea generate secret INTERNAL_TOKEN`\"\n$ plugin services restart\n```\n\n### `gitea_lfs_jwt_secret`\n\nLFS authentication secret. This value is randomly generated at install time.\n([Gitea reference](https://docs.gitea.io/en-us/config-cheat-sheet/#server-server))\n\n- default: **generated on install**\n\nTo change this value, use the installed `plugin` program and restart the\nservices to apply the updated configuration:\n\n```console\n$ plugin config set gitea_lfs_jwt_secret \\\n  \"`gitea generate secret LFS_JWT_SECRET`\"\n$ plugin services restart\n```\n\n### `gitea_oauth2_jwt_secret`\n\nOAuth2 authentication secret for access and refresh tokens. This value is\nrandomly generated at install time.\n([Gitea reference](https://docs.gitea.io/en-us/config-cheat-sheet/#oauth2-oauth2))\n\n- default: **generated on install**\n\nTo change this value, use the installed `plugin` program and restart the\nservices to apply the updated configuration:\n\n```console\n$ plugin config set gitea_oauth2_jwt_secret \\\n  \"`gitea generate secret JWT_SECRET`\"\n$ plugin services restart\n```\n\n### `gitea_secret_key`\n\nGlobal secret key. This value is randomly generated at install time.\n([Gitea reference](https://docs.gitea.io/en-us/config-cheat-sheet/#security-security))\n\n- default: **generated on install**\n\nTo change this value, use the installed `plugin` program and restart the\nservices to apply the updated configuration:\n\n```console\n$ plugin config set gitea_secret_key \\\n  \"`gitea generate secret SECRET_KEY`\"\n$ plugin services restart\n```\n\n### System Configuration\n\nThe following configuration is used to configure and setup the services during\npost installation and is therefore not intended to be changed or modified by a\nplugin user.\n\n### `gitea_domain`\n\nDomain name of this server.\n([Gitea reference](https://docs.gitea.io/en-us/config-cheat-sheet/#server-server))\n\n- default: `\"localhost\"`\n\n### `gitea_user_home`\n\nUsed to determine a parent path for storing all repository data.\n\n- default: **\\$HOME for gitea_user**\n\n### `gitea_user`\n\nThe non-privileged user which runs the `gitea` service.\n\n- default: `\"git\"`\n\n### `gitea_work_dir`\n\nUsed to determine a parent path for storing all internal service state and\nconfiguration.\n\n- default: `\"/var/db/gitea\"`\n\n## Code of Conduct\n\nThis project adheres to the Contributor Covenant [code of\nconduct][code-of-conduct]. By participating, you are expected to uphold this\ncode. Please report unacceptable behavior to fnichol@nichol.ca.\n\n## Issues\n\nIf you have any problems with or questions about this project, please contact us\nthrough a [GitHub issue][issues].\n\n## Contributing\n\nYou are invited to contribute to new features, fixes, or updates, large or\nsmall; we are always thrilled to receive pull requests, and do our best to\nprocess them as fast as we can.\n\nBefore you start to code, we recommend discussing your plans through a [GitHub\nissue][issues], especially for more ambitious contributions. This gives other\ncontributors a chance to point you in the right direction, give you feedback on\nyour design, and help you find out if someone else is working on the same thing.\n\n## Release History\n\nThis project uses a \"deployable master\" strategy, meaning that the `master`\nbranch is assumed to be working and production ready. As such there is no formal\nversioning process and therefore also no formal changelog documentation.\n\n## Authors\n\nCreated and maintained by [Fletcher Nichol][fnichol] (\u003cfnichol@nichol.ca\u003e).\n\n## License\n\nLicensed under the Mozilla Public License Version 2.0 ([LICENSE.txt][license]).\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the MPL-2.0 license, shall be\nlicensed as above, without any additional terms or conditions.\n\n[badge-license]: https://img.shields.io/badge/License-MPL%202.0%20-blue.svg\n[badge-ci-overall]:\n  https://api.cirrus-ci.com/github/fnichol/iocage-plugin-gitea.svg\n[ci]: https://cirrus-ci.com/github/fnichol/iocage-plugin-gitea\n[code-of-conduct]:\n  https://github.com/fnichol/iocage-plugin-gitea/blob/master/CODE_OF_CONDUCT.md\n[fnichol]: https://github.com/fnichol\n[issues]: https://github.com/fnichol/iocage-plugin-gitea/issues\n[license]:\n  https://github.com/fnichol/iocage-plugin-gitea/blob/master/LICENSE.txt\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnichol%2Fiocage-plugin-gitea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffnichol%2Fiocage-plugin-gitea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnichol%2Fiocage-plugin-gitea/lists"}