Gitea


POST ON 2022-10-30 BY WOLVES

GITEA

作为GOGs的社群支持版本,Gitea在大量开发者的努力下,已经具备了几乎和gitlab相当的能力,并且极其轻量化

  • 搭建

Docker

  • dockerfile
FROM python:3.10-alpine3.20

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories
RUN apk add tzdata iproute2 git bash bash-completion --no-cache
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone

RUN mkdir /data
RUN adduser -D git
RUN echo 'git:git' | chpasswd
RUN chown -R git:git /data

RUN pip3 install nbconvert -i https://pypi.tuna.tsinghua.edu.cn/simple
docker run -itd --name gitea -p 3000:3000 --privileged -v /volume2/docker/gitea:/data gitea:py3.10-a3.20 /data/app/docker-entrypoint

自定义构建

apk add git bash --no-cache
adduer git
su git -c '/data/app/gitea web --config /data/gitea/conf/app.ini'

jupyter支持

  • This guide will show you how to configure an external renderer to display Jupyter Notebooks. However this guide will also work for other types of files and even binary files! The sky is the limit.
  • In order to display something more attractive to the user we need some HTML, luckily Jupyter has a module called nbconvert:
# Install our converter software of choice on the Gitea machine:
sudo apt install python3-pip
pip3 install nbconvert
  • then Configuring Gitea to use the converter
[markup.jupyter]
ENABLED = true
FILE_EXTENSIONS = .ipynb
RENDER_COMMAND = "jupyter nbconvert --stdout --to html --template full "
IS_INPUT_FILE = true

[markup.sanitizer.jupyter0]
ELEMENT = div
ALLOW_ATTR = class
REGEXP =

GITEA支持镜像上传

  • 支持的软件包管理器

目前支持以下软件包管理器:

NameLanguagePackage client
Alpine-apk
CargoRustcargo
Chef-knife
ComposerPHPcomposer
ConanC++conan
Conda-conda
Container-任何符合OCI规范的客户端
CRANR-
Debian-apt
Generic-任何HTTP客户端
GoGogo
Helm-任何HTTP客户端, cm-push
MavenJavamvn, gradle
npmJavaScriptnpm, yarn, pnpm
NuGet.NETnuget
PubDartdart, flutter
PyPIPythonpip, twine
RPM-yum, dnf, zypper
RubyGemsRubygem, Bundler
SwiftSwiftswift
Vagrant-vagrant
  • nginx转发时应使用fullchain
文件名文件作用
cert.pem服务端证书
chain.pem浏览器需要的所有证书但不包括服务端证书,比如根证书和中间证书
fullchain.pem包括了cert.pem和chain.pem的内容
privkey.pem证书的私钥