Skip to content

Build on OSL 6.1 - #77

Merged
Mistium merged 1 commit into
mainfrom
osl-6
Nov 15, 2026
Merged

Mistium merged 1 commit into
mainfrom
osl-6

Conversation

@Mistium

@Mistium Mistium commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Moves the API from OSL 3.0.0 (78deaec4) to the latest OSL, 6.1.1 (aeb83e39).

What changed

  • CI pins OSL aeb83e39. AGENTS.md and README say OSL 6.1.
  • osl fix renamed serve.limitRequests(n, {window: ms}) to serve.rateLimit({requests: n, window: date.minute | date.hour}). All 34 limits keep the same counts and windows. The route dump is identical apart from that spelling.
  • osl fix renamed the record types to class. They were already shared, so nothing copies differently.
  • Four test files set a sibling module's global to a test value. They now do it inside a small setup function, because OSL 6.1.1 reads a top-level assignment in a sibling file as a second declaration. That's an OSL bug, fixed in https://git.rotur.dev/osl/.go/pulls/85 (6.1.2). Once that lands and CI pins it, these can go back to plain assignments.
  • One behaviour fix from the new compiler: validGitFilePath meant to refuse NUL bytes with "\x00". OSL 3.0 read that as the text x00, so it refused paths containing "x00" and let NUL through. OSL 6 reads it as NUL.

Checks

Before deploying

  • Build with OSL aeb83e39 cross-compiled for the server (osl-aeb8), not osl-78de.
  • Check how the server is fronted. On OSL 6, c.ip() only trusts X-Forwarded-For from 127.0.0.0/8 and ::1, and takes the rightmost untrusted address. It never reads X-Real-IP. With cloudflared on the same Mac this works unchanged, and is safer than before (3.0 trusted a spoofable leftmost value). If the proxy is on another host, every visitor would get the proxy's address, so the rate limits would apply site-wide and view dedup would merge visitors. In that case, pass serve.new({trustProxy: [...]}) in main.osl. Check with pgrep -fl cloudflared on the API host.
  • " 5".toNum() now gives 5 instead of 0, so numeric query values with surrounding spaces parse. Harmless.

Version

1.0.0 → 1.0.1 (patch: toolchain move, no API change).

No screenshots: backend only, nothing visible changes.

Pin CI to OSL aeb83e39 (6.1.1). osl fix renamed serve.limitRequests to
serve.rateLimit with the same limits and windows, and the record types to
class. Test files that point a sibling's global at test values now do it
inside a setup function, because OSL 6 reads a top-level assignment in a
sibling file as a second declaration.
@Mistium
Mistium merged commit 8991780 into main Nov 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant