From 2152b1ec45eae26fa669d9a08100357cc3af892f Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Wed, 30 Jun 2021 22:57:50 +0200 Subject: Add git hosting tutorial --- git.html | 186 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 git.html (limited to 'git.html') diff --git a/git.html b/git.html new file mode 100644 index 0000000..ca9ba75 --- /dev/null +++ b/git.html @@ -0,0 +1,186 @@ + + + + Hosting Your Own Git Repositories – LandChad.net + + + + + + + +

Hosting Your Own Git Repositories

+ +
+

+ Once you have your own VPS or other Internet-available server, you can + start hosting your own git repositories. The goal of this tutorial is + for you to go from + +

git clone github.com/...
+ + to + +
git clone YourLandChadDomainName.xyz/...
+ + so you can cultivate your own homegrown, grass fed code, rather than + relying on a centralized proprietary service like GitHub. +

+ +

What's not included in this tutorial

+ + + +

Installing git

+ +

+ You most likely already have it installed on your server, but if not, + run + +

apt install git
+ + We don't need any additional software, git itself ships + with everything needed to host a remote repository! +

+ +

Creating bare repositories

+ +

+ For each repository you want to host, you will need to manually create + what's called a "bare" repository on your server. These hold all the + commits and any other git data needed for your repository, but without + an expanded "index" in which you can just browse all the files of a + certain commit in the file system. +

+ +

+ These repositories need to be owned by the git user, and + you should probably pick a directory where you will store them all. One + sane choice is under /srv/git/, and we will use this as the + example directory for the rest of the tutorial, but any other path will + do as well. +

+ +

Become the git user and create the directory

+ +

+ If you're logged in to your server as root and have git + installed, you can become the git user by executing + +

su git
+ + Now navigate to/create your desired directory, for example + +

+cd /srv
+mkdir git
+        
+ +

Create the repo

+ +

+ Now you can create the bare repository with + + +

git init --bare my-repo.git
+ + By convention, bare repository names end with ".git". +

+ +

+ Repeat the above command for any other repositories you want to host. +

+ +

Syncing local repositories with your server

+ +

Set up SSH login for the git user

+ +

+ You will need to be able to login remotely via ssh as the + git user we've used before. To do this, you will either + need to set up a password for the git user with + +

passwd git
+ + or copy your public SSH key from your local machine to + /home/git/.ssh/authorized_keys. +

+ +

Syncing a new repository with your server

+

+ If you've just created a new repository on your local machine, you will + need to tell git where the remote repository is to be able + to sync with it (using commands like git push or + git pull). We do this by defining a "remote" for your + repository. +

+ +

+ A remote is just a named URL remembered in your repo's configuration. So + we need a name and a URL. By convention, the "main" remote is called + "origin". The URL has the format user@host:path, where + +

+

+ +

+ So, to create a new remote, run + +

git remote add origin git@yourdomain.xyz:/srv/git/my-repo.git
+ + Now you'll be able to run git push origin master to push + your commits or git pull origin to pull from the remote. +

+ +

Syncing an existing repository

+ +

+ If you've already set up your local repository to sync with a service + like GitHub it probably already has a remote called "origin". You can + see your repo's remotes with + +

git remote -v
+ + You can follow the above instructions, substituting an arbitrary other + name other than "origin" to create a differently named remote, e.g. + +
git remote add vps git@...
+ + Now you'll be able to push/pull with git push vps master + and git pull vps, respectively. +

+ +

+ Or, to completely sever ties with your centralized git provider, first + remove the original origin with + +

git remote remove origin
+ + and then follow the instructions as above. +

+
+ + + -- cgit v1.2.3 From e4913737cc7e6ca95b8d5c27c118c71dd5d88a4b Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Wed, 30 Jun 2021 23:01:14 +0200 Subject: Add contribution info --- git.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'git.html') diff --git a/git.html b/git.html index ca9ba75..bfeb086 100644 --- a/git.html +++ b/git.html @@ -180,6 +180,12 @@ mkdir git and then follow the instructions as above.

+ +

Contribution

