From c583ff7e551815ff866768ad684667e5fdc36e71 Mon Sep 17 00:00:00 2001 From: Woodpecker CI Date: Mon, 3 Apr 2023 14:18:48 +0000 Subject: [PATCH] Update docs --- docs/search/search_index.json | 2 +- docs/setup_nginx/index.html | 3 ++- docs/sitemap.xml.gz | Bin 201 -> 201 bytes 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/search/search_index.json b/docs/search/search_index.json index 3bd70c2..7173920 100644 --- a/docs/search/search_index.json +++ b/docs/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"

This is the documentation for GotHub, the free and open source alternative front-end for GitHub. It's mostly aimed towards developers and instance owners who want to self-host GotHub.

GotHub website GotHub repository

"},{"location":"environment_variables/","title":"Environment variables used by GotHub","text":"

You can set these in two ways:

  1. Create a .env file in the root directory of GotHub and set the variables there.

  2. Set the variables in your environment.

"},{"location":"environment_variables/#instance-configuration","title":"Instance configuration","text":""},{"location":"environment_variables/#gothub_setup_complete","title":"GOTHUB_SETUP_COMPLETE","text":"

This variable is used by GotHub to check if you've completed setup or not. The GotHub setup wizard sets this to true for you. If it's empty, you will get a banner on GotHub's main page saying you haven't completed setup. Once you're done setting up GotHub, set this to true.

"},{"location":"environment_variables/#gothub_ip_logged","title":"GOTHUB_IP_LOGGED","text":"

If you log IPs on your instance, set this to true. Otherwise, set it to false.

"},{"location":"environment_variables/#gothub_request_url_logged","title":"GOTHUB_REQUEST_URL_LOGGED","text":"

If you log request URLs on your instance, set this to true. Otherwise, set it to false.

"},{"location":"environment_variables/#gothub_user_agent_logged","title":"GOTHUB_USER_AGENT_LOGGED","text":"

If you log user agents on your instance, set this to true. Otherwise, set it to false.

"},{"location":"environment_variables/#gothub_diagnostic_info_logged","title":"GOTHUB_DIAGNOSTIC_INFO_LOGGED","text":"

If you log diagnostic info on your instance, set this to true. Otherwise, set it to false.

"},{"location":"environment_variables/#gothub_instance_privacy_policy","title":"GOTHUB_INSTANCE_PRIVACY_POLICY","text":"

URL to your instance's privacy policy. Set to \"\" if you don't have one. For example: GOTHUB_INSTANCE_PRIVACY_POLICY=https://instance.dev/privacy-policy

"},{"location":"environment_variables/#gothub_instance_country","title":"GOTHUB_INSTANCE_COUNTRY","text":"

Country where your instance is hosted. For example: GOTHUB_INSTANCE_COUNTRY=Norway

"},{"location":"environment_variables/#gothub_instance_provider","title":"GOTHUB_INSTANCE_PROVIDER","text":"

Name of your ISP/Hosting provider. For example: GOTHUB_INSTANCE_PROVIDER=Altibox

"},{"location":"environment_variables/#gothub_instance_cloudflare","title":"GOTHUB_INSTANCE_CLOUDFLARE","text":"

If you're using Cloudflare, set this to true. Otherwise, set it to false.

"},{"location":"environment_variables/#gothub-server-configuration","title":"GotHub server configuration","text":""},{"location":"environment_variables/#gothub_port","title":"GOTHUB_PORT","text":"

Port to run GotHub on. For example: GOTHUB_PORT=8080. This gets overwritten by the \"--port\" flag if you pass it to the \"gothub serve\" command. Set to 3000 by default, optional.

"},{"location":"environment_variables/#gothub_user_agent","title":"GOTHUB_USER_AGENT","text":"

User agent to use when making requests to GitHub. For example: GOTHUB_USER_AGENT=GotHub/1.0.0. Set to Chrome on Windows 10 by default, optional.

"},{"location":"setup_caddy/","title":"Setting up Caddy for GotHub","text":"

Setting up the Caddy web server is not hard at all. Caddy is the recommended web server for GotHub, due it being made in Go, having HTTP/3 support and automatic certificate generation.

After installing Caddy, append the following to the Caddyfile:

gothub.domain.tld {\n    reverse_proxy localhost:3000\n}\n
"},{"location":"setup_docker/","title":"Setup GotHub in a Docker container","text":"

Note

