Page updated:

Storage Configuration

TrendRadar automatically picks a suitable storage backend based on how you deploy it. In most cases you don't need to configure anything manually — only GitHub Actions deployments require additional cloud storage setup.

Automatic storage backend selection

Deployment environmentStorage locationDescription
Docker / local deploymentLocal diskData is stored in the output/ directory — works out of the box
GitHub ActionsCloud storageThe Actions runtime is destroyed after each run, so you must configure cloud storage to persist data

Local storage (SQLite)

Docker and local deployments use local SQLite storage by default. Data is saved in the output/ directory, with no additional configuration required.

output directory structure

The files in the output/ directory serve different purposes:
  • SQLite database: stores news data, ranking trajectories, RSS entries, AI analysis results, and other core runtime data
  • HTML reports: visual report files used for email push and web viewing
  • TXT snapshots: plain-text data snapshots used for debugging and troubleshooting

Remote S3 storage (GitHub Actions users)

The GitHub Actions runtime is destroyed after each run, so you need to configure S3-compatible cloud storage to persist data. We recommend Cloudflare R2 — its free tier is more than enough.

Secrets to configure

In your GitHub repository, go to Settings > Secrets and variables > Actions, and add the following Secrets:
Secret nameValue to enterRequiredDescription
STORAGE_BACKENDremoteRequiredStorage backend type — just set it to remote
S3_BUCKET_NAMEyour bucket nameRequiredFor example, trendradar-data
S3_ACCESS_KEY_IDyour Access Key IDRequiredObtained when you create the API Token
S3_SECRET_ACCESS_KEYyour Secret Access KeyRequiredObtained when you create the API Token (shown only once)
S3_ENDPOINT_URLyour R2 endpoint URLRequiredFormat: https://[account-id].r2.cloudflarestorage.com
S3_REGIONautoOptionalOptional; defaults to "auto" and usually needs no change

Cloudflare R2 setup guide

1
Sign in to the Cloudflare Dashboard
Sign in to your Cloudflare account, then find and click R2 Object Storage in the left-hand menu.
2
Create a bucket
Click Overview > Create Bucket, enter a bucket name (for example, trendradar-data), then click create.
3
Get the endpoint URL
Go back to the Overview page, scroll down to the Account Details section, and find the S3 API address. This address is your S3_ENDPOINT_URL:
https://[your-account-id].r2.cloudflarestorage.com
4
Create an API Token
In the Account Details area, click Manage (R2 API Tokens) to open the token management page. Click Create Account API Token:
  • Give the token a name (for example, trendradar)
  • Permissions: Admin Read and Write
  • Specify bucket: select the bucket you just created
  • Click Create
5
Save the keys

Other S3-compatible providers

In addition to Cloudflare R2, TrendRadar supports other S3-compatible storage services. Below are the endpoint URL formats for common providers:
ProviderS3_ENDPOINT_URL formatNotes
Cloudflare R2https://<account-id>.r2.cloudflarestorage.comRecommended; generous free tier
Alibaba Cloud OSShttps://oss-cn-<region>.aliyuncs.comReplace <region> with the actual region, e.g. hangzhou, shanghai
Tencent Cloud COShttps://cos.ap-<region>.myqcloud.comReplace <region> with the actual region, e.g. guangzhou, beijing
AWS S3https://s3.<region>.amazonaws.comReplace <region> with the actual region, e.g. us-east-1

Data retention policy

You can configure how many days to keep local and cloud data in config/config.yaml:
storage:
  local:
    retention_days: 0     # Retention days (default 0, i.e. keep forever. Set to 30 to keep only the last 30 days)
  remote:
    retention_days: 0     # Retention days (default 0, i.e. keep forever)

Data pull (MCP Server scenario)

If you use the MCP Server to interact with remote data locally, you can configure automatic data sync from remote to local on startup:
storage:
  pull:
    enabled: false    # Enable auto-pull on startup (true=enable, false=disable)
    days: 7           # Pull data from the last N days

Timezone settings

Data timestamps depend on the timezone setting. You can adjust the timezone in config/config.yaml:
app:
  timezone: "Asia/Shanghai"  # China time by default
If you use it in another timezone, just change it to the corresponding timezone identifier (for example, America/New_York, Europe/London, etc.).