| .forgejo/workflows | ||
| cmd/phantom | ||
| configs | ||
| docker | ||
| internal | ||
| web | ||
| .gitignore | ||
| docker-compose.yml | ||
| go.mod | ||
| go.sum | ||
| golangci.yml | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
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