Code Monkey home page Code Monkey logo

sa-demo's Introduction

sbergile

Project setup (development)

npm install
npm run dev

Project setup (production)

To simplify project deployment, Docker is used.

Build an image:

docker build . -t sbergile

Run project:

docker run -p 443:3000 -v $(pwd)/data:/app/data -v $(pwd)/cert:/app/cert sbergile

Please make sure you have generated and installed ssl certificates (see below).

Certificates

Certificates are used to provide secured server-client connection.

Certificate generation

OpenSSL is used to generate CA, Server and Client keys and certificates.

Certificate generation config sample is provided in cert/ssl.conf, please review and edit it as neded; make sure you have set correct Common Name (CN) and Subject Alternative Names (alt_names section).

CA

openssl genrsa -out ca.key 2048
openssl req -new -sha256 -x509 -days 1095 -key ca.key -out ca.crt

Server

openssl genrsa -out server.key 2048
openssl req -new -key server.key -sha256 -out server.csr -config ssl.cnf
openssl x509 -req -days 1095 -in server.csr -CA ca.crt -CAkey ca.key -set_serial 0x`openssl rand 16 -hex` -sha256 -out server.pem -extfile ssl.cnf -extensions v3_req

Client

openssl genrsa -out client.key 2048
openssl req -new -key client.key -sha256 -out client.csr
openssl x509 -req -days 1095 -in client.csr -CA ca.crt -CAkey ca.key -set_serial 0x`openssl rand 16 -hex` -sha256 -out client.pem

On the last step you have to export client certificate in portable p12 format; you will be asked to set up an export password for it.

openssl pkcs12 -export -in client.pem -inkey client.key -name "DEMO ACCESS" -out client.p12

Certificate installation

You must place files server.key, server.pem and ca.crt in cert directory on the server side and install ca.crt and client.p12 to the client device (see below).

Windows

Select "Contol Panel" > "Internet options" > "Content" > "Certificates" win0

Use an "Import" button on the "Trusted root certificates" tab to open "Certificate import wizard" win1

Select ca.crt in "Open file" dialog win2

Press "Next" > "Next" and accept the security warning. win3 win4

Use an "Import" button on the "Personal" tab to open "Certificate import wizard" win5

Select client.p12 in "Open file" dialog win6

Enter the password for client.p12 win7

Press "Next" > "Next" win8

macOS

Open "Applications" > "Utilities" > "Keychain Access" and select "File" > "Import items" menu action.

mac0

Select ca.crt in "Open file" dialog

mac1

Double-click on imported certificate and set up preference "Trust" > "When using this certificate" > "Always trust" mac2

Use "File" > "Import items" again and select client.p12 in "Open file" dialog" mac3

Enter the password for client.p12 mac4

sa-demo's People

Contributors

vgolovnin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.