Files
alexandrev-tibco 379f935fe7 +1
2026-02-04 13:42:36 +01:00
..
+1
2026-02-01 22:47:26 +01:00
+1
2026-02-01 22:47:26 +01:00
+1
2026-02-04 13:42:36 +01:00
+1
2026-02-01 22:47:26 +01:00
+1
2026-02-01 22:47:26 +01:00
+1
2026-02-01 22:47:26 +01:00

OG Share Service

This service powers dynamic Open Graph share pages and images for Portfolio Journal.

Endpoints

  • /share?data=BASE64URL renders the HTML page with OG tags.
  • /og?data=BASE64URL renders the 1200x630 PNG image.

Payload (JSON, base64url-encoded):

{
  "n": "Goal name",
  "r": 12500.5,
  "g": 20000,
  "c": "USD",
  "td": "2026-12-31",
  "ec": "2026-10-15",
  "p": false
}

Fields:

  • n goal name
  • r current amount
  • g goal amount
  • c currency code (ISO 4217)
  • td target date (YYYY-MM-DD, optional)
  • ec estimated completion date (YYYY-MM-DD, optional)
  • p privacy mode; when true, hides the current amount

Run locally

cd og-service
GO111MODULE=on go run .

OpenRC (Alpine) service

Example steps (requires root):

# Build and install the binary
make build
cp og-service/bin/portfoliojournal-og /usr/local/bin/portfoliojournal-og
chmod +x /usr/local/bin/portfoliojournal-og

# Install the OpenRC script
cp og-service/portfoliojournal-og.openrc /etc/init.d/portfoliojournal-og
chmod +x /etc/init.d/portfoliojournal-og

# Enable and start
rc-update add portfoliojournal-og default
rc-service portfoliojournal-og start

Or run the helper script (requires root):

sudo sh og-service/install-openrc.sh

NGINX example

location /share {
    proxy_pass http://127.0.0.1:8090;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Host $host;
}

location /og {
    proxy_pass http://127.0.0.1:8090;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Host $host;
}