Lindenii Project Forge
Login

server

Lindenii Forge’s main backend daemon
Commit info
ID
a5b72b25a298040798636455d29a7413636368f2
Author
Runxi Yu <me@runxiyu.org>
Author date
Tue, 01 Apr 2025 13:51:25 +0800
Committer
Runxi Yu <me@runxiyu.org>
Committer date
Tue, 01 Apr 2025 13:54:48 +0800
Actions
Add forge-mail(5) and update forge(5) for LMTP
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org>

.PHONY: clean version.go man source.tar.gz

CFLAGS = -Wall -Wextra -Werror -pedantic -std=c99 -D_GNU_SOURCE
MAN_PAGES = forge.5 hookc.1 forge.1
MAN_PAGES = forge.5 hookc.1 forge.1 forge-mail.5

forge: source.tar.gz version.go hookc/*.c hookc/hookc man # TODO
	go build .

man: $(MAN_PAGES:%=man/%.html) $(MAN_PAGES:%=man/%.txt)

man/%.html: man/%
	mandoc -Thtml -O style=./mandoc.css $< > $@

man/%.txt: man/% utils/colb
	mandoc $< | ./utils/colb > $@

utils/colb: utils/colb.c

hookc/hookc:

version.go:
	printf 'package main\n\nconst VERSION = "%s"\n' `git describe --tags --always --dirty` > $@

clean:
	$(RM) forge version.go vendor

source.tar.gz:
	rm -f source.tar.gz
	go mod vendor
	git ls-files -z | xargs -0 tar -czf source.tar.gz vendor
.\" SPDX-License-Identifier: AGPL-3.0-only
.\" SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org>
.Dd March 30, 2025
.Dt FORGE-MAIL 5
.Os Lindenii Forge
.Sh NAME
.Nm forge-mail
.Nd configuring Lindenii Forge email integration
.Sh DESCRIPTION
.Nm
is a guide to configuring Lindenii Forge for email integration.
.Pp
This is currently a stub. Here is a working configuration that works
for the Lindenii Project itself, though.
.Sh /etc/smtpd/smtpd.conf
.Bd -literal
table forge file:/etc/smtpd/forge
action "FORGE" lmtp "/srv/forge/lmtp.sock" rcpt-to virtual <forge>
match from any for domain "forge.lindenii.runxiyu.org" action "FORGE"
.Ed
.Sh /etc/smtpd/forge
.Bd -literal
@ forge
.Ed
.Sh SEE ALSO
.Xr forge 1 ,
.Xr forge 5 ,
.Xr smtpd.conf 5
.Sh AUTHORS
.An Runxi Yu Aq Mt https://runxiyu.org
.An Test_User Aq Mt hax@runxiyu.org
.\" SPDX-License-Identifier: AGPL-3.0-only
.\" SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org>
.Dd March 30, 2025
.Dt FORGE 5
.Os Lindenii Forge
.Sh NAME
.Nm forge.scfg
.Nd configuration file for Lindenii Forge
.Sh DESCRIPTION
.Nm
describes the configuration for
.Xr forge 1
instance using the
scfg
format.
.Pp
Each directive consists of a name followed by zero or more parameters. Directives may also introduce blocks of subdirectives using braces.
.Pp
Comments begin with
.Sq #
and extend to the end of the line.
.Sh DIRECTIVES
.Bl -tag -width Ds
.It Ic http
Configures the ingress HTTP server.
.Bl -tag -width Ds
.It Ic net
Network type to listen on (e.g., 
.Dq tcp ,
.Dq tcp4 ,
.Dq unix ) .
.It Ic addr
Address to listen on (e.g., 
.Dq :8080
or
.Dq /var/run/lindenii/forge/http.sock ) .
.It Ic cookie_expiry
How long (in seconds) to keep session cookies.
.It Ic root
Canonical root URL of the web interface (e.g.,
.Dq https://forge.example.org ) .
.It Ic read_timeout , write_timeout , idle_timeout
Timeouts, in seconds, for the general HTTP server context.
.It Ic reverse_proxy
Boolean indicating whether to trust X-Forwarded-For headers.
.El
.It Ic ssh
Configures the SSH server.
.Bl -tag -width Ds
.It Ic net
Network type to listen on
.Dq ( tcp
is recommended).
.It Ic addr
Address to listen on (e.g.,
.Dq :22 ) .
.It Ic key
Path to the SSH host key (must be passwordless).
.It Ic root
Canonical SSH URL prefix (e.g.,
.Dq ssh://forge.example.org ) .
.El
.It Ic git
Configures Git repository storage.
.Bl -tag -width Ds
.It Ic repo_dir
Filesystem path under which new repositories are stored.
.El
.It Ic db
Configures database connection.
.Bl -tag -width Ds
.It Ic type
Database type (currently must be
.Dq postgres ) .
.It Ic conn
Connection string, e.g.,
.Dq postgresql:///lindenii-forge?host=/var/run/postgresql .
.El
.It Ic general
Miscellaneous settings.
.Bl -tag -width Ds
.It Ic title
A user-facing name for the instance.
.El
.It Ic hooks
Configures Git hook communication with the forge daemon.
.Bl -tag -width Ds
.It Ic socket
Path to a UNIX domain socket for receiving hook events.
.It Ic execs
Directory where Git hook executables are stored.
.El
.It Ic irc
Optional configuration for IRC presence.
.Bl -tag -width Ds
.It Ic tls
Boolean indicating whether to use TLS.
.It Ic net , addr
Network type and address (e.g.,
.Dq tcp ,
.Dq irc.example.org:6697 ) .
.It Ic sendq
Maximum send queue size.
.It Ic nick , user , gecos
Identity fields for the IRC connection.
.El
.It Ic lmtp
Configuration for the LMTP/MX component. You may wish to refer to
.Xr forge-mail 5
for information on configuring your SMTP server.
.Bl -tag -width Ds
.It Ic socket
The path to the UNIX domain socket to listen on.
.It Ic max_size
The maximum acceptable ingress message size.
.It Ic domain
The domain-part of our LMTP server.
.It Ic read_timeout , write_timeout
General timeouts for LMTP connections.
.El
.El
.Sh FILES
.Bl -tag -width Ds
.It Pa /etc/lindenii/forge.scfg
Default path to the configuration file.
.El
.Sh SEE ALSO
.Xr forge 1 ,
.Xr hookc 1 ,
.Lk https://git.sr.ht/~emersion/scfg scfg
.Sh AUTHORS
.An Runxi Yu Aq Mt https://runxiyu.org
.An Test_User Aq Mt hax@runxiyu.org