Installing an automatic container update tool alongside GotHub is highly recommended. We recommend Watchtower.

"},{"location":"setup_docker/#requirements","title":"Requirements","text":""},{"location":"setup_docker/#run-method","title":"Run method","text":"

Note

We recommend you to use the Compose method mentioned below, because it's easier to maintain and update.

Our Docker image is available on the Codeberg registry here.

You can run GotHub in a Docker container by running the following command:

docker run -d --name gothub -p 3000:3000 codeberg.org/gothub/gothub:dev\n

You can also run the master branch of GotHub by replacing dev with latest. Confusing, right?

Warning

GotHub requires a couple of environment variables if you'd like to get listed on the instances list. We mention the most minimal command up there just in case someone wants to run GotHub locally. You can pass a .env file to the docker run command by adding --env-file .env to the command.

"},{"location":"setup_docker/#compose-method","title":"Compose method","text":"

We have a compose.yml file available on our Codeberg repository. You can find it here.

You can run GotHub in a Docker container by running the following command:

mkdir gothub\ncd gothub\nwget https://codeberg.org/gothub/gothub/raw/branch/dev/compose.yml\ndocker compose up -d\n

Warning

You should definitely edit the compose.yml file, as it contains a couple of environment variables you should fill out if you want to get listed on the instances list.

"},{"location":"setup_docker/#keep-gothub-up-to-date","title":"Keep GotHub up-to-date","text":"

We recommend you get an automatic container update tool alongside GotHub. We recommend Watchtower for this.

If you don't want to use Watchtower, you can update GotHub by running the following command:

docker compose pull && docker compose down && docker compose up -d\n
"},{"location":"setup_manual/","title":"Setup GotHub manually","text":"

Note

We recommend you to use Docker over manually running GotHub, because it's easier and you can have automatic updates via Watchtower. You can find the Docker documentation here. If you still want to run GotHub manually, you can continue reading.

"},{"location":"setup_manual/#requirements","title":"Requirements","text":""},{"location":"setup_manual/#installation","title":"Installation","text":"

You need to clone the repository. You can do this by running the following command:

git clone https://codeberg.org/gothub/gothub.git\n

Then, you need to build the binary. You can do this by running the following command:

go build\n
"},{"location":"setup_manual/#configuration","title":"Configuration","text":"

GotHub uses environment variables for configuration. You can find a list of all environment variables here.

GotHub has a setup wizard that will help you configure GotHub. Run the following command to start the setup wizard:

./gothub setup\n

The wizard will ask you a few questions about your privacy practices, where you're hosting etc. After you've answered all the questions, the wizard will generate a \".env\" file for you. You can then start GotHub by running the following command:

./gothub serve\n

You can also pass --port to specify a port to run GotHub on. This overrides the GOTHUB_PORT environment variable.

"},{"location":"setup_manual/#keep-gothub-up-to-date","title":"Keep GotHub up-to-date","text":"

GotHub's CLI has a command to update GotHub. You can run this command by running the following command:

./gothub update\n

It will try to pull from Git and then rebuild the binary. If it doesn't work, just run git pull and then go build.

"},{"location":"setup_nginx/","title":"Setting up NGINX for GotHub","text":"

Note

NGINX does not support automatic certificate generation. You need to use certbot to create and maintain the certificates but that is out of scope of this tutorial.

After installing NGINX, create /etc/nginx/conf.d/gothub.conf with the following contents

