summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi319
1 files changed, 319 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index f5efd34024e..4d28f7c4aab 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -429,6 +429,7 @@ Services
429* Desktop Services:: D-Bus and desktop services. 429* Desktop Services:: D-Bus and desktop services.
430* Sound Services:: ALSA and Pulseaudio services. 430* Sound Services:: ALSA and Pulseaudio services.
431* File Search Services:: Tools to search for files. 431* File Search Services:: Tools to search for files.
432* Forge Services:: Hosting your own software forge.
432* Database Services:: SQL databases, key-value stores, etc. 433* Database Services:: SQL databases, key-value stores, etc.
433* Mail Services:: IMAP, POP3, SMTP, and all that. 434* Mail Services:: IMAP, POP3, SMTP, and all that.
434* Messaging Services:: Messaging services. 435* Messaging Services:: Messaging services.
@@ -20358,6 +20359,7 @@ declaration.
20358* Desktop Services:: D-Bus and desktop services. 20359* Desktop Services:: D-Bus and desktop services.
20359* Sound Services:: ALSA and Pulseaudio services. 20360* Sound Services:: ALSA and Pulseaudio services.
20360* File Search Services:: Tools to search for files. 20361* File Search Services:: Tools to search for files.
20362* Forge Services:: Hosting your own software forge.
20361* Database Services:: SQL databases, key-value stores, etc. 20363* Database Services:: SQL databases, key-value stores, etc.
20362* Mail Services:: IMAP, POP3, SMTP, and all that. 20364* Mail Services:: IMAP, POP3, SMTP, and all that.
20363* Messaging Services:: Messaging services. 20365* Messaging Services:: Messaging services.
@@ -28758,6 +28760,323 @@ G-exp denoting the channels to use when updating the database
28758@end table 28760@end table
28759@end deftp 28761@end deftp
28760 28762
28763@node Forge Services
28764@subsection Forge Services
28765
28766Forges are applications designed to ease collaboration on software
28767development. Their usual features include an issue tracker, code
28768versioning and a system to request and conduct change reviews.
28769
28770@cindex software forge, self-hosting
28771@cindex forgejo, software forge
28772@subsubheading Forgejo
28773
28774This is the service for running Forgejo (@url{https://forgejo.org/}).
28775It is provided via the @code{(gnu services forgejo)} module.
28776
28777@defvar forgejo-service-type
28778The service type for the Forgejo source forge. It takes a
28779@code{forgejo-configuration} object as a value, documented below. In
28780its simplest form, a Forgejo service can be defined as just:
28781
28782@lisp
28783(service forgejo-service-type)
28784@end lisp
28785
28786Here's a slightly more involved service configuration, intended as a
28787secure, private software forge that is able to send notification emails.
28788
28789@lisp
28790(service forgejo-service-type
28791 (forgejo-configuration
28792 (offline-mode? #t)
28793 (require-signin-to-view? #t)
28794 (http-address "10.1.1.1") ;exposed via wireguard
28795 (ssh-address "10.1.1.1")
28796 (mailer? #t)
28797 (mail-from "some-email@@example.com")
28798 (smtp-address "smtp.example.com")
28799 (smtp-user "some-email@@example.com")
28800 (smtp-password-file "/etc/forgejo/smtp_secret")
28801 (mail-notification? #t)))
28802@end lisp
28803@end defvar
28804
28805Below is the documentation for the @code{forgejo-configuration} record:
28806
28807@c %start of fragment
28808
28809@deftp {Data Type} forgejo-configuration
28810Available @code{forgejo-configuration} fields are:
28811
28812@table @asis
28813@item @code{forgejo} (default: @code{forgejo}) (type: file-like)
28814The forgejo package.
28815
28816@item @code{work-directory} (default: @code{"/var/lib/forgejo"}) (type: string)
28817The directory where Forgejo keeps its state, including its database when
28818using @code{"sqlite3"} as the @code{database-type}.
28819
28820@item @code{shepherd-provision} (default: @code{(forgejo)}) (type: list-of-symbols)
28821The name(s) of the service.
28822
28823@item @code{configuration-wizard?} (default: @code{#f}) (type: boolean)
28824Whether to use the initial configuration page (wizard) to setup Forgejo.
28825Setting this to @code{#t} means that none of the declarative
28826configuration values will be honored. The Forgejo-generated
28827configuration file will be kept under @file{custom/conf/app.ini},
28828relative to the value of the @code{work-directory}.
28829
28830@item @code{user} (default: @code{"forgejo"}) (type: string)
28831The name of the user under which Forgejo will be executed.
28832
28833@item @code{group} (default: @code{"forgejo"}) (type: string)
28834The name of the group under which Forgejo will be executed.
28835
28836@item @code{custom-configuration-file} (type: maybe-file-like)
28837File-like object to provide a complete Forgejo configuration file as an
28838escape hatch, overriding every other fields of this configuration.
28839
28840@item @code{application-name} (default: @code{"Forgejo"}) (type: string)
28841The application name that shows in every page title.
28842
28843@item @code{application-slogan} (default: @code{""}) (type: string)
28844Slogan to show near the application name in every page title.
28845
28846@item @code{run-mode} (default: @code{"prod"}) (type: run-mode)
28847The run mode to use; either @code{"dev"} or @code{"prod"}.
28848
28849@item @code{domain} (default: @code{"localhost"}) (type: string)
28850The domain name or host address of the server.
28851
28852@item @code{offline-mode?} (default: @code{#f}) (type: boolean)
28853Set to @code{#t} to run Forgejo in offline mode, meaning it won't reach
28854out to any external services such as Gravatar, CDNs, etc. and serve
28855everything locally instead.
28856
28857@item @code{port} (default: @code{3000}) (type: unprivileged-port)
28858The port Forgejo will listen on. The port should be an unprivileged
28859port; to serve Forgejo on a privileged port like @code{80}, configure a
28860reverse proxy. It is ignored when using a Unix-domain socket.
28861
28862@item @code{protocol} (default: @code{"http"}) (type: protocol)
28863Listen protocol. Either @code{http}, @code{https}, @code{fcgi},
28864@code{"http+unix"} or @code{"fcgi+unix"}. @samp{+unix} means @emph{via}
28865a Unix-domain socket, in which case @code{http-address} must be the file
28866name of the socket to use.
28867
28868@item @code{root-url} (type: maybe-string)
28869Overwrite the automatically generated public URL, which implicitly
28870defaults to @samp{@var{protocol}://@var{domain}:@var{port}}, which is
28871necessary using a reverse proxy.
28872
28873@item @code{http-address} (default: @code{"0.0.0.0"}) (type: string)
28874The address to listen to. It can be an absolute file name when using a
28875Unix-domain socket, for example @file{/run/forgejo.sock}, or a file name
28876relative to the @code{work-directory}, for example @file{forgejo.sock}.
28877
28878@item @code{ssh-address} (default: @code{"0.0.0.0"}) (type: string)
28879The IP address to listen on for the SSH server.
28880
28881@item @code{lfs?} (default: @code{#t}) (type: boolean)
28882Whether to enable Git LFS support.
28883
28884@item @code{lfs-secret-file} (default: @code{"/etc/forgejo/lfs_jwt_secret"}) (type: string)
28885The file name of the LFS JWT (JSON Web Token) secret, necessary for
28886proper Git LFS operation, which can be generated with @samp{forgejo
28887generate secret JWT_SECRET}. Automatically generated the first time
28888Forgejo runs if it does not yet exist.
28889
28890@item @code{mail-notification?} (default: @code{#f}) (type: boolean)
28891Whether to enable email notifications.
28892
28893@item @code{acme?} (default: @code{#f}) (type: boolean)
28894Whether to enable @acronym{ACME,Automatic Certificate Management
28895Environment}, to automatically provision TLS certificates, which can be
28896useful if you use the @code{https} or @code{https+unix} protocols.
28897
28898@item @code{tls-cert-file} (default: @code{"https/cert.pem"}) (type: string)
28899File name of a TLS certificate file. Ignored if @code{acme?} is
28900enabled. A relative file name is located under
28901@file{@var{work-directory}/custom}.
28902
28903@item @code{tls-key-file} (default: @code{"https/key.pem"}) (type: string)
28904File name of a TLS key. Ignored if @code{acme?} is enabled. A relative
28905file name is located under @file{@var{work-directory}/custom}.
28906
28907@item @code{ssh-port} (default: @code{22}) (type: port-or-false)
28908The SSH port Forgejo will use; if you already run an OpenSSH as the SSH
28909server, specify the port used by the SSH daemon. Otherwise, you need to
28910use an unprivileged port (greater or equal to 1024) which Forgejo will
28911use with its built-in SSH server. Set to @code{#f} to disable SSH
28912support.
28913
28914@item @code{actions?} (default: @code{#t}) (type: boolean)
28915Whether to enable actions capabilities.
28916
28917@item @code{default-actions-url} (default: @code{"https://code.forgejo.org"}) (type: string)
28918The default address to fetch action plugins from.
28919
28920@item @code{internal-token-file} (default: @code{"/etc/forgejo/internal_token"}) (type: string)
28921The file name of the internal token used to validate communication
28922within Forgejo, which can be generated with @samp{forgejo generate
28923secret INTERNAL_TOKEN}
28924
28925@item @code{secret-key-file} (default: @code{"/etc/forgejo/secret_key"}) (type: string)
28926The file name containing the global secret key used for encrypting data
28927like 2FA secrets; it is thus very important to back it up somewhere safe
28928to avoid losing access to encrypted data.
28929
28930@item @code{oauth2-jwt-secret-file} (default: @code{"/etc/forgejo/oauth2_jwt_secret"}) (type: string)
28931The file name of the OAuth2 JWT secret, which Forgejo expects to exist.
28932
28933@item @code{mail-notification-on-new-user-signin?} (default: @code{#f}) (type: boolean)
28934Whether to notify administrators by email when a new user signs in for
28935the first time.
28936
28937@item @code{mailer?} (default: @code{#f}) (type: boolean)
28938Whether to enable the mail server integration, used for sending email
28939notifications for example.
28940
28941@item @code{mail-from} (default: @code{""}) (type: string)
28942The FROM email address used for sent emails, per the RFC 5322
28943specification. This can be for example just an email address, or
28944something like @samp{"Name" <email@@example.com>}. This field
28945@emph{must} be specified if @code{mailer?} is set to @code{#t}.
28946
28947@item @code{mail-subject-prefix} (default: @code{""}) (type: string)
28948The prefix displayed before the subject in emails.
28949
28950@item @code{mail-protocol} (default: @code{""}) (type: mail-protocol)
28951The mail server protocol. One of @code{"smtp"}, @code{"smtps"},
28952@code{"smtp+starttls"}, @code{"smtp+unix"}, @code{"sendmail"},
28953@code{"dummy"} or @code{""}. The empty string defaults means the
28954protocol is inferred from the value of the @code{smtp-port} value,
28955meaning its effective implicit value is @code{"smtps"}. @code{"dummy"}
28956causes emails to be sent to the log, useful for testing. When
28957@code{"sendmail"} is used, it is expected to be fully and correctly
28958externally configured, with the other @samp{smtp-} prefixed options of
28959this configuration ignored.
28960
28961@item @code{smtp-address} (default: @code{""}) (type: string)
28962The mail server address, for example @code{"smtp.example.com"} or an
28963absolute file name, if using @code{"smtp+unix"} for the
28964@code{mail-protocol}.
28965
28966@item @code{smtp-port} (default: @code{465}) (type: port)
28967The mail server port. This field affects the implicit value of the
28968@code{mail-protocol}.
28969
28970@item @code{smtp-user} (default: @code{""}) (type: string)
28971The SMTP server user name, if required
28972
28973@item @code{smtp-password-file} (default: @code{""}) (type: string)
28974An absolute file name containing the password of the SMTP server.
28975
28976@item @code{mail-plain-text?} (default: @code{#f}) (type: boolean)
28977Send emails only in plain text, without HTML alternative.
28978
28979@item @code{sendmail-command} (default: @code{"sendmail"}) (type: string)
28980The file name of the @command{sendmail} command to use, which can be
28981either an absolute file name or a command name to be looked from
28982@env{"PATH"}.
28983
28984@item @code{sendmail-options} (default: @code{()}) (type: list-of-strings)
28985Optional options to pass to the @command{sendmail} command. If your
28986@code{sendmail} program, like that of Postfix, interprets options, you
28987should provide @code{"--"} as the first option.
28988
28989@item @code{sendmail-timeout} (default: @code{"5m"}) (type: string)
28990The timeout for Sendmail, provided as a
28991@uref{https://pkg.go.dev/time#ParseDuration,Go @code{time.Duration}
28992string}, for example @code{"300ms"}, @code{"1.5h"} or @code{"2h45m"}.
28993
28994@item @code{sendmail-convert-crlf?} (default: @code{#t}) (type: boolean)
28995Whether to convert @samp{\r\n} to @samp{\n} for Sendmail.
28996
28997@item @code{log-level} (default: @code{"info"}) (type: log-level)
28998The log level to use. Either @code{"trace"}, @code{"debug"},
28999@code{"info"}, @code{"warn"}, @code{"error"} or @code{"none"}.
29000
29001@item @code{openid-signin?} (default: @code{#t}) (type: boolean)
29002Whether to allow signing in using OpenID.
29003
29004@item @code{disable-registration?} (default: @code{#f}) (type: boolean)
29005Disallow registration, only allowing administrators to create accounts.
29006
29007@item @code{confirm-mail-on-registration?} (default: @code{#f}) (type: boolean)
29008Whether to require email confirmation when new users register.
29009
29010@item @code{require-signin-to-view?} (default: @code{#f}) (type: boolean)
29011Whether users must sign in before they can view the explore pages.
29012
29013@item @code{default-keep-email-private?} (default: @code{#f}) (type: boolean)
29014Whether by default a user email is displayed on their profile.
29015
29016@item @code{user-push-to-create?} (default: @code{#f}) (type: boolean)
29017Allow users to push local repositories to Forgejo and have them
29018automatically created for a user.
29019
29020@item @code{organization-push-to-create?} (default: @code{#f}) (type: boolean)
29021Allow users to push local repositories to Forgejo and have them
29022automatically created for an organization.
29023
29024@item @code{default-push-to-create-private?} (default: @code{#t}) (type: boolean)
29025Whether to make newly created repositories private by default when they
29026were created via push.
29027
29028@item @code{default-merge-style} (default: @code{"merge"}) (type: merge-style)
29029The default merge style to use. Either @code{"merge"}, @code{"rebase"},
29030@code{"rebase-merge"}, @code{"squash"} or @code{"fast-forward-only"}.
29031
29032@item @code{default-trust-model} (default: @code{"committer"}) (type: trust-model)
29033The default trust model for repositories. Either @code{"collaborator"},
29034@code{"committer"} or @code{"collaboratorcommitter"}
29035
29036@item @code{metrics?} (default: @code{#f}) (type: boolean)
29037Whether to enable the metrics endpoint.
29038
29039@item @code{metrics-token} (default: @code{""}) (type: string)
29040A secret to use, if authorization to the metrics endpoint is desired.
29041
29042@item @code{database-type} (default: @code{"sqlite3"}) (type: database-type)
29043The database type to use. Either @code{"sqlite3"}, @code{"mysql"} or
29044@code{"postgres"}. The sqlite3 type is the simplest to use, but a
29045full-fledged database like PostgreSQL may scale better for multiple
29046users. If you change this, make sure to adjust the other
29047@samp{database-*} values accordingly. Also note that currently, the
29048PostgreSQL and MySQL databases must be manually created: refer to the
29049official Forgejo documentation for
29050@uref{https://forgejo.org/docs/latest/admin/installation/database-preparation,database
29051preparation}.
29052
29053@item @code{database-host} (default: @code{"/var/run/postgresql"}) (type: string)
29054This is the @samp{@var{host}:@var{port}} tuple for remote database
29055MySQL/PostgreSQL hosts, or a local Unix-domain socket file. If using
29056MySQL, this should be adjusted to @file{/run/mysqld/mysqld.sock}
29057
29058@item @code{database-name} (default: @code{"forgejo"}) (type: string)
29059The MySQL/PostgreSQL database name to use.
29060
29061@item @code{database-user} (default: @code{"forgejo"}) (type: string)
29062The MySQL/PostgreSQL database user to use.
29063
29064@item @code{database-password-file} (type: maybe-string)
29065A file name containing the password to access the MySQL/PostgreSQL
29066database, for example @file{"/etc/forgejo/db_passwd"}.
29067
29068@item @code{database-tls?} (default: @code{#f}) (type: ssl-mode)
29069Whether the connection to a MySQL/PostgreSQL database should use TLS.
29070Set to @code{#t} to enable TLS with full verification or to
29071@code{'skip-verify} to enable TLS without verification.
29072
29073@end table
29074
29075@end deftp
29076
29077
29078@c %end of fragment
29079
28761 29080
28762@node Database Services 29081@node Database Services
28763@subsection Database Services 29082@subsection Database Services