Commit Graph

71 Commits

Author SHA1 Message Date
Alex Palaistras 6e2e0037e4 Push misc fixes to documentation and virtual env 2024-04-01 13:46:46 +01:00
Alex Palaistras fe30677a46 Deprecate generic container volume backup/restore
Previously, all container volumes initialized via the `container-volume`
service would have local rotating backups performed by pushing `tar`
archives to the `/var/lib/backups/coreos-home-server` directory.

This proved to be a simple and effective mechanism for storing historic
volume state locally; however, the use-case for historic backup is
usually data loss, either partial (e.g. by deleting files inadvertently)
or complete (e.g. by loss of disk), which is likely better mitigated by
more concrete mechanisms of retention.

In addition, this need to store historic volume state locally, in its
totality, proved to be a barrier for performing partial backups, which
is an issue especially for larger volumes.

This commit deprecates this simple, generic volume backup/restore
mechanism, and instead has us rely directly on Rclone reading from the
volume in question.
2024-04-01 13:41:32 +01:00
Alex Palaistras 3cdf8b8c98 Remove hard-coded Podman auto-update schedule
This should be controlled by hosts, not by the framework itself.
2024-04-01 12:34:32 +01:00
Alex Palaistras 6dcbba7aa2 container-network: Update path conditional
Conditional for network path needed to be updated after upgrade to
Netavark.
2024-03-29 19:19:31 +00:00
Alex Palaistras e72f1bc607 Move to `skx/rss2email` for RSS-to-email transport
This allows us to move to a more configurable base, driven by service
configuration files (which can be extended by private configuration)
rather than systemd-driven configuration, which wasn't ever as robust as
it should've been.
2024-03-10 15:11:39 +00:00
Alex Palaistras 96a1e177e3 rclone: Add WebDAV volume share service
This allows for serving any Podman volume over WebDAV, with the ability
to serve a dedicated subdirectory per user. Authentication is provided
by LDAP, and users are expected to be in the `rclone_user` group.
2024-02-04 12:01:03 +00:00
Alex Palaistras 90c57f3aee Add configuration for Shiori, bookmark manager
This is, apparently, the easiest solution to set up, while still being
as featureful as required for simple use (readable and PDF archive of
bookmarks).
2024-01-14 17:07:04 +00:00
Alex Palaistras 7606e87a4c Correctly load certificates from /etc/ssl/private 2024-01-13 23:28:01 +00:00
Alex Palaistras 83bea27cd4 Move to dedicated Let's Encrypt certificate volume
We would previously use the `letsencrypt` volume used as state by Lego
itself, which contains a number of private files not intended to be
accessed widely; the `letsencrypt-certificates` volume used now contains
only certificate chains and private keys, under dedicated folders.
2024-01-12 14:59:04 +00:00
Alex Palaistras b6f0880445 container-build: Use latest ID in previous tag
Using the name itself has the tag point to the name, which defeats the
purpose of tagging with the `previous` tag.
2024-01-03 18:19:25 +00:00
Alex Palaistras 2a8d56e17e container-build: Use `bash` for `ExecCondition`
Since `sh` may point to a POSIX shell, and brace expansion is undefined there.
2023-12-30 18:39:26 +00:00
Alex Palaistras ab12d60d31 Tag existing images with `previous` on re-build
Container builds using the `container-build@` systemd service will
generally tag any container image built with the `latest` tag, which is
then referred to pervasively in container executions.

However, this tag is overwritten when building new images, and, combined
with how `podman auto-update` will prune old image digests, may cause us
to lack the ability to roll back, automatically or otherwise.

This commit sets a `previous` tag on container re-builds, which should
only generally happen when source files change (due to the `ExecCondition`)
present on the service, which in turn should ensure that images are not
spuriously tagged as such.
2023-12-22 19:27:40 +00:00
Alex Palaistras d8a4b7874f Skip container builds unless local files changed
This commit adds an `ExecCondition` directive on the `container-build@`
service, used as a pre-requisite for all other Podman-based services,
skipping `podman build` invocations unless local `Containerfile` or any
files in the `container` sub-directories have changed.

Container builds are responsible for the majority of time taken during
boot, even with cache in place; this will help alleviate pressure and
hopefully speed up boot considerably.
2023-12-20 19:50:39 +00:00
Alex Palaistras 6304685aa6 grafana: Update, use Quadlet, use LDAP for auth 2023-11-19 13:14:57 +00:00
Alex Palaistras 36e1e3039e coturn: Enable and startup on health-checks 2023-10-29 15:56:02 +00:00
Alex Palaistras fcf9175060 Enable Podman auto-updates for Redis and MariaDB
Container auto-updates are scheduled for 30 minutes past every hour, or
approximately 30 minutes after `coreos-home-server-update` runs, in
order to give enough time for container builds to complete; only
containers with auto-updates enabled are eligible, however.

This also enables health-checks for Redis, and updates the version to
7.2.
2023-10-29 13:31:27 +00:00
Alex Palaistras 3465082806 letsencrypt: Update Lego to version 4.13.3 2023-08-12 16:31:56 +01:00
Alex Palaistras 15b41eee1a nginx: Update to version 1.25, move to Quadlet 2023-08-12 16:31:31 +01:00
Alex Palaistras 3943c51181 Remove concrete unit files for generated ones
Podman-generated systemd unit files aren't usually generated into
`/etc/systemd/system`, and this directory is preferred for any
pre-existing unit files.
2023-08-12 13:21:31 +01:00
Alex Palaistras 8daef2903a Generate services with Quadlet after CoreOS update
This is to work around issues where generators don't seem to run on
`daemon-reload` as they should, and may be reverted some time in the
future.
2023-08-11 20:58:44 +01:00
Alex Palaistras c5a6208e6a redis: Move to container unit, Debian Bookworm
The container file is now directly based on Debian Bookworm, and uses
official Debian packages.
2023-08-11 20:12:23 +01:00
Alex Palaistras efff72baa8 nginx: Update configuration, remove static serve
Services will now have an additional set of security-oriented response
headers attached, and cache times re-jigged.

In addition, the `nginx-serve-static@` service has been removed in
favour of `nginx-serve-volume@`, which is simpler to set up and use.
2023-03-25 13:21:47 +00:00
Alex Palaistras 6f8b8763c6 prosody: Make component registration more flexible 2023-01-02 14:15:13 +00:00
Alex Palaistras 4bc17662bd Remove Spectrum in favour of Slidge
Slidge replaces Spectrum with immense improvement to bridging
capabilities, albeit with only experimental MUC support. Nevertheless,
the current state is sufficiently stable for a complete replacement.
2022-12-13 15:37:42 +00:00
Alex Palaistras 560cfc82b6 slidge: Add service for legacy protocol bridging 2022-12-13 10:16:45 +00:00
Alex Palaistras 1b71debe96 Add configuration for GoToSocial
This adds a basic GoToSocial setup with a default configured
administrator, to be used as a small environment for trusted users.
2022-11-27 16:25:53 +00:00
Alex Palaistras eda658f99d nginx: Move back to separate UPSTREAM variables
This commit moves the `nginx-proxy-http` service back to separate
`UPSTREAM_HOST`, `UPSTREAM_PORT`, and `UPSTREAM_PATH` variables, which
allows for more granular configuration, e.g. `proxy_redirect` patterns.
2022-10-29 17:24:58 +01:00
Alex Palaistras a99e97abfe hugo: Switch to webhook-based builder
This commit switches Hugo to a webhook-based building process, with
support for Github, Gitlab, and Gitea hooks (including local versions of
Gitea) initially. In addition, Hugo-based sites are now intended to be
served under a single volume, with ingress configuration pointing to
sub-paths into the volume.

Documentation for webhook setup and NGINX proxy configuration is still
underway, and will be filled in later.
2022-10-28 17:52:05 +01:00
Alex Palaistras e637394c12 nginx: Use unified UPSTREAM_ENDPOINT environment
This commit unifies the `UPSTREAM_HOST` and `UPSTREAM_PORT` environment
variables to a new `UPSTREAM_ENDPOINT` variable, making additional
customizations (such as a `proxy_pass` to a sub-path) possible.
2022-10-28 17:44:26 +01:00
Alex Palaistras 48abe1c3db Improve virtual environment
Virtual environments now re-use names, to prevent accumulation of older
environments when updating versions.
2022-10-13 18:59:57 +01:00
Alex Palaistras bafdb80fa2 rss2email: Add custom CSS template 2022-10-04 12:27:30 +01:00
Alex Palaistras 3bb5d70100 Move deprecated services to attic 2022-09-22 18:25:14 +01:00
Alex Palaistras 84a17f6df3 Support same-name directories in CoreOS update
This commit extends our `coreos-home-server-update` script with support
for updating host directories with configuration collected across
multiple remote directories of the same name. This will, essentially,
allow for extending systemd services with custom configuration, as
sometimes required of base systemd service files.
2022-09-19 13:02:29 +01:00
Alex Palaistras 4294f1ec9c Add LDAP support with LLDAP
This sets the stage for moving common authentication from IMAP/Dovecot
to LDAP, which allows for more control over user information, as well as
a basic form of RBAC.

No services are currently set up to support LDAP -- support will follow
soon after this commit.
2022-09-19 13:00:31 +01:00
Alex Palaistras 9ee50ce43d Remove embedded host configuration
This commit removes host configuration that is only useful for my own
personal use-cases, and leaves base and virtual hosts, which are more
commonly useful. It is intended that additional hosts are tracked as
either submodules or subtrees, as required by individual use-cases.
2022-08-01 20:30:31 +01:00
Alex Palaistras e467b89e7f Add Gitea for managed code hosting
This commit adds a new service for Gitea, exposing HTTP and SSH ports by
default (SSH over 7920), and accepting authentication via the local SMTP
server. No users are otherwise created by default, and administration is
expected to happen either via CLI, or via a custom admin user.
2022-07-23 17:01:27 +01:00
Alex Palaistras dad3d1c12c Improve backups, introduce remote restore
Container volume backup logic has been moved to a (largely equivalent)
external script, allowing for future expansion of functionality. In
addition, a `rclone-pull@` service has been added and set up as a default
dependency for the `container-volume-restore@` service, allowing for
automatic set up of servers based on latest remote backups.
2022-07-17 19:38:10 +01:00
Alex Palaistras 011650105b Implement metrics with Grafana and Prometheus
This commit adds two services, `grafana` and `prometheus`, and sets up
some existing services (`dovecot` and `prosody`) to expose metrics into
Grafana. In addition, systemd services have been added to facilitate
registering metrics for services into Prometheus, as well as
automatically provisioning Grafana dashboards based on static JSON
representations.

This work will continue to evolve as more services gain proper Grafana
dashboards, and Loki is also integrated for access to the systemd
journal.
2022-04-25 20:12:06 +01:00
Alex Palaistras 3aea8f42d9 hugo: Add service for building Hugo-based sites
By default, a `[email protected]` systemd service is included,
for building Hugo-based sites as stored in a local Git repository (as
served by the `git` service), and into a volume (which is intended to be
served by the `nginx-serve-volume` service).
2022-04-18 18:19:14 +01:00
Alex Palaistras 38ded924a9 Update Prosody to version 0.12
This brings a number of changes and improvements, and moves from MariaDB
to SQLite for storage, which requires manual migration for pre-existing
deployments using `prosody-migrator`.
2022-03-22 20:23:07 +00:00
Alex Palaistras f613ce2496 rclone: Fix issues, simplify sync configuration
This commit fixes issues with remote path conflicts in default
configuration, and makes the encrypted transport the default.
2022-02-07 11:34:49 +00:00
Alex Palaistras 4fc786219a container-volume-backup: Use symlink to latest file
Pointers to the latest backup are useful for restore operations, but
should be ignored in all other cases, and thus are more appropriately
handled as symbolic links.
2022-02-07 11:10:38 +00:00
Alex Palaistras 9dad5ad2c4 rclone: Add systemd service for transparent backup
This commit adds a new systemd service, `[email protected]`,
templated against the absolute path of a directory to keep in sync with
a (presumably) remote store.

Support for Backblaze B2 endpoints has been set up by default, but the
specific remote type can be configured via the `RCLONE_REMOTE_TYPE` host
variable. In addition, a default-passthrough remote that encrypts data
against a static password and salt has been defined under the `crypt`
name, and can also be used as the `RCLONE_DEST` of choice.
2022-02-06 20:39:14 +00:00
Alex Palaistras c65689d325 Clean up host environment files 2022-02-05 16:06:45 +00:00
Alex Palaistras 0fbbc39e27 base: Only copy service directories if used
We no longer copy service directories into `/etc/coreos-home-server` if
these have not had their respective `spec.bu` files included; these
directories are not needed in these cases, and would be erroneously
considered as eligible in subsequent `coreos-home-server-update`
invocations.
2022-02-05 16:05:00 +00:00
Alex Palaistras 4636730d32 Implement minor improvements for volume backups
Container volume backups will now be skipped if no changes have been
made in source files against the latest backup. In addition the default
timer has been changed for performing backups once a day, at 02:00,
likely a time where there's less traffic on the server.
2022-02-05 16:01:22 +00:00
Alex Palaistras f877a72e83 Flatten directory structures
This commit contains a fairly large diff for a fairly small change:
moving the `config/common` directory to `host/base` to better reflect
its intended use, and promoting `config/service` to the root directory.

These changes unlock some improvements in `coreos-home-server-update`
processes, which will (assuming `/etc/coreos-home-server/base` exists)
keep host-wide systemd services in sync in addition to service-specific
ones.

Changes have been make to the `Makefile` and a few other places where
`config/common` was referenced, but most of this work is renames that
are not intended to break compatibility with new or running servers.
2022-01-15 11:43:33 +00:00
Alex Palaistras b499b81c54 Add service for Coturn, a TURN/STUN server
Most importantly, this helps make WebRTC calls in XMPP more reliable
when either (or both) endpoints are behind NAT (as is the case with most
mobile devices), and avoids depending on a third-party service.

Default configuration has been applied in the virtual environment file;
this allows for setting up most host-dependent configuration easily.
2022-01-15 10:18:52 +00:00
Alex Palaistras 1effe81ec7 nginx: Add `nginx-serve-volume` service
This service allows for easy serving of static content in a volume,
typically HTML files in directory structures mapping to the navigation
structure for the content served.
2021-12-06 12:02:52 +00:00
Alex Palaistras 5e7dbcfca0 host/virtual: Proxy more services by default
Navidrome, Radicale, and WriteFreely will now also be exposed by
default, which makes for easier testing from outside the virtual host.
2021-11-27 17:47:18 +00:00