OG Share Service
This service powers dynamic Open Graph share pages and images for Portfolio Journal.
Endpoints
/share?data=BASE64URLrenders the HTML page with OG tags./og?data=BASE64URLrenders 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:
ngoal namercurrent amountggoal amountccurrency code (ISO 4217)tdtarget date (YYYY-MM-DD, optional)ecestimated completion date (YYYY-MM-DD, optional)pprivacy 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;
}