Gitea and NGinx Setup Guide
Great self-hosted option that brings teams and developers high-efficiency, but easy operations from planning to production.
Kernel: Please check to make sure these options are set correctly.
* CONFIG_CGROUP_FREEZER: is not set when it should be.
* CONFIG_VETH: is not set when it should be.
* CONFIG_BRIDGE_NETFILTER: is not set when it should be.
* CONFIG_IP_NF_TARGET_MASQUERADE: is not set when it should be.
* CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: is not set when it should be.
* CONFIG_NETFILTER_XT_MATCH_IPVS: is not set when it should be.
* CONFIG_NETFILTER_XT_MARK: is not set when it should be.
* CONFIG_CGROUP_PERF: is not set when it should be.
* CONFIG_IP_NF_TARGET_REDIRECT: is not set when it should be.
* CONFIG_IP_VS: is not set when it should be.
* CONFIG_IP_VS_NFCT: is not set when it should be.
* CONFIG_IP_VS_PROTO_TCP: is not set when it should be.
* CONFIG_IP_VS_PROTO_UDP: is not set when it should be.
* CONFIG_IP_VS_RR: is not set when it should be.
* CONFIG_VXLAN: is not set when it should be.
* CONFIG_CRYPTO_SEQIV: is not set when it should be.
* CONFIG_INET_ESP: is not set when it should be.
* CONFIG_IPVLAN: is not set when it should be.
* CONFIG_MACVLAN: is not set when it should be.
* CONFIG_DUMMY: is not set when it should be.
* CONFIG_NF_NAT_FTP: is not set when it should be.
* CONFIG_NF_CONNTRACK_FTP: is not set when it should be.
* CONFIG_NF_NAT_TFTP: is not set when it should be.
* CONFIG_NF_CONNTRACK_TFTP: is not set when it should be.
Add Gitea User (optional)
Prepare Gitea Folders and Users
Create ~/gitea/docker-compose.yml
cat << "EOF" > ~/docker/docker-compose.yml
# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0
services:
postgresql:
image: docker.io/bitnami/postgresql:latest
volumes:
- 'postgresql_data:/bitnami/postgresql'
environment:
- POSTGRESQL_DATABASE=bitnami_gitea
- POSTGRESQL_USERNAME=bn_gitea
- POSTGRESQL_PASSWORD=bitnami1
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
gitea:
image: docker.io/bitnami/gitea:1
volumes:
- 'gitea_data:/bitnami/gitea'
environment:
- GITEA_DATABASE_HOST=postgresql
- GITEA_DATABASE_NAME=bitnami_gitea
- GITEA_DATABASE_USERNAME=bn_gitea
- GITEA_DATABASE_PASSWORD=bitnami1
ports:
- '3000:3000'
- '2222:2222'
volumes:
postgresql_data:
driver: local
gitea_data:
driver: local
NGinx
Install Nginx on Ubuntu
Configure sites-available for Gitea
cat << "EOF" > /etc/nginx/sites-available/git.linux-shell.se
server {
server_name git.linux-shell.se;
root /var/www/html;
location / {
# Proxy all requests to Gitea running on port 3000
proxy_pass http://localhost:3000;
# Pass on information about the requests to the proxied service using headers
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Create Symlink for Nginx
Resource(s)