#!/usr/bin/env sh #-*-mode: Shell-script; coding: utf-8;-*- gitea_ini=/etc/gitea/app.ini # We want to listen on 127.0.0.1 instead of 0.0.0.0 for now if ! grep HTTP_ADDR $gitea_ini; then sed -i -e '/\[server\]/a HTTP_ADDR = /var/lib/gitea/unix-domain-socket' $gitea_ini sed -i -e '/\[server\]/a PROTOCOL = unix' $gitea_ini sed -i -e '/\[server\]/a UNIX_SOCKET_PERMISSION = 666' $gitea_ini sed -i -e '/\[server\]/a START_SSH_SERVER = true' $gitea_ini sed -i -e '/\[server\]/a SSH_DOMAIN = git.functionalidiot.com' $gitea_ini sed -i -e '/\[server\]/a SSH_PORT = 2222' $gitea_ini sed -i -e '/\[server\]/a SSH_LISTEN_PORT = 2222' $gitea_ini fi if ! grep OFFLINE_MODE $gitea_ini; then # Setup offlinemode we don't need the cdn crap sed -i -e '/\[server\]/a OFFLINE_MODE = true' $gitea_ini fi # Change the gitea APP_NAME if ! grep APP_NAME $gitea_ini; then sed -i -e '/^RUN_MODE.*/a APP_NAME = just a bunch of git repos' $gitea_ini fi # Ensure all new repos are private by default if ! grep FORCE_PRIVATE $gitea_ini; then sed -i -e '/\[repository\]/a FORCE_PRIVATE=true' $gitea_ini fi # No limits to repos if ! grep MAX_CREATION_LIMIT $gitea_ini; then sed -i -e '/\[repository\]/a MAX_CREATION_LIMIT=-1' $gitea_ini fi # Don't use http for git operations if ! grep DISABLE_HTTP_GIT $gitea_ini; then sed -i -e '/\[repository\]/a DISABLE_HTTP_GIT=true' $gitea_ini fi if ! grep CUSTOM $gitea_ini; then cat <<- FIN | tee -a $gitea_ini # CUSTOM [security] INTERNAL_TOKEN = $INTERNAL_TOKEN SECRET_KEY = $SECRET_KEY INSTALL_LOCK = true [oauth2] ENABLE = false [other] SHOW_FOOTER_VERSION = false [openid] ENABLE_OPENID_SIGNIN = false ENABLE_OPENID_SIGNUP = false [ui] SHOW_USER_EMAIL = false [api] ENABLE_SWAGGER = false [service] DEFAULT_KEEP_EMAIL_PRIVATE = true DISABLE_REGISTRATION = true REGISTER_EMAIL_CONFIRM = false ENABLE_NOTIFY_MAIL = false ENABLE_CAPTCHA = false REQUIRE_SIGNIN_VIEW = false DEFAULT_ALLOW_CREATE_ORGANIZATION = true NO_REPLY_ADDRESS = noreply.example.org ALLOW_ONLY_EXTERNAL_REGISTRATION = false DEFAULT_ENABLE_TIMETRACKING = true [mailer] ENABLED = false [picture] DISABLE_GRAVATAR = false ENABLE_FEDERATED_AVATAR = true [git] MAX_GIT_DIFF_LINES = 20000 MAX_GIT_DIFF_LINE_CHARACTERS = 100000 FIN fi