Skip to content

t2ym/hooked-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hooked App

Application Template for Thin Hook Preprocessor

Table of Contents

Features

  • App Template for Thin Hook Preprocessor
  • Apps
    • React app in TypeScript
    • Lit app in TypeScript
    • Lit app in JavaScript (default)

Getting Started

  1. Prerequisites
  • Linux OS (Ubuntu recommended)
  • Node.js (>=18 LTS)
  • GCC compiler (g++)
  • Google Chrome for Linux
  • openssl
  • nginx (for test)
  1. Clone the Repo
git clone https://github.com/t2ym/hooked-app
  1. Install Dependencies
cd hooked-app
npm run pack # download packages via npm pack
npm install 
npm install # optional dependencies
  1. Install Certificates

Optionally, you can copy trusted certificates for an existing thin-hook project to keys/demoCA/ instead of generating and installing them

npm run build:monitor # build the monitor mode server
# Input an empty password for the generated client certificate

google-chrome &
# Navigate to chrome://settings/certificates
# Import the generated demo root CA
#   hooked-app/keys/demoCA/demoCA.crt 
# at Authorities tab in Manage Certificates pane
# Import the generated client certificate 
#   hooked-app/keys/demoCA/client.pfx 
# at Your certificates tab in Manage Certificates pane

npm run start:monitor # start the monitor mode server
# Open https://localhost:8080/ and 
# Check if the certificate for the site is trusted
# Ctrl-C to shutdown the monitor server
  1. Test
# Start the monitor mode server
npm run start:monitor
  • In another terminal
npm run test:browser
# Chrome browser opens
# Click ▶ to start the test
# Close the browser to quit the test:browser script
# Non-interactive test
npm test
  1. Build
npm run build
  1. Start the Server
npm start
  1. Open the App
google-chrome https://localhost:8080/ &
  1. Open the empty skeleton of Validation Console
google-chrome https://localhost:8082/ &
# Select the client certificate

Customization & Configuration

Switch to the Lit + TypeScript app

  • Change the value of this.path.raw as raw-lit by setting the array index from 2 to 0

Change the app hostname

  • Set the environment variable SERVER_HOST as the server hostname in FQDN
    • If the variable is not defined, the default hostname is localhost

Change the app version

  • Update the value of this["generate-version"].version, or
  • Select the version generation scheme at this["generate-version"].scheme

Notes

  • The example modular access policies at config/policy/ are still experimental
    • Monolithic policies are recommended
  • The UI libraries at compat-lib are old and have to be updated

License

BSD-2-Clause