Browse Source

initial commit

master
Josh Habdas 2 years ago
commit
816380e7da
Signed by: jhabdas GPG Key ID: B148B31154C75A74
5 changed files with 136 additions and 0 deletions
  1. +3
    -0
      .dockerignore
  2. +1
    -0
      .gitignore
  3. +13
    -0
      COPYING
  4. +69
    -0
      README.md
  5. +50
    -0
      docker-compose.yml

+ 3
- 0
.dockerignore View File

@ -0,0 +1,3 @@
.*
*.yml
*.md

+ 1
- 0
.gitignore View File

@ -0,0 +1 @@
.env

+ 13
- 0
COPYING View File

@ -0,0 +1,13 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright 2018 Josh Habdas <jhabdas@protonmail.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

+ 69
- 0
README.md View File

@ -0,0 +1,69 @@
# High Tea
> Self-hosted git server with [Docker](https://www.docker.com), [Gitea](https://gitea.io/), [Postgres](https://www.postgresql.org) and [Traefik](https://traefik.io).
## Basic Usage
Start the stack daemonized with `docker-compose up -d`. View the logs with `docker-compose logs`. Restart with [`restart`](https://docs.docker.com/compose/reference/restart/) and [`stop`](https://docs.docker.com/compose/reference/stop/) to stop.
## Requirements
- Domain. Pick one up on [Namecheap](https://go.habd.as/namecheap).
- Virtual Private Server. Get one with [Vultr](https://go.habd.as/vultr) or [DigitalOcean](https://go.habd.as/digitalocean).
## Installation
1. Follow the Traefik Let's Encrypt [Networking guide](https://docs.traefik.io/user-guide/docker-and-lets-encrypt/#networking).
2. Copy this repository to the host machine.
3. Set `traefik.frontend.rule` in `docker-compose.yml` for your domain.
3. Start the stack with [`docker compose up -d`](https://docs.docker.com/compose/reference/up/).
4. Navigate to the host machine in a browser.
5. Access `/install` and complete initial configuration.
### Initial Configuration
Select `PostgreSQL` as the database type. Use `db` as the host and set the user, password and database name using [environment variables](https://docs.docker.com/compose/environment-variables/).
Defaults in `docker-compose.yml`:
```bash
POSTGRES_USER=gitea
POSTGRES_PASSWORD=gitea
POSTGRES_DB=gitea
```
Under _General Settings_ set `Site Title`, `SSH Server Domain` and `Gitea Base URL`. These can be changed later in the Gitea `app.ini` config file.
Configure the admin user under the _Administrator Account Settings_ then **Install Gitea** to complete initial configuration.
### Using the Dark Theme
To use the dark theme modify `app.ini` as specified in [Customizing the look of Gitea](https://docs.gitea.io/en-us/customizing-gitea/#customizing-the-look-of-gitea) then restart Gitea with `docker-compose restart gitea`.
### Accessing via SSH
Until Traefik [supports TCP](https://github.com/containous/traefik/issues/10) SSH connections to Gitea are exposed directly from the container to the host on port `2222` using the [`ports`](https://docs.docker.com/compose/compose-file/compose-file-v2/#ports) setting in `docker-compose.yml`. While it's possible to bind from the container directly to port `22` on the host chances are your host already has an SSH daemon running on this port.
To automatically use port `2222` when using `git` to interact with the remote create a `config` file in `~/.ssh/` on your client and add `Port` like:
```bash
Host gitea git.example.com
HostName git.example.com
Port 2222
IdentityFile ~/.ssh/gitea_rsa
User exampleuser
```
Where `git.example.com` matches your host domain and `someuser` matches your Gitea username.
### Additional Configuration
See the [Gitea Docs](https://docs.gitea.io/) for additional configuration options. For support head over to the [Gitea Forums](https://discourse.gitea.io).
## License
Copyright (C) 2018 Josh Habdas <jhabdas@protonmail.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the COPYING file for more details.

+ 50
- 0
docker-compose.yml View File

@ -0,0 +1,50 @@
#
# Copyright (c) 2018, 13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
version: "2.1"
services:
gitea:
image: gitea/gitea:latest
depends_on:
db:
condition: service_healthy
environment:
- USER_UID=1000
- USER_GID=1000
restart: always
networks:
- web
- default
volumes:
- /opt/gitea:/data
expose:
- "3000"
ports:
- "2222:22"
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.frontend.rule=Host:git.example.com"
- "traefik.port=3000"
- "traefik.protocol=http"
db:
image: postgres:9.6
restart: always
environment:
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD=gitea
- POSTGRES_DB=gitea
volumes:
- /opt/postgres:/var/lib/postgresql/data
healthcheck:
test: "exit 0"
networks:
web:
external: true

Loading…
Cancel
Save