Server

Installation

Docker

docker run -p 8080:8080 ghcr.io/wikinewsfeed/wikinewsfeed:latest

Configuration

Configuration is applied using Environment variables

VariableTypeDefaultDescription
PORTString8080Listen to port
WNF_URLString, URLhttp://localhost:8080URL to be displayed in readers
WNF_MAXAGEString1800Cache-Control age (only useful behind a CDN)
WNF_DBPathstats.dbPath where database file should be saved
WNF_CORSString*CORS Header

Recommendations

Default response times from Wikipedia range 600-2000ms. Therefor it is absolutely necessary to run the server behind a caching proxy if you want a quick response

Here's example configuration for varnishopen in new window, that will work with the default settings:

vcl 4.1;

backend default {
    .host = "0.0.0.0";
    .port = "8080";
}

Monitoring

/metrics exposes Prometheus metrics, following metrics are included

wnf_subscribers_total
wnf_hits_total
wnf_subscriber_hits_total
wnf_subscriber_unique_hits_total

Building

Clone the repository

git clone https://github.com/WikiNewsFeed/wikinewsfeed.git

Build using Docker

docker build -t wikinewsfeed/wikinewsfeed .

Build from source

1. Build the binary

Install the dependencies

go mod download

Build

go build

2. Build the docs

Install the dependencies

npm i

(Optionally) Preview the changes

npm run docs:dev

Build

npm run docs:build