Skip to content

biblemesh/toad-reader-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

649 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation (dev staging setup using docker compose)

  1. Copy .env-example to .env (this should work without modification)

  2. Populate other .env files from the other repos:

  3. Log into GitHub Packages using one of the following

    1. Using Personal Access Token

      1. Create GitHub classic personal access token with the read:packages scope and an expiration date a year from now. Unfortunately fine-grained is not supported
      2. Log into GitHub Packages using the GitHub personal access token as the password: docker login ghcr.io
    2. Using OAuth Token with GitHub CLI

      gh auth login --scopes read:packages
      gh auth token | docker login ghcr.io --password-stdin --username ${GITHUB_USERNAME}
      
  4. Build and start the caddy service: docker compose up -d caddy

  5. Pull other services: docker compose pull

  6. Build and start the services: docker compose up (note that the caddy service must be started first, otherwise you may receive an error from Docker about the network)

Proxy auto-configuration file

A file called proxy.pac is generated and hosted by Caddy, to simplify connecting to the services by domain name. To use it (assuming your Caddy service is accessible on localhost, set your proxy autoconfiguration URL to:

https://localhost:3128/proxy.pac

You will also need to add the rootCA.crt root certificate to your OS or browser's certificates manager. This certificate is available inside the biblemesh/shibboleth-common:1.0.0-dev Docker image, after this has been built.

Installation (standalone server, dev mode)

  1. nvm use
  2. npm install
  3. Copy .env-example.standalone to .env and update appropriately (DEV_NETWORK_IP for sure)
  4. Create a MySQL database using db_structure.sql and seeds.sql
  5. Change auto-increment for the book table to be some large number so as to not conflict with other devs (since the same aws s3 bucket is used)
  6. Complete AWS setup (needed for import of epub or audiobook + testing emails)

(Unless emails need to be tested, you may simply log in with dev@toadreader.com, grabbing the login code from the logs.)

Development

npm start

Running Tests

Available Commands

  • Run all tests:

    npm test
  • Run a specific test file (e.g., auth_routes.test.ts):

    npm test -- auth_routes
  • Watch mode:

    npm test -- --watch

Notes

  • Make sure your .env files are correctly populated.
  • Watch out for default setting assumptions (e.g., default language, video quality).
  • All global states should be reset between tests to prevent cross-contamination.

Demo

toadreader.com/demo

License

AGPL-3.0 (summary)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 85.4%
  • TypeScript 11.8%
  • HTML 1.9%
  • Other 0.9%