• XSLT 37.9%
  • Rust 25.3%
  • Astro 13.6%
  • CSS 13%
  • TypeScript 5.6%
  • Other 4.6%
Find a file
AverageHelper 87bba89ecd
All checks were successful
/ test (push) Successful in 2m23s
chore: remove on-demand tls
2025-07-22 19:04:38 -06:00
.forgejo/workflows rust webserver :3 (#6) 2025-04-20 23:35:37 +00:00
.github/workflows fix(ci): Ensure PR autoclose only happens on GitHub 2023-12-13 21:13:38 -07:00
.vscode chore: Update Astro 2025-03-09 22:33:42 -06:00
functions chore: remove on-demand tls 2025-07-22 19:04:38 -06:00
public feat: Serve a Gemini capsule! 2025-05-12 16:00:13 -06:00
src chore: 🥺 2025-05-20 02:58:37 -06:00
.dockerignore feat: Dockerize for easier deployment and stack changes 2024-10-30 12:53:33 -06:00
.editorconfig fix: Upgrade eslint and other outdated deps 2025-03-09 21:20:18 -06:00
.gitignore chore: ignore compose.yml 2025-07-22 16:12:48 -06:00
.npmrc feat: Let's try something different 2023-11-17 18:16:40 -07:00
.prettierignore feat: Move to own host instead of Cloudflare (#4) 2024-04-03 06:01:47 +00:00
.prettierrc fix: Upgrade eslint and other outdated deps 2025-03-09 21:20:18 -06:00
.rustfmt.toml chore(rust): Some boilerplate 2024-11-17 18:50:35 -07:00
app.sh feat: Dockerize for easier deployment and stack changes 2024-10-30 12:53:33 -06:00
astro.config.ts feat: Style the machine-readable sitemap file 2024-10-23 19:22:04 -06:00
build.rs feat: Serve a Gemini capsule! 2025-05-12 16:00:13 -06:00
Cargo.lock fix(gemini): Send TLS close_notify reliably 2025-05-20 14:52:12 -06:00
Cargo.toml fix(gemini): Send TLS close_notify reliably 2025-05-20 14:52:12 -06:00
compose.example.yaml chore: let compose.yml be modified sanely 2025-07-22 15:49:33 -06:00
deno.jsonc rust webserver :3 (#6) 2025-04-20 23:35:37 +00:00
deno.lock rust webserver :3 (#6) 2025-04-20 23:35:37 +00:00
Dockerfile feat: permit changing the running port 2025-07-22 15:53:22 -06:00
eslint.config.mjs chore: Update Astro 2025-03-09 22:33:42 -06:00
FUNDING.yml chore: Update funding link 2023-12-02 16:01:46 -07:00
package-lock.json rust webserver :3 (#6) 2025-04-20 23:35:37 +00:00
package.json chore: Update Astro 2025-03-09 22:33:42 -06:00
README.md feat: permit changing the running port 2025-07-22 15:53:22 -06:00
test.sh chore: let compose.yml be modified sanely 2025-07-22 15:49:33 -06:00
tsconfig.json chore: Update Astro 2025-03-09 22:33:42 -06:00

portfolio

A basic web site to plug my projects and things, accessible at https://average.name via HTTPS or gemini://average.name via Gemini protocol.

Feel free to poke around, I guess.

Contributing

We use Astro to generate static HTML from templates, which we serve statically using Rocket.rs. Astro runs on Node, and our webserver uses Rust. Make sure both of these are installed on your system in order to build the webserver.

Install Dependencies

We'll need these for our build tools.

deno install --frozen
npm ci

Make changes

The contents of the /src directory gets compiled into static HTML assets.

The contents of the /public directory get copied into the output folder as-is.

The build result lives in /dist, and gets sent verbatim to the web host. Please do not modify these files directly.

The /functions directory contains the back-end logic, including serving static files and responding to WebFinger requests.

Build the site

This command will build static site assets to /dist and download runtime dependencies, without starting a webserver:

deno task build
cargo build --release

Run unit tests

To run unit tests with code coverage, use the test.sh script at the directory root. This will prompt you to install the necessary components.

To run unit tests without code coverage, run cargo test.

Run the site with Rust

This part is mainly for my own notes. Go run your own website! lol

After the site is built, this command will run a production-ready webserver:

cargo run --release

By default, the HTTP server runs on port 8787, and the Gemini capsule on port 1965.

Run the site with Docker Compose

This part is mainly for my own notes. Go run your own website! lol

docker compose up -d --no-deps --build

The HTTP servers run on port 8787, and the Gemini capsule on port 1965. You can modify these ports in compose.yaml, use a docker run command instead, or set the HTTP_PORT and GEMINI_PORT environment variables.

Certificates

For local development

If you're already developing a Gemini capsule locally, copy those certs into a new .certs directory in this project. Otherwise, create TLS certificates like so:

mkdir -p .certs
cd .certs
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 1103760 -nodes -subj '/CN=localhost' -addext 'subjectAltName=DNS:localhost'

Note that the -days arg in the command above sets the cert to expire sometime around the year 3024. This is sufficient for use with Gemini capsules or local development, but not much else.

Important

Change the /CN= and subjectAltName= parts to your expected internet domain when using in production. Consider also setting a shorter -days parameter, and setting a cron job to re-issue a new cert when this one expires.

The <project>/.certs directory must contain key.pem and cert.pem, or the server will panic.

Contributing

This project lives primarily at git.average.name. Read-only mirrors also exist on Codeberg and GitHub. Issues or pull requests should be filed at git.average.name. You may sign in or create an account directly, or use one of several OAuth 2.0 providers.