Skip to content
tinfoilhashPublic

About

verify any file with signatures from people you trust

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

80 Commits

Folders and files

Repository files navigation

hasheus

verify any file with signatures from people you trust. built using typescript, lit, and vite+.

development

vite+ is used to develop, test, lint, and build the site. see their docs for specifics not covered here.

prerequisites

  1. the global vp cli, which picks the node.js and pnpm versions in devEngines in package.json automatically:

    curl -fsSL https://vite.plus | bash
  2. nak, whose built-in relay is used for local development and testing.

dependencies

install dependencies:

vp install

config

configuration is done through environment variables. see vite's guide for full details.

.env.development is under version control to quickly bootstrap your development environment.

start

start a local relay with sample data:

vp run dev:relay

then, in another terminal, start the development server:

vp dev

tests

vitest runs the unit tests, which sit next to the modules they test (file.ts → file.test.ts). to run them once:

vp test

or to rerun them as files change:

vp test watch

to see how much of src/services they cover, with an html report in coverage:

vp test --coverage

ci adds the coverage table to each run's summary. components aren't counted, since the end-to-end tests cover them.

playwright runs the end-to-end tests in e2e against chromium, firefox, and webkit. it starts its own nak relay and development server on separate ports, so nak needs to be installed, but nothing needs to be running. install the browsers once:

vp exec playwright install

then run the tests:

vp run test:e2e

a slower test that hashes a file over 512 mb only runs when asked for:

E2E_LARGE_FILE=1 vp run test:e2e

code style & linting

oxfmt enforces a consistent code style, and oxlint enforces a level of code quality and checks types, both configured in vite.config.ts. stylelint is setup with the standard config to enforce css rules. it's recommended to install the vite+ extension pack and a stylelint integration for your editor, which format and fix on save.

to run all via the command line:

vp run check

or to fix what can be fixed automatically:

vp run check:fix

a pre-commit hook also fixes what it can in staged files. it's installed by vp install, and can be turned off in your clone:

vp hooks disable

deployment

release

when the development branch is ready for release, release it! is used to orchestrate the release process:

vp run release

once the release process is complete, merge the development branch into the main branch, which should always reflect the latest release.

build

to generate a production build via the command line:

vp build

this creates a dist directory with the files to be deployed.

docker

a Dockerfile is included that builds and serves the site:

  1. make sure you have docker installed and running. docker desktop is an easy way to get started on your own machine.

  2. build an image named hasheus from the Dockerfile:

    docker build --tag hasheus .

    this generates a production build of the site using .env.production. docker-static-website is used to serve the site.

  3. start a new container using the image, which serves the site on port 3000:

    docker run --interactive --tty --rm --init --publish 3000:3000 hasheus

if you're just looking to build the site, but not serve it, you can change the docker build command to export the dist directory from the docker image to your host machine:

docker build --target=export --output=dist --tag hasheus .

About

verify any file with signatures from people you trust

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages