Project

General

Profile

Support #952

Install Gitea on FreeBSD

Added by Daniel Curtis about 4 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Source Code Management
Target version:
Start date:
11/30/2020
Due date:
% Done:

100%

Estimated time:

Description

This is a guide for setting up Gitea with PostgreSQL on FreeBSD 12.

Prepare the Environment

  • Make sure the system is up to date:
    pkg update && pkg upgrade
    

Setup PostgreSQL

  • Install PostgreSQL:
    pkg install postgresql96-{client,server, contrib}
    
  • Initialize, start, and enable postgresql at boot:
    sysrc postgresql_enable="YES" 
    service postgresql initdb
    service postgresql start
    
  • Log in to postgresql user account and connect to database:
    su - postgres
    psql -d template1
    
  • Create a user:
    CREATE USER gitea WITH PASSWORD 'SuperSecretPassword' CREATEDB;
    
  • Create the database & grant all privileges on database
    CREATE DATABASE giteadb WITH OWNER gitea TEMPLATE template0 ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8';
    
  • Quit the database session
    \q
    exit
    

Setup Gitea

  • Install the dependencies
    pkg install gitea
    
  • Edit the app.ini file:
    vi /usr/local/etc/gitea/conf/app.ini
    
    • Modify the following values:
      [database]
      DB_TYPE  = postgres
      HOST     = 127.0.0.1:5432 
      NAME     = giteadb
      PASSWD   = SuperSecretPassword
      SSL_MODE = disable
      USER     = gitea
      
      [server]
      DOMAIN       = 192.168.0.54
      HTTP_ADDR    = 192.168.0.54
      HTTP_PORT    = 3000
      ROOT_URL     = http://192.168.0.54:3000/
      
  • Start and enable gitea:
    sysrc 'gitea_enable=YES'
    service gitea start
    

Resources

#1

Updated by Daniel Curtis about 4 years ago

  • Description updated (diff)
  • Category set to Source Code Management
  • Status changed from New to Resolved
  • Assignee set to Daniel Curtis
  • Target version set to FreeBSD 12
  • % Done changed from 0 to 100
#2

Updated by Daniel Curtis almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF