Find a file
kuu7o 722708cb6f
All checks were successful
golangci-lint / lint (push) Successful in 1m30s
Build and release container directly from master / build (push) Successful in 2m14s
chore: update templ
2026-01-10 13:38:22 -03:00
.forgejo/workflows CI: Add OCI image builds 2025-07-24 17:03:27 -04:00
cmd/phantom refactor: Adopt standard Go project layout 2025-07-21 18:17:07 -04:00
configs feat: use default configuration if config.yml is not available 2025-08-01 17:36:39 -04:00
docker chore: use mirror.gcr.io for docker 2025-12-28 14:27:55 -03:00
internal chore: update templ 2026-01-10 13:38:22 -03:00
web fix: use ThemeApi for theme variables 2026-01-10 13:35:29 -03:00
.gitignore chore: add config.yml to .gitignore 2025-08-03 21:49:22 -04:00
docker-compose.yml feat: use default configuration if config.yml is not available 2025-08-01 17:36:39 -04:00
go.mod chore: update templ 2026-01-10 13:38:22 -03:00
go.sum chore: update templ 2026-01-10 13:38:22 -03:00
golangci.yml CI: add golangci (#3) 2025-07-22 23:16:43 +02:00
LICENSE init 2025-07-21 15:47:29 -04:00
Makefile chore: fragment Makefile on different parts 2025-08-01 17:43:22 -04:00
README.md Add podman compose, podman quadlets and quadlet-nix installation instructions 2025-09-20 13:40:04 -03:00

Phantom

Phantom is a privacy frontend for fandom.com

Configuration

Phantom's configuration can be managed through config.yml or overridden using environment variables. The application prioritizes environment variables over the config.yml file.

Environment Variable YAML Path Default Value (from config.go) Example Value
SERVER_PORT server.port 8080 80
SERVER_HOST server.host 0.0.0.0 127.0.0.1
INSTANCE_THEME instance.theme dark light
INSTANCE_NAME instance.name kuuro.net nadeko.net
INSTANCE_JS_ENABLED instance.js.enabled true false
CACHE_ENABLED cache.enabled false true
CACHE_DURATION cache.duration 86400 (24 hours) 3600
LOG_LEVEL log.level info debug

Getting Started

Cloning the Project

To get a copy of the project, clone the repository using Git:

git clone https://codeberg.org/phantom-org/phantom.git
cd phantom

Running Directly

To run the application directly, you need to have Go and Make installed. Navigate to the project root and execute:

make
./phantom

Running with Docker Compose

For a containerized setup, you can use Docker Compose. Ensure Docker and Docker Compose are installed on your system. From the project root, run:

docker compose up -d

Running with Podman Compose

podman compose up -d
# or this if the command above doesn't work
podman-compose up -d

Running using Podman Quadlets

Create .config/containers/systemd/phantom.container in your home folder, (Example: /home/services/.config/containers/systemd/phantom.container) and copy this content in it:

[Container]
ContainerName=phantom
Image=codeberg.org/phantom-org/phantom:latest
PublishPort=127.0.0.1:10000:8080

# README!!!: You can use either a volume or environment variables to configure
# phantom, uncomment one of them acording to your needs.

# Config volume, create a folder in ~/.config/phantom and store config.yml there
# Volume=%h/.config/phantom/config.yml:/app/configs/config.yml

# Environment variables
# Environment="INSTANCE_NAME=example.com"
# Environment="LOG_LEVEL=info"

[Service]
Restart=always
RestartSec=30
TimeoutStartSec=900

[Unit]
Description=Phantom - a privacy frontend for fandom.com

Save the file and run:

systemctl --user daemon-reload
systemctl --user start phantom
# watch the logs of the container to see if everything is running fine
journalctl --user -u phantom

Documentation: https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html

Running using quadlet-nix with NixOS and home-manager (Rootless)

Install https://github.com/SEIAROTg/quadlet-nix and read the Rootless containers (via Home Manager) section

Copy ./configs/config.example.yml into the same directory where the Nix configuration will be.

Place this Nix configuration in the place you want:

# phantom.nix

let
  configPath = builtins.toString ./config.yml;
in
{
  virtualisation.quadlet.containers = {
    phantom = {
      autoStart = true;
      serviceConfig = {
        RestartSec = "30";
        Restart = "always";
      };
      containerConfig = {
        image = "codeberg.org/phantom-org/phantom:latest";
        publishPorts = [ "127.0.0.1:10000:8080" ];
		# README!!!: You can use either a volume or environment variables to configure
        # phantom, uncomment one of them acording to your needs.
        # volumes = [
        #   "${configPath}:/app/configs/config.yml"
        # ];

		# Environment variables
		# environments = {
		#   INSTANCE_NAME = "example.com";
        #   LOG_LEVEL = "info";
		# };
      };
    };
  };
}

Support the Project

If you find Phantom useful and would like to support its development, please consider donating. Your contributions help maintain and improve this project.

Donate here: kuuro.net/donate