New Feature

HTML Preview via S3

Git Studio now renders .html files directly — no more plain text source code in Preview mode.

What changed?

Clicking an .html file on git.arikigame.com now shows the rendered webpage in a Preview tab. The HTML is served from S3 with stale-while-revalidate caching — first view uploads to S3, subsequent views are instant.

1
Click .html file
Preview / Source toggle appears
2
First view
Blob uploaded to S3
3
Redirect
302 to presigned S3 URL
4
SWR cache
Stale served instantly, revalidated in background

Security

HTML is served from S3 (tinqs-git-preview bucket) — a completely different origin from git.arikigame.com. The iframe uses sandbox="allow-scripts" only — no allow-same-origin. Even if JavaScript runs, it cannot access Gitea session cookies, API tokens, or DOM.

Writing HTML for Git Studio

RuleDetails
Images Upload to S3 and use absolute URLs: https://tinqs-screenshots.s3.eu-west-1.amazonaws.com/...
CSS / JS Inline in the HTML file (single-file preferred) or use CDN URLs
Relative paths Do NOT use — HTML is served from S3, not the repo
Frontmatter Optional HTML comment block at top for title, date, author
Expand Click the expand icon (top-right) to open full-screen in a new tab

S3 Image Test

This image is served from tinqs-screenshots S3 bucket — proving S3 images render correctly inside the preview iframe:

Screenshot of Git Studio

Infrastructure

ComponentDetail
S3 Buckettinqs-git-preview (eu-west-1)
IAM Usergitea-s3 (scoped policy)
Config[html_preview] section in /etc/gitea/app.ini
Buildtinqs-git 3b81d57 (fork of Gitea v1.26.1)
RouteGET /:owner/:repo/preview/:ref/*path