GOTWEBD.CONF(5)
π NAME π
gotwebd.conf β the configuration file for gotwebd(8). Yep, itβs a File Formats Manual page, section 5, iykyk. β¨
π¦ DESCRIPTION π¦
Okay so gotwebd.conf is the run-time configuration file for gotwebd(8). Itβs where you tell your Got web server how to act, and itβs giving main character energy but make it settings. π
The file format is line-based, with one configuration directive per line. Comments can be put anywhere in the file using a hash mark (#), and they extend to the end of the current line. π
Argument names that donβt begin with a letter, digit, or underscore β plus reserved words like listen, server, or user β must be quoted. Arguments containing whitespace should be surrounded by double quotes (").
Macros can be defined and later expanded in context. Macro names must start with a letter, digit, or underscore, and may contain any of those characters, but they may not be reserved words. Macros are not expanded inside quotes. For example:
lan_addr = "192.168.0.1"
listen on $lan_addr port 9090
π GLOBAL CONFIGURATION π
The available global configuration directives are as follows, bestie:
chroot pathβ Set the path to thechroot(2)environment ofhttpd(8). If not specified, it defaults to/var/www, the home directory of thewwwuser. Setting the path to/effectively disableschroot. π«Άhtdocs pathβ Set the path to the directory which contains static files linked from HTML generated bygotwebd(8), such asgotweb.css. The specified path will be looked up relative to the chroot directory ofhttpd(8). If not specified thenhtdocs/gotwebdwill be used.
Whether these files will be served by gotwebd(8) or by httpd(8) depends on how request routing is configured in httpd(8).
This setting can also be configured on a per-server basis. β¨
gotweb_url_root pathβ Sets the URL path under whichhttpd(8)is routing requests togotwebd(8). Defaults to"/".
The specified path should match the path of the location block in httpd.conf(5) which forwards requests to gotwebd(8) via the FastCGI socket. If the URL path is not configured correctly then gotwebd(8) will not be able to serve static files from the htdocs directory. Browsers will not be able to load CSS and image files unless these files are served directly from httpd(8).
This setting can also be configured on a per-server basis. π
repos_url_path pathβ Sets the URL path under which Git repositories will be displayed bygotwebd(8). The path specified here is relative togotweb_url_root.
Defaults to "/". This default should only be changed if a website is configured as the landing page instead of the usual index page shown by gotwebd(8). Otherwise, changing repos_url_path will result in "not found" errors when browsers attempt to visit the gotweb root URL path.
This setting can also be configured on a per-server basis. π¦
disable authenticationβ Disable authentication, allowing any browser to view any repository not hidden via thehide repositories,hide repository, orrespect_exportokdirectives. Authentication is disabled by default. πenable authentication [insecure]β Enable authentication, requiring browsers to present a login token cookie before read-only repository access is granted. Authentication can also be configured on a per-server or per-repository basis.
Browsers presenting a valid login token cookie will be mapped to the user account which obtained the login token over SSH from the weblogin command of gotsh(1).
Unauthenticated browsers will be mapped to the user account which runs httpd(8). This user account can be set with the www user directive. Attempts to read repositories as this user will be denied unless authentication is disabled for the repository.
Unless the insecure keyword is used, the login token cookie will be marked as "Secure", which causes browsers to only send the cookie when connected to the web server over a TLS connection. π₯
listen on address port numberβ Configure an address and port for incoming FastCGI connections. Valid address arguments are hostnames, IPv4 and IPv6 addresses. The port argument may be a number or a service name defined inservices(5). May be specified multiple times to build up a list of listening sockets. πlisten on socket pathβ Configure a Unix-domain socket for incoming FastCGI connections. May be specified multiple times to build up a list of listening sockets.
While the specified path must be absolute, it should usually point inside the web serverβs chroot directory such that the web server can access the socket. π
login hint port numberβ Sets the SSH port number displayed in login hints which are shown on the error page if authentication has failed. This can be used to point SSH clients at the correct port number whensshd(8)is listening on a non-default port. πlogin hint user nameβ Sets the user name displayed in login hints which are shown on the error page if authentication has failed. This can be used to advertise the name of an anonymous user account which has been given read access to one or more repositories via thepermitdirective.
If not set then no login hint will be displayed and users will somehow need to learn about using the gotsh(1) weblogin command via other means. π
This setting can also be configured on a per-server basis. π
login socket pathβ Set the path to the Unix-domain socket forgotsh(1)weblogincommands. By default the path/var/run/gotweb-login.sockwill be used. πcontrol socket pathβ Set the path to the Unix-domain socket forgotwebctl(8)commands. By default the path/var/run/gotwebd.sockwill be used. π§prefork numberβ Spawn enough processes such that number requests can be handled in parallel. By default,gotwebd(8)will handle up to3requests in parallel. The maximum allowed is32. βuser userβ Set the user which will rungotwebd(8). If not specified, the user_gotwebdwill be used. π«Άwww user userβ Set the user which runshttpd(8). Needed to ensure that the web server can access Unix-domain sockets created bygotwebd(8). If not specified, the userwwwwill be used. πssh_hostkey_ecdsa stringβ Set the serverβs SSH ECDSA host key fingerprint to be displayed beneath login hints and beneath clone URLs which use the SSH protocol. πssh_hostkey_ed25519 stringβ Set the serverβs SSH ED25519 host key fingerprint to be displayed beneath login hints and beneath clone URLs which use the SSH protocol. πssh_hostkey_rsa stringβ Set the serverβs SSH RSA host key fingerprint to be displayed beneath login hints and beneath clone URLs which use the SSH protocol. π
Heads up, bestie: if nolistendirective is used,gotwebd(8)will listen on the Unix-domain socket at/var/www/run/gotweb.sock. No cap. π
π SERVER CONFIGURATION π
At least one server context must exist for gotwebd(8) to function. In case no server context is defined in the configuration file, a default server context will be used which uses default parameters for all applicable settings. β¨
A server context is declared with a unique name, followed by server-specific configuration directives inside curly braces:
server name {...}
If more than one server is defined, each name should match the hostname which browsers use to reach the corresponding server. The first server defined is used if the requested hostname is not matched by any server block. πΈ
The available server configuration directives are as follows:
custom_css pathβ Set the path to a custom Cascading Style Sheet (CSS) to be used. If this option is not specified then the default style sheetgotweb.csswill be used.
This path must be valid in the web serverβs URL space since browsers will attempt to fetch it. π
logo pathβ Set the path to an image file containing a logo to be displayed. Defaults togot.png.
This path must be valid in the web serverβs URL space since browsers will attempt to fetch it. π¦
htdocs pathβ Set the path to the directory which contains static files linked from HTML generated bygotwebd(8), such asgotweb.css. The specified path will be looked up relative to the chroot directory ofhttpd(8). If not specified then the globalhtdocsconfiguration setting applies.
Whether these files will be served by gotwebd(8) or by httpd(8) depends on how request routing is configured in httpd(8). π
gotweb_url_root pathβ Sets the URL path under whichhttpd(8)is routing requests to thisgotwebd(8)server. Defaults to"/".
The specified path should match the path of the location block in httpd.conf(5) which forwards requests to gotwebd(8) via the FastCGI socket. If the URL path is not configured correctly then gotwebd(8) will not be able to serve static files from the htdocs directory. Browsers will not be able to load CSS and image files unless these files are served directly from httpd(8).
If not set then the global gotweb_url_root setting will be used. π
repos_url_path pathβ Sets the URL path under which Git repositories will be displayed bygotwebd(8). The path specified here is relative togotweb_url_root.
Defaults to "/". This default should only be changed if a website is configured as the landing page instead of the usual index page shown by gotwebd(8). Otherwise, changing repos_url_path will result in "not found" errors when browsers attempt to visit the gotweb root URL path.
If not set then the global repos_url_path setting will be used. π₯
disable authenticationβ Disable authentication for this server, allowing any browser to view any repository not hidden via thehide repositories,hide repository, orrespect_exportokdirectives. Authentication can also be configured on a per-repository basis.
If not specified, the global configuration context determines whether authentication is disabled. π«Ά
enable authentication [insecure]β turns authentication ON, bestie, so browsers have to present a login token cookie before they get read-only repository access π . You can also configure authentication on a per-repository basis. If this isnβt specified, the global configuration context decides whether authentication is enabled. Periodt.hide repositories on | offβ controls whether repositories are hidden by default. Hidden repositories literally cannot be browsed viagotwebd(8). By default,hide repositoriesis set tooffand all repositories found in therepos_pathwill be displayed. Ifhide repositoriesis set toon, then a repository will only be displayed if its repository-specifichide repositoryparameter is set tooff. Repositories will be hidden regardless of whether authentication is enabled and has failed or succeeded. No cap.login hint user nameβ sets the user name to use in login hints displayed when authentication fails. If itβs not set, then the login hint setting in the global configuration context will be used β¨.logo_url urlβ sets a hyperlink for the logo. Defaults tohttps://gameoftrees.orgπ.max_commits_display numberβ sets the maximum amount of commits and tags displayed per page. Defaults to25π.max_repos_display numberβ sets the maximum amount of repositories displayed on the index screen. Defaults to25. Set it to zero to show all the repositories without pagination π¦.repos_path pathβ sets the path to the directory which contains Git repositories that the server should publish. This path is absolute. Repositories can be served even if they reside outside the web serverβs chroot directory. Defaults to/got/publicinside the web serverβs chroot directory. Thechrootdirective must be used before the server declaration in order to take effect π.ssh_hostkey_ecdsa stringβ sets the serverβs SSH ECDSA host key fingerprint to be displayed beneath login hints and beneath clone URLs which use the SSH protocol. If itβs not set, then SSH fingerprints found in the global configuration context will be used π§.ssh_hostkey_ed25519 stringβ sets the serverβs SSH ED25519 host key fingerprint to be displayed beneath login hints and beneath clone URLs which use the SSH protocol. If itβs not set, then SSH fingerprints found in the global configuration context will be used πΈ.ssh_hostkey_rsa stringβ sets the serverβs SSH RSA host key fingerprint to be displayed beneath login hints and beneath clone URLs which use the SSH protocol. If itβs not set, then SSH fingerprints found in the global configuration context will be used β.
π repository name {...} π
Sets options which apply to a particular repository served by this server. A repository context is declared with a unique name, followed by repository-specific configuration directives inside curly braces.
The repository will be looked up within the serverβs repos_path, where the directory name can exist with or without a β.gitβ suffix.
For each repository, access rules can be configured using the permit and deny configuration directives. Multiple access rules can be specified, and the last matching rule determines the action taken.
If no access rules are set in a repository context, or if a repository exists in the serverβs repos_path without being mentioned in gotwebd.conf at all, then the access rules set in the server and global configuration contexts apply. If no rule matches then the repository will be inaccessible if authentication is enabled. Thatβs the tea β.
The available repository configuration directives are as follows:
clone_url stringβ sets the repository Git clone URL shown on the repository summary page. Thestringparameter should be wrapped in quotes and should be a valid URL for use withgot cloneorgit clone. If no clone URL is set ingotwebd.confthen URLs stored in the repositoryβscloneurlfile will be shown instead. This file may contain multiple URLs, one per line π₯.ssh_hostkey_ecdsa stringβ sets the serverβs SSH ECDSA host key fingerprint to be displayed beneath the clone URL. Should be set when the clone URL uses the SSH protocol. If itβs not set, then SSH fingerprints found in the server or global configuration context will be used.ssh_hostkey_ed25519 stringβ sets the serverβs SSH ED25519 host key fingerprint to be displayed beneath the clone URL. Should be set when the clone URL uses the SSH protocol. If itβs not set, then SSH fingerprints found in the server or global configuration context will be used.ssh_hostkey_rsa stringβ sets the serverβs SSH RSA host key fingerprint to be displayed beneath the clone URL. Should be set when the clone URL uses the SSH protocol. If itβs not set, then SSH fingerprints found in the server or global configuration context will be used.description stringβ sets the repository description shown on the repository listing page. Thestringparameter should be wrapped in quotes and can only contain one line of text. If no description is set ingotwebd.confthen the description stored in the repositoryβsdescriptionfile will be shown instead. This file may contain multiple lines of text π.deny identityβ denies repository access to users with the usernameidentity. Group names may be matched by prepending a colon (:) toidentity. Numeric IDs are also accepted π.permit identityβ permits repository access to users with the usernameidentity. Group names may be matched by prepending a colon (:) toidentity. Numeric IDs are also accepted π«Ά.disable authenticationβ disables authentication, allowing any browser to view the repository. Any access rules configured withpermitordenydirectives for this repository will be ignored. If itβs not specified, the server context or global context determines whether authentication is disabled π.enable authentication [insecure]β enables authentication, requiring browsers to present a login token cookie before read-only repository access is granted. If itβs not specified, the server context or global context determines whether authentication is enabled π .hide repository on | offβ controls whether the repository is hidden. Hidden repositories cannot be browsed viagotwebd(8). If itβs not set, the server contextβshide repositoriesparameter determines whethergotwebd(8)will display the repository π.
π¦ website url-path {...} π¦
Shows a web site when the browser visits the given url-path.
For each web site, access rules can be configured using the permit and deny configuration directives. Multiple access rules can be specified, and the last matching rule determines the action taken.
If no access rules are set in a web site context then the access rules set in the server and global configuration contexts apply. If no rule matches then the web site will be inaccessible if authentication is enabled.
The hide repository or respect_exportok directives do not apply to web site content.
Website content must conform to the Content-Security-Policy (CSP) generated by gotwebd(8), which is:
default-src 'self'; script-src 'self'; object-src 'none';
The available website configuration parameters are as follows:
deny identityβ denies web site access to users with the usernameidentity. Group names may be matched by prepending a colon (:) toidentity. Numeric IDs are also accepted.permit identityβ permits web site access to users with the usernameidentity. Group names may be matched by prepending a colon (:) toidentity. Numeric IDs are also accepted.disable authenticationβ disables authentication, allowing any browser to view the web site. Any access rules configured withpermitordenydirectives for this web site will be ignored. If itβs not specified, the server context or global context determines whether authentication is disabled.enable authentication [insecure]β enables authentication, requiring browsers to present a login token cookie before access to the web site is granted. If itβs not specified, the server context or global context determines whether authentication is enabled.repository nameβ serves web site content from the specified Git repository. The repository will be looked up within the serverβsrepos_path, where the directory name can exist with or without a β.gitβ suffix. Therepositoryparameter is mandatory π.branch nameβ looks up files to serve as web site content on the specified branch in the repository. By default, the branch resolved via the repositoryβsHEADreference is used. If thenamedoes not begin withrefs/headsthen the name is searched in therefs/headsreference namespace.path pathβ looks up files to serve as web site content at the specifiedpathin the repository. Defaults to the root directory,/π.respect_exportok on | offβ flips on the whole "is this repo even allowed to be seen" vibe check: the repo only shows up if it's got that magicgit-daemon-export-okfile inside it β and like, that's regardless of whether authentication is enabled and whether the auth actually failed or succeeded. Off by default, so nobody's hiding unless you say so πshow_repo_age on | offβ toggles whether we show off when the repo was last touched. On by default β¨show_repo_cloneurl on | offβ toggles showing the clone URLs for a repo. Ngl this one needs a lil help from you: either the repo's option has to be set, or you gotta create acloneurlfile inside the repo with one URL per line. On by default π«Άshow_repo_description on | offβ toggles showing the repo description. On by default. Bestie, you should update thedescriptionfile inside the repo with an actual description. Or (iconic alternative), you can set it via the per-repositorydescriptionoption right ingotwebd.confπshow_repo_owner on | offβ sets whether the repo owner gets shown. On by default. For this to work you need anownerfile inside the repository, or anownerfield under the[gotweb]or[gitweb]section in the config file inside the repository. Like so:
[gotweb]
owner = "Your Name"
And heads up β if both exist, the owner file wins over the config π
site_link stringβ the site link name that shows up on the index page. Defaults toRepositories.site_name stringβ the displayed site name title. Defaults toGotweb.site_owner stringβ the displayed site owner. Defaults toGot Owner.show_site_owner on | offβ toggles showing the site owner. On by default πΈsummary_commits_display numberβ the max number of commits to show on the summary page. Defaults to10.summary_tags_display numberβ the max number of tags to show on the summary page. Defaults to3.
β¨ TYPES β¨
Lowkey the most underrated section imo. This is where you configure media types π¨
So when it's serving plain files β think style-sheets, images, or any other web site content β gotwebd(8) will set the Content-Type of the response header based on the file extension of the matching media type. And if you don't specify anything? No stress, gotwebd(8) comes with built-in media types for text/css, text/html, text/plain, text/xml, image/gif, image/png, image/jpeg, image/svg+xml, application/javascript, and application/manifest+json π¦
The types section has to include one or more lines of this syntax, all wrapped up in curly braces:
type/subtype name [name ...]
type/subtype name [name ...]β sets the media type and subtype to the specified extension name. You can list one or more names per line, and each line may end with an optional semicolon. Later lines overwrite earlier lines (so like, last one in wins, periodt) πinclude fileβ pulls in types definitions from an external file β for example/usr/share/misc/mime.typesπ
π FILES π
/etc/gotwebd.confβ the default location of thegotwebd.confconfiguration file./var/www/run/gotweb.sockβ the default location for thegotwebd(8)Unix-domain socket.
π₯ EXAMPLES π₯
Okay this part ate, let's get into it. A sample config that allows public browsing:
www user "www" # www username needs quotes since www is a keyword
server "localhost" {
site_name "my public repos"
site_owner "Flan Hacker"
site_link "Flan' Projects"
}
Another one β this time listening on a local port instead of the implicit Unix-domain socket, and serving repos that live outside the web server's chroot:
listen on 127.0.0.1 port 9000
listen on ::1 port 9000
server "localhost" {
site_name "my public repos"
repos_path "/var/git"
}
And this one shows off how to define custom media types π
server "localhost" {
repos_path "/var/git"
}
types {
text/css css
text/html html htm
text/plain txt
image/gif gif
image/jpeg jpeg jpg
image/png png
application/javascript js
application/xml xml
}
This next one is the main character example β it shows how gotwebd(8) can serve static web sites straight out of Git repositories. Big energy:
# Load a set of mime types from an external file.
types { include "/usr/share/misc/mime.types" }
# This server displays just one web site, no Git repositories.
server "www.example.com" {
# Do not display any Git repository data.
hide repositories on
# Serve the www.git repository as a web site when
# the browser visits "www.example.com".
website "/" {
repository "www" # /var/www/got/public/www.git
# Any child URL paths the browser wants to
# visit will be looked up in www.git, on
# the branch which the symbolic HEAD
# reference points to.
}
}
# This server displays both web sites and Git repositories.
server "project.example.com" {
repos_path "/var/git"
# Display Git repositories when the URL path "/gotweb/" is
# is visited by the browser.
repos_url_path "/gotweb"
website "/" {
# Display the "www" repository as a web site when
# the browser visits "project.example.com".
repository "www" # /var/git/www or /var/git/www.git
# Any child URL path the browser wants to visit will
# be looked up in www.git, except for "gotweb/" which
# maps to repos_path, and "docs/" which is used by
# other repositories defined below.
}
repository "www.git" { # /var/git/www or /var/git/www.git
# Otherwise, hide data in this repository. It will
# not be shown under the "/gotweb" URL path.
hide repository on
}
# Display the src.git repository's "docs/html" directory
# as found on the main branch as a web site at the
# URL "project.example.com/docs/".
website "/docs" {
repository "src"
path "/docs/html"
branch "main" # same as "refs/heads/main"
# Any child URL paths the browser wants to visit will
# be looked up in src.git, except for "gotweb/"
# which maps to repos_path, and "docs/api/" which is
# used by another web site defined below.
}
repository "src" { # /var/git/src or /var/git/src.git
# Otherwise, hide data in this repository. It will
# not be shown under the "/gotweb" URL path.
hide repository on
}
# Display the "main" branch of api-docs.git repository
# as a web site at the URL
# "project.example.com/docs/api/latest/".
website "/docs/api/latest" {
repository "api-docs.git"
branch "main"
}
# Display the "1.x-stable" branch of the api-docs.git
# as a web site at the URL
# "project.example.com/docs/api/1.x/".
website "/docs/api/1.x" {
repository "api-docs.git"
branch "1.x-stable"
}
# The api-docs repository will also be shown under "/gotweb"
# because the hide repositories and hide repository
# settings default to "off".
}
And finally, the authentication example β the one where all the access-control drama happens π
# 3 scopes: global, per-server, per-repository
enable authentication # override the default which is 'disable'
# Allow user "admin" to read anything unless overridden with a
# "deny" rule later.
permit "admin"
server "public.example.com" {
disable authentication # override global setting
repos_path "/var/www/got/public"
}
server "secure.example.com" {
permit flan_squee # grant access to flan_squee
permit :developers # grant access to developers group
repos_path "/var/git"
# Tell vistors who see a "login failed" error page that
# they can log in as the "anonymous" user via ssh.
login hint user "anonymous"
repository "got" { # /var/git/got and /var/git/got.git
# Grant access to users who have authenticated as
# the anonymous user to gotsh(1), which anyone with
# an SSH client sbould be able to do.
# Dumb web crawlers will remain locked out.
permit "anonymous"
}
repository "public" {
# As an exception, allow any web browsers and
# web crawlers to view this repository.
disable authentication
}
repository "secret" {
deny admin # not even the admin can read this
}
}
π SEE ALSO π
got(1), httpd.conf(5), services(5), gotwebctl(8), gotwebd(8), httpd(8)
That's the whole page bestie, you made it π go forth and serve some repos. This one's the Debian build, dated $Mdocdate$, and it's the GOTWEBD.CONF(5) page β ily, bye πβ¨
π¦ where this page comes from
- alpine 3.24: got-doc 0.126-r0 Β· ISC
- nixos 26.05: got 0.125
- Copyright (c) 2020 Tracey Emery <tracey@traceyemery.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms