From 97770a9718f7a512b143ac02e7b35c1b3b199db9 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Fri, 18 Nov 2022 19:34:41 -0700 Subject: [PATCH 1/3] Initial commit --- README.md | 19 ++++++++++++++++-- gitea/README.md | 3 +++ gitea/docker-compose.yml | 42 ++++++++++++++++++++++++++++++++++++++++ gitea/run-this-first.sh | 3 +++ 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 gitea/README.md create mode 100644 gitea/docker-compose.yml create mode 100755 gitea/run-this-first.sh diff --git a/README.md b/README.md index 8b6c0ab..6ed10b2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ -# hosting -Documentation and code related to laconic self-hosting +# Laconic Hosting +Documentation and code related to self-hosting laconic network development and build services. +## Goals +1. Bootstrap development services for Laconic including source code repository, CI/CD pipeline, package registries. +1. Achieve #1 relying only on the following prerequisites: + * General purpose computer hardware + * Popular Linux distributions + * Base software construction tools: compilers and so on + * Docker (->Podman?) + * Internet connectivity + * Public DNS + * A set of "seed" git repositories, hosted at an existing Laconic deployment, or GitHub for first-generation seed. +2. Do not require any of the following (although they may be used if desired): + * Commercial cloud hosting services + * Public package registries + * Public container repositories + * Closed source software diff --git a/gitea/README.md b/gitea/README.md new file mode 100644 index 0000000..0f21388 --- /dev/null +++ b/gitea/README.md @@ -0,0 +1,3 @@ +## Manual deployment notes +### Gitea +1. Create admin user in web UI on initial setup diff --git a/gitea/docker-compose.yml b/gitea/docker-compose.yml new file mode 100644 index 0000000..d4b9e42 --- /dev/null +++ b/gitea/docker-compose.yml @@ -0,0 +1,42 @@ +version: "3" + +networks: + gitea: + external: false + +services: + server: + image: gitea/gitea:1.17.1 + container_name: gitea + environment: + - USER_UID=1000 + - USER_GID=1000 + - GITEA__database__DB_TYPE=postgres + - GITEA__database__HOST=db:5432 + - GITEA__database__NAME=gitea + - GITEA__database__USER=gitea + - GITEA__database__PASSWD=gitea + restart: always + networks: + - gitea + volumes: + - ./gitea:/data + - /etc/timezone:/etc/timezone:ro + - /etc/localtime:/etc/localtime:ro + ports: + - "3000:3000" + - "222:22" + depends_on: + - db + + db: + image: postgres:14 + restart: always + environment: + - POSTGRES_USER=gitea + - POSTGRES_PASSWORD=gitea + - POSTGRES_DB=gitea + networks: + - gitea + volumes: + - ./postgres:/var/lib/postgresql/data diff --git a/gitea/run-this-first.sh b/gitea/run-this-first.sh new file mode 100755 index 0000000..3c2c89d --- /dev/null +++ b/gitea/run-this-first.sh @@ -0,0 +1,3 @@ +#!/bin/sh +mkdir -p ./gitea +mkdir -p ./postgres From a2287c0ece391abdea9ea084314856f113136ad5 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 20 Nov 2022 22:35:19 -0700 Subject: [PATCH 2/3] Initial work on drone --- drone/README.md | 0 drone/docker-compose.yml | 23 +++++++++++++++++++++++ drone/run-this-first.sh | 2 ++ gitea/docker-compose.yml | 1 + 4 files changed, 26 insertions(+) create mode 100644 drone/README.md create mode 100644 drone/docker-compose.yml create mode 100755 drone/run-this-first.sh diff --git a/drone/README.md b/drone/README.md new file mode 100644 index 0000000..e69de29 diff --git a/drone/docker-compose.yml b/drone/docker-compose.yml new file mode 100644 index 0000000..db1d8a5 --- /dev/null +++ b/drone/docker-compose.yml @@ -0,0 +1,23 @@ +version: "3" + +services: + server: + image: drone/drone:2.15.0 + container_name: drone + environment: + - DRONE_GITEE_SERVER=http://host.docker.internal:3000 + - DRONE_GITEE_CLIENT_ID=f7018cdd7c2a2515eb0cc3eeea039a3aeda0991a520c9e6f7eca37b97761de20 + - DRONE_GITEE_CLIENT_SECRET=a29f1465460f620d1238b6ebf207ae6778a6bfd074b3c7befe72d5f9647ed02c + - DRONE_GITEE_API_SERVER=http://host.docker.internal:3000/api/v5 + - DRONE_RPC_SECRET=13807911a5934895854d1cc0dceea44a + - DRONE_SERVER_HOST=localhost + - DRONE_SERVER_PROTO=http + restart: always + volumes: + - ./drone:/data + extra_hosts: + - "host.docker.internal:host-gateway" + # TODO: remove fixed host port number + ports: + - "7080:80" + - "7443:443" diff --git a/drone/run-this-first.sh b/drone/run-this-first.sh new file mode 100755 index 0000000..9b7ad28 --- /dev/null +++ b/drone/run-this-first.sh @@ -0,0 +1,2 @@ +#!/bin/sh +mkdir -p ./drone diff --git a/gitea/docker-compose.yml b/gitea/docker-compose.yml index d4b9e42..39538ce 100644 --- a/gitea/docker-compose.yml +++ b/gitea/docker-compose.yml @@ -23,6 +23,7 @@ services: - ./gitea:/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro + # TODO: remove fixed host port number ports: - "3000:3000" - "222:22" From 18f83c1ec33054b702ac127e7e9168ef3f34d167 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Wed, 14 Dec 2022 13:13:09 -0700 Subject: [PATCH 3/3] Remove drone --- drone/README.md | 0 drone/docker-compose.yml | 23 ----------------------- drone/run-this-first.sh | 2 -- 3 files changed, 25 deletions(-) delete mode 100644 drone/README.md delete mode 100644 drone/docker-compose.yml delete mode 100755 drone/run-this-first.sh diff --git a/drone/README.md b/drone/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/drone/docker-compose.yml b/drone/docker-compose.yml deleted file mode 100644 index db1d8a5..0000000 --- a/drone/docker-compose.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: "3" - -services: - server: - image: drone/drone:2.15.0 - container_name: drone - environment: - - DRONE_GITEE_SERVER=http://host.docker.internal:3000 - - DRONE_GITEE_CLIENT_ID=f7018cdd7c2a2515eb0cc3eeea039a3aeda0991a520c9e6f7eca37b97761de20 - - DRONE_GITEE_CLIENT_SECRET=a29f1465460f620d1238b6ebf207ae6778a6bfd074b3c7befe72d5f9647ed02c - - DRONE_GITEE_API_SERVER=http://host.docker.internal:3000/api/v5 - - DRONE_RPC_SECRET=13807911a5934895854d1cc0dceea44a - - DRONE_SERVER_HOST=localhost - - DRONE_SERVER_PROTO=http - restart: always - volumes: - - ./drone:/data - extra_hosts: - - "host.docker.internal:host-gateway" - # TODO: remove fixed host port number - ports: - - "7080:80" - - "7443:443" diff --git a/drone/run-this-first.sh b/drone/run-this-first.sh deleted file mode 100755 index 9b7ad28..0000000 --- a/drone/run-this-first.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -mkdir -p ./drone