Skip to content

kakwa/hnrss-ai-filtering

 
 

Repository files navigation

hnrss — Hacker News RSS

hnrss provides custom, realtime RSS feeds for Hacker News.

The project page explains all available RSS feeds and options, and is served directly by the running instance.

Building

To build for the local platform without stripping:

go build -o hnrss .

Running

./hnrss [-bind HOST:PORT]

The default bind address is 127.0.0.1:9000. Override it with -bind:

./hnrss -bind 0.0.0.0:8080

The server handles SIGINT (Ctrl-C) with a 5-second graceful shutdown.

Deploying

SystemD Daemon + Nginx

Copy the binary:

install -m 755 hnrss /usr/local/bin

create SystemD unit /etc/systemd/system/hnrss.service:

[Unit]
Description=Hacker News RSS
After=network.target

[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/hnrss -bind 127.0.0.1:9001
User=daemon
Group=daemon
StandardOutput=journal
StandardError=journal
SyslogIdentifier=hnrss

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
sudo systemctl enable --now hnrss

And put a reverse proxy (nginx, Caddy, etc.) in front if it, for example:

server {
	server_name hnrss.kakwalab.ovh;

   location / {
     proxy_pass http://127.0.0.1:9001;
   }

    # TODO: check if it works without certificate
    listen 443 ssl;
    #ssl_certificate /etc/letsencrypt/live/hnrss.kakwalab.ovh/fullchain.pem; # managed by Certbot
    #ssl_certificate_key /etc/letsencrypt/live/hnrss.kakwalab.ovh/privkey.pem; # managed by Certbot
    #include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    #ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
  
server {
	server_name hnrss.kakwalab.ovh;
  listen 80;

  location / {
    proxy_pass http://127.0.0.1:9001;
  }
}

finally, run certbot to get a proper certificate.

Dependencies

Runtime dependencies are fetched from the Algolia Hacker News Search API and the Hacker News website directly — no local database or cache is required. The service is stateless.

About

Custom, realtime RSS feeds for Hacker News - AI filtering version

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 99.7%
  • Makefile 0.3%