server {\n    listen 80;\n    listen [::]:80;\n    listen 443 ssl http2;\n    listen [::]:443 ssl http2;\n\n    server_name gothub.domain.tld;\n\n    # Recommended but not required\n    access_log off;\n    error_log /var/log/nginx/error.log crit;\n\n    location / {\n        proxy_pass http://127.0.0.1:3000;\n        proxy_set_header X-Forwarded-For $remote_addr;\n        proxy_set_header Host $host;    # so GotHub knows domain\n        proxy_http_version 1.1;     # to keep alive\n        proxy_set_header Connection \"\"; # to keep alive\n    }\n}\n
"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":"

This is the documentation for GotHub, the free and open source alternative front-end for GitHub. It's mostly aimed towards developers and instance owners who want to self-host GotHub.

GotHub website GotHub repository

"},{"location":"environment_variables/","title":"Environment variables used by GotHub","text":"

You can set these in two ways:

  1. Create a .env file in the root directory of GotHub and set the variables there.

  2. Set the variables in your environment.

"},{"location":"environment_variables/#instance-configuration","title":"Instance configuration","text":""},{"location":"environment_variables/#gothub_setup_complete","title":"GOTHUB_SETUP_COMPLETE","text":"

This variable is used by GotHub to check if you've completed setup or not. The GotHub setup wizard sets this to true for you. If it's empty, you will get a banner on GotHub's main page saying you haven't completed setup. Once you're done setting up GotHub, set this to true.

"},{"location":"environment_variables/#gothub_ip_logged","title":"GOTHUB_IP_LOGGED","text":"

If you log IPs on your instance, set this to true. Otherwise, set it to false.

"},{"location":"environment_variables/#gothub_request_url_logged","title":"GOTHUB_REQUEST_URL_LOGGED","text":"

If you log request URLs on your instance, set this to true. Otherwise, set it to false.

"},{"location":"environment_variables/#gothub_user_agent_logged","title":"GOTHUB_USER_AGENT_LOGGED","text":"

If you log user agents on your instance, set this to true. Otherwise, set it to false.

"},{"location":"environment_variables/#gothub_diagnostic_info_logged","title":"GOTHUB_DIAGNOSTIC_INFO_LOGGED","text":"

If you log diagnostic info on your instance, set this to true. Otherwise, set it to false.

"},{"location":"environment_variables/#gothub_instance_privacy_policy","title":"GOTHUB_INSTANCE_PRIVACY_POLICY","text":"

URL to your instance's privacy policy. Set to \"\" if you don't have one. For example: GOTHUB_INSTANCE_PRIVACY_POLICY=https://instance.dev/privacy-policy

"},{"location":"environment_variables/#gothub_instance_country","title":"GOTHUB_INSTANCE_COUNTRY","text":"

Country where your instance is hosted. For example: GOTHUB_INSTANCE_COUNTRY=Norway

"},{"location":"environment_variables/#gothub_instance_provider","title":"GOTHUB_INSTANCE_PROVIDER","text":"

Name of your ISP/Hosting provider. For example: GOTHUB_INSTANCE_PROVIDER=Altibox

"},{"location":"environment_variables/#gothub_instance_cloudflare","title":"GOTHUB_INSTANCE_CLOUDFLARE","text":"

If you're using Cloudflare, set this to true. Otherwise, set it to false.

"},{"location":"environment_variables/#gothub-server-configuration","title":"GotHub server configuration","text":""},{"location":"environment_variables/#gothub_port","title":"GOTHUB_PORT","text":"

Port to run GotHub on. For example: GOTHUB_PORT=8080. This gets overwritten by the \"--port\" flag if you pass it to the \"gothub serve\" command. Set to 3000 by default, optional.

"},{"location":"environment_variables/#gothub_user_agent","title":"GOTHUB_USER_AGENT","text":"

User agent to use when making requests to GitHub. For example: GOTHUB_USER_AGENT=GotHub/1.0.0. Set to Chrome on Windows 10 by default, optional.

"},{"location":"setup_caddy/","title":"Setting up Caddy for GotHub","text":"

Setting up the Caddy web server is not hard at all. Caddy is the recommended web server for GotHub, due it being made in Go, having HTTP/3 support and automatic certificate generation.

After installing Caddy, append the following to the Caddyfile:

gothub.domain.tld {\n    reverse_proxy localhost:3000\n}\n
"},{"location":"setup_docker/","title":"Setup GotHub in a Docker container","text":"

Note

Installing an automatic container update tool alongside GotHub is highly recommended. We recommend Watchtower.

"},{"location":"setup_docker/#requirements","title":"Requirements","text":""},{"location":"setup_docker/#run-method","title":"Run method","text":"

Note

We recommend you to use the Compose method mentioned below, because it's easier to maintain and update.

Our Docker image is available on the Codeberg registry here.

You can run GotHub in a Docker container by running the following command:

docker run -d --name gothub -p 3000:3000 codeberg.org/gothub/gothub:dev\n

You can also run the master branch of GotHub by replacing dev with latest. Confusing, right?

Warning

GotHub requires a couple of environment variables if you'd like to get listed on the instances list. We mention the most minimal command up there just in case someone wants to run GotHub locally. You can pass a .env file to the docker run command by adding --env-file .env to the command.

"},{"location":"setup_docker/#compose-method","title":"Compose method","text":"

We have a compose.yml file available on our Codeberg repository. You can find it here.

You can run GotHub in a Docker container by running the following command:

mkdir gothub\ncd gothub\nwget https://codeberg.org/gothub/gothub/raw/branch/dev/compose.yml\ndocker compose up -d\n

Warning

You should definitely edit the compose.yml file, as it contains a couple of environment variables you should fill out if you want to get listed on the instances list.

"},{"location":"setup_docker/#keep-gothub-up-to-date","title":"Keep GotHub up-to-date","text":"

We recommend you get an automatic container update tool alongside GotHub. We recommend Watchtower for this.

If you don't want to use Watchtower, you can update GotHub by running the following command:

docker compose pull && docker compose down && docker compose up -d\n
"},{"location":"setup_manual/","title":"Setup GotHub manually","text":"

Note

We recommend you to use Docker over manually running GotHub, because it's easier and you can have automatic updates via Watchtower. You can find the Docker documentation here. If you still want to run GotHub manually, you can continue reading.

"},{"location":"setup_manual/#requirements","title":"Requirements","text":""},{"location":"setup_manual/#installation","title":"Installation","text":"

You need to clone the repository. You can do this by running the following command:

git clone https://codeberg.org/gothub/gothub.git\n

Then, you need to build the binary. You can do this by running the following command:

go build\n
"},{"location":"setup_manual/#configuration","title":"Configuration","text":"

GotHub uses environment variables for configuration. You can find a list of all environment variables here.

GotHub has a setup wizard that will help you configure GotHub. Run the following command to start the setup wizard:

./gothub setup\n

The wizard will ask you a few questions about your privacy practices, where you're hosting etc. After you've answered all the questions, the wizard will generate a \".env\" file for you. You can then start GotHub by running the following command:

./gothub serve\n

You can also pass --port to specify a port to run GotHub on. This overrides the GOTHUB_PORT environment variable.

"},{"location":"setup_manual/#keep-gothub-up-to-date","title":"Keep GotHub up-to-date","text":"

GotHub's CLI has a command to update GotHub. You can run this command by running the following command:

./gothub update\n

It will try to pull from Git and then rebuild the binary. If it doesn't work, just run git pull and then go build.

"},{"location":"setup_nginx/","title":"Setting up NGINX for GotHub","text":"

Note

NGINX does not support automatic certificate generation. You need to use certbot to create and maintain the certificates but that is out of scope of this tutorial. We also recommend you to try the Caddy web server, because it has automatic HTTPS, HTTP/3 and easier configuration.

After installing NGINX, create /etc/nginx/conf.d/gothub.conf with the following contents

server {\n    listen 80;\n    listen [::]:80;\n    listen 443 ssl http2;\n    listen [::]:443 ssl http2;\n\n    server_name gothub.domain.tld;\n\n    # Recommended but not required\n    access_log off;\n    error_log /var/log/nginx/error.log crit;\n\n    location / {\n        proxy_pass http://127.0.0.1:3000;\n        proxy_set_header X-Forwarded-For $remote_addr;\n        proxy_set_header Host $host;    # so GotHub knows domain\n        proxy_http_version 1.1;     # to keep alive\n        proxy_set_header Connection \"\"; # to keep alive\n    }\n}\n
"}]} \ No newline at end of file diff --git a/docs/setup_nginx/index.html b/docs/setup_nginx/index.html index 19964dd..8b532be 100644 --- a/docs/setup_nginx/index.html +++ b/docs/setup_nginx/index.html @@ -340,7 +340,8 @@

Setting up NGINX for GotHub

Note

-

NGINX does not support automatic certificate generation. You need to use certbot to create and maintain the certificates but that is out of scope of this tutorial.

+

NGINX does not support automatic certificate generation. You need to use certbot to create and maintain the certificates but that is out of scope of this tutorial. +We also recommend you to try the Caddy web server, because it has automatic HTTPS, HTTP/3 and easier configuration.

After installing NGINX, create /etc/nginx/conf.d/gothub.conf with the following contents

server {
diff --git a/docs/sitemap.xml.gz b/docs/sitemap.xml.gz
index bfa7ef794c9bdc8644f201974b298b2f28f959cd..a9c7c35b7be0945f2ea7b7e993faef0bd5b8ff0e 100644
GIT binary patch
delta 14
VcmX@fc#@G#zMF%?>A^&{!vG=g1knHh

delta 14
VcmX@fc#@G#zMF&N@BN8vhXEy$1&aUx