Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
# Not target/: it holds the engine's ExternalProject stamps, but each
# sub-build's CMakeCache lives in the engine submodule tree, so a
# restored target/ fails with "Error: could not load cache".
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.os }}-cargo-${{ hashFiles('Cargo.lock', 'engine', 'shim/**', 'patches/**', 'build.rs') }}
key: ${{ matrix.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
- name: build
run: cargo build --release --all-targets -vv 2>&1 | grep -vE "^\s*$|warning:" | tail -200
env:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
target/
cloud/node_modules/
cloud/app.env
cloud/*.db
cloud/*.db-*
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ TUI keys: arrows or hjkl move, type or `=` to enter, Enter/F2 edit, Tab commit
right, Del clear, Ctrl+Z / Ctrl+Y undo and redo, `[` `]` switch sheet, `<` `>`
column width, `g` go to, `:w file.xlsx` save as, `:q` quit, `?` all keys.

## Hosted API and MCP

The same engine over HTTPS and remote MCP at **https://sk33p.pwa.pit.world**: evaluate
formulas, read ranges, write cells and convert workbooks with nothing installed.
Free tier (a key by email, 100 calls a day); Pro is $9 per 30 days via CoinPay.
Docs: https://sk33p.pwa.pit.world/docs. Source in `cloud/`.

```sh
curl -s https://sk33p.pwa.pit.world/api/v1/eval -H 'content-type: application/json' \
-d '{"formulas":["=PMT(5%/12,360,-300000)"]}'
```

## Engine notes

- The formula parser has no `^` operator: write `POWER(A1,2)`.
Expand Down
5 changes: 5 additions & 0 deletions cloud/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
test
app.env
*.db
*.db-*
25 changes: 25 additions & 0 deletions cloud/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# sk33p cloud: Bun + Hono in front of the sk33p release binary.
# ubuntu:24.04 because the release binary is built on ubuntu-latest (glibc 2.39).
FROM oven/bun:1.4.4 AS bun

FROM ubuntu:24.04
ARG SK33P_VERSION=latest
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl util-linux zlib1g libstdc++6 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=bun /usr/local/bin/bun /usr/local/bin/bun
RUN set -eu; \
if [ "$SK33P_VERSION" = latest ]; then url=https://github.com/profullstack/sk33p/releases/latest/download/sk33p-linux-x86_64.tar.gz; \
else url=https://github.com/profullstack/sk33p/releases/download/$SK33P_VERSION/sk33p-linux-x86_64.tar.gz; fi; \
curl -fsSL "$url" | tar -xz -C /usr/local/bin sk33p && chmod 755 /usr/local/bin/sk33p && /usr/local/bin/sk33p --version
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile --production
COPY src ./src
# Checkouts can carry owner-only modes; the app runs as a non-root user.
RUN chmod -R a+rX /app && useradd --system --uid 10033 --home /data sk33p && mkdir -p /data && chown sk33p /data
USER sk33p
ENV PORT=8811 HOST=0.0.0.0 DATA_DIR=/data SK33P_BIN=/usr/local/bin/sk33p NODE_ENV=production
EXPOSE 8811
HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD curl -fsS http://127.0.0.1:8811/healthz || exit 1
CMD ["bun", "src/main.ts"]
209 changes: 209 additions & 0 deletions cloud/bun.lock

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions cloud/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# docker compose -f cloud/compose.yml --env-file cloud/app.env up -d --build
services:
web:
build: .
image: sk33p-cloud:latest
restart: unless-stopped
env_file: app.env
environment:
ORIGIN: https://sk33p.pwa.pit.world
ports:
- "127.0.0.1:8811:8811"
volumes:
- data:/data
read_only: true
tmpfs:
- /tmp:size=512m
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
mem_limit: 3g
pids_limit: 256
volumes:
data:
15 changes: 15 additions & 0 deletions cloud/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "sk33p-cloud",
"private": true,
"type": "module",
"description": "sk33p.pwa.pit.world: hosted sk33p API and remote MCP (free tier + Pro via CoinPay)",
"scripts": {
"start": "bun src/main.ts",
"test": "bun test"
},
"dependencies": {
"@profullstack/coinpay-onboard": "^0.5.1",
"@profullstack/footer": "^0.7.2",
"hono": "^4.13.23"
}
}
Loading
Loading