+
LandChad.net
Because Everyone should be an Internet LandChad.
  • chad
  • RSS
  • BTC
  • XMR
  • Github
  • -- cgit v1.2.3 From 89c47b9236bbb7b05f9d24fbe2ad9d3239082429 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 30 Jun 2021 17:15:38 -0400 Subject: git tweaks --- git.html | 65 ++++++++++++++++++++++++++++++-------------------------------- index.html | 4 ++-- 2 files changed, 33 insertions(+), 36 deletions(-) (limited to 'git.html') diff --git a/git.html b/git.html index bfeb086..ad0fbae 100644 --- a/git.html +++ b/git.html @@ -9,45 +9,34 @@ -

    Hosting Your Own Git Repositories

    +

    Hosting Your Own Git Repositories

    Once you have your own VPS or other Internet-available server, you can start hosting your own git repositories. The goal of this tutorial is - for you to go from + for you to go from

    git clone github.com/...
    - to +

    to

    git clone YourLandChadDomainName.xyz/...
    - so you can cultivate your own homegrown, grass fed code, rather than +

    + so you can cultivate your own homegrown, grass-fed code, rather than relying on a centralized proprietary service like GitHub.

    -

    What's not included in this tutorial

    - -
      -
    • - We will not set up a web front end. Your only interaction with - these repos will be via the git command line tool. -
    • -
    • - We will not support multiple users. It's expected only you, the - server owner, have write access to these repos. -
    • -
    -

    Installing git

    You most likely already have it installed on your server, but if not, - run + run:

    apt install git
    +

    We don't need any additional software, git itself ships with everything needed to host a remote repository!

    @@ -75,24 +64,27 @@

    If you're logged in to your server as root and have git installed, you can become the git user by executing +

    su git
    +

    Now navigate to/create your desired directory, for example +

    -
    
    -cd /srv
    -mkdir git
    -        
    +
    cd /srv
    +mkdir git

    Create the repo

    Now you can create the bare repository with +

    git init --bare my-repo.git
    +

    By convention, bare repository names end with ".git".

    @@ -107,12 +99,12 @@ mkdir git

    You will need to be able to login remotely via ssh as the git user we've used before. To do this, you will either - need to set up a password for the git user with - -

    passwd git
    - + need to set up a password for the git user by running + passwd git, or copy your public SSH key from your local machine to /home/git/.ssh/authorized_keys. + See the SSH keys instructional for details + (just log in as git instead of root).

    Syncing a new repository with your server

    @@ -127,7 +119,8 @@ mkdir git

    A remote is just a named URL remembered in your repo's configuration. So we need a name and a URL. By convention, the "main" remote is called - "origin". The URL has the format user@host:path, where + "origin". The URL has the format user@host:path, where: +

    • @@ -135,7 +128,7 @@ mkdir git we've already worked with before.
    • - host is a DNS hostname pointing to your server. + host is your domain name. Alternatively you could even use your server's raw IP address.
    • @@ -146,10 +139,12 @@ mkdir git

      - So, to create a new remote, run + So, to create a new remote, run: +

      git remote add origin git@yourdomain.xyz:/srv/git/my-repo.git
      +

      Now you'll be able to run git push origin master to push your commits or git pull origin to pull from the remote.

      @@ -159,25 +154,27 @@ mkdir git

      If you've already set up your local repository to sync with a service like GitHub it probably already has a remote called "origin". You can - see your repo's remotes with + see your repo's remotes with: +

      git remote -v
      +

      You can follow the above instructions, substituting an arbitrary other name other than "origin" to create a differently named remote, e.g. +

      git remote add vps git@...
      +

      Now you'll be able to push/pull with git push vps master and git pull vps, respectively.

      Or, to completely sever ties with your centralized git provider, first - remove the original origin with - -

      git remote remove origin
      - + remove the original origin with: + git remote remove origin and then follow the instructions as above.

      diff --git a/index.html b/index.html index 06286fa..7c3b9ab 100644 --- a/index.html +++ b/index.html @@ -58,8 +58,8 @@ -- cgit v1.2.3 From f22f0fdc29a55bde2cabe3db26a4388b5c96ba5f Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 30 Jun 2021 17:34:27 -0400 Subject: random tweaks --- git.html | 3 ++- index.html | 24 ++++++++++++++---------- nextcloud.html | 4 ++-- pix/tor.png | Bin 28118 -> 0 bytes pix/tor.svg | 41 +++++++++++++++++++++++++++++++++++++++++ style.css | 5 +++++ tor.html | 4 +++- 7 files changed, 67 insertions(+), 14 deletions(-) delete mode 100644 pix/tor.png create mode 100644 pix/tor.svg (limited to 'git.html') diff --git a/git.html b/git.html index ad0fbae..b5dd616 100644 --- a/git.html +++ b/git.html @@ -9,9 +9,10 @@ -

      Hosting Your Own Git Repositories

      +

      Hosting Your Own Git Repositories

      +

      Once you have your own VPS or other Internet-available server, you can start hosting your own git repositories. The goal of this tutorial is diff --git a/index.html b/index.html index 7c3b9ab..f6803ea 100644 --- a/index.html +++ b/index.html @@ -45,6 +45,20 @@

    • Get a secure HTTPS connection with Certbot.
    • +

      Excellent Extras

      + + +

      "Build your own platform!"

      + +

      Accepting Cryptocurrency Tips

      -

      Excellent Extras

      - -

      In the Works...

      diff --git a/nextcloud.html b/nextcloud.html index 40c5dba..b5b7021 100644 --- a/nextcloud.html +++ b/nextcloud.html @@ -9,10 +9,10 @@ -

      logo Setting up a Nextcloud Instance

      +

      Setting up a Nextcloud Instance

      - +logo

      What is Nextcloud?

      logoNextcloud is a free and open source solution for cloud storage. However it can also do other things, such as manage your email, notes, calender, tasks, and can even connect to the Fediverse (think Mastodon and Pleroma). Pretty much every service that Google has to offer has a much better alternative as a Nextcloud app and this is a must-have for anyone wanting to get away from Google services but still wants a traditional cloud experience (in the likes of Google Services, anyways).

      diff --git a/pix/tor.png b/pix/tor.png deleted file mode 100644 index 1bac8e2..0000000 Binary files a/pix/tor.png and /dev/null differ diff --git a/pix/tor.svg b/pix/tor.svg new file mode 100644 index 0000000..4d7eefd --- /dev/null +++ b/pix/tor.svg @@ -0,0 +1,41 @@ + + + + onion-bg + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/style.css b/style.css index 1b6a37a..40eee45 100644 --- a/style.css +++ b/style.css @@ -69,6 +69,7 @@ pre { p img, li img, h1 img, h2 img, h3 img, h4 img { vertical-align: middle ; max-width: 1em; + max-height: 1em; border: none ; display: inline ; } @@ -79,6 +80,10 @@ img { display: block ; border: solid 5px beige ; } +.titleimg { + border: none ; + height: 150px ; +} strong { color: orange ; } diff --git a/tor.html b/tor.html index 1da2656..db4ec64 100644 --- a/tor.html +++ b/tor.html @@ -9,9 +9,11 @@ -

      Mirror Your Site Over Tor onion

      +

      Mirror Your Site Over Tor

      + + Tor logo

      Now that you have a website, why not offer it on a private alternative such as the onion network?

      -- cgit v1.2.3