From 8aa6459e07e010fab8111ca4d06c52d7464fb423 Mon Sep 17 00:00:00 2001 From: Matt Marcha Date: Wed, 26 Jun 2024 17:55:15 +1200 Subject: [PATCH] Initial commit --- .gitignore | 1 + docker-compose.yml | 33 +++++++++++++++++++++++++++++++++ readme.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100755 .gitignore create mode 100755 docker-compose.yml create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..5f25951 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +forgejo diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100755 index 0000000..9b43d40 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +networks: + forgejo: + external: false + +services: + server: + image: codeberg.org/forgejo/forgejo:7 + container_name: forgejo + environment: + - USER_UID=1000 + - USER_GID=1000 + - FORGEJO__server__ENABLE_ACME=true + - FORGEJO__server__ACME_ACCEPTTOS=true + - FORGEJO__server__ACME_DIRECTORY=https + - FORGEJO__server__ACME_EMAIL=from+acme-git.marcha.me@marcha.me + - FORGEJO__server__PROTOCOL=https + - FORGEJO__server__REDIRECT_OTHER_PORT=true + - FORGEJO__server__PORT_TO_REDIRECT=3080 + - FORGEJO__server__DOMAIN=git.marcha.me + - FORGEJO__server__ROOT_URL=https://git.marcha.me/ + + restart: always + networks: + - forgejo + volumes: + - ./forgejo:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - '443:3000' + - '2222:22' + - '80:3080' + diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..05fd979 --- /dev/null +++ b/readme.md @@ -0,0 +1,42 @@ +# Forgejo conf + +Configuration for my instance of Forgejo using podman and podman-compose. + +## Prerequisite + +- `podman` & `podman-compose` installed + +- The domain/subdomain for the forge, here `git.marcha.me` + +- Open ports 22, 80, 443, 2222 + +## Deployment + +Clone the repository in a dedicated folder. `cd` in the folder then run `podman-compose up -d` + +Stop with `podman-compose down` + +### SSH configuration + +To use git with SSH, you'll need an SSH key + +`ssh-keygen -t ed25519 -a 100` + +Copy/Paste the public key in Forgejo. +Then on your device, update your ssh config: + +`nano ~/.ssh/config` + +Add the following + +``` +Host forge + User git + IdentityFile ~/.ssh/git + Hostname git.marcha.me + Port 2222 +``` + +SSH for the forge is now working in using git@forge. Ex: `git clone git@forge:Matt/ecofse.git ecofse` + +