今天用树莓派折腾了个 Gitea,中途遇到些问题,等有空我再整理一下吧。
请查看最新文档:使用 Docker 安装 gitea、drone
现在把我的 app.ini
配置信息记录一下:
APP_NAME = GitCat
RUN_MODE = prod
RUN_USER = git
[repository]
ROOT = /data/git/repositories
[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo
[repository.upload]
TEMP_PATH = /data/gitea/uploads
[server]
#PROTOCOL = http
APP_DATA_PATH = /data/gitea
DOMAIN = gitcat.com
SSH_DOMAIN = gitcat.com
HTTP_PORT = 3000
ROOT_URL = http://gitcat.com/
DISABLE_SSH = false
SSH_PORT = 22
SSH_LISTEN_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
LFS_JWT_SECRET = RnMvC6DQg1wxYmXrVw9DvWj9t5OI5sEk3i5ROYVQSi8
OFFLINE_MODE = true
[database]
PATH = /data/gitea/gitea.db
DB_TYPE = mysql
HOST = db:3306
NAME = gitea
USER = gitea
PASSWD = 123456
SCHEMA =
SSL_MODE = disable
CHARSET = utf8mb4
[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
[session]
PROVIDER_CONFIG = /data/gitea/sessions
PROVIDER = file
[picture]
AVATAR_UPLOAD_PATH = /data/gitea/avatars
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
DISABLE_GRAVATAR = true
ENABLE_FEDERATED_AVATAR = false
[attachment]
PATH = /data/gitea/attachments
[log]
ROOT_PATH = /data/gitea/log
MODE = file
LEVEL = info
[security]
INSTALL_LOCK = true
SECRET_KEY = Nvd8BqfHwH1PkVyRUmIVYUIp6jLdLBsmsAaDIy6gnihFaIMIBCrQ2UMqcx46ddfB
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1OTkxMzE5MzV9.DgAZSAPNxg-vmxavGIPQICsRfeaLmb_J_9F2WL9z3KI
[service]
DISABLE_REGISTRATION = false
REQUIRE_SIGNIN_VIEW = false
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = false
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.localhost
[oauth2]
JWT_SECRET = BXWYP9x8UiWTuZ1V-TMxmAqlzGmEcduq-7c-NxCmxgk
[mailer]
ENABLED = false
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false
docker-compose.yaml
放置在 /data/gitea
目录下:
version: '2'
services:
web:
image: gitea/gitea:latest
volumes:
- ./data:/data
ports:
- "10080:3000"
- "22:22"
depends_on:
- db
restart: always
db:
image: mariadb:10
restart: always
environment:
- MYSQL_ROOT_PASSWORD=A123456a
- MYSQL_DATABASE=gitea
- MYSQL_USER=gitea
- MYSQL_PASSWORD=123456
volumes:
- ./db/:/var/lib/mysql
Caddy Server 转发设置
### Git Cat
gitcat.com:80 {
reverse_proxy 127.0.0.1:10080
}
/etc/hosts
gitcat.com 本地域名配置
ip_address gitcat.com
192.168.1.109 gitcat.com
暂时记录一下,有空整理一篇文章出来。
若是 docker compose
方式,则不需要设置开机启动。这个程序由 docker 管理。