From 2ea5001f4ea7fab95179abaa0e0db4c874dacbfe Mon Sep 17 00:00:00 2001 From: Don Delmar Davis Date: Mon, 4 Jan 2021 08:51:40 -0800 Subject: Document initial server setup --- README.md | 33 ++++++++++++++++++++++++++++----- clone-repos.py | 9 ++++++--- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6779dbd..385f201 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,43 @@ # gitea-configuration + Build notes for getea server. +## Server Setup +### Installing pre-requisites +We are building on a ubuntu/focal/cloud (from lxc's images) container with preseeded admin accounts. ``` -apt-get -y install curl postgresql git +apt-get -y install curl postgresql apache2 git apt-get install postfix +... add as a Satelite (null client) ... +``` +We want to use a single git user so we add it (will deal with this later) + +``` adduser --system --shell /bin/bash --group --disabled-password --home /home/git git +``` +We are going to use the package provided by packaging.gitlab.io + +``` curl -sL -o /etc/apt/trusted.gpg.d/morph027-gitea.asc https://packaging.gitlab.io/gitea/gpg.key deb [trusted=yes arch=amd64] https://packaging.gitlab.io/gitea gitea main" | sudo tee /etc/apt/sources.list.d/morph027-gitea.list update.sh apt-get install gitea +``` +### Setting up postgresql database +``` su - postgres postgres@shelly:~$ createuser -P git ... add passwd postgres@shelly:~$ createdb gitea -O git -ssh-keygen -cat ~/.ssh/id_rsa.pub -cd ~gitea/gitea-repositories/feurig -git clone --mirror git@github.com:feurig/redmine-configuration.git +``` +### Initial configuration +Once gitea is installed go to myservername:3000 and navigate to the login in the upper right corner. Fill in the database,username, and dbpassword. Replace localhost with your servers fqdn. Create admin user (remember password here) + + + +## references +* [https://gitlab.com/packaging/gitea](https://gitlab.com/packaging/gitea) +* [https://bryangilbert.com/post/devops/how-to-setup-gitea-ubuntu/](https://bryangilbert.com/post/devops/how-to-setup-gitea-ubuntu/) +* [https://luxagraf.net/src/gitea-nginx-postgresql-ubuntu-1804](https://luxagraf.net/src/gitea-nginx-postgresql-ubuntu-1804) +* [https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) \ No newline at end of file diff --git a/clone-repos.py b/clone-repos.py index db26a00..cdefad8 100755 --- a/clone-repos.py +++ b/clone-repos.py @@ -1,8 +1,13 @@ #!/usr/bin/python """-------------------------------------------------------------------------clone-repos.py + +STUB FOR REWRITE: +This should be segmented into servertomirror/organization/user/repository +and the sources should be consolidated into either a file or other data source. + Make mirror copies of repos from github and bitbucket. Author: D. Delmar Davis -Copyleft: (c) 2020 D. Delmar Davis +Copyleft: (c) 2021 D. Delmar Davis Liscense: mit """ #from github import Github @@ -51,5 +56,3 @@ for repo in bitbucketrepos: #user = g.get_user(username) #for repo in user.get_repos(): # print"'"+username+"/"+repo.name+"'," - - -- cgit v1.2.3