diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d1e432ce..092fcc11 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,27 +2,54 @@ name: 'Build' on: workflow_dispatch: workflow_call: + pull_request: push: branches: - 'main' jobs: - deploy: - name: 'Deploy' + build: + name: 'Build' runs-on: ubuntu-latest steps: - name: 'Checkout' - uses: actions/checkout@v4 + uses: actions/checkout@v7 + with: + # The whole history: each page's "Last updated", sitemap date and JSON-LD dates come + # from git (lastModified in source.config.ts). A shallow clone gives every page the same date. + fetch-depth: 0 + + # Bun installs and runs the scripts; Next.js itself still builds on Node. + - name: 'Setup Bun' + uses: oven-sh/setup-bun@v2 + with: + bun-version-file: package.json + - name: 'Setup Node' - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: - node-version: 20 - - uses: pnpm/action-setup@v3 - name: Install pnpm + node-version: 22 + + - name: 'Cache Bun packages' + uses: actions/cache@v6 with: - version: 10 - run_install: true # pnpm will install dependencies recursively. + path: ~/.bun/install/cache + key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }} + restore-keys: bun-${{ runner.os }}- + + - name: 'Install dependencies' + run: bun install --frozen-lockfile + + - name: 'Check content (MDX that could run code)' + run: bun run check:content + + - name: 'Test the scripts (bun test)' + run: bun test + + - name: 'Typecheck' + run: bun run typecheck - - name: 'Build' - run: | - pnpm build \ No newline at end of file + # prebuild runs check:content again (Netlify builds run it there); + # postbuild runs check:paths and check:links on out/. + - name: 'Build' + run: bun run build diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 00000000..e981481c --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,106 @@ +# Publishes the built docs for the Pelican Hub, which serves them on pelican.dev from Forge: +# /docs/* and the root files (/update-panel.sh, /llms.txt, ...). scripts/pack-docs.mjs packs +# out/ into the folder the Hub installs (App\Services\Site\DocsBuildService): the /docs files, +# _next/, _root/ with the root files, 404.html, redirects.json (netlify.toml's /docs redirects) +# and BUILD.json naming the commit. It goes to a branch the Hub downloads: +# +# main -> docs-build (pelican.dev, production) +# feat/fumadocs-next -> preview/docs-under-docs (hub-preview.pelican.dev) +# +# The last step asks that Hub to install it right away; it also checks every 10 minutes. +name: 'Publish docs build' +on: + workflow_dispatch: + push: + branches: + - 'main' + - 'feat/fumadocs-next' + # Daily, so a new Panel release (scripts/sync-release.mjs) reaches pelican.dev without a push. + # GitHub runs schedules from main only, so this rebuilds pelican.dev, like a push to main. + schedule: + - cron: '23 5 * * *' + +concurrency: + group: publish-docs-${{ github.ref_name }} + cancel-in-progress: true + +permissions: + contents: write + +jobs: + publish: + name: 'Build and publish /docs for the Hub' + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v7 + with: + # The whole history: each page's "Last updated", sitemap date and JSON-LD dates come + # from git (lastModified in source.config.ts). A shallow clone gives every page the same date. + fetch-depth: 0 + + - name: 'Setup Bun' + uses: oven-sh/setup-bun@v2 + with: + bun-version-file: package.json + + - name: 'Setup Node' + uses: actions/setup-node@v7 + with: + node-version: 22 + + - name: 'Cache Bun packages' + uses: actions/cache@v6 + with: + path: ~/.bun/install/cache + key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }} + restore-keys: bun-${{ runner.os }}- + + - name: 'Install dependencies' + run: bun install --frozen-lockfile + + # Nothing is published that fails the tests or the typecheck (build.yml runs the same). + - name: 'Test the scripts (bun test)' + run: bun test + + - name: 'Typecheck' + run: bun run typecheck + + # prebuild checks the content, postbuild checks every file lands where it should and every link works. + - name: 'Build' + env: + # sync-release reads the latest Panel release with it (a higher rate limit). + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: bun run build + + - name: 'Pack the docs for the Hub' + run: bun run pack:docs dist-docs + + - name: 'Pick the target' + id: target + run: | + if [ "$GITHUB_REF_NAME" = "main" ]; then + echo "branch=docs-build" >> "$GITHUB_OUTPUT" + echo "refresh=https://pelican.dev/docs/_refresh" >> "$GITHUB_OUTPUT" + else + echo "branch=preview/docs-under-docs" >> "$GITHUB_OUTPUT" + echo "refresh=https://hub-preview.pelican.dev/docs/_refresh" >> "$GITHUB_OUTPUT" + fi + + - name: 'Publish to ${{ steps.target.outputs.branch }}' + working-directory: dist-docs + env: + GH_TOKEN: ${{ github.token }} + TARGET: ${{ steps.target.outputs.branch }} + run: | + git init -q -b docs-build + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git add -A + git commit -q -m "Docs build of ${GITHUB_SHA::10} (${GITHUB_REF_NAME})" + git push -q -f "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "HEAD:refs/heads/${TARGET}" + + # Not fatal: the Hub also checks on its own every 10 minutes and on the first visit. Until + # the Hub serves pelican.dev, the production refresh reaches Netlify and fails harmlessly. + - name: 'Ask the Hub to install it' + run: curl -fsS --max-time 60 "${{ steps.target.outputs.refresh }}" || echo "The Hub will pick it up on its next check." diff --git a/.gitignore b/.gitignore index 0595129c..6f7f3852 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,15 @@ # Dependencies /node_modules -# Production -/build +# Production (static export) +/out # Generated files -.docusaurus -.cache-loader +/.next +/.source +next-env.d.ts +*.tsbuildinfo +.netlify # Misc .DS_Store @@ -22,3 +25,9 @@ yarn-error.log* /.idea package-lock.json + +# design skill working files +.taste-skill + +# scripts/pack-docs.mjs +/dist-docs diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..24304e8b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,29 @@ + + +## This is NOT the Next.js you know + +This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. + +This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean. + + + +## Scripts and checks + +- Everything runs with Bun: `bun install`, `bun run ', + 'a component pages are not given': '', + 'code in an attribute': 'x', + 'a function in an attribute': ' []} />', + 'a spread attribute': 'x', + 'an event handler': '
x
', + 'a lowercase event handler': '', + 'dangerouslySetInnerHTML': '
', + 'a javascript: link in JSX': 'x', + 'a vbscript: link': 'x', + 'a javascript: link with a tab in the scheme': 'x', + 'a javascript: link in braces': "x", + 'a data: link in a template literal': 'x', + 'a javascript: URL nested in literal data': "", + 'a javascript: Markdown link': '[x](javascript:alert(1))', + 'a data: Markdown image': '![x](data:text/html;base64,PHNjcmlwdD4=)', + 'MDX that does not parse': '', +}; + +for (const [name, page] of Object.entries(blocked)) { + test(`fails on ${name}`, () => { + const { ok, output } = check(page); + // The output is in the comparison, so a failure shows what the check said. + expect({ ok, output }).toMatchObject({ ok: false }); + expect(output).toMatch(/problem/); + }); +} + +const allowed = { + 'the components the docs use': [ + '', + ' Text', + '', + '', + '', + ' NGINX', + '', + '', + '
', + ' More', + ' Hidden', + '
', + ].join('\n'), + 'literal data in an attribute': "", + 'nested literal data': '', + 'a comment': '{/* a note for editors */}', + // @mdx-js/mdx 3 compiles an indented import/export as a paragraph of text, not code. + 'an indented export, which MDX reads as text': ' export const a = 1', + 'code that only looks like code': '```sh\nexport CF_Token=abc\n```\n\nRun `import x` or `', + '', + '', + '', + ].join(''); + + expect(pathsLoadedOutsideDocs(html)).toEqual(['/_next/static/app.js', '/styles.css', '/img/logo.png', '/og/home.png']); + }); + + test('/docs/, the root files, other sites and plain links don\'t', () => { + const html = [ + '', + '', + '', + '', + '', + 'Plugins', + '', + ].join(''); + + expect(pathsLoadedOutsideDocs(html)).toEqual([]); + }); +}); diff --git a/scripts/install-sh.test.mjs b/scripts/install-sh.test.mjs new file mode 100644 index 00000000..ec9a38bb --- /dev/null +++ b/scripts/install-sh.test.mjs @@ -0,0 +1,447 @@ +// bun test scripts/install-sh.test.mjs +// public/install.sh (pelican.dev/install.sh), run for real in --dry-run: the options and their +// errors, the files it writes (pelican.env, stack.yml, deploy.sh) for each profile, with and +// without a domain, that a second run keeps the keys and passwords, and what deploy.sh writes +// (Traefik's routes) and hands to `docker stack deploy` (with a stub docker), and how Docker is +// installed on each distribution (a fake os-release). Also shellcheck, when it's installed. The script lives in public/ (served as it +// is), so its test lives here. +import { describe, expect, test } from 'bun:test'; +import { chmodSync, existsSync, mkdtempSync, readFileSync, statSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { parse } from 'yaml'; + +const SCRIPT = join(import.meta.dir, '..', 'public', 'install.sh'); + +/** A bash of version 4 or newer (the script's servers have 5; macOS ships 3.2 as /bin/bash). */ +function findBash() { + for (const bash of ['/opt/homebrew/bin/bash', '/usr/local/bin/bash', '/usr/bin/bash', '/bin/bash', Bun.which('bash')]) { + if (!bash || !existsSync(bash)) continue; + const { stdout } = Bun.spawnSync([bash, '-c', 'echo ${BASH_VERSINFO[0]}']); + if (Number(stdout.toString().trim()) >= 4) return bash; + } + return null; +} + +const BASH = findBash(); +const suite = BASH ? describe : describe.skip; + +function install(args, env = {}) { + const result = Bun.spawnSync([BASH, SCRIPT, ...args], { + env: { PATH: process.env.PATH, HOME: process.env.HOME, ...env }, + stdin: 'ignore', + }); + return { code: result.exitCode, out: result.stdout.toString() + result.stderr.toString() }; +} + +function dryRun(extra = [], dir = mkdtempSync(join(tmpdir(), 'pelican-install-')), env = {}) { + const result = install(['--dry-run', '--dir', dir, ...extra], env); + return { ...result, dir }; +} + +const BASE = ['--domain', 'panel.example.com', '--email', 'admin@pelican.test']; +const IP = ['--ip', '203.0.113.10']; // no domain: the Panel on the server's IP (given, as a dry run doesn't look it up) + +/** pelican.env as an object (KEY='value' lines). */ +function settings(dir) { + const values = {}; + for (const line of readFileSync(join(dir, 'pelican.env'), 'utf8').split('\n')) { + const match = line.match(/^([A-Z_][A-Z0-9_]*)='(.*)'$/); + if (match) values[match[1]] = match[2]; + } + return values; +} + +const stack = (dir) => parse(readFileSync(join(dir, 'stack.yml'), 'utf8')); + +suite('install.sh options', () => { + test('--help lists the options and their environment variables, and exits 0', () => { + const { code, out } = install(['--help']); + expect(code).toBe(0); + for (const flag of ['--interactive', '--domain', '--email', '--ip', '--profile', '--wings', '--wings-domain', '--dry-run', '--staging']) { + expect(out).toContain(flag); + } + for (const name of ['PELICAN_DOMAIN', 'PELICAN_EMAIL', 'PELICAN_PROFILE', 'PELICAN_WINGS', 'PELICAN_IP', 'PELICAN_INTERACTIVE']) { + expect(out).toContain(name); + } + expect(out).not.toContain('--yes'); // not asking is the default; there's nothing to say yes to + }); + + test('an unknown option fails with exit 2', () => { + expect(install(['--nope']).code).toBe(2); + }); + + test('it asks nothing by default: no options means the Panel on the IP, quick, no Wings', () => { + const { code, out, dir } = dryRun(IP); + expect(code).toBe(0); + expect(settings(dir)).toMatchObject({ PANEL_DOMAIN: '', PANEL_IP: '203.0.113.10', LE_EMAIL: '', PROFILE: 'quick', WINGS_DOMAIN: '' }); + expect(out).not.toContain('Wings:'); + // A domain needs an email; without --interactive that's an error naming both ways to give it. + expect(dryRun(['--domain', 'panel.example.com']).out).toContain('--email (or PELICAN_EMAIL) is needed with --domain'); + }); + + test('--yes from older instructions is still accepted', () => { + expect(dryRun([...IP, '--yes']).code).toBe(0); + }); + + test('every option can be an environment variable, and the option wins over it', () => { + const fromEnv = dryRun([], undefined, { + PELICAN_DOMAIN: 'panel.example.com', + PELICAN_EMAIL: 'admin@pelican.test', + PELICAN_PROFILE: 'production', + PELICAN_WINGS: 'yes', + PELICAN_WINGS_DOMAIN: 'node.example.com', + PELICAN_STAGING: '1', + }); + expect(fromEnv.code).toBe(0); + expect(settings(fromEnv.dir)).toMatchObject({ + PANEL_DOMAIN: 'panel.example.com', + LE_EMAIL: 'admin@pelican.test', + PROFILE: 'production', + WINGS_DOMAIN: 'node.example.com', + LE_CA_SERVER: 'https://acme-staging-v02.api.letsencrypt.org/directory', + }); + + const overridden = dryRun(['--profile', 'quick', '--no-wings'], undefined, { PELICAN_PROFILE: 'production', PELICAN_WINGS: '1', PELICAN_IP: '203.0.113.10' }); + expect(settings(overridden.dir)).toMatchObject({ PROFILE: 'quick', WINGS_DOMAIN: '', PANEL_IP: '203.0.113.10' }); + }); + + test('bad values are refused before anything is written', () => { + const domain = dryRun(['--domain', 'not a domain', '--email', 'admin@pelican.test']); + expect(domain.code).not.toBe(0); + expect(domain.out).toContain("isn't a domain name"); + expect(existsSync(join(domain.dir, 'pelican.env'))).toBe(false); + + expect(dryRun(['--domain', 'panel.example.com', '--email', "o'brien@example.com"]).out).toContain("isn't an email"); + expect(dryRun([...BASE, '--profile', 'enterprise']).out).toContain('--profile is quick or production'); + expect(dryRun(['--ip', '300.1.2.3']).out).toContain("isn't an IPv4 address"); + // Let's Encrypt refuses contacts at example.com (seen on a real run): a real run stops before + // touching anything (here as non-root, it stops at that check, before the root check)... + const real = install(['--dir', mkdtempSync(join(tmpdir(), 'pelican-install-')), '--domain', 'panel.example.com', '--email', 'admin@example.com']); + expect(real.code).not.toBe(0); + expect(real.out).toContain("Let's Encrypt refuses addresses at example.com"); + // ...while a dry run, which only shows the plan, warns and goes on (the docs' example uses it). + const preview = dryRun(['--domain', 'panel.example.com', '--email', 'you@example.com']); + expect(preview.code).toBe(0); + expect(preview.out).toContain('use a real email for the real run'); + }); + + test('with a domain, Wings needs its own; without one, it needs none (and may not have one)', () => { + expect(dryRun([...BASE, '--wings']).out).toContain('--wings-domain (or PELICAN_WINGS_DOMAIN) is needed'); + expect(dryRun([...BASE, '--wings', '--wings-domain', 'panel.example.com']).out).toContain('Wings needs its own domain'); + const ip = dryRun([...IP, '--wings']); + expect(ip.code).toBe(0); + expect(ip.out).toContain('http://203.0.113.10:8080'); + expect(settings(ip.dir).WINGS_DOMAIN).toBe(''); + expect(dryRun([...IP, '--wings', '--wings-domain', 'node.example.com']).out).toContain('--wings-domain needs --domain'); + }); + + test('--interactive without a terminal stops and says to pass the options instead', () => { + const { code, out } = install(['--dry-run', '--interactive', ...BASE]); + expect(code).not.toBe(0); + expect(out).toContain('--interactive needs a terminal'); + expect(install(['--dry-run', ...BASE], { PELICAN_INTERACTIVE: '1' }).out).toContain('--interactive needs a terminal'); + }); +}); + +suite('install.sh files', () => { + test('quick: Traefik and the Panel, nothing else; secrets stay in pelican.env', () => { + const { code, out, dir } = dryRun(BASE); + expect(code).toBe(0); + expect(out).toContain('Dry run: nothing changed'); + + const env = settings(dir); + expect(env.PROFILE).toBe('quick'); + expect(env.PANEL_DOMAIN).toBe('panel.example.com'); + expect(env.APP_KEY).toMatch(/^base64:[A-Za-z0-9+/]{43}=$/); + expect(env.DB_PASSWORD).toBeUndefined(); + expect(statSync(join(dir, 'pelican.env')).mode & 0o777).toBe(0o600); + expect(out).not.toContain(env.APP_KEY); + + const file = stack(dir); + expect(Object.keys(file.services).sort()).toEqual(['panel', 'traefik']); + expect(readFileSync(join(dir, 'stack.yml'), 'utf8')).not.toContain('#PRODUCTION'); + + // Traefik: real client IPs (host mode), routes from the file deploy.sh writes, Let's Encrypt + // from pelican.env, and no Docker socket (it doesn't need one). + const traefik = file.services.traefik; + expect(traefik.ports).toEqual([ + { target: 80, published: 80, protocol: 'tcp', mode: 'host' }, + { target: 443, published: 443, protocol: 'tcp', mode: 'host' }, + ]); + expect(traefik.command).toContain('--providers.file.directory=/etc/traefik/dynamic'); + expect(traefik.command).toContain('--certificatesResolvers.letsencrypt.acme.caServer=${LE_CA_SERVER}'); + expect(traefik.command.join(' ')).not.toContain('providers.swarm'); + expect(traefik.volumes.join(' ')).not.toContain('docker.sock'); + expect(traefik.deploy.placement.constraints).toEqual(['node.id == ${SWARM_NODE_ID}']); + + // The Panel: behind Traefik, trusting only the public network it shares with Traefik. + const panel = file.services.panel; + expect(panel.environment).toMatchObject({ + APP_URL: '${PANEL_URL}', + APP_KEY: '${APP_KEY}', + BEHIND_PROXY: 'true', + TRUSTED_PROXIES: '${PUBLIC_SUBNET}', + }); + expect(panel.environment.DB_CONNECTION).toBeUndefined(); + expect(panel.volumes).toContain('pelican-plugins:/var/www/html/plugins'); + expect(panel.deploy.labels).toBeUndefined(); + expect(file.networks.public.ipam.config[0].subnet).toBe('${PUBLIC_SUBNET}'); + expect(env.PUBLIC_SUBNET).toBe('10.203.250.0/24'); + // Traefik is pinned to an exact version (updates are deliberate), unless asked otherwise. + expect(env.TRAEFIK_IMAGE).toMatch(/^traefik:v\d+\.\d+\.\d+$/); + expect(settings(dryRun(BASE, undefined, { PELICAN_TRAEFIK_IMAGE: 'traefik:v3.6.25' }).dir).TRAEFIK_IMAGE).toBe('traefik:v3.6.25'); + }); + + test('production: MariaDB and Redis on an internal network, with generated passwords', () => { + const { code, dir } = dryRun([...BASE, '--profile', 'production']); + expect(code).toBe(0); + const env = settings(dir); + expect(env.DB_PASSWORD).toMatch(/^[A-Za-z0-9]{32}$/); + expect(env.DB_ROOT_PASSWORD).toMatch(/^[A-Za-z0-9]{32}$/); + expect(env.DB_PASSWORD).not.toBe(env.DB_ROOT_PASSWORD); + + const file = stack(dir); + expect(Object.keys(file.services).sort()).toEqual(['cache', 'database', 'panel', 'traefik']); + expect(file.services.panel.environment).toMatchObject({ + DB_CONNECTION: 'mariadb', + DB_HOST: 'database', + DB_PASSWORD: '${DB_PASSWORD}', + CACHE_STORE: 'redis', + SESSION_DRIVER: 'redis', + QUEUE_CONNECTION: 'redis', + REDIS_HOST: 'cache', + }); + expect(file.services.panel.networks).toEqual(['public', 'internal']); + expect(file.services.database.networks).toEqual(['internal']); + expect(file.services.database.environment.MARIADB_PASSWORD).toBe('${DB_PASSWORD}'); + expect(file.networks.internal).toEqual({ driver: 'overlay', internal: true }); + expect(Object.keys(file.volumes)).toEqual(expect.arrayContaining(['pelican-db', 'pelican-redis'])); + }); + + test('a second run keeps APP_KEY and the passwords, and refuses to switch profiles', () => { + const first = dryRun([...BASE, '--profile', 'production']); + const before = settings(first.dir); + const again = dryRun([], first.dir); // everything comes from pelican.env + expect(again.code).toBe(0); + expect(again.out).toContain('keeping its keys and passwords'); + const after = settings(first.dir); + expect(after.APP_KEY).toBe(before.APP_KEY); + expect(after.DB_PASSWORD).toBe(before.DB_PASSWORD); + expect(after.DB_ROOT_PASSWORD).toBe(before.DB_ROOT_PASSWORD); + + const switched = dryRun(['--profile', 'quick'], first.dir); + expect(switched.code).not.toBe(0); + expect(switched.out).toContain('uses the production profile'); + }); + + test("--staging uses Let's Encrypt staging; running again without it goes back to real certificates", () => { + const { dir } = dryRun([...BASE, '--staging']); + expect(settings(dir).LE_CA_SERVER).toBe('https://acme-staging-v02.api.letsencrypt.org/directory'); + expect(dryRun([...BASE, '--staging'], dir).code).toBe(0); + expect(settings(dir).LE_CA_SERVER).toBe('https://acme-staging-v02.api.letsencrypt.org/directory'); + + const again = dryRun([], dir); + expect(again.out).toContain('Moving from Let\'s Encrypt staging to real certificates'); + expect(settings(dir).LE_CA_SERVER).toBe('https://acme-v02.api.letsencrypt.org/directory'); + }); + + test('another CA set by hand in pelican.env is kept on a second run', () => { + const { dir } = dryRun(BASE); + const file = join(dir, 'pelican.env'); + writeFileSync(file, readFileSync(file, 'utf8').replace(/^LE_CA_SERVER=.*$/m, "LE_CA_SERVER='https://acme.zerossl.com/v2/DV90'")); + expect(dryRun([], dir).code).toBe(0); + expect(settings(dir).LE_CA_SERVER).toBe('https://acme.zerossl.com/v2/DV90'); + }); + + test('a second run keeps the public subnet chosen on the first, unless PELICAN_PUBLIC_SUBNET says otherwise', () => { + const { dir } = dryRun(IP, undefined, { PELICAN_PUBLIC_SUBNET: '10.99.1.0/24' }); + expect(dryRun([], dir).code).toBe(0); + expect(settings(dir).PUBLIC_SUBNET).toBe('10.99.1.0/24'); + expect(dryRun([], dir, { PELICAN_PUBLIC_SUBNET: '10.99.3.0/24' }).code).toBe(0); + expect(settings(dir).PUBLIC_SUBNET).toBe('10.99.3.0/24'); + }); + + test('Wings is downloaded beside the binary and renamed over it (a running one can be replaced, not written)', () => { + const { out } = dryRun([...IP, '--wings']); + expect(out).toContain('-o /usr/local/bin/wings.new'); + expect(out).toContain('mv -f /usr/local/bin/wings.new /usr/local/bin/wings'); + expect(out).not.toContain('-o /usr/local/bin/wings '); + }); + + test('the address ranges can be changed for networks that clash', () => { + const dir = mkdtempSync(join(tmpdir(), 'pelican-install-')); + const result = install(['--dry-run', '--dir', dir, ...BASE], { + PELICAN_PUBLIC_SUBNET: '10.99.1.0/24', + PELICAN_GWBRIDGE_SUBNET: '10.99.2.0/24', + }); + expect(result.code).toBe(0); + expect(settings(dir).PUBLIC_SUBNET).toBe('10.99.1.0/24'); + expect(settings(dir).WINGS_UPSTREAM).toBe('http://10.99.2.1:8080'); + expect(result.out).toContain('--subnet 10.99.2.0/24'); + }); +}); + +/** A dry run on a server whose /etc/os-release says `release` (PELICAN_OS_RELEASE, for the tests). */ +function dryRunOn(release) { + const file = join(mkdtempSync(join(tmpdir(), 'pelican-os-')), 'os-release'); + writeFileSync(file, release); + return dryRun(IP, undefined, { PELICAN_OS_RELEASE: file }); +} + +const CENTOS_REPO = 'curl -fsSL https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo'; +const GET_DOCKER = 'curl -fsSL https://get.docker.com | CHANNEL=stable sh'; + +suite('install.sh Docker', () => { + // get.docker.com sends these to Docker's repo named after them, which has no Docker Engine + // packages: "Unable to find a match: docker-ce" (seen on Rocky 9). + test.each([ + ['AlmaLinux 9', 'ID="almalinux"\nVERSION_ID="9.6"\nID_LIKE="rhel centos fedora"\n'], + ['Rocky Linux 8', 'ID="rocky"\nVERSION_ID="8.10"\nID_LIKE="rhel centos fedora"\n'], + ['Rocky Linux 10', 'ID="rocky"\nVERSION_ID="10.0"\nID_LIKE="rhel centos fedora"\n'], + ['Oracle Linux 9', 'ID="ol"\nVERSION_ID="9.6"\nID_LIKE="fedora"\n'], + ])('%s gets Docker from Docker\'s CentOS repo, not get.docker.com', (_name, release) => { + const { code, out } = dryRunOn(release); + expect(code).toBe(0); + expect(out).toContain(CENTOS_REPO); + expect(out).toContain('dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin'); + expect(out).not.toContain('get.docker.com'); + }); + + test.each([ + ['Ubuntu 24.04', 'ID=ubuntu\nVERSION_ID="24.04"\nID_LIKE=debian\n'], + ['Debian 13', 'ID=debian\nVERSION_ID="13"\n'], + ['CentOS Stream 10', 'ID="centos"\nVERSION_ID="10"\nID_LIKE="rhel fedora"\n'], + ['RHEL 9', 'ID="rhel"\nVERSION_ID="9.6"\nID_LIKE="fedora"\n'], + ['Fedora 43', 'ID=fedora\nVERSION_ID=43\n'], + ['no os-release', ''], + ])('%s keeps Docker\'s own script', (_name, release) => { + const { code, out } = dryRunOn(release); + expect(code).toBe(0); + expect(out).toContain(GET_DOCKER); + expect(out).not.toContain(CENTOS_REPO); + }); + + test('Docker is started after it is installed', () => { + const { out } = dryRunOn('ID="rocky"\nVERSION_ID="9.6"\nID_LIKE="rhel centos fedora"\n'); + expect(out.indexOf('systemctl enable --now docker')).toBeGreaterThan(out.indexOf('dnf -y install docker-ce')); + }); +}); + +suite('deploy.sh', () => { + /** Runs deploy.sh with a stub docker that records its arguments and environment. */ + function deploy(dir) { + const bin = mkdtempSync(join(tmpdir(), 'pelican-bin-')); + const record = join(bin, 'calls'); + writeFileSync( + join(bin, 'docker'), + `#!/bin/sh\n{ echo "ARGS $*"; echo "PANEL_URL=$PANEL_URL"; echo "PELICAN_DIR=$PELICAN_DIR"; echo "ACME_STORAGE=$ACME_STORAGE"; echo "APP_KEY_SET=\${APP_KEY:+yes}"; } >> "${record}"\n`, + ); + chmodSync(join(bin, 'docker'), 0o755); + const result = Bun.spawnSync([BASH, join(dir, 'deploy.sh')], { env: { PATH: `${bin}:${process.env.PATH}` } }); + return { + code: result.exitCode, + err: result.stderr.toString(), + calls: existsSync(record) ? readFileSync(record, 'utf8') : '', + }; + } + + const routes = (dir) => parse(readFileSync(join(dir, 'traefik', 'pelican.yml'), 'utf8')).http; + + test('without a domain: the Panel on http://, on port 80 at any address, no HTTPS', () => { + const { dir } = dryRun(IP); + const { code, calls } = deploy(dir); + expect(code).toBe(0); + expect(calls).toMatch(/ARGS stack deploy (--detach=true )?--compose-file stack\.yml pelican/); + expect(calls).toContain('PANEL_URL=http://203.0.113.10'); + expect(calls).toContain(`PELICAN_DIR=${dir}`); + expect(calls).toContain('APP_KEY_SET=yes'); + + const http = routes(dir); + expect(http.routers).toEqual({ + 'pelican-panel': { rule: 'PathPrefix(`/`)', priority: 1, entryPoints: ['web'], service: 'pelican-panel' }, + }); + expect(http.services['pelican-panel'].loadBalancer.servers).toEqual([{ url: 'http://panel:80' }]); + expect(http.middlewares).toBeUndefined(); + }); + + test('with a domain: HTTPS with Let\'s Encrypt, and plain HTTP sent to HTTPS', () => { + const { dir } = dryRun(BASE); + const { code, calls } = deploy(dir); + expect(code).toBe(0); + expect(calls).toContain('PANEL_URL=https://panel.example.com'); + expect(calls).toContain('ACME_STORAGE=acme.json'); + + const http = routes(dir); + expect(http.routers['pelican-panel']).toEqual({ + rule: 'Host(`panel.example.com`)', + entryPoints: ['websecure'], + service: 'pelican-panel', + tls: { certResolver: 'letsencrypt' }, + }); + // HTTP to the Panel's name goes to HTTPS; anything else on port 80 (the bare IP) to the Panel. + expect(http.routers['pelican-to-https']).toMatchObject({ rule: 'Host(`panel.example.com`)', entryPoints: ['web'], middlewares: ['pelican-to-https'] }); + expect(http.middlewares['pelican-to-https']).toEqual({ redirectScheme: { scheme: 'https', permanent: true } }); + expect(http.routers['pelican-to-domain']).toMatchObject({ rule: 'PathPrefix(`/`)', priority: 1, entryPoints: ['web'], middlewares: ['pelican-to-domain'] }); + expect(http.middlewares['pelican-to-domain']).toEqual({ redirectRegex: { regex: '^https?://[^/]+(.*)', replacement: 'https://panel.example.com${1}' } }); + expect(http.routers['pelican-wings']).toBeUndefined(); + }); + + test('certificates are kept per CA: staging gets its own store, so its test certificates go with it', () => { + const { dir } = dryRun([...BASE, '--staging']); + expect(deploy(dir).calls).toContain('ACME_STORAGE=acme-acme-staging-v02.api.letsencrypt.org-directory.json'); + dryRun([], dir); // without --staging: back to Let's Encrypt's production server + expect(deploy(dir).calls).toContain('ACME_STORAGE=acme.json'); + }); + + test('adding a domain later: set it in pelican.env and deploy again', () => { + const { dir } = dryRun(IP); + const file = join(dir, 'pelican.env'); + writeFileSync(file, readFileSync(file, 'utf8').replace("PANEL_DOMAIN=''", "PANEL_DOMAIN='panel.example.com'")); + + const missingEmail = deploy(dir); + expect(missingEmail.code).not.toBe(0); + expect(missingEmail.err).toContain('LE_EMAIL is needed'); + + writeFileSync(file, readFileSync(file, 'utf8').replace("LE_EMAIL=''", "LE_EMAIL='admin@pelican.test'")); + const { code, calls } = deploy(dir); + expect(code).toBe(0); + expect(calls).toContain('PANEL_URL=https://panel.example.com'); + expect(routes(dir).routers['pelican-panel'].tls).toEqual({ certResolver: 'letsencrypt' }); + }); + + test('adding a domain later by running the script again keeps everything else', () => { + const first = dryRun(IP); + const before = settings(first.dir); + const again = dryRun(BASE, first.dir); + expect(again.code).toBe(0); + const after = settings(first.dir); + expect(after).toMatchObject({ PANEL_DOMAIN: 'panel.example.com', PANEL_IP: '203.0.113.10', APP_KEY: before.APP_KEY }); + }); + + test('with Wings on a domain, Traefik routes it to Wings on the host', () => { + const { dir } = dryRun([...BASE, '--wings', '--wings-domain', 'node.example.com']); + expect(settings(dir).WINGS_DOMAIN).toBe('node.example.com'); + expect(deploy(dir).code).toBe(0); + + const http = routes(dir); + expect(http.routers['pelican-wings']).toEqual({ + rule: 'Host(`node.example.com`)', + entryPoints: ['websecure'], + service: 'pelican-wings', + tls: { certResolver: 'letsencrypt' }, + }); + expect(http.services['pelican-wings'].loadBalancer.servers).toEqual([{ url: 'http://10.204.0.1:8080' }]); + expect(http.routers['pelican-to-https'].rule).toBe('Host(`panel.example.com`) || Host(`node.example.com`)'); + }); +}); + +const shellcheck = Bun.which('shellcheck'); +(shellcheck && BASH ? test : test.skip)('shellcheck finds nothing in install.sh or the deploy.sh it writes', () => { + const { dir } = dryRun(BASE); + for (const file of [SCRIPT, join(dir, 'deploy.sh')]) { + const result = Bun.spawnSync([shellcheck, '-s', 'bash', file]); + expect(result.stdout.toString()).toBe(''); + expect(result.exitCode).toBe(0); + } +}); diff --git a/scripts/pack-docs.mjs b/scripts/pack-docs.mjs new file mode 100644 index 00000000..ae4c3937 --- /dev/null +++ b/scripts/pack-docs.mjs @@ -0,0 +1,80 @@ +#!/usr/bin/env bun +/** + * Packs the built site (out/) into the folder the Pelican Hub serves on pelican.dev. + * + * When: in CI, after the build ("Publish docs build" workflow); by hand to look at the result + * Run: bun run pack:docs (or: bun scripts/pack-docs.mjs [folder], default dist-docs/) + * Tests: bun test scripts/pack-docs.test.mjs + * + * What the folder holds: + * + * index.html, panel/, md/, search.json … the docs, served under /docs/ + * _next/ their scripts and styles + * _root/update-panel.sh, llms.txt … the root files (ROOT_FILES) + * 404.html the docs' not-found page + * redirects.json netlify.toml's redirects under /docs + * BUILD.json which commit this is + */ +import { existsSync } from 'node:fs'; +import { cp, mkdir, rm } from 'node:fs/promises'; +import { basename, join } from 'node:path'; +import { ROOT_FILES } from '../router/paths.mjs'; + +/** + * The redirects under /docs from netlify.toml (it stays the one list: Netlify's PR previews use + * it too). Only real redirects (3xx); the rewrites (200) are rules the Hub has built in. + */ +export function docsRedirects(toml) { + const { redirects = [] } = Bun.TOML.parse(toml); + const underDocs = (from) => from === '/docs' || from?.startsWith('/docs/'); + + return redirects + .map(({ from, to, status = 301 }) => ({ from, to, status })) + .filter(({ from, to, status }) => underDocs(from) && to && status >= 300 && status < 400); +} + +/** + * Packs `src` (the built site) into `folder`, which is emptied first. The folder's name must + * start with "dist", so a typo like `bun run pack:docs .` can't delete the repo or the build. + */ +export async function pack(folder, { src = 'out', toml = 'netlify.toml' } = {}) { + if (!basename(folder).startsWith('dist')) { + throw new Error(`The output folder's name must start with "dist" (got "${folder}"): it is deleted first.`); + } + + const needed = ['docs/index.html', '_next/static', '404.html', ...ROOT_FILES]; + for (const path of needed) { + if (!existsSync(join(src, path))) throw new Error(`${join(src, path)} is missing: run "bun run build" first`); + } + + // Read before anything is deleted, so a broken netlify.toml leaves the old folder alone. + const redirects = docsRedirects(await Bun.file(toml).text()); + + await rm(folder, { recursive: true, force: true }); + await mkdir(join(folder, '_root'), { recursive: true }); + + await cp(join(src, 'docs'), folder, { recursive: true }); + await cp(join(src, '_next'), join(folder, '_next'), { recursive: true }); + await cp(join(src, '404.html'), join(folder, '404.html')); + for (const name of ROOT_FILES) { + await cp(join(src, name), join(folder, '_root', name)); + } + + await Bun.write(join(folder, 'redirects.json'), `${JSON.stringify(redirects, null, 2)}\n`); + + const build = { + sha: process.env.GITHUB_SHA ?? 'local', + branch: process.env.GITHUB_REF_NAME ?? 'local', + built_at: new Date().toISOString().replace(/\.\d+Z$/, 'Z'), + }; + await Bun.write(join(folder, 'BUILD.json'), `${JSON.stringify(build)}\n`); + + return { redirects: redirects.length, rootFiles: ROOT_FILES.length }; +} + +if (import.meta.main) { + process.chdir(join(import.meta.dir, '..')); + const folder = process.argv[2] ?? 'dist-docs'; + const { redirects, rootFiles } = await pack(folder); + console.log(`pack-docs: ${folder} (${redirects} redirects, ${rootFiles} root files)`); +} diff --git a/scripts/pack-docs.test.mjs b/scripts/pack-docs.test.mjs new file mode 100644 index 00000000..8cbc27d1 --- /dev/null +++ b/scripts/pack-docs.test.mjs @@ -0,0 +1,110 @@ +// bun test scripts/pack-docs.test.mjs (all tests: bun test) +// What the Hub gets: the packed folder, and the redirects taken from netlify.toml. +import { afterAll, describe, expect, test } from 'bun:test'; +import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { tmpdir } from 'node:os'; +import { join } from 'node:path'; +import { ROOT_FILES } from '../router/paths.mjs'; +import { docsRedirects, pack } from './pack-docs.mjs'; + +describe('docsRedirects', () => { + test('keeps the redirects under /docs, drops rewrites and other paths', () => { + const toml = ` +[build] + command = "bun run build" + +[[redirects]] + from = "/docs/_next/*" + to = "/_next/:splat" + status = 200 + +[[redirects]] + from = "/docs/about" + to = "/docs/contributors/" + status = 301 + +[[redirects]] + from = "/discord" + to = "https://discord.gg/pelican-panel" + status = 301 + +[[redirects]] + from = "/docs/old/*" + to = "/docs/new/:splat" + status = 302 +`; + + expect(docsRedirects(toml)).toEqual([ + { from: '/docs/about', to: '/docs/contributors/', status: 301 }, + { from: '/docs/old/*', to: '/docs/new/:splat', status: 302 }, + ]); + }); + + test('a redirect without a status is a 301, as on Netlify', () => { + expect(docsRedirects('[[redirects]]\nfrom = "/docs/a"\nto = "/docs/b/"\n')).toEqual([{ from: '/docs/a', to: '/docs/b/', status: 301 }]); + }); + + test('reads the real netlify.toml', async () => { + const redirects = docsRedirects(await Bun.file(new URL('../netlify.toml', import.meta.url)).text()); + + expect(redirects.length).toBeGreaterThanOrEqual(6); + expect(redirects).toContainEqual({ from: '/docs/guides/disk-quotas/zfs', to: '/docs/guides/disk-quotas/about/', status: 301 }); + for (const { from, status } of redirects) { + expect(from.startsWith('/docs')).toBe(true); + expect(status >= 300 && status < 400).toBe(true); + } + }); +}); + +test('only /docs and paths under it, not /docsfoo', () => { + const toml = ` +[[redirects]] + from = "/docsfoo" + to = "/docs/" + +[[redirects]] + from = "/docs" + to = "/docs/" +`; + + expect(docsRedirects(toml)).toEqual([{ from: '/docs', to: '/docs/', status: 301 }]); +}); + +describe('pack', () => { + const sandbox = mkdtempSync(join(tmpdir(), 'pack-docs-')); + const src = join(sandbox, 'out'); + const toml = join(sandbox, 'netlify.toml'); + afterAll(() => rmSync(sandbox, { recursive: true, force: true })); + + const write = (path, body) => { + mkdirSync(join(src, path, '..'), { recursive: true }); + writeFileSync(join(src, path), body); + }; + write('docs/index.html', 'docs'); + write('docs/panel/index.html', 'panel'); + write('_next/static/app.css', 'css'); + write('404.html', 'not found'); + for (const name of ROOT_FILES) write(name, name); + writeFileSync(toml, '[[redirects]]\nfrom = "/docs/about"\nto = "/docs/contributors/"\n'); + + test('lays the folder out the way the Hub installs it', async () => { + const folder = join(sandbox, 'dist-docs'); + expect(await pack(folder, { src, toml })).toEqual({ redirects: 1, rootFiles: ROOT_FILES.length }); + + expect(readdirSync(folder).sort()).toEqual(['404.html', 'BUILD.json', '_next', '_root', 'index.html', 'panel', 'redirects.json']); + expect(readdirSync(join(folder, '_root')).sort()).toEqual([...ROOT_FILES].sort()); + expect(JSON.parse(readFileSync(join(folder, 'redirects.json'), 'utf8'))).toEqual([{ from: '/docs/about', to: '/docs/contributors/', status: 301 }]); + expect(Object.keys(JSON.parse(readFileSync(join(folder, 'BUILD.json'), 'utf8')))).toEqual(['sha', 'branch', 'built_at']); + }); + + test('refuses an output folder that isn\'t a dist folder, before deleting anything', async () => { + await expect(pack(src, { src, toml })).rejects.toThrow('must start with "dist"'); + await expect(pack(sandbox, { src, toml })).rejects.toThrow('must start with "dist"'); + expect(existsSync(join(src, 'docs/index.html'))).toBe(true); + }); + + test('says what\'s missing when the build hasn\'t run', async () => { + await expect(pack(join(sandbox, 'dist-x'), { src: join(sandbox, 'nothing'), toml })).rejects.toThrow('run "bun run build" first'); + }); +}); + diff --git a/scripts/sync-eggs.mjs b/scripts/sync-eggs.mjs new file mode 100644 index 00000000..d69c7a4e --- /dev/null +++ b/scripts/sync-eggs.mjs @@ -0,0 +1,851 @@ +#!/usr/bin/env bun +/** + * Refreshes the egg data for the interim /eggs page and the homepage games strip. + * + * When: before every build (prebuild, with --if-online: no network keeps the saved data, a bug + * still fails the build); by hand to refresh + * Writes: data/eggs.json, public/data/eggs/, public/img/eggs/, public/img/games/ + * Run: bun run sync:eggs (or: bun scripts/sync-eggs.mjs [--if-online]) + * Tests: bun test scripts/sync-eggs.test.mjs (the parts that need no network) + * + * Builds data/eggs.json for the /eggs page and the homepage games strip. + * + * Source: the egg index that pelican-eggs regenerates every day from its egg + * repositories (pelican-eggs/pelican-eggs.github.io, content/pelican.json). + * For each egg it reads the egg file for its Docker image and any icon built + * into the egg. Games are grouped by their folder in the egg repository (or by + * GAME_BY_PATH, for folders that hold eggs for several games) and + * looked up on Steam by exact name for their store artwork, the same way the + * community "Egg Images" plugin does. Steam results are kept in the output + * file, so later runs only look up games they haven't seen. + * + * Square icons (the `icon` field, used by the homepage games strip) come from + * the icon each game's publisher uploads to Steam: the app's client icon (a + * Windows .ico, up to 512px) or its 32px community icon, both on Steam's + * community CDN. The hashes in their addresses come from the public SteamCMD + * info API (api.steamcmd.net), so no API key is needed. Games on the homepage + * (FEATURED in lib/eggs.ts) get a small local copy in public/img/games; the + * rest keep the address of the 32px icon. Games that aren't on Steam use an + * original drawing from public/img/games, or an icon built into their own egg. + * + * Each egg file also gives its default Docker image (the first one it lists), + * the panel features it uses and its variable names (for search). Pelican Hub's + * public API (hub.pelican.dev/api/eggs) is matched to the eggs by uuid for each + * egg's Hub page, install count and last update. When the Hub can't be reached, + * the values from the previous run are kept. + * + * An egg published twice (as JSON and as YAML, same uuid and name) is listed once. + * Each egg gets an id ("minecraft/paper") and a small detail file, + * public/data/eggs/.json (images, startup and stop commands, variables, + * install script), which /eggs loads only when someone opens that egg. + */ +import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { parse as parseYaml } from 'yaml'; + +const root = join(dirname(fileURLToPath(import.meta.url)), '..'); +const OUT = join(root, 'data/eggs.json'); +/** One small JSON file per egg for its detail view on /eggs, loaded when it opens. */ +const DETAILS = join(root, 'public/data/eggs'); +const ICONS = join(root, 'public/img/eggs'); +const GAME_ICONS = join(root, 'public/img/games'); +const INDEX_URL = 'https://raw.githubusercontent.com/pelican-eggs/pelican-eggs.github.io/main/content/pelican.json'; +const HUB_API = 'https://hub.pelican.dev/api/eggs'; +const STEAM_ICON_CDN = 'https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/apps'; +/** Largest side of a saved icon: 64 CSS pixels on a 2x screen. Smaller sources are not enlarged. */ +const ICON_PX = 128; +const soft = process.argv.includes('--if-online'); + +/** How long one request may take, in ms. */ +const TIMEOUT_MS = { default: 15_000, hub: 20_000, steam: 10_000, download: 20_000 }; +/** How many requests run at once: egg files (raw GitHub, fast), Steam lookups and icon downloads (rate-limited). */ +const PARALLEL = { eggFiles: 16, steam: 4, icons: 4 }; +/** The Hub's API gives 100 eggs a page; never read more than this many pages (5,000 eggs), so a bad answer can't loop. */ +const HUB_MAX_PAGES = 50; +/** How much of an egg's description the /eggs list keeps. */ +const DESCRIPTION_CHARS = 220; + +// Original drawings (public/img/games) for games that have no Steam page. +// Nothing of the publisher's is copied in; the script never overwrites these. +const DRAWN_ICONS = { + minecraft: '/img/games/minecraft.svg', + 'minecraft-bedrock': '/img/games/minecraft.svg', +}; + +const CATEGORY = { + Minecraft: 'minecraft', + 'Games Steamcmd': 'games', + 'Games Standalone': 'games', + Chatbots: 'bots', + Voice: 'voice', + Database: 'databases', + Software: 'software', + Storage: 'storage', + Monitoring: 'monitoring', + Generic: 'generic', +}; +const CATEGORY_NAMES = { + games: 'Games', + minecraft: 'Minecraft', + bots: 'Chat bots', + voice: 'Voice', + databases: 'Databases', + software: 'Software', + storage: 'Storage', + monitoring: 'Monitoring', + generic: 'Generic', +}; + +// Folder names that don't read or search well, mapped to the game's real name. +// Steam artwork is only used when this name matches a store entry exactly, so a +// wrong guess here means "no artwork", never the wrong game's artwork. +const STEAM_NAME = { + gmod: "Garry's Mod", + ark_survival_evolved: 'ARK: Survival Evolved', + ark_survival_ascended: 'ARK: Survival Ascended', + lotr_moria: 'The Lord of the Rings: Return to Moria', + mount_blade_II_bannerlord: 'Mount & Blade II: Bannerlord', + sonsoftheforest: 'Sons Of The Forest', + scpsl: 'SCP: Secret Laboratory', + team_fortress_2: 'Team Fortress 2', + team_fortress_2_classic: 'Team Fortress 2 Classic', + left4dead_2: 'Left 4 Dead 2', + left4dead: 'Left 4 Dead', + '7_days_to_die': '7 Days to Die', + nmrih: 'No More Room in Hell', + rdr: 'Red Dead Redemption 2', + // Left as one group on purpose: one open-source project whose single release ships + // its Red Alert, Tiberian Dawn and Dune 2000 mods, and needs none of the originals. + openra: 'OpenRA', + beamng: 'BeamNG.drive', + eft: 'Escape from Tarkov (SPT)', + // Both eggs run any GoldSrc game you point them at (CS 1.6 by default), so no one game's artwork. + hlds_server: 'Custom GoldSrc engine game (HLDS)', + cs2d: 'CS2D', + ksp: 'Kerbal Space Program', + // The same game in both repos (games-standalone/ddracenetwork, games-steamcmd/ddnet); "DDNet" on Steam. + ddracenetwork: 'DDNet', + ddnet: 'DDNet', + // Zandronum is a multiplayer port of the classic Doom and Doom II, not the 2016 "DOOM" a bare "Doom" matched. + doom: 'Doom + Doom II', + empyrion: 'Empyrion - Galactic Survival', + fof: 'Fistful of Frags', + foundry_vtt: 'Foundry Virtual Tabletop', + minetest: 'Luanti', + mohaa: 'Medal of Honor: Allied Assault', + neosvr: 'Neos VR', + neverwinter_nights_ee: 'Neverwinter Nights: Enhanced Edition', + openarena: 'OpenArena', + openrct2: 'OpenRCT2', + pavlov_vr: 'Pavlov', + post_scriptum: 'Squad 44', + sourcecoop: 'Source Co-op', + stormworks: 'Stormworks: Build and Rescue', + subnautica_nitrox_mod: 'Subnautica', + the_ship: 'The Ship: Murder Party', + thebattleforwesnoth: 'The Battle for Wesnoth', + trackmania2020: 'Trackmania', + urbanterror: 'Urban Terror', + venice_unleashed: 'Battlefield 3 (Venice Unleashed)', + vintage_story: 'Vintage Story', + world_of_padman: 'World of Padman', + citadel: 'Citadel: Forged with Fire', + classicube: 'ClassiCube', + hogwarp: 'Hogwarts Legacy', + holdfast: 'Holdfast: Nations At War', + losangelescrimes: 'Los Angeles Crimes', + supertuxkart: 'SuperTuxKart', + conan_exiles: 'Conan Exiles', + wine: 'Windows games (Wine)', + ftl_tachyon: 'FTL: Tachyon', + tiny_block: 'Tiny Block', + leaguesandbox: 'LeagueSandbox', + nazi_zombies_portable: 'Nazi Zombies: Portable', + daggerfall_online: 'Daggerfall Online', + path_of_titans: 'Path of Titans', + hytale: 'Hytale', + clone_hero: 'Clone Hero', + custom_source_engine: 'Custom Source engine game', +}; + +// Folders that hold eggs for more than one game. Keys are "//" +// prefixes (the longest match wins); values are the game the egg is for. Variants +// of one game (Rust Autowipe, Valheim Plus, Terraria TShock…) don't need an entry. +// An egg in one of these folders that no entry covers is shown on its own and the +// sync warns, so a new mod can't land under the wrong game. +const GAME_BY_PATH = { + // games-standalone/gta: multiplayer mods for different Grand Theft Auto games. + 'games-standalone/gta/fivem/': 'Grand Theft Auto V', // fivem.net: "a modification for Grand Theft Auto V" + 'games-standalone/gta/altv/': 'Grand Theft Auto V', // altv.mp: "multiplayer modification for Grand Theft Auto: V" + 'games-standalone/gta/ragemp/': 'Grand Theft Auto V', // RAGE Multiplayer: "multiplayer modification for Grand Theft Auto V" (egg README) + 'games-standalone/gta/ragecoop/': 'Grand Theft Auto V', // RAGECOOP-V: co-op for GTA V story mode, built on ScriptHookVDotNet + 'games-standalone/gta/samp/': 'Grand Theft Auto: San Andreas', // SA-MP: mod for the PC version of GTA: San Andreas + 'games-standalone/gta/openmp/': 'Grand Theft Auto: San Andreas', // open.mp: GTA San Andreas server, compatible with SA-MP + 'games-standalone/gta/mtasa/': 'Grand Theft Auto: San Andreas', // mtasa.com: "Multi Theft Auto: San Andreas" + // gtaconnected.com: "Works on GTA III, Vice City, San Andreas, and GTA IV". It is + // for no single game, so it is listed under its own name (with the games it runs on) + // rather than under one of them. + 'games-standalone/gta/gtac/': 'GTA Connected (GTA III, Vice City, San Andreas, IV)', + // games-steamcmd/counter_strike: two different Valve games. + 'games-steamcmd/counter_strike/counter_strike_2/': 'Counter-Strike 2', + 'games-steamcmd/counter_strike/counter_strike_source/': 'Counter-Strike: Source', + // games-steamcmd/truck-simulator: SCS Software's two truck games, each with its own dedicated server. + 'games-steamcmd/truck-simulator/euro-truck-simulator2/': 'Euro Truck Simulator 2', + 'games-steamcmd/truck-simulator/american-truck-simulator/': 'American Truck Simulator', + // games-steamcmd/arma: two Bohemia games (Reforger is its own game, not an Arma 3 version). + 'games-steamcmd/arma/arma3/': 'Arma 3', + 'games-steamcmd/arma/arma_reforger/': 'Arma Reforger', + // games-standalone/cubeengine: two different free shooters built on the Cube engines. + 'games-standalone/cubeengine/assaultcube/': 'AssaultCube', + 'games-standalone/cubeengine/cube2/': 'Cube 2: Sauerbraten', + // minecraft/proxy: Waterdog PE is a proxy for Bedrock Edition ("for Minecraft: Bedrock Edition"). + 'minecraft/proxy/bedrock/': 'Minecraft: Bedrock Edition', +}; +const MIXED_FOLDERS = new Set( + Object.keys(GAME_BY_PATH) + .filter((key) => key.startsWith('games-')) + .map((key) => key.split('/').slice(0, 2).join('/') + '/'), +); +export const gameByPath = (path) => + Object.entries(GAME_BY_PATH) + .filter(([prefix]) => path.startsWith(prefix)) + .sort((a, b) => b[0].length - a[0].length)[0]?.[1] ?? null; + +// Display names whose Steam store entry is called something else. Only the +// artwork lookup uses these, and it still needs an exact match. +const STEAM_STORE_NAME = { + // Since 2025 Steam sells GTA V as "Enhanced" and "Legacy"; both are the game these mods run on. + 'Grand Theft Auto V': 'Grand Theft Auto V Enhanced', +}; + +export const slugify = (s) => + s + .toLowerCase() + .replace(/&/g, 'and') + .replace(/[^a-z0-9]+/g, '-') + .replace(/^-|-$/g, ''); +const humanize = (s) => + s + .replace(/[_-]+/g, ' ') + .replace(/\b([a-z])/g, (m) => m.toUpperCase()) + .trim(); +const norm = (s) => s.toLowerCase().replace(/[^a-z0-9]+/g, ''); + +/** + * A request that failed because of the network or the server (offline, timed out, rate + * limited, an error status), not because of a bug here. With --if-online, only these keep the + * saved data instead of failing the build. + */ +class NetworkError extends Error {} + +/** fetch(), with a timeout, turning network failures and error statuses into NetworkError. */ +async function fetchOk(url, ms) { + let res; + try { + res = await fetch(url, { signal: AbortSignal.timeout(ms) }); + } catch (error) { + throw new NetworkError(`${url}: ${error.message}`); + } + if (!res.ok) throw new NetworkError(`${res.status} ${url}`); + return res; +} + +async function getText(url, ms = TIMEOUT_MS.default) { + return (await fetchOk(url, ms)).text(); +} + +async function pool(items, size, fn) { + let i = 0; + await Promise.all( + Array.from({ length: size }, async () => { + while (i < items.length) { + const n = i++; + await fn(items[n], n); + } + }), + ); +} + +/** Panel features the /eggs filters know about (lib/egg-helpers.ts has their labels). */ +const FEATURES = new Set(['eula', 'java_version', 'gsl_token', 'steam_disk_space', 'pid_limit']); + +/** Runtimes whose version range is worth naming when an egg offers several images. */ +const IMAGE_FAMILY = { + java: 'Java', + nodejs: 'Node.js', + node: 'Node.js', + python: 'Python', + dotnet: '.NET', + mariadb: 'MariaDB', + mongodb: 'MongoDB', + postgres: 'PostgreSQL', + redis: 'Redis', +}; + +/** "Java 8–25" for an egg offering java_8 … java_25, "3 images" otherwise; null for one image. */ +export function imageNote(images) { + if (images.length < 2) return null; + const tags = images.map((image) => /:([a-z]+)_(\d+(?:\.\d+)*)$/.exec(image)); + const family = tags[0] && IMAGE_FAMILY[tags[0][1]]; + if (family && tags.every((t) => t && IMAGE_FAMILY[t[1]] === family)) { + const versions = tags.map((t) => t[2]).sort((a, b) => a.localeCompare(b, 'en', { numeric: true })); + return `${family} ${versions[0]}–${versions.at(-1)}`; + } + return `${images.length} images`; +} + +/** Text from an egg file: Windows line ends made plain, outer blank lines dropped. */ +const text = (value) => (typeof value === 'string' ? value.replace(/\r\n?/g, '\n').trim() : ''); + +/** + * Validation rules as a list. Older eggs write them as one "required|string|max:20" + * string; a regex rule may hold "|" itself, so its pieces are joined back up. + */ +export function ruleList(rules) { + if (Array.isArray(rules)) return rules.filter((r) => typeof r === 'string' && r).map((r) => r.trim()); + if (typeof rules !== 'string' || !rules.trim()) return []; + const out = []; + for (const piece of rules.split('|')) { + const last = out.at(-1); + // Still inside "regex:/…/": the closing delimiter hasn't come yet. + if (last?.startsWith('regex:') && !/^regex:(.).*\1[a-z]*$/s.test(last)) out[out.length - 1] = `${last}|${piece}`; + else out.push(piece.trim()); + } + return out.filter(Boolean); +} + +/** Pull what the page needs out of an egg file (JSON or YAML; Pterodactyl's or Pelican's format). */ +export function readEgg(source) { + let data; + try { + data = JSON.parse(source); + } catch { + data = parseYaml(source); + } + const egg = data?.egg ?? data; + if (!egg || typeof egg !== 'object') throw new Error('not an egg'); + const out = { uuid: egg.uuid ?? null, images: [], icon: null, features: [], vars: [], detail: null }; + + // The first image is the default: the panel picks it for new servers. + const images = Object.entries(egg.docker_images ?? {}).filter(([, image]) => typeof image === 'string' && image); + if (!images.length && typeof egg.image_docker === 'string') images.push([egg.image_docker, egg.image_docker]); + out.images = images.map(([, image]) => image); + out.features = Array.isArray(egg.features) ? egg.features.filter((f) => typeof f === 'string') : []; + const variables = (Array.isArray(egg.variables) ? egg.variables : []).filter((v) => v && typeof v === 'object'); + out.vars = [...new Set(variables.map((v) => v.env_variable).filter((v) => typeof v === 'string' && v))]; + // Pelican's YAML export calls the icon "icon"; its JSON export and older eggs call it "image". + const icon = [egg.icon, egg.image].find((v) => typeof v === 'string' && v.startsWith('data:image/')); + if (icon) out.icon = icon; + + // Everything the egg's detail view shows (public/data/eggs/.json). + const startup = + egg.startup_commands && typeof egg.startup_commands === 'object' + ? Object.entries(egg.startup_commands).map(([label, command]) => ({ label, command: text(command) })) + : [{ label: 'Default', command: text(egg.startup) }]; + const install = egg.scripts?.installation ?? {}; + out.detail = { + format: egg.meta?.version ?? null, + author: text(egg.author) || null, + description: text(egg.description), + images: images.map(([label, image]) => (label === image ? { image } : { label, image })), + startup: startup.filter((s) => s.command), + stop: text(egg.config?.stop) || null, + features: [...new Set(out.features)], + variables: variables + .slice() + .sort((a, b) => (Number(a.sort) || 0) - (Number(b.sort) || 0)) + .map((v) => ({ + name: text(v.name) || text(v.env_variable), + description: text(v.description), + env: text(v.env_variable), + default: v.default_value == null ? '' : String(v.default_value), + rules: ruleList(v.rules), + viewable: Boolean(v.user_viewable), + editable: Boolean(v.user_editable), + })), + install: { + container: text(install.container) || null, + entrypoint: text(install.entrypoint) || null, + script: text(install.script), + }, + }; + + out.features = [...new Set(out.features.filter((f) => FEATURES.has(f)))].sort(); + return out; +} + +/** Every egg on Pelican Hub, by uuid. Throws when any page fails, so a half list is never used. */ +async function hubEggs() { + const byUuid = new Map(); + let last = 1; + for (let page = 1; page <= last; page++) { + const data = JSON.parse(await getText(`${HUB_API}?per_page=100&page=${page}&sort=name`, TIMEOUT_MS.hub)); + if (!Array.isArray(data.data)) throw new Error(`unexpected Hub answer on page ${page}`); + last = Math.min(Number(data.last_page) || 1, HUB_MAX_PAGES); + for (const egg of data.data) { + if (!egg.uuid) continue; + if (!byUuid.has(egg.uuid)) byUuid.set(egg.uuid, []); + byUuid.get(egg.uuid).push(egg); + } + } + return byUuid; +} + +/** "#" is legal in a repo path but ends a URL ("…/generic/…/c#/egg.yaml"), so encode it. */ +const encodeEggUrl = (url) => url.replace(/#/g, '%23'); + +/** Steam store search, keeping only an exact name match. */ +async function steamLookup(name) { + // Steam's search finds nothing for a term with "+" in it ("DOOM + DOOM II"); the match below ignores it anyway. + const term = name.replace(/\s*\+\s*/g, ' '); + const url = `https://store.steampowered.com/api/storesearch/?term=${encodeURIComponent(term)}&cc=us&l=en`; + const data = JSON.parse(await getText(url, TIMEOUT_MS.steam)); + const hit = (data.items ?? []).find((item) => norm(item.name) === norm(name)); + if (!hit) return { steamAppId: null, art: null }; + return { steamAppId: hit.id, art: (await steamHeader(hit.id)) ?? hit.tiny_image ?? null }; +} + +/** The 460×215 store header (its address has a hash, so it must be asked for). */ +async function steamHeader(appId) { + try { + const url = `https://store.steampowered.com/api/appdetails?appids=${appId}&filters=basic`; + const data = JSON.parse(await getText(url, TIMEOUT_MS.steam)); + return data[appId]?.data?.header_image ?? null; + } catch { + return null; + } +} + +async function getBuffer(url, ms = TIMEOUT_MS.download) { + return Buffer.from(await (await fetchOk(url, ms)).arrayBuffer()); +} + +/** The homepage's games, read from lib/eggs.ts so the list lives in one place. */ +function featuredSlugs() { + const source = readFileSync(join(root, 'lib/eggs.ts'), 'utf8'); + const list = /export const FEATURED\s*=\s*\[([^\]]*)\]/.exec(source)?.[1]; + if (!list) { + console.warn('eggs: FEATURED not found in lib/eggs.ts; no local icons this run'); + return new Set(); + } + return new Set([...list.matchAll(/['"]([^'"]+)['"]/g)].map((m) => m[1])); +} + +/** An icon built into the game's own egg (not a mod loader's or proxy's logo). */ +function ownEggIcon(game) { + return game.eggs.find((e) => e.icon && (game.eggs.length === 1 || norm(e.name) === norm(game.name)))?.icon ?? null; +} + +/** Hashes of an app's Steam icons, from the public SteamCMD info API. */ +async function steamIconHashes(appId) { + const data = JSON.parse(await getText(`https://api.steamcmd.net/v1/info/${appId}`, TIMEOUT_MS.default)); + const common = data?.data?.[appId]?.common ?? {}; + return { icon: common.icon ?? null, clienticon: common.clienticon ?? null }; +} + +/** + * The largest picture in a Windows .ico file: PNG bytes, or raw RGBA decoded + * from the older bitmap format (sharp reads neither .ico nor bitmaps). + */ +function largestIcoFrame(buf) { + if (buf.length < 6 || buf.readUInt16LE(0) !== 0 || buf.readUInt16LE(2) !== 1) return null; + const isPng = (d) => d.length > 24 && d.readUInt32BE(0) === 0x89504e47; + let best = null; + for (let i = 0, count = buf.readUInt16LE(4); i < count; i++) { + const at = 6 + i * 16; + if (at + 16 > buf.length) break; + const size = buf.readUInt32LE(at + 8); + const offset = buf.readUInt32LE(at + 12); + const data = buf.subarray(offset, offset + size); + if (data.length < 40) continue; + const width = isPng(data) ? data.readUInt32BE(16) : data.readInt32LE(4); + const bpp = isPng(data) ? 32 : data.readUInt16LE(14); + if (!best || width > best.width || (width === best.width && bpp > best.bpp)) best = { width, bpp, data }; + } + if (!best) return null; + return isPng(best.data) ? { png: best.data } : { raw: decodeIcoBitmap(best.data) }; +} + +/** Decode an .ico bitmap (1/4/8/24/32 bits per pixel) to top-down RGBA. */ +function decodeIcoBitmap(d) { + const headerSize = d.readUInt32LE(0); + const width = d.readInt32LE(4); + const height = Math.abs(d.readInt32LE(8)) / 2; // the height counts the mask too + const bpp = d.readUInt16LE(14); + const compression = d.readUInt32LE(16); + if (width <= 0 || height <= 0 || ![1, 4, 8, 24, 32].includes(bpp) || ![0, 3].includes(compression)) return null; + let p = headerSize + (compression === 3 && headerSize === 40 ? 12 : 0); + const palette = []; + if (bpp <= 8) { + const colors = d.readUInt32LE(32) || 1 << bpp; + for (let i = 0; i < colors; i++, p += 4) palette.push([d[p + 2], d[p + 1], d[p]]); + } + const stride = Math.ceil((width * bpp) / 32) * 4; + const maskStride = Math.ceil(width / 32) * 4; + const maskStart = p + stride * height; + if (maskStart > d.length) return null; + const out = Buffer.alloc(width * height * 4); + let hasAlpha = false; + for (let y = 0; y < height; y++) { + const row = p + (height - 1 - y) * stride; // rows are stored bottom-up + for (let x = 0; x < width; x++) { + const o = (y * width + x) * 4; + let rgb; + let a = 255; + if (bpp === 32) { + rgb = [d[row + x * 4 + 2], d[row + x * 4 + 1], d[row + x * 4]]; + a = d[row + x * 4 + 3]; + if (a) hasAlpha = true; + } else if (bpp === 24) { + rgb = [d[row + x * 3 + 2], d[row + x * 3 + 1], d[row + x * 3]]; + } else { + const bit = x * bpp; + rgb = palette[(d[row + (bit >> 3)] >> (8 - bpp - (bit & 7))) & ((1 << bpp) - 1)] ?? [0, 0, 0]; + } + out[o] = rgb[0]; + out[o + 1] = rgb[1]; + out[o + 2] = rgb[2]; + out[o + 3] = a; + } + } + // Without a real alpha channel, transparency comes from the 1-bit mask after the pixels. + if (!hasAlpha && maskStart + maskStride * height <= d.length) { + for (let y = 0; y < height; y++) { + const row = maskStart + (height - 1 - y) * maskStride; + for (let x = 0; x < width; x++) { + if ((d[row + (x >> 3)] >> (7 - (x & 7))) & 1) out[(y * width + x) * 4 + 3] = 0; + else if (bpp === 32) out[(y * width + x) * 4 + 3] = 255; + } + } + } + return { data: out, width, height }; +} + +/** Save a game's Steam icon as a small square WebP; false when it has none. */ +async function saveSteamIcon(sharp, appId, hashes, file) { + let input = null; + if (hashes.clienticon) { + try { + const frame = largestIcoFrame(await getBuffer(`${STEAM_ICON_CDN}/${appId}/${hashes.clienticon}.ico`)); + if (frame?.png) input = sharp(frame.png); + else if (frame?.raw) { + const { data, width, height } = frame.raw; + input = sharp(data, { raw: { width, height, channels: 4 } }); + } + } catch { + /* fall back to the 32px community icon */ + } + } + if (!input && hashes.icon) input = sharp(await getBuffer(`${STEAM_ICON_CDN}/${appId}/${hashes.icon}.jpg`)); + if (!input) return false; + const { width = ICON_PX, height = ICON_PX } = await input.metadata(); + const side = Math.min(ICON_PX, Math.max(width, height)); // never enlarge; the browser scales small icons + await input + .resize(side, side, { fit: 'contain', background: { r: 0, g: 0, b: 0, alpha: 0 } }) + .webp({ quality: 90, alphaQuality: 90, effort: 6 }) + .toFile(file); + return true; +} + +async function loadSharp() { + try { + return (await import('sharp')).default; + } catch { + console.warn('eggs: sharp is not installed; featured icons stay remote and egg icons full size this run'); + return null; + } +} + +async function main() { + const previous = existsSync(OUT) ? JSON.parse(readFileSync(OUT, 'utf8')) : null; + const known = new Map((previous?.games ?? []).map((g) => [g.slug, g])); + + const index = JSON.parse(await getText(INDEX_URL)); + const groups = new Map(); + + for (const nest of index.nests) { + const category = CATEGORY[nest.nest_type] ?? 'generic'; + for (const entry of nest.Eggs) { + const url = entry.download_url; + // .../pelican-eggs//refs/heads/main//egg-x.json + const repo = /\/pelican-eggs\/([^/]+)\/refs\/heads\//.exec(url)?.[1] ?? ''; + const parts = url.split('/refs/heads/main/')[1]?.split('/') ?? []; + const repoPath = `${repo}/${parts.join('/')}`; + const folder = category === 'minecraft' ? 'minecraft' : category === 'games' ? parts[0] : null; + const override = category === 'minecraft' || category === 'games' ? gameByPath(repoPath) : null; + const unlisted = !override && category === 'games' && MIXED_FOLDERS.has(`${repo}/${folder}/`); + if (unlisted) console.warn(`eggs: ${repoPath} is in a folder with several games but not in GAME_BY_PATH; listed on its own`); + const gameName = + override ?? + (category === 'minecraft' + ? parts[0] === 'bedrock' + ? 'Minecraft: Bedrock Edition' + : 'Minecraft' + : folder && !unlisted + ? STEAM_NAME[folder] ?? humanize(folder) + : entry.egg.name); + const slug = gameName === 'Minecraft: Bedrock Edition' ? 'minecraft-bedrock' : slugify(gameName); + if (!groups.has(slug)) groups.set(slug, { slug, name: gameName, category, folder, eggs: [] }); + groups.get(slug).eggs.push({ + id: null, + name: entry.egg.name, + description: (entry.egg.description ?? '').replace(/\s+/g, ' ').trim().slice(0, DESCRIPTION_CHARS), + url: encodeEggUrl(url), + image: null, + imageNote: null, + icon: null, + features: [], + vars: [], + hubUrl: null, + installs: null, + updatedAt: null, + }); + } + } + + // Egg files: Docker images, features, variables and built-in icon. + const allEggs = [...groups.values()].flatMap((g) => g.eggs.map((e) => ({ g, e }))); + const uuids = new Map(); + mkdirSync(ICONS, { recursive: true }); + const sharp = await loadSharp(); + const savedIcons = new Set(); + let read = 0; + const details = new Map(); + await pool(allEggs, PARALLEL.eggFiles, async ({ g, e }) => { + try { + const egg = readEgg(await getText(e.url)); + e.image = egg.images[0] ?? null; + e.imageNote = imageNote(egg.images); + e.features = egg.features; + e.vars = egg.vars; + details.set(e, egg.detail); + if (egg.uuid) uuids.set(e, egg.uuid); + if (egg.icon) { + const [, ext, b64] = /^data:image\/([a-z+]+);base64,(.+)$/.exec(egg.icon) ?? []; + if (b64) { + const name = slugify(g.slug + '-' + e.name); + const bytes = Buffer.from(b64, 'base64'); + // Egg icons can be 512px PNGs of 200 KB; /eggs shows them as small thumbnails. + let file = null; + if (sharp && ext !== 'svg+xml') { + file = `${name}.webp`; + await sharp(bytes) + .resize(ICON_PX, ICON_PX, { fit: 'inside', withoutEnlargement: true }) + .webp({ quality: 90, alphaQuality: 90, effort: 6 }) + .toFile(join(ICONS, file)) + .catch(() => (file = null)); + } + if (!file) { + file = `${name}.${ext === 'svg+xml' ? 'svg' : ext}`; + writeFileSync(join(ICONS, file), bytes); + } + e.icon = `/img/eggs/${file}`; + savedIcons.add(file); + } + } + read++; + } catch (error) { + console.warn(`eggs: could not read ${e.url} (${error.message}); listed without its details`); + } + }); + + // public/img/eggs only holds icons this script saves: drop ones no egg uses any more. + // (An egg whose file couldn't be read this run keeps its icon file.) + const unreadIcons = new Set(allEggs.filter(({ e }) => !details.has(e)).map(({ g, e }) => slugify(g.slug + '-' + e.name))); + for (const file of readdirSync(ICONS)) { + if (!savedIcons.has(file) && !unreadIcons.has(file.replace(/\.[a-z]+$/, ''))) rmSync(join(ICONS, file)); + } + + // Some eggs are published twice, as JSON and as YAML (same uuid, same name): list them + // once, keeping the JSON file, which older panels can import too. + let duplicates = 0; + for (const g of groups.values()) { + const seen = new Set(); + const ordered = [...g.eggs].sort((a, b) => Number(b.url.endsWith('.json')) - Number(a.url.endsWith('.json'))); + const keep = new Set(); + for (const e of ordered) { + const key = uuids.has(e) ? `${uuids.get(e)} ${norm(e.name)}` : e.url; + if (seen.has(key)) { + duplicates++; + continue; + } + seen.add(key); + keep.add(e); + } + g.eggs = g.eggs.filter((e) => keep.has(e)); + } + for (let i = allEggs.length - 1; i >= 0; i--) { + if (!allEggs[i].g.eggs.includes(allEggs[i].e)) allEggs.splice(i, 1); + } + + // Pelican Hub: each egg's page, install count and last update, matched by uuid. + // Offline or rate-limited: keep what the previous run found. + const knownEggs = new Map((previous?.games ?? []).flatMap((g) => g.eggs.map((e) => [encodeEggUrl(e.url), e]))); + let hubFetchedAt = previous?.hubFetchedAt ?? null; + let hubMatched = 0; + try { + const hub = await hubEggs(); + hubFetchedAt = new Date().toISOString(); + // Two eggs in the index can carry the same uuid (one copied from another); then + // only the one whose name matches the Hub's gets the link, never a guess. + const sharing = new Map(); + for (const uuid of uuids.values()) sharing.set(uuid, (sharing.get(uuid) ?? 0) + 1); + for (const { e } of allEggs) { + const uuid = uuids.get(e); + const candidates = (uuid && hub.get(uuid)) || []; + const byName = candidates.find((h) => norm(h.name) === norm(e.name)); + const hit = byName ?? (sharing.get(uuid) === 1 && candidates.length === 1 ? candidates[0] : null); + if (!hit) continue; + e.hubUrl = hit.url; + e.installs = Number(hit.install_count) || 0; + e.updatedAt = hit.updated_at ?? null; + hubMatched++; + } + } catch (error) { + console.warn(`eggs: Pelican Hub not reached (${error.message}); keeping the previous Hub data`); + for (const { e } of allEggs) { + const old = knownEggs.get(e.url); + if (!old) continue; + e.hubUrl = old.hubUrl ?? null; + e.installs = old.installs ?? null; + e.updatedAt = old.updatedAt ?? null; + } + } + + // Steam artwork for games, cached from the previous run. + const games = [...groups.values()]; + let looked = 0; + await pool( + games.filter((g) => g.category === 'games'), + PARALLEL.steam, + async (g) => { + const cached = known.get(g.slug); + // Reuse earlier matches; try again for games that had none. + if (cached?.steamAppId) { + g.steamAppId = cached.steamAppId; + g.art = cached.art; + // Older runs kept the small capsule image; upgrade it to the header once. + if (!g.art || g.art.includes('capsule_231x87')) g.art = (await steamHeader(g.steamAppId)) ?? g.art; + return; + } + try { + Object.assign(g, await steamLookup(STEAM_STORE_NAME[g.name] ?? g.name)); + looked++; + } catch { + g.steamAppId = null; + g.art = null; + } + }, + ); + + // Square icons. Featured games get a local WebP (once; the file is the cache); + // other Steam games keep the address of their 32px community icon. + const featured = featuredSlugs(); + mkdirSync(GAME_ICONS, { recursive: true }); + let iconLookups = 0; + let iconFiles = 0; + await pool(games, PARALLEL.icons, async (g) => { + g.steamAppId ??= null; + g.icon = DRAWN_ICONS[g.slug] ?? null; + if (g.icon) return; + if (!g.steamAppId) { + g.icon = ownEggIcon(g); + return; + } + const file = join(GAME_ICONS, `${g.slug}.webp`); + if (existsSync(file)) { + g.icon = `/img/games/${g.slug}.webp`; + return; + } + const cached = known.get(g.slug); + const cachedRemote = cached?.steamAppId === g.steamAppId && cached.icon?.startsWith(STEAM_ICON_CDN) ? cached.icon : null; + if (cachedRemote && !(featured.has(g.slug) && sharp)) { + g.icon = cachedRemote; + return; + } + try { + const hashes = await steamIconHashes(g.steamAppId); + iconLookups++; + if (featured.has(g.slug) && sharp && (await saveSteamIcon(sharp, g.steamAppId, hashes, file).catch(() => false))) { + g.icon = `/img/games/${g.slug}.webp`; + iconFiles++; + return; + } + g.icon = hashes.icon ? `${STEAM_ICON_CDN}/${g.steamAppId}/${hashes.icon}.jpg` : null; + } catch { + g.icon = cachedRemote; + } + }); + + for (const g of games) { + // No store artwork: fall back to an original drawing, or an icon built into the game's own egg. + g.art ??= DRAWN_ICONS[g.slug] ?? ownEggIcon(g); + delete g.folder; + g.eggs.sort((a, b) => a.name.localeCompare(b.name) || a.url.localeCompare(b.url)); + // "/": the address of the egg's detail view (/eggs/?egg=minecraft/paper). + const taken = new Set(); + for (const e of g.eggs) { + const base = `${g.slug}/${slugify(e.name) || 'egg'}`; + let id = base; + for (let n = 2; taken.has(id); n++) id = `${base}-${n}`; + taken.add(id); + e.id = id; + } + } + games.sort((a, b) => b.eggs.length - a.eggs.length || a.name.localeCompare(b.name)); + + // Detail files. An egg whose file couldn't be read this run keeps its previous one. + const written = new Set(); + let detailFiles = 0; + for (const { g, e } of allEggs) { + const file = join(DETAILS, `${e.id}.json`); + written.add(file); + const detail = details.get(e); + if (!detail) continue; + const { format, author, description, ...rest } = detail; + const out = { id: e.id, game: { slug: g.slug, name: g.name }, name: e.name, author, description, url: e.url, format, ...rest }; + mkdirSync(dirname(file), { recursive: true }); + writeFileSync(file, JSON.stringify(out) + '\n'); + detailFiles++; + } + if (existsSync(DETAILS)) { + for (const entry of readdirSync(DETAILS, { recursive: true, withFileTypes: true })) { + const file = join(entry.parentPath, entry.name); + if (entry.isFile() && file.endsWith('.json') && !written.has(file)) rmSync(file); + } + for (const entry of readdirSync(DETAILS, { withFileTypes: true })) { + const dir = join(DETAILS, entry.name); + if (entry.isDirectory() && !readdirSync(dir).length) rmSync(dir, { recursive: true }); + } + } + + const categories = Object.entries(CATEGORY_NAMES) + .map(([id, name]) => ({ id, name, count: games.filter((g) => g.category === id).reduce((n, g) => n + g.eggs.length, 0) })) + .filter((c) => c.count > 0); + + const out = { generatedAt: new Date().toISOString(), source: INDEX_URL, hubFetchedAt, categories, games }; + mkdirSync(dirname(OUT), { recursive: true }); + writeFileSync(OUT, JSON.stringify(out, null, 1) + '\n'); + console.log( + `eggs: ${allEggs.length} eggs (${read} files read, ${duplicates} duplicates dropped, ` + + `${detailFiles} detail files written) in ${games.length} groups; ` + + `${allEggs.filter(({ e }) => e.hubUrl).length} on Pelican Hub (${hubMatched} matched this run), ` + + `${allEggs.filter(({ e }) => e.installs).length} with installs; ` + + `${games.filter((g) => g.art).length} with artwork (${looked} Steam lookups), ` + + `${games.filter((g) => g.icon).length} with square icons (${iconLookups} icon lookups, ${iconFiles} saved) → data/eggs.json`, + ); +} + +if (import.meta.main) { + main().catch((error) => { + // --if-online (the build): no network, or GitHub, the Hub or Steam failing, keeps the saved + // data and lets the build go on. Anything else is a bug in this script and fails the build. + if (soft && error instanceof NetworkError && existsSync(OUT)) { + console.warn(`eggs: could not refresh (${error.message}); using the saved data/eggs.json`); + process.exit(0); + } + console.error(error); + process.exit(1); + }); +} diff --git a/scripts/sync-eggs.test.mjs b/scripts/sync-eggs.test.mjs new file mode 100644 index 00000000..1d532a19 --- /dev/null +++ b/scripts/sync-eggs.test.mjs @@ -0,0 +1,83 @@ +// bun test scripts/sync-eggs.test.mjs (all tests: bun test) +// The parts of sync-eggs that need no network: reading an egg file, its rules and images, +// and which game a folder belongs to. +import { describe, expect, test } from 'bun:test'; +import { gameByPath, imageNote, readEgg, ruleList, slugify } from './sync-eggs.mjs'; + +describe('readEgg', () => { + const egg = { + meta: { version: 'PLCN_v3' }, + uuid: 'a1b2', + author: 'egg@example.com', + description: 'A server.\r\n', + features: ['eula', 'java_version', 'not_a_known_feature'], + docker_images: { 'Java 21': 'ghcr.io/pelican-eggs/yolks:java_21', 'Java 17': 'ghcr.io/pelican-eggs/yolks:java_17' }, + startup: 'java -jar {{SERVER_JARFILE}}', + config: { stop: 'stop' }, + scripts: { installation: { container: 'alpine', entrypoint: 'ash', script: '#!/bin/ash\r\necho hi\r\n' } }, + variables: [ + { name: 'Jar', env_variable: 'SERVER_JARFILE', default_value: 'server.jar', user_viewable: true, user_editable: true, rules: 'required|string', sort: 2 }, + { name: 'Build', env_variable: 'BUILD', default_value: 'latest', user_viewable: true, user_editable: false, rules: 'required', sort: 1 }, + ], + }; + + test('reads a JSON egg: images, features, variables and the detail view', () => { + const read = readEgg(JSON.stringify(egg)); + + expect(read.uuid).toBe('a1b2'); + expect(read.images).toEqual(['ghcr.io/pelican-eggs/yolks:java_21', 'ghcr.io/pelican-eggs/yolks:java_17']); + // Only the features the /eggs filters know, sorted. + expect(read.features).toEqual(['eula', 'java_version']); + expect(read.vars).toEqual(['SERVER_JARFILE', 'BUILD']); + expect(read.detail.description).toBe('A server.'); + expect(read.detail.install.script).toBe('#!/bin/ash\necho hi'); + // Variables in the egg's sort order. + expect(read.detail.variables.map((v) => v.env)).toEqual(['BUILD', 'SERVER_JARFILE']); + expect(read.detail.startup).toEqual([{ label: 'Default', command: 'java -jar {{SERVER_JARFILE}}' }]); + }); + + test('reads the same egg written as YAML', () => { + const yaml = [ + 'uuid: a1b2', + 'docker_images:', + ' Java 21: ghcr.io/pelican-eggs/yolks:java_21', + 'startup: java -jar server.jar', + 'variables: []', + ].join('\n'); + + expect(readEgg(yaml)).toMatchObject({ uuid: 'a1b2', images: ['ghcr.io/pelican-eggs/yolks:java_21'] }); + }); + + test('throws on something that isn\'t an egg', () => { + expect(() => readEgg('42')).toThrow('not an egg'); + }); +}); + +describe('ruleList', () => { + test('splits a rule string, keeping a regex that contains "|" whole', () => { + expect(ruleList('required|string|max:20')).toEqual(['required', 'string', 'max:20']); + expect(ruleList('required|regex:/^(a|b)$/')).toEqual(['required', 'regex:/^(a|b)$/']); + }); + + test('takes a list as it is, and nothing for empty values', () => { + expect(ruleList(['required', '', ' string '])).toEqual(['required', 'string']); + expect(ruleList('')).toEqual([]); + expect(ruleList(undefined)).toEqual([]); + }); +}); + +test('imageNote: a version range for one runtime, a count otherwise, nothing for one image', () => { + expect(imageNote(['ghcr.io/y:java_8', 'ghcr.io/y:java_25', 'ghcr.io/y:java_17'])).toBe('Java 8–25'); + expect(imageNote(['ghcr.io/y:java_17', 'ghcr.io/y:nodejs_20'])).toBe('2 images'); + expect(imageNote(['ghcr.io/y:java_17'])).toBe(null); +}); + +test('gameByPath: the most specific folder rule wins, and unknown folders have none', () => { + expect(gameByPath('games-standalone/gta/fivem/egg-fivem.json')).toBe('Grand Theft Auto V'); + expect(gameByPath('games-standalone/gta/samp/egg-samp.json')).toBe('Grand Theft Auto: San Andreas'); + expect(gameByPath('games-steamcmd/valheim/egg.json')).toBe(null); +}); + +test('slugify', () => { + expect(slugify('Counter-Strike & Friends: 2')).toBe('counter-strike-and-friends-2'); +}); diff --git a/scripts/sync-release.mjs b/scripts/sync-release.mjs new file mode 100644 index 00000000..e7ab2e98 --- /dev/null +++ b/scripts/sync-release.mjs @@ -0,0 +1,50 @@ +#!/usr/bin/env bun +/** + * Reads the latest Pelican Panel release from GitHub, for the homepage and llms.txt. + * + * When: before every build (prebuild); by hand to see what the build will use + * Writes: data/release.json ({} when GitHub can't be reached: the typed values in lib/home-data.ts are used) + * Run: bun run sync:release + * Tests: bun test scripts/sync-release.test.mjs + * + * Never fails the build: no network, a rate limit or a 5-second timeout just means the fallback. + * GITHUB_TOKEN, when set (CI sets it), raises GitHub's rate limit. + */ +import { join } from 'node:path'; + +const OUT = join(import.meta.dir, '..', 'data', 'release.json'); + +/** The newest published release (drafts skipped, prereleases kept), or null. */ +export function pickRelease(releases) { + const latest = releases + .filter((release) => !release.draft && release.published_at) + .sort((a, b) => Date.parse(b.published_at) - Date.parse(a.published_at))[0]; + if (!latest) return null; + + return { + version: latest.tag_name.replace(/^v/, ''), // "v1.0.0-rc.4" → "1.0.0-rc.4" + released: new Date(latest.published_at).toLocaleDateString('en-GB', { + day: 'numeric', + month: 'long', + year: 'numeric', + timeZone: 'UTC', + }), + url: latest.html_url, + }; +} + +if (import.meta.main) { + let release = null; + try { + const response = await fetch('https://api.github.com/repos/pelican/panel/releases?per_page=10', { + headers: process.env.GITHUB_TOKEN ? { Authorization: `Bearer ${process.env.GITHUB_TOKEN}` } : {}, + signal: AbortSignal.timeout(5000), + }); + if (!response.ok) throw new Error(`GitHub answered ${response.status}`); + release = pickRelease(await response.json()); + } catch (error) { + console.warn(`release: using the typed version in lib/home-data.ts (${error.message})`); + } + await Bun.write(OUT, `${JSON.stringify(release ?? {}, null, 2)}\n`); + if (release) console.log(`release: pelican/panel ${release.version}, ${release.released}`); +} diff --git a/scripts/sync-release.test.mjs b/scripts/sync-release.test.mjs new file mode 100644 index 00000000..24269cdf --- /dev/null +++ b/scripts/sync-release.test.mjs @@ -0,0 +1,40 @@ +// bun test scripts/sync-release.test.mjs (all tests: bun test) +// Which release sync-release.mjs picks from GitHub's list. No network: the list is written here. +import { expect, test } from 'bun:test'; +import { pickRelease } from './sync-release.mjs'; + +const release = (tag, publishedAt, draft = false) => ({ + tag_name: tag, + published_at: publishedAt, + html_url: `https://github.com/pelican/panel/releases/tag/${tag}`, + draft, +}); + +test('takes the newest release, whatever order GitHub lists them in', () => { + expect( + pickRelease([ + release('v1.0.0-rc.3', '2026-11-14T17:04:30Z'), + release('v1.0.0-rc.4', '2026-11-19T18:47:34Z'), + release('v1.0.0-rc.2', '2026-10-22T16:29:49Z'), + ]), + ).toEqual({ + version: '1.0.0-rc.4', + released: '19 November 2026', + url: 'https://github.com/pelican/panel/releases/tag/v1.0.0-rc.4', + }); +}); + +test('skips drafts, which have no publish date yet', () => { + expect(pickRelease([release('v1.0.1', null, true), release('v1.0.0-rc.4', '2026-11-19T18:47:34Z')]).version).toBe( + '1.0.0-rc.4', + ); +}); + +test('reads the date in UTC', () => { + expect(pickRelease([release('v1.0.0', '2026-11-19T23:30:00Z')]).released).toBe('19 November 2026'); +}); + +test('gives null when there is no published release', () => { + expect(pickRelease([])).toBeNull(); + expect(pickRelease([release('v1.0.1', null, true)])).toBeNull(); +}); diff --git a/sidebars.ts b/sidebars.ts deleted file mode 100644 index 4974b621..00000000 --- a/sidebars.ts +++ /dev/null @@ -1,90 +0,0 @@ -import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; - -/** - * Creating a sidebar enables you to: - - create an ordered group of docs - - render a sidebar for each doc of that group - - provide next/previous navigation - - The sidebars can be generated from the filesystem, or explicitly defined here. - - Create as many sidebars as you want. - */ -const sidebars: SidebarsConfig = { - Sidebar: [ - 'welcome', - { - type: 'category', - label: 'Panel', - collapsed: false, - items: [ - 'panel/getting-started', - 'panel/webserver-config', - 'panel/panel-setup', - 'panel/optional-config', - 'panel/update', - { - type: 'category', - label: 'Advanced', - items: [ - 'panel/advanced/redis', - 'panel/advanced/mysql', - 'panel/advanced/artisan', - 'panel/advanced/docker', - 'panel/advanced/podman', - 'panel/advanced/cloudflare-tunnel', - 'panel/advanced/api-docs', - 'panel/advanced/plugins', - ] - } - ], - }, - { - type: 'category', - label: 'Wings', - items: [ - 'wings/install', - 'wings/optional-config', - 'wings/update' - ], - }, - { - type: 'category', - label: 'Eggs', - items: [ - 'eggs/creating-a-custom-egg', - 'eggs/creating-a-custom-yolk', - ], - }, - { - type: 'category', - label: 'Guides', - items: [ - 'guides/docker', - 'guides/mounts', - 'guides/ssl', - 'guides/php-upgrade', - 'guides/database-hosts', - 'guides/change-panel-domain', - 'guides/uninstalling', - 'guides/migrating-from-pterodactyl', - 'guides/translating', - 'guides/troubleshooting', - - { - type: 'category', - label: 'Disk Quotas', - items: [ - 'guides/disk-quotas/about', - 'guides/disk-quotas/ext4-xfs', - ] - } - ], - }, - 'versioning', - 'comparison', - 'contributors', - ], -}; - -export default sidebars; diff --git a/source.config.ts b/source.config.ts new file mode 100644 index 00000000..b60f490e --- /dev/null +++ b/source.config.ts @@ -0,0 +1,144 @@ +import { defineConfig, defineDocs, frontmatterSchema, metaSchema } from 'fumadocs-mdx/config'; +import { rehypeCodeDefaultOptions } from 'fumadocs-core/mdx-plugins/rehype-code'; +import { remarkAdmonition } from 'fumadocs-core/mdx-plugins/remark-admonition'; +import { remarkMdxMermaid } from 'fumadocs-core/mdx-plugins/remark-mdx-mermaid'; +import { transformerMetaHighlight } from '@shikijs/transformers'; +import lastModified from 'fumadocs-mdx/plugins/last-modified'; +import type { Paragraph, PhrasingContent, Root } from 'mdast'; +import { visit } from 'unist-util-visit'; +import { transformerSetup, transformerWrap } from './lib/shiki-setup'; + +// The documentation under /docs. +export const docs = defineDocs({ + dir: 'content/docs', + docs: { + schema: frontmatterSchema, + postprocess: { + // Markdown of each page for /llms.txt, /llms-full.txt and /docs/….md + // (lib/llms.ts). The JSX components come out as placeholders that + // lib/llms.ts turns into plain Markdown. + includeProcessedMarkdown: { + headingIds: false, + mdxAsPlaceholder: ['Admonition', 'Callout', 'Tabs', 'TabItem', 'Link', 'SetupPanel', 'Mermaid'], + }, + }, + }, + meta: { schema: metaSchema }, +}); + +// Stand-alone pages outside the docs, like /faq. (/support is app/(landing)/support/page.tsx.) +export const pages = defineDocs({ + dir: 'content/pages', + docs: { schema: frontmatterSchema }, + meta: { schema: metaSchema }, +}); + +const codeDefaults = rehypeCodeDefaultOptions; + +// Language names the pages used on Docusaurus (Prism) that Shiki calls +// something else, or doesn't ship. Writers can keep using either name. +const LANGUAGE_ALIASES: Record = { + NGINX: 'nginx', + apacheconf: 'apache', + unit: 'ini', + caddy: 'plaintext', + caddyfile: 'plaintext', +}; + +// Docusaurus took `:::note` blocks written tight, with no blank lines: +// +// :::note +// Text. +// ::: +// +// Markdown reads that as one paragraph, but remarkAdmonition only matches when +// `:::note` and `:::` are paragraphs of their own, so the page showed the colons +// as text. This splits them out first, so pages copied from main work as written. +const ADMONITION_OPEN = /^:::\w+(\[[^\]\n]*\])?[ \t]*\n/; +const ADMONITION_CLOSE = /\n[ \t]*:::[ \t]*$/; + +function remarkSplitAdmonitions() { + const paragraph = (value: string): Paragraph => ({ type: 'paragraph', children: [{ type: 'text', value }] }); + return (tree: Root) => { + visit(tree, 'paragraph', (node, index, parent) => { + if (!parent || index === undefined) return; + const children: PhrasingContent[] = [...node.children]; + let opener: string | undefined; + let closer = false; + + const head = children[0]; + const open = head?.type === 'text' ? ADMONITION_OPEN.exec(head.value) : null; + if (head?.type === 'text' && open) { + opener = open[0].trim(); + children[0] = { type: 'text', value: head.value.slice(open[0].length) }; + } + const tail = children[children.length - 1]; + if (tail?.type === 'text' && ADMONITION_CLOSE.test(tail.value)) { + closer = true; + children[children.length - 1] = { type: 'text', value: tail.value.replace(ADMONITION_CLOSE, '') }; + } + if (!opener && !closer) return; + + const body = children.filter((c) => !(c.type === 'text' && c.value === '')); + const parts: Paragraph[] = []; + if (opener) parts.push(paragraph(opener)); + if (body.length > 0) parts.push({ type: 'paragraph', children: body }); + if (closer) parts.push(paragraph(':::')); + parent.children.splice(index, 1, ...parts); + return index + parts.length; + }); + }; +} + +function remarkLanguageAliases() { + return (tree: Root) => { + visit(tree, 'code', (node) => { + if (node.lang && node.lang in LANGUAGE_ALIASES) node.lang = LANGUAGE_ALIASES[node.lang]; + }); + }; +} + +export default defineConfig({ + plugins: [lastModified()], + mdxOptions: { + remarkPlugins: (plugins) => [ + // `:::note` ... `:::` blocks become a , coloured the same way as + // (components/mdx/admonition.tsx). + remarkSplitAdmonitions, + [ + remarkAdmonition, + { + typeMap: { + note: 'info', + info: 'info', + tip: 'success', + caution: 'warning', + warning: 'warning', + danger: 'error', + }, + }, + ], + remarkMdxMermaid, + remarkLanguageAliases, + ...plugins, + ], + rehypeCodeOptions: { + ...codeDefaults, + themes: { light: 'github-light', dark: 'github-dark' }, + // Code blocks are navy in both themes (app/global.css), in github-dark's colours. Its + // comment grey (#6a737d) is under 4.5:1 there (2.98:1 on a highlighted line); GitHub's + // newer dark comment grey passes on plain and highlighted lines. + colorReplacements: { 'github-dark': { '#6a737d': '#8b949e' } }, + fallbackLanguage: 'plaintext', + transformers: [ + ...(codeDefaults.transformers ?? []), + // ```nginx {5,11} highlights lines 5 and 11, like it did on Docusaurus. + transformerMetaHighlight(), + // ```nginx setup fills the reader's own values in (see components/setup). + transformerSetup(), + // ```text wrap wraps long lines (prompts and other text that is read, not run). + transformerWrap(), + ], + }, + }, +}); diff --git a/src/components/HomepageFeatures/look.tsx b/src/components/HomepageFeatures/look.tsx deleted file mode 100644 index 04aab731..00000000 --- a/src/components/HomepageFeatures/look.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import React, {JSX} from 'react'; -import clsx from 'clsx'; -import Heading from '@theme/Heading'; -import styles from './styles.module.css'; -import Zoom from 'react-medium-image-zoom'; -import 'react-medium-image-zoom/dist/styles.css'; -import { useColorMode } from '@docusaurus/theme-common'; - -type FeatureItem = { - title: string; - light: string; - dark: string -}; - -const FeatureList: FeatureItem[] = [ - { - title: 'Client Area', - light: 'https://peli.nyc3.digitaloceanspaces.com/docs/serverconsoled.gif', - dark: 'https://peli.nyc3.digitaloceanspaces.com/docs/serverconsolel.gif' }, - { - title: 'Panel Settings', - light: 'https://peli.nyc3.digitaloceanspaces.com/docs/panelsettingsd.gif', - dark: 'https://peli.nyc3.digitaloceanspaces.com/docs/panelsettingsl.gif' }, - { - title: 'Create Server', - light: 'https://peli.nyc3.digitaloceanspaces.com/docs/createserverd.gif', - dark: 'https://peli.nyc3.digitaloceanspaces.com/docs/createserverl.gif' }, -]; - -function Feature({title, light, dark}: FeatureItem) { - const {colorMode} = useColorMode(); - let image: string; - - if (colorMode === 'dark') { - image = light; - } else { - image = dark; - } - - return ( -
-
- - {title} -
-
- ); - } - -export default function HomepageLook(): JSX.Element { - return ( -
-
-

Shots of the Screen

-
- {FeatureList.map((props, idx) => ( - - ))} -
-
-
- ); -} - diff --git a/src/components/HomepageFeatures/sponsors.tsx b/src/components/HomepageFeatures/sponsors.tsx deleted file mode 100644 index 49f1797a..00000000 --- a/src/components/HomepageFeatures/sponsors.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import React, {JSX} from 'react'; -import clsx from 'clsx'; -import styles from './styles.module.css'; -import 'react-medium-image-zoom/dist/styles.css'; -import {useColorMode} from "@docusaurus/theme-common"; - -type SponsorItem = { - sponsor: string; - logo: string; - logoDM: string; - url: string; - desc: string; -}; - -const SponsorList: SponsorItem[] = [ - /* { - sponsor: 'Name of Sponsor', - logo: '/img/homepage/sponsor/image.png', - url: 'https://example.com', - desc: '', - }, */ - { - sponsor: 'DataForest', - logo: '/img/homepage/sponsor/df-cloud-logo.svg', - logoDM: '/img/homepage/sponsor/df-cloud-logo-darkmode.svg', - url: 'https://cloud.dataforest.net/?mtm_campaign=pelican&mtm_kwd=main', - desc: '', -}, - { - sponsor: 'DreamHost', - logo: '/img/homepage/sponsor/dreamhost-logo.png', - logoDM: '/img/homepage/sponsor/dreamhost-logo-darkmode.png', - url: 'https://www.dreamhost.com/hosting/vps/pelican/', - desc: '', -}, -]; - -function Sponsor({sponsor, logo, logoDM, url, desc}: SponsorItem) { - - const {colorMode} = useColorMode(); - let image: string; - - if (colorMode === 'dark') { - image = logoDM; - } else { - image = logo; - } - - return ( - - {sponsor} - - ); - } - -export default function HomepageSponsor(): JSX.Element { - return ( -
-
-

Project Sponsors

-
- {SponsorList.map((props, idx) => ( - - ))} -
-

- A heartfelt thank you to our sponsors, whose generous support keeps Pelican flying. -

-
-
- ); -} - diff --git a/src/components/HomepageFeatures/styles.module.css b/src/components/HomepageFeatures/styles.module.css deleted file mode 100644 index b248eb2e..00000000 --- a/src/components/HomepageFeatures/styles.module.css +++ /dev/null @@ -1,11 +0,0 @@ -.features { - display: flex; - align-items: center; - padding: 2rem 0; - width: 100%; -} - -.featureSvg { - height: 200px; - width: 200px; -} diff --git a/src/components/HomepageFeatures/what.tsx b/src/components/HomepageFeatures/what.tsx deleted file mode 100644 index 02e88c2b..00000000 --- a/src/components/HomepageFeatures/what.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import React, {JSX} from 'react'; -import clsx from 'clsx'; -import Heading from '@theme/Heading'; -import styles from './styles.module.css'; - -type FeatureItem = { - title: string; - img: string; -}; - -const FeatureList: FeatureItem[] = [ - { - title: 'Node Overview', - img: 'img/homepage/1.png', }, - { - title: 'User Overview', - img: 'img/homepage/2.png', }, - { - title: 'Create Node', - img: 'img/homepage/3.png', }, - { - title: 'Editing an Egg', - img: 'img/homepage/4.png', }, - { - title: 'Editing a Server', - img: 'img/homepage/5.png', }, - { - title: 'Creating an API Key', - img: 'img/homepage/6.png', }, -]; - -function Feature({title, img}: FeatureItem) { - return ( -
-
- {title} -
-
- -
-
- ); -} - -export default function HomepageWhat(): JSX.Element { - return ( -
-
-

What is Pelican?

-

- Pelican is the ultimate, free game server control panel offering high flying security. - It's a breeze to manage your servers with our sleek and user-friendly interface. - And thanks to Docker, they all run in their own safe space. -

-
-
- ); -} diff --git a/src/components/HomepageFeatures/why.tsx b/src/components/HomepageFeatures/why.tsx deleted file mode 100644 index ae5b9b3f..00000000 --- a/src/components/HomepageFeatures/why.tsx +++ /dev/null @@ -1,107 +0,0 @@ -import React, {JSX} from 'react'; -import clsx from 'clsx'; -import Heading from '@theme/Heading'; -import styles from './styles.module.css'; -import { Icon } from '@iconify/react/dist/iconify.js'; -import Link from "@docusaurus/Link"; - -type FeatureItem = { - title: string; - icon: string; - description: JSX.Element; -}; - -const FeatureList: FeatureItem[] = [ - { - title: 'Updated Interface', - icon: 'tabler:app-window', - description: ( - <> - Intuitive interface, one click installations, comprehensive documentation, active community support, automatic updates. - - ), - }, - { - title: 'Free to Use & Open Source', - icon: 'tabler:currency-dollar-off', - description: ( - <> - Pelican is 100% free to use forever for your self, friends, family, and others. All of our code is completely open source on GitHub. - - ) - }, - { - title: 'Eggs', - icon: 'tabler:eggs', - description: ( - <> - <>We support - Minecraft<>, - Terraria<>, - Palworld<>, - Valheim<>, - Enshrouded<>, - Factorio<>, - and so much more. - Check our eggs out, we like them scrambled! - - ), - }, - { - title: 'Powered by Docker', - icon: 'tabler:brand-docker', - description: ( - <> - Each server is ran in its own container and completely isolated. - This allows you to use almost any of your machines with Pelican. - - ), - }, - { - title: 'Scaleable to the Sky', - icon: 'tabler:server-2', - description: ( - <> - Whether you're some friends that want to play together, or a gaming community, we've got you covered. - - ) - }, - { - title: 'Security', - icon: 'tabler:lock-check', - description: ( - <> - Pelican takes security extremely seriously and natively supports SSL, 2FA, AES-256 encryption, and more. - - ) - }, -]; - -function Feature({title, icon, description}: FeatureItem) { - return ( -
-
- -
-
- {title} -

{description}

-
-
- ); -} - -export default function HomepageWhy(): JSX.Element { - return ( -
-
-

Why use Pelican?

-
- {FeatureList.map((props, idx) => ( - - ))} -
-
-
- ); -} diff --git a/src/css/custom.scss b/src/css/custom.scss deleted file mode 100644 index 06b688ed..00000000 --- a/src/css/custom.scss +++ /dev/null @@ -1,172 +0,0 @@ -/* You can override the default Infima variables here. */ -:root { - --ifm-color-primary-lightester: rgb(240, 249, 255); - --ifm-color-primary-lightest: rgb(224, 242, 254); - --ifm-color-primary-lighter: rgb(186, 230, 253); - --ifm-color-primary-light: rgb(125, 211, 252); - --ifm-color-primary: rgb(56, 189, 248); - --ifm-color-primary-dark: rgb(14, 165, 233); - --ifm-color-primary-darker: rgb(2, 132, 199); - --ifm-color-primary-darkest: rgb(3, 105, 161); - --ifm-color-primary-darkester: rgb(7, 89, 133); - --ifm-color-primary-darkestest: rgb(12, 74, 110); - --ifm-color-primary-darkestester: rgb(8, 47, 73); - - --ifm-color-info-dark: rgb(14, 165, 233); - --ifm-color-info-darker: rgb(2, 132, 199); - --ifm-color-info-darkest: rgb(3, 105, 161); - --ifm-color-info-light: rgb(125, 211, 252); - --ifm-color-info-lighter: rgb(186, 230, 253); - --ifm-color-info-lightest: rgb(240, 249, 255); - - --ifm-container-width-xl: 1600px; - --ifm-container-width: 1280px; - - --ifm-code-font-size: 95%; -} - -[data-theme='light'] { - --docusaurus-highlighted-code-line-bg: var(--ifm-color-primary-lighter); - - .hero--primary { - --ifm-hero-background-color: var(--ifm-color-primary-dark); - } - - .hero .hero__subtitle { - color: white; - } -} - -/* For readability concerns, you should choose a lighter palette in dark mode. */ -[data-theme='dark'] { - --ifm-heading-color: white; - --docusaurus-highlighted-code-line-bg: var(--ifm-color-primary-darkestest); - - .hero--primary { - --ifm-hero-background-color: var(--ifm-color-primary-darkest); - } - - .hero--dark { - --ifm-hero-background-color: #303846; - --ifm-hero-text-color: rgb(83, 78, 78); - } - - .hero__subtitle { - color: white; - } -} - -.footer { - text-align: center; -} - -.main-wrapper { - min-height: calc(100vh - 60px); -} - -html[data-theme='dark'] .github-link { - align-items: center; - display: flex; - - &:before { - align-self: center; - background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBmaWxsPSIjZTNlM2UzIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDBDMy41OCAwIDAgMy41OCAwIDhjMCAzLjU0IDIuMjkgNi41MyA1LjQ3IDcuNTkuNC4wNy41NS0uMTcuNTUtLjM4IDAtLjE5LS4wMS0uODItLjAxLTEuNDktMi4wMS4zNy0yLjUzLS40OS0yLjY5LS45NC0uMDktLjIzLS40OC0uOTQtLjgyLTEuMTMtLjI4LS4xNS0uNjgtLjUyLS4wMS0uNTMuNjMtLjAxIDEuMDguNTggMS4yMy44Mi43MiAxLjIxIDEuODcuODcgMi4zMy42Ni4wNy0uNTIuMjgtLjg3LjUxLTEuMDctMS43OC0uMi0zLjY0LS44OS0zLjY0LTMuOTUgMC0uODcuMzEtMS41OS44Mi0yLjE1LS4wOC0uMi0uMzYtMS4wMi4wOC0yLjEyIDAgMCAuNjctLjIxIDIuMi44Mi42NC0uMTggMS4zMi0uMjcgMi0uMjcuNjggMCAxLjM2LjA5IDIgLjI3IDEuNTMtMS4wNCAyLjItLjgyIDIuMi0uODIuNDQgMS4xLjE2IDEuOTIuMDggMi4xMi41MS41Ni44MiAxLjI3LjgyIDIuMTUgMCAzLjA3LTEuODcgMy43NS0zLjY1IDMuOTUuMjkuMjUuNTQuNzMuNTQgMS40OCAwIDEuMDctLjAxIDEuOTMtLjAxIDIuMiAwIC4yMS4xNS40Ni41NS4zOEE4LjAxMyA4LjAxMyAwIDAwMTYgOGMwLTQuNDItMy41OC04LTgtOHoiLz48L3N2Zz4=") 0 0/contain; - content: ''; - display: inline-flex; - height: 32px; - width: 32px; - margin-right: 0.25rem; - color: var(--ifm-navbar-link-color); - } - - &:hover { - &:before { - background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBmaWxsPSIjMzhiZGY4IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDBDMy41OCAwIDAgMy41OCAwIDhjMCAzLjU0IDIuMjkgNi41MyA1LjQ3IDcuNTkuNC4wNy41NS0uMTcuNTUtLjM4IDAtLjE5LS4wMS0uODItLjAxLTEuNDktMi4wMS4zNy0yLjUzLS40OS0yLjY5LS45NC0uMDktLjIzLS40OC0uOTQtLjgyLTEuMTMtLjI4LS4xNS0uNjgtLjUyLS4wMS0uNTMuNjMtLjAxIDEuMDguNTggMS4yMy44Mi43MiAxLjIxIDEuODcuODcgMi4zMy42Ni4wNy0uNTIuMjgtLjg3LjUxLTEuMDctMS43OC0uMi0zLjY0LS44OS0zLjY0LTMuOTUgMC0uODcuMzEtMS41OS44Mi0yLjE1LS4wOC0uMi0uMzYtMS4wMi4wOC0yLjEyIDAgMCAuNjctLjIxIDIuMi44Mi42NC0uMTggMS4zMi0uMjcgMi0uMjcuNjggMCAxLjM2LjA5IDIgLjI3IDEuNTMtMS4wNCAyLjItLjgyIDIuMi0uODIuNDQgMS4xLjE2IDEuOTIuMDggMi4xMi41MS41Ni44MiAxLjI3LjgyIDIuMTUgMCAzLjA3LTEuODcgMy43NS0zLjY1IDMuOTUuMjkuMjUuNTQuNzMuNTQgMS40OCAwIDEuMDctLjAxIDEuOTMtLjAxIDIuMiAwIC4yMS4xNS40Ni41NS4zOEE4LjAxMyA4LjAxMyAwIDAwMTYgOGMwLTQuNDItMy41OC04LTgtOHoiLz48L3N2Zz4=") 0 0/contain; - } - } -} - -html[data-theme='light'] .github-link { - align-items: center; - display: flex; - - &:before { - align-self: center; - background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBmaWxsPSIjMWMxZTIxIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDBDMy41OCAwIDAgMy41OCAwIDhjMCAzLjU0IDIuMjkgNi41MyA1LjQ3IDcuNTkuNC4wNy41NS0uMTcuNTUtLjM4IDAtLjE5LS4wMS0uODItLjAxLTEuNDktMi4wMS4zNy0yLjUzLS40OS0yLjY5LS45NC0uMDktLjIzLS40OC0uOTQtLjgyLTEuMTMtLjI4LS4xNS0uNjgtLjUyLS4wMS0uNTMuNjMtLjAxIDEuMDguNTggMS4yMy44Mi43MiAxLjIxIDEuODcuODcgMi4zMy42Ni4wNy0uNTIuMjgtLjg3LjUxLTEuMDctMS43OC0uMi0zLjY0LS44OS0zLjY0LTMuOTUgMC0uODcuMzEtMS41OS44Mi0yLjE1LS4wOC0uMi0uMzYtMS4wMi4wOC0yLjEyIDAgMCAuNjctLjIxIDIuMi44Mi42NC0uMTggMS4zMi0uMjcgMi0uMjcuNjggMCAxLjM2LjA5IDIgLjI3IDEuNTMtMS4wNCAyLjItLjgyIDIuMi0uODIuNDQgMS4xLjE2IDEuOTIuMDggMi4xMi41MS41Ni44MiAxLjI3LjgyIDIuMTUgMCAzLjA3LTEuODcgMy43NS0zLjY1IDMuOTUuMjkuMjUuNTQuNzMuNTQgMS40OCAwIDEuMDctLjAxIDEuOTMtLjAxIDIuMiAwIC4yMS4xNS40Ni41NS4zOEE4LjAxMyA4LjAxMyAwIDAwMTYgOGMwLTQuNDItMy41OC04LTgtOHoiLz48L3N2Zz4=") 0 0/contain; - content: ''; - display: inline-flex; - height: 32px; - width: 32px; - margin-right: 0.25rem; - color: var(--ifm-navbar-link-color); - } - - &:hover { - &:before { - background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij48cGF0aCBmaWxsPSIjMzhiZGY4IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04IDBDMy41OCAwIDAgMy41OCAwIDhjMCAzLjU0IDIuMjkgNi41MyA1LjQ3IDcuNTkuNC4wNy41NS0uMTcuNTUtLjM4IDAtLjE5LS4wMS0uODItLjAxLTEuNDktMi4wMS4zNy0yLjUzLS40OS0yLjY5LS45NC0uMDktLjIzLS40OC0uOTQtLjgyLTEuMTMtLjI4LS4xNS0uNjgtLjUyLS4wMS0uNTMuNjMtLjAxIDEuMDguNTggMS4yMy44Mi43MiAxLjIxIDEuODcuODcgMi4zMy42Ni4wNy0uNTIuMjgtLjg3LjUxLTEuMDctMS43OC0uMi0zLjY0LS44OS0zLjY0LTMuOTUgMC0uODcuMzEtMS41OS44Mi0yLjE1LS4wOC0uMi0uMzYtMS4wMi4wOC0yLjEyIDAgMCAuNjctLjIxIDIuMi44Mi42NC0uMTggMS4zMi0uMjcgMi0uMjcuNjggMCAxLjM2LjA5IDIgLjI3IDEuNTMtMS4wNCAyLjItLjgyIDIuMi0uODIuNDQgMS4xLjE2IDEuOTIuMDggMi4xMi41MS41Ni44MiAxLjI3LjgyIDIuMTUgMCAzLjA3LTEuODcgMy43NS0zLjY1IDMuOTUuMjkuMjUuNTQuNzMuNTQgMS40OCAwIDEuMDctLjAxIDEuOTMtLjAxIDIuMiAwIC4yMS4xNS40Ni41NS4zOEE4LjAxMyA4LjAxMyAwIDAwMTYgOGMwLTQuNDItMy41OC04LTgtOHoiLz48L3N2Zz4=") 0 0/contain; - } - } -} -html[data-theme='dark'] .discord-link { - align-items: center; - display: flex; - - &:before { - align-self: center; - background: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0c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MzQ1MSAzMC4xNjkzQzE3LjM0NTEgMjYuMjI1IDIwLjE3MTcgMjMuMDEzMyAyMy43MjU5IDIzLjAxMzNDMjcuMzA4IDIzLjAxMzMgMzAuMTYyNiAyNi4yNTMyIDMwLjEwNjYgMzAuMTY5M0MzMC4xMDY2IDM0LjExMzYgMjcuMjggMzcuMzI1MyAyMy43MjU5IDM3LjMyNTNaTTQ3LjMxNzggMzcuMzI1M0M0My44MTk2IDM3LjMyNTMgNDAuOTM3MSAzNC4xMTM2IDQwLjkzNzEgMzAuMTY5M0M0MC45MzcxIDI2LjIyNSA0My43NjM2IDIzLjAxMzMgNDcuMzE3OCAyMy4wMTMzQzUwLjkgMjMuMDEzMyA1My43NTQ1IDI2LjI1MzIgNTMuNjk4NiAzMC4xNjkzQzUzLjY5ODYgMzQuMTEzNiA1MC45IDM3LjMyNTMgNDcuMzE3OCAzNy4zMjUzWiIgZmlsbD0iI2UzZTNlMyIvPjwvc3ZnPg==") 0 0/contain; - content: ''; - display: inline-flex; - height: 32px; - width: 32px; - margin-right: 0.25rem; - color: var(--ifm-navbar-link-color); - } - - &:hover { - &:before { - background: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0cHgiIHdpZHRoPSIyNHB4IiB2aWV3Qm94PSIwIDAgNzEgNTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYwLjEwNDUgNC44OTc4QzU1LjU3OTIgMi44MjE0IDUwLjcyNjUgMS4yOTE2IDQ1LjY1MjcgMC40MTU0MkM0NS41NjAzIDAuMzk4NTEgNDUuNDY4IDAuNDQwNzY5IDQ1LjQyMDQgMC41MjUyODlDNDQuNzk2MyAxLjYzNTMgNDQuMTA1IDMuMDgzNCA0My42MjA5IDQuMjIxNkMzOC4xNjM3IDMuNDA0NiAzMi43MzQ1IDMuNDA0NiAyNy4zODkyIDQuMjIxNkMyNi45MDUgMy4wNTgxIDI2LjE4ODYgMS42MzUzID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zQzUzLjY5ODYgMzQuMTEzNiA1MC45IDM3LjMyNTMgNDcuMzE3OCAzNy4zMjUzWiIgZmlsbD0iIzM4YmRmOCIvPjwvc3ZnPg==") 0 0/contain; - } - } -} - -html[data-theme='light'] .discord-link { - align-items: center; - display: flex; - - &:before { - align-self: center; - background: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0cHgiIHdpZHRoPSIyNHB4IiB2aWV3Qm94PSIwIDAgNzEgNTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYwLjEwNDUgNC44OTc4QzU1LjU3OTIgMi44MjE0IDUwLjcyNjUgMS4yOTE2IDQ1LjY1MjcgMC40MTU0MkM0NS41NjAzIDAuMzk4NTEgNDUuNDY4IDAuNDQwNzY5IDQ1LjQyMDQgMC41MjUyODlDNDQuNzk2MyAxLjYzNTMgNDQuMTA1IDMuMDgzNCA0My42MjA5IDQuMjIxNkMzOC4xNjM3IDMuNDA0NiAzMi43MzQ1IDMuNDA0NiAyNy4zODkyIDQuMjIxNkMyNi45MDUgMy4wNTgxIDI2LjE4ODYgMS42MzUzIDI1LjU2MTcgMC41MjUyODlDMjUuNTE0MSAwLjQ0MzU4OSAyNS40MjE4IDAuNDAxMzMgMjUuMzI5NCAwLjQxNTQyQzIwLjI1ODQgMS4yODg4IDE1LjQwNTcgMi44MTg2IDEwLjg3NzYgNC44OTc4QzEwLjgzODQgNC45MTQ3IDEwLjgwNDggNC45NDI5IDEwLjc4MjUgNC45Nzk1QzEuNTc3OTUgMTguNzMwOSAtMC45NDM1NjEgMzIuMTQ0MyAwLjI5MzQwOCA0NS4zOTE0QzAuMjk5MDA1IDQ1LjQ1NjIgMC4zMzUzODYgNDUuNTE4MiAwLjM4NTc2MSA0NS41NTc2QzYuNDU4NjYgNTAuMDE3NCAxMi4zNDEzIDUyLjcyNDkgMTguMTE0NyA1NC41MTk1QzE4LjIwNzEgNTQuNTQ3NyAxOC4zMD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5NDJDNzIuMTc0NyAzMC4wNzkxIDY4LjIxNDcgMTYuNzc1NyA2MC4xOTY4IDQuOTgyM0M2MC4xNzcyIDQuOTQyOSA2MC4xNDM3IDQuOTE0NyA2MC4xMDQ1IDQuODk3OFpNMjMuNzI1OSAzNy4zMjUzQzIwLjIyNzYgMzcuMzI1MyAxNy4zNDUxIDM0LjExMzYgMTcuMzQ1MSAzMC4xNjkzQzE3LjM0NTEgMjYuMjI1IDIwLjE3MTcgMjMuMDEzMyAyMy43MjU5IDIzLjAxMzNDMjcuMzA4IDIzLjAxMzMgMzAuMTYyNiAyNi4yNTMyIDMwLjEwNjYgMzAuMTY5M0MzMC4xMDY2IDM0LjExMzYgMjcuMjggMzcuMzI1MyAyMy43MjU5IDM3LjMyNTNaTTQ3LjMxNzggMzcuMzI1M0M0My44MTk2IDM3LjMyNTMgNDAuOTM3MSAzNC4xMTM2IDQwLjkzNzEgMzAuMTY5M0M0MC45MzcxIDI2LjIyNSA0My43NjM2IDIzLjAxMzMgNDcuMzE3OCAyMy4wMTMzQzUwLjkgMjMuMDEzMyA1My43NTQ1IDI2LjI1MzIgNTMuNjk4NiAzMC4xNjkzQzUzLjY5ODYgMzQuMTEzNiA1MC45IDM3LjMyNTMgNDcuMzE3OCAzNy4zMjUzWiIgZmlsbD0iIzFjMWUyMSIvPjwvc3ZnPg==") 0 0/contain; - content: ''; - display: inline-flex; - height: 32px; - width: 32px; - margin-right: 0.25rem; - color: var(--ifm-navbar-link-color); - } - - &:hover { - &:before { - background: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0cHgiIHdpZHRoPSIyNHB4IiB2aWV3Qm94PSIwIDAgNzEgNTUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYwLjEwNDUgNC44OTc4QzU1LjU3OTIgMi44MjE0IDUwLjcyNjUgMS4yOTE2IDQ1LjY1MjcgMC40MTU0MkM0NS41NjAzIDAuMzk4NTEg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LjMxNzggMzcuMzI1M0M0My44MTk2IDM3LjMyNTMgNDAuOTM3MSAzNC4xMTM2IDQwLjkzNzEgMzAuMTY5M0M0MC45MzcxIDI2LjIyNSA0My43NjM2IDIzLjAxMzMgNDcuMzE3OCAyMy4wMTMzQzUwLjkgMjMuMDEzMyA1My43NTQ1IDI2LjI1MzIgNTMuNjk4NiAzMC4xNjkzQzUzLjY5ODYgMzQuMTEzNiA1MC45IDM3LjMyNTMgNDcuMzE3OCAzNy4zMjUzWiIgZmlsbD0iIzM4YmRmOCIvPjwvc3ZnPg==") 0 0/contain; - } - } -} - -// Has to be a better way to style the announcment bar.... -html[data-theme='dark'] .content_node_modules--pnpm-\@docusaurus\+theme-classic\@3-2-1_\@types\+react\@18-2-74_react-dom\@18-2-0_react\@18-2-0_typescript\@5-2-2-node_modules-\@docusaurus-theme-classic-lib-theme-AnnouncementBar-Content-styles-module { - font-size: larger; - color: white; - padding: 1rem; -} - -html[data-theme='light'] .content_node_modules--pnpm-\@docusaurus\+theme-classic\@3-2-1_\@types\+react\@18-2-74_react-dom\@18-2-0_react\@18-2-0_typescript\@5-2-2-node_modules-\@docusaurus-theme-classic-lib-theme-AnnouncementBar-Content-styles-module { - font-size: larger; - color: white; - padding: 1rem; -} - -// The JetBrains logo has black lettering, so give it a light backing in dark mode -html[data-theme='dark'] img[src$='/jetbrains.svg'] { - background: white; - padding: 0.5rem 0.75rem; - border-radius: 0.5rem; -} diff --git a/src/css/tailwind.css b/src/css/tailwind.css deleted file mode 100644 index b5c61c95..00000000 --- a/src/css/tailwind.css +++ /dev/null @@ -1,3 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; diff --git a/src/pages/index.module.css b/src/pages/index.module.css deleted file mode 100644 index 9f71a5da..00000000 --- a/src/pages/index.module.css +++ /dev/null @@ -1,23 +0,0 @@ -/** - * CSS files with the .module.css suffix will be treated as CSS modules - * and scoped locally. - */ - -.heroBanner { - padding: 4rem 0; - text-align: center; - position: relative; - overflow: hidden; -} - -@media screen and (max-width: 996px) { - .heroBanner { - padding: 2rem; - } -} - -.buttons { - display: flex; - align-items: center; - justify-content: center; -} diff --git a/src/pages/index.tsx b/src/pages/index.tsx deleted file mode 100644 index b632ead6..00000000 --- a/src/pages/index.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import React, {JSX} from 'react'; -import clsx from 'clsx'; -import Link from '@docusaurus/Link'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import Layout from '@theme/Layout'; -import HomepageWhy from '@site/src/components/HomepageFeatures/why'; -import HomepageWhat from '@site/src/components/HomepageFeatures/what'; -import HomepageLook from '@site/src/components/HomepageFeatures/look'; -import HomepageSponsors from '@site/src/components/HomepageFeatures/sponsors' -import Heading from '@theme/Heading'; -import { Icon } from '@iconify/react/dist/iconify.js'; - -import styles from './index.module.css'; - -function HomepageHeader() { - const {siteConfig} = useDocusaurusContext(); - return ( -
-
- - {siteConfig.title} - -

{siteConfig.tagline}

-
- Install - Demo -
-
-
- ); -} - -export default function Home(): JSX.Element { - const {siteConfig} = useDocusaurusContext(); - return ( - - -
- - - - -
-
- ); -} diff --git a/src/pages/support.mdx b/src/pages/support.mdx deleted file mode 100644 index 56161e97..00000000 --- a/src/pages/support.mdx +++ /dev/null @@ -1,47 +0,0 @@ -import Link from "@docusaurus/Link"; - -# Support Pelican - -Supporting us will let us pay for the resources and time to keep Pelican amazing! - -How will your support be used? - -* Contributors: 75% -* Bug Bounties: 15% -* Moderators: 10% - -
- -## Monthly Support & Benefits: - -| | Individual | Team | Company | -|------------------------|--------------|--------------|------------------| -| Discord Role | Donor | Donor | Sponsor | -| Support Priority | Medium | High | Highest | -| # of Discord Members | 1 | 3 | 6 | -| Discord Channel | Lounge | Lounge | Sponsor Lounge | -| Early Beta | ✅ | ✅ | ✅ | -| Private Raffles | ✅ | ✅ | ✅ | -| Advertise on Discord | ❌ | ✅ | ✅ | -| Logo on Websites | ❌ | ❌ | ✅ | -| Commercial License | ❌ | ❌ | ✅ | -| Monthly 1:1 Calls | ❌ | ❌ | 1 hour | -| Monthly Cost | $19 | $99 | $499 | - - -If you'd like to support the project, [visit us on the Pelican Hub](https://hub.pelican.dev/donors), to get started! - -
- -## One Time Support - -We really appreciate you, please follow this link to give a one time amount: - -Donate One Time - -
- -

Thank you again for choosing to support Pelican!

diff --git a/src/plugins/tailwind-config.cjs b/src/plugins/tailwind-config.cjs deleted file mode 100644 index f6cbde9f..00000000 --- a/src/plugins/tailwind-config.cjs +++ /dev/null @@ -1,15 +0,0 @@ -function tailwindPlugin(context, options) { - return { - name: 'tailwind-plugin', - configurePostCss(postcssOptions) { - postcssOptions.plugins = [ - require('postcss-import'), - require('tailwindcss'), - require('autoprefixer'), - ]; - return postcssOptions; - }, - }; -} - -module.exports = tailwindPlugin; \ No newline at end of file diff --git a/src/theme/MDXComponents.js b/src/theme/MDXComponents.js deleted file mode 100644 index d5b41c17..00000000 --- a/src/theme/MDXComponents.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import MDXComponents from '@theme-original/MDXComponents'; -import { Icon } from '@iconify/react'; // Import the entire Iconify library. -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; // Import the FontAwesomeIcon component. -import { library } from '@fortawesome/fontawesome-svg-core'; // Import the library component. -import { fab } from '@fortawesome/free-brands-svg-icons'; // Import all brands icons. -import { fas } from '@fortawesome/free-solid-svg-icons'; // Import all solid icons. - -export default { - // Re-use the default mapping - ...MDXComponents, - IIcon: Icon, // Make the iconify Icon component available in MDX as . - FAIcon: FontAwesomeIcon, // Make the FontAwesomeIcon component available in MDX as . -}; \ No newline at end of file diff --git a/static/.nojekyll b/static/.nojekyll deleted file mode 100644 index e69de29b..00000000 diff --git a/static/js/snowflake.min.js b/static/js/snowflake.min.js deleted file mode 100644 index 4e2d7b32..00000000 --- a/static/js/snowflake.min.js +++ /dev/null @@ -1,5 +0,0 @@ -/**! - Source: https://github.com/nextapps-de/snowflake - License: Apache License 2.0 - */ -!function(){"use strict";const t=document.createElement("canvas"),e=t.getContext("2d"),n=window.devicePixelRatio||1,o=new Image,i=window["dRg4!"]="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMAAABYR2ztAAAAGFBMVEXk7PTk7PTk7PTk7PTk7PTk7PQAAADk7PQLtLMUAAAAB3RSTlO18FHbI4YAkU+M0QAAAVVJREFUeF7F1T1PwzAQgGGGouwg5B8QEWaioqyVSsNKoXL2KPYcE6L371PLcp1GjU7A0IztI53Pvo8bK3y/BnkpgGoQAFwXmPvCg/ZZL4A3hg94rPheBOFbBCaCiyHqo9gpAHc44m4Ots6L9h1uC/+/Ws/AE3qapuFrBpo5GCdgX14G+UMAHaxsRjEFLb3dQB0BB0U9BR1uRwS2Acdw/hYVCkYbQJcB4zlogL6OWbQV9OchMhiKlKYBxinYA9omsAW4SyAHWCfQKgagjGADVLgUogGdA6sAdh4bGCMw0PuwOO2BCQlmoBPQ8eAQUzIJdKo8JQunBHN3uodXa8NZAfCRbPg5glnN6eW+2BBy+RtIIQ4JSIcU0xQvSrxq6bHE5xYLRi45uWjlspcbR249uXnl9pcHiDyC0hD7hJc0xMQxKA9SeRTLw1xeB9ffWfJilVfz/7f/D7vzJWHzmXRTAAAAAElFTkSuQmCC";let a,d,r,l=0,c=0,h=(w=1,g=5,Math.floor(Math.random()*(g-w+1)+w)),A=2,s=.5,u=1.5,f=!0;var w,g;const m=[],p=[],y=[{r:1.5,o:.3},{r:1.7,o:.4},{r:1.9,o:.6},{r:2.1,o:.8},{r:2.3,o:1},{r:2.5,o:1},{r:2.7,o:.8},{r:2.9,o:.6},{r:3.1,o:.4},{r:3.5,o:.3}];function x(t){let e=Math.random()*y.length|0,i=y[e];this.buffer=p[e]||function(t){const e=y[t],i=p[t]=document.createElement("canvas"),a=i.getContext("2d"),d=Math.ceil(e.r*n*u*A),r=e.r<2.3?.9*(2.3-e.r)*n*u:e.r>2.3?1.1*(e.r-2.3)*n*u:0;return i.height=i.width=d,a.globalAlpha=e.o,a.filter=a.webkitFilter="blur("+r+"px)",a.drawImage(o,0,0,o.width,o.height,0,0,d,d),a.globalAlpha=e.o/1.5,a.fillStyle="#e4ecf4",a.beginPath(),a.arc(d/2,d/2,d/2/2,0,2*Math.PI,!1),a.closePath(),a.fill(),i}(e),this.r=i.r*n*u,this.w=Math.ceil(i.r*n*u*A),this.x=P(a),this.y=t||-this.w,this.o=i.o,this.vy=i.r*i.r*n*u/A/2,this.vx=(.5-P())/A*n*u,this.deg=(1-P(2))*A/n/u/180*Math.PI}function b(t){if(l=window.requestAnimationFrame(b),!o.loaded)return;e.clearRect(0,0,a,d);let i=c?(t-c)/(1e3/60):1;i>100&&(i=1),c=t;for(let t,o=0,l=r*s|0;o=d||t.x>=a||t.x<=-t.w?m.length>l?m.splice(o--,1):m[o]=new x(0):e.drawImage(t.buffer,0,0,t.w,t.w,t.x,t.y,t.w,t.w)}function B(){let e=t.parentElement;!e||e===document.body&&(e=document.documentElement),e?(a=e.clientWidth,d=e.clientHeight):(a=window.innerWidth,d=window.innerHeight),a=a/3*n*u,d=d/3*n*u,r=a/(n*u)*(d/(n*u))/1500|0,t.width=a,t.height=d}function P(t){return Math.random()*(t||1)}function M(e){const n=t.style;for(const t in e)n.setProperty(t,e[t])}function C(){const t=window.SnowflakeConfig;if(t)for(let e in t)"start"===e?f=!!t[e]:E[e](t[e]);o.loaded||o.src||(o.src=i),f&&Q()}function Q(){B(),b(0),f=!0,t.setAttribute("id","snowflake"),t.parentElement||document.body.appendChild(t)}window.addEventListener("resize",B,!1);const E=window.Snowflake={style:M,speed:function(t){h=t},size:function(t){A=3*t,p.length=0},quality:function(t){u=1.5*Math.min(Math.max(t,.1),2),p.length=0,m.length=0,B()},density:function(t){s=t},opacity:function(t){M({opacity:t})},index:function(t){M({"z-index":t})},image:function(t){o.loaded=!t,t&&(o.src=t),p.length=0},mount:function(e){e.appendChild(t),M({position:e===document.body?"fixed":"absolute"}),f&&B()},start:function(){f?l||b(0):C()||Q(),M({display:""})},stop:function(){cancelAnimationFrame(l),M({display:"none"}),l=c=0}};M({position:"fixed",top:"0",left:"0",width:"100%",height:"100%","z-index":"999999","pointer-events":"none"}),o.loaded=!1,o.onload=function(){o.loaded=!0},o.onerror=function(){o.onerror=null,o.src=i},"complete"===document.readyState?C():window.addEventListener("load",C,!1)}(); \ No newline at end of file diff --git a/tailwind.config.js b/tailwind.config.js deleted file mode 100644 index f19630bf..00000000 --- a/tailwind.config.js +++ /dev/null @@ -1,29 +0,0 @@ -const { fontFamily } = require("tailwindcss/defaultTheme"); - -/** @type {import('tailwindcss').Config} */ -module.exports = { - corePlugins: { - preflight: false, - container: false, - }, - darkMode: ["class", '[data-theme="dark"]'], - content: ["./src/**/*.{jsx,tsx,html,mdx}"], - theme: { - extend: { - fontFamily: { - sans: ['"Inter"', ...fontFamily.sans], - jakarta: ['"Plus Jakarta Sans"', ...fontFamily.sans], - mono: ['"Fira Code"', ...fontFamily.mono], - }, - borderRadius: { - sm: "4px", - }, - screens: { - sm: "0px", - lg: "997px", - }, - colors: {}, - }, - }, - plugins: [], -}; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 7dc3bde1..902bc881 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,25 @@ { - // This file is not used in compilation. It is here just for a nice editor experience. - "extends": "@docusaurus/tsconfig", "compilerOptions": { - "jsx": "react", - "baseUrl": "." - } + "target": "ESNext", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "react-jsx", + "incremental": true, + "paths": { + "@/*": ["./*"], + "fumadocs-mdx:collections/*": ["./.source/*"] + }, + "plugins": [{ "name": "next" }] + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts"], + "exclude": ["node_modules", "_old"] } diff --git a/ui/nav.json b/ui/nav.json new file mode 100644 index 00000000..852567c4 --- /dev/null +++ b/ui/nav.json @@ -0,0 +1,39 @@ +{ + "items": [ + { "label": "Docs", "href": "/docs/" }, + { "label": "Plugins", "href": "/plugins" }, + { "label": "Eggs", "href": "/eggs" }, + { "label": "Community", "href": "https://discord.gg/pelican-panel" }, + { "label": "Sponsor", "href": "/sponsor" } + ], + "footer": [ + { + "title": "Product", + "items": [ + { "label": "Documentation", "href": "/docs/" }, + { "label": "Install guide", "href": "/docs/getting-started/" }, + { "label": "Live demo", "href": "https://demo.pelican.dev" }, + { "label": "Plugin Hub", "href": "/plugins" } + ] + }, + { + "title": "Community", + "items": [ + { "label": "Discord", "href": "https://discord.gg/pelican-panel" }, + { "label": "GitHub", "href": "https://github.com/pelican/panel" }, + { "label": "Contributors", "href": "/docs/contributors/" }, + { "label": "Translate", "href": "/docs/guides/translating/" } + ] + }, + { + "title": "Project", + "items": [ + { "label": "FAQ", "href": "/faq/" }, + { "label": "Sponsor", "href": "/sponsor" }, + { "label": "Versioning", "href": "/docs/versioning/" }, + { "label": "Comparison", "href": "/docs/comparison/" } + ] + } + ], + "cta": { "label": "Get started", "href": "/docs/getting-started/" } +} diff --git a/ui/tokens.css b/ui/tokens.css new file mode 100644 index 00000000..a836d412 --- /dev/null +++ b/ui/tokens.css @@ -0,0 +1,158 @@ +/* ========================================================================= + * pelican.dev design tokens, V12 "B v3" (light) and "V3 · Night" (dark). + * + * The one source for the colours, font stacks and sizes the site uses. This + * repo imports it (app/global.css, which loads on every page), and the build + * publishes it at /docs/ui/v1/tokens.css for the Hub to copy, so both halves of + * pelican.dev draw with the same values. Plain CSS (no Tailwind at-rules), so + * it works anywhere. + * + * Only custom properties live here; the rules that use them stay in + * app/(landing)/home.css (the `.pl` pages) and app/global.css (the docs). + * + * Dark mode: next-themes puts `dark` on before the first paint (system + * setting by default; the switch in either nav overrides it and stores the + * choice in localStorage "theme", shared by the docs and the Hub). + * ====================================================================== */ + +/* ---- Fonts --------------------------------------------------------------- + * Bricolage Grotesque (display, 800), Instrument Sans (text), JetBrains Mono + * (code). In this repo next/font sets these three variables on with its + * own hashed family names; these are the fallbacks for anyone self-hosting the + * faces under their real names. :where() keeps them at zero specificity, so + * next/font's class always wins. + * ------------------------------------------------------------------------- */ +:where(:root) { + --pl-font-display: 'Bricolage Grotesque', 'Bricolage Grotesque Fallback'; + --pl-font-text: 'Instrument Sans', 'Instrument Sans Fallback'; + --font-jetbrains: 'JetBrains Mono', 'JetBrains Mono Fallback'; +} + +/* ---- Page-wide brand colours (the docs chrome reads these) --------------- */ +:root { + --pl-ink: #04121c; + --pl-sky: #38bdf8; + --pl-sky-deep: #0b79ad; + --pl-white: #ffffff; + --pl-paper: #f3f7f9; + /* the thick edge used on cards, code and callouts (and the interim pages' hard shadow) */ + --pl-edge: var(--pl-ink); + --pl-shadow: var(--pl-ink); + /* The page roles of the Hub's redesigned pages (the `.pl` names without the prefix), for + chrome that sits outside a `.pl` wrapper, such as the docs. */ + --pl-fg: #04121c; /* text and icons */ + --pl-text: #1f3644; /* lead paragraphs */ + --pl-muted: #33505f; + --pl-ground: #f3f7f9; /* the page under the cards (the Hub's --paper) */ + --pl-card: #ffffff; + --pl-rule: #d5e3ea; /* 2px dividers */ + --pl-rule-soft: #e3edf2; + --pl-chip: #e3edf2; /* inline code, counts */ + --pl-hover: #e8f6fd; + --pl-hover-strong: #cdeefd; /* the current item in a list */ + --pl-kicker: #0a76a8; /* small sky text over a title: the Hub's #0b79ad a shade darker, 4.6:1 on the ground */ + --pl-code: #04121c; /* code blocks are navy in both themes */ + --pl-on-code: #e3ecf1; + --pl-on-code-soft: #b9ccd6; + --pl-line-on-ink: #2e4756; + /* Tones: the callouts, and the Hub's alerts that copy them. */ + --pl-info: #0b79ad; + --pl-ok: #15803d; + --pl-warn: #b45309; + --pl-bad: #b42318; + --pl-idea: #a16207; +} + +.dark { + --pl-edge: #2e4756; + --pl-shadow: #38bdf8; + /* Soft white: pure #fff glares on navy. */ + --pl-fg: #e3ecf1; + --pl-text: #d4e3ea; + --pl-muted: #b9ccd6; + --pl-ground: #071926; + --pl-card: #0a1e2b; + --pl-rule: #2e4756; + --pl-rule-soft: #1f3a4a; + --pl-chip: #14304a; + --pl-hover: #0f2c3d; + --pl-hover-strong: #123a52; + --pl-kicker: #38bdf8; + --pl-code: #000b12; + --pl-info: #38bdf8; + --pl-ok: #4ade80; + --pl-warn: #fbbf24; + --pl-bad: #fda29b; + --pl-idea: #facc15; +} + +/* ---- The `.pl` design (homepage, site pages, the Hub's pages) ------------ + * `.pl` is the wrapper around a V12 page. + * ------------------------------------------------------------------------- */ +.pl { + --ink: #04121c; + --sky: #38bdf8; + --sky-deep: #0b79ad; + --white: #ffffff; + --paper: #f3f7f9; + --text: #1f3644; + --on-ink-soft: #b9ccd6; + --line-on-ink: #2e4756; + --line: 3px solid var(--ink); + --pad: clamp(16px, 4cqi, 64px); + --section: clamp(72px, 9cqi, 120px); + --font-display: var(--pl-font-display), 'Helvetica Neue', sans-serif; + --font-text: var(--pl-font-text), 'Helvetica Neue', system-ui, sans-serif; + --font-code: var(--font-jetbrains), ui-monospace, Menlo, monospace; + --btn-shadow: var(--ink); + /* Theme roles. --ink and --white flip in dark mode (below); these stay put or + carry the role the light values had. */ + --navy: #04121c; /* always navy: text on sky, chrome that is dark in both themes */ + --snow: #ffffff; /* always white: text on navy */ + --shadow: var(--ink); /* hard offset shadow on cards */ + --muted: #33505f; + --faint: #8aa3b0; + --rule: #d5e3ea; + --rule-soft: #e3edf2; + --rule-ink: rgba(4, 18, 28, 0.12); + --chip: #e3edf2; + --hover: #e8f6fd; + --hover-strong: #cdeefd; + --on-sky-soft: #0b2a3b; + --kbd-bg: rgba(255, 255, 255, 0.5); +} + +/* In the dark, --ink and --white swap roles: --ink is the foreground (text, the + 3px borders) and --white the card surface. Shadows turn sky; sky bands become + navy grounds; navy (.on-ink) sections keep their light values. */ +.dark .pl { + --ground: #04121c; + --deep: #071926; + --code: #000b12; + --ink: #ffffff; + --white: #0a1e2b; + --card: #0a1e2b; /* the surface, also inside .on-ink where --white is white again */ + --paper: #071926; + --text: #d4e3ea; + --muted: #b9ccd6; + --faint: #7f99a6; + --rule: #2e4756; + --rule-soft: #1f3a4a; + --rule-ink: rgba(185, 204, 214, 0.18); + --chip: #14304a; + --hover: #0f2c3d; + --hover-strong: #123a52; + --on-sky-soft: #b9ccd6; + --kbd-bg: rgba(255, 255, 255, 0.1); + --sky-deep: #38bdf8; + --shadow: var(--sky); + --btn-shadow: var(--sky); +} + +/* Navy sections were already dark: give them back their light values. */ +.dark .pl .on-ink { + --ink: #04121c; + --white: #ffffff; + --line: 3px solid var(--line-on-ink); + --btn-shadow: var(--snow); +}