From 2aac1784082dd4191d7174d7606e4aa1324b1fb3 Mon Sep 17 00:00:00 2001 From: CynthiaRutledge <57842886+CynthiaRutledge@users.noreply.github.com> Date: Sat, 16 Nov 2019 11:37:39 -0800 Subject: [PATCH] Add files via upload --- Dockerfile | 16 ++++++++++++ Procfile | 1 + README.md | 23 ++++++++++++++++ data.js | 52 ++++++++++++++++--------------------- server.cert | 17 ++++++++++++ server.js | 12 ++++++--- server.key | 28 ++++++++++++++++++++ static/css/main.pcss | 3 +-- views/accounts.pug | 4 +-- views/landing.pug | 6 +++-- views/partials/footer.pug | 6 +++-- views/partials/head.pug | 3 +-- views/transfer.complete.pug | 22 +++++++++++++--- 13 files changed, 147 insertions(+), 46 deletions(-) create mode 100644 Dockerfile create mode 100644 Procfile create mode 100644 README.md create mode 100644 server.cert create mode 100644 server.key diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8da5e42 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM node:10 +WORKDIR /usr/src/app +# Install app dependencies +# A wildcard is used to ensure both package.json AND package-lock.json are copied +# where available (npm@5+) +COPY package*.json ./ + +RUN npm install +# If you are building your code for production +# RUN npm ci --only=production + +COPY . . + +EXPOSE 8080 + +CMD [ "node", "server.js" ] diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..5ec9cc2 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: node index.js \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..5ea0a99 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +Fake bank for messing with refund scammers. + +Running in Docker: + +``` +docker build -t fake-bank . +docker run -d -p 192.168.181.1:443:8080 fake-bank:latest +``` + +You'll need to replace `192.168.181.1` with whatever interface your virtual machine guest is running on. + +Edit your Windows guest host file so that `njcreditunionmutual.com` resolves to `192.168.181.1` (or whatever). +https://www.groovypost.com/howto/edit-hosts-file-windows-10/ + +Visit the domain, copy the cert to a file, and trust it in the guest. +http://www.hackaapl.com/how-to-trust-self-signed-certificates-in-windows-7/ + +Cert was generated with: + +``` +openssl req -subj "/CN=njcreditunionmutual.com" -nodes -new -x509 -keyout server.key -out server.cert -days 3650 +``` + diff --git a/data.js b/data.js index eaedea3..13c0d7e 100644 --- a/data.js +++ b/data.js @@ -4,31 +4,31 @@ accounts = [{ balance: 1240.36, }, { - nickname: 'AARP Platinum Credit Card', + nickname: 'Standard Credit Card', number: '2579', - balance: 19001, + balance: 2025.25, }, { nickname: 'High-Interest Savings', number: '2580', - balance: -1240.36, + balance: 3250.36, }, { - nickname: 'Fixed-Rate War Bond', + nickname: 'Fixed-Rate 5 Year Term CD', number: '9704', - balance: 1240.36, + balance: 5000.00, }] transactions = [{ description: 'APL*ITUNES.COM/BILL', amount: -50, - date: new Date(2019, 6, 22), + date: new Date(2019, 10, 7), account: 0 }, { description: 'Dunkin\' Donuts', amount: -25, - date: new Date(), + date: new Date(2019, 10, 4), account: 0 }, { @@ -39,32 +39,32 @@ transactions = [{ }, { description: `XFER FROM ACCT x${accounts[2].number}`, - amount: 200, - date: new Date(), + amount: 250, + date: new Date(2019, 10, 1), account: 0 }, { - description: 'Cheque #103 Deposit', + description: 'Check Deposit', amount: 33.10, - date: new Date(), - account: 0 + date: new Date(2019, 9, 20), + account: 2 }, { - description: 'Social Security', - amount: 1392.19, - date: new Date(), - account: 2 + description: 'Check #103 Withdrawal', + amount: -1392.19, + date: new Date(2019, 9, 16), + account: 0 }, { description: 'QVC*SHOPPING/BILL', amount: -140.50, - date: new Date(), + date: new Date(2019, 9, 10), account: 0 }, { description: 'Netflix', amount: -12.99, - date: new Date(), + date: new Date(2019, 8, 25), account: 0 }] @@ -72,19 +72,13 @@ transfers = [{ origin: 2, destination: 0, amount: 250, - date: new Date() -}, -{ - origin: 2, - destination: 0, - amount: 250, - date: new Date() + date: new Date(2019, 10, 1) }, { - origin: 2, - destination: 0, - amount: 250, - date: new Date() + origin: 0, + destination: 3, + amount: 5000, + date: new Date(2019, 7, 22) }] module.exports = (() => ({ diff --git a/server.cert b/server.cert new file mode 100644 index 0000000..971c409 --- /dev/null +++ b/server.cert @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICwDCCAagCCQC8BPqISsqq7zANBgkqhkiG9w0BAQsFADAiMSAwHgYDVQQDDBdu +amNyZWRpdHVuaW9ubXV0dWFsLmNvbTAeFw0xOTExMTYxOTE0NDZaFw0yOTExMTMx +OTE0NDZaMCIxIDAeBgNVBAMMF25qY3JlZGl0dW5pb25tdXR1YWwuY29tMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApFdLJzdpdfS301iSO7lPRVOqXO+u +BsfR5cqwKUa6QOoPXQNI9ffT8HYxWNy7GdBck4LCSrNOjxPiC8nWW5vhERGIvHZW +LvOw9zc0r3AfbxyEDziWwQDGaujXehEEVOu+Q7nJFt63P1hrOhaL1cZrsw25bcCE +POZZUmLMBIidPdr+B6hHSVwPa5tvcdBVmxin75+DO+0aD4aVY/lBPctZG17/2GRB +/JxX9eCQSFA/aDSPfrI9siYpaYPr8j29FY/fVF6smdVz5Yc8nbtuab5uc7C1u2OS +tyOw9iVCkAZrY8EWcVkqPmKq7avigo2PLe9gXiYljTXnhwxv2T5QlAySvwIDAQAB +MA0GCSqGSIb3DQEBCwUAA4IBAQApRkKyyUj5ET3uTvqM8jsesKHfzMWRKDZj2Y+r +zPMsHRUEhaNF3CgOEnGXrMKFiE4l7+JbWzGvY6wyw/gSGmPs2dFeoVYTfW64GRB3 +VsHeJ3dlRWlov1mmIwtmqkixQWVcEyJP7bTOhLxl6vOA0aS04XeT5g1JV2BHVf5A +Il0dUxMvf5+lMTEMDRVG26DUR1QWD4pA2DcmYKqaWWql0189O+5ZtNCv98DMs/8k +OAGBpetXch2hdCqGQFdbI9mV9f1QWIcj4Mx5J96/B5flcm2Gin5y5Zd1SlvWKzai +cmgwFBcqUUZXjY0n63i4eh+1lG5KDfxGJ6V//lV3ZxgWak2r +-----END CERTIFICATE----- diff --git a/server.js b/server.js index 9087bff..630ffed 100644 --- a/server.js +++ b/server.js @@ -2,6 +2,8 @@ const port = process.env['PORT'] || 8080 const express = require('express') const path = require('path') +const https = require('https') +const fs = require('fs') const app = express() @@ -45,7 +47,6 @@ app.get('/', function (req, res) { }) }) -app.use('/admin', require('./apps/admin')) app.use('/a', require('./apps/userauth')) app.use('/b', require('./apps/banking')) app.use('/api', require('./apps/api')) @@ -64,5 +65,10 @@ app.use((err, req, res, next) => { }) }) -app.listen(port) -console.log(`Server is listening! Port: ${port}`) +https.createServer({ + key: fs.readFileSync('server.key'), + cert: fs.readFileSync('server.cert') +}, app).listen(port, () => { + console.log(`Https server is listening! Port: ${port}`) +}) + diff --git a/server.key b/server.key new file mode 100644 index 0000000..2e3ab44 --- /dev/null +++ b/server.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCkV0snN2l19LfT +WJI7uU9FU6pc764Gx9HlyrApRrpA6g9dA0j199PwdjFY3LsZ0FyTgsJKs06PE+IL +ydZbm+EREYi8dlYu87D3NzSvcB9vHIQPOJbBAMZq6Nd6EQRU675DuckW3rc/WGs6 +FovVxmuzDbltwIQ85llSYswEiJ092v4HqEdJXA9rm29x0FWbGKfvn4M77RoPhpVj ++UE9y1kbXv/YZEH8nFf14JBIUD9oNI9+sj2yJilpg+vyPb0Vj99UXqyZ1XPlhzyd +u25pvm5zsLW7Y5K3I7D2JUKQBmtjwRZxWSo+Yqrtq+KCjY8t72BeJiWNNeeHDG/Z +PlCUDJK/AgMBAAECggEAQGzoTWtvsIpLNlNWoIs5BFiURPLBKm9TXd5jyQqtIZ2g +gDo1dBe/wljTZ57AypHgeQOd32MDvRtyVmS94BPv250gGaHaj3WBPqkpwk0WRZzM +OJtanjcLkgXN01CwfgodALfomUqeU/r5rkAAecHbnsoWk2wRaz5ybdXFXVGhMwny +EHA84BGemGfXNehOSawRSZp6WsJ0DKPF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static/css/main.pcss index 977ba31..019d655 100644 --- a/static/css/main.pcss +++ b/static/css/main.pcss @@ -47,8 +47,7 @@ main#landing { --background-size: 215px; - background-image: url('/fancybg.png'); - background-size: var(--background-size) var(--background-size); + background-color: #E68D6E; height: 100%; } diff --git a/views/accounts.pug b/views/accounts.pug index 908c946..902f067 100644 --- a/views/accounts.pug +++ b/views/accounts.pug @@ -24,10 +24,10 @@ include partials/header.pug - else .text-xl.flex.flex-row.justify-between span Available Credit - span $ #{balanceString(account.balance)} + span $ #{balanceString(10000-account.balance)} .flex.flex-row.justify-between span Outstanding Balance - span $ #{balanceString(1000-account.balance)} + span $ #{balanceString(account.balance)} .flex.flex-col.w-full.text-center.mt-2(class='md:flex-row') a.button.flex-grow.green(href=`/b/transfer?account=${account.number}`) Transfer diff --git a/views/landing.pug b/views/landing.pug index 1a04fec..0d15f23 100644 --- a/views/landing.pug +++ b/views/landing.pug @@ -21,7 +21,7 @@ main#landing section.card.text-center.p-0 header h1.text-4xl= siteTitle - h2.text-lg Where all your banking dreams come true. + h2.text-lg The feeling is Mutual. Bank on it. article form.text-left(method='post' action='/a/login') - if(error) @@ -37,7 +37,9 @@ main#landing footer.text-left h4.normal-case.mb-2.underline a(href='/a/recover') Forgot your password? - h4.text-gray-500 Microsoft will never ask for your banking details..... + h4.text-gray-500 + span Warning: Microsoft will never ask you to log into your bank. + a Learn more. include partials/footer.pug include partials/foot.pug \ No newline at end of file diff --git a/views/partials/footer.pug b/views/partials/footer.pug index d8946c8..8a75c28 100644 --- a/views/partials/footer.pug +++ b/views/partials/footer.pug @@ -1,9 +1,11 @@ footer.mt-auto.py-5.px-2.bg-gray-100 div.container.text-center - p All content on this site copyright © 2019 + p Copyright © 2019 strong= siteTitle | . All rights reserved. p a(href='/') Home | | - a(href='/admin') Employees + a(href='/rates') Rates + | | + a(href='/contact') Contact diff --git a/views/partials/head.pug b/views/partials/head.pug index b642948..880384c 100644 --- a/views/partials/head.pug +++ b/views/partials/head.pug @@ -15,7 +15,7 @@ doctype html head - - const siteTitle = 'Bank of Abogaca' + const siteTitle = 'New Jersey Credit Union Mutual Bank LLC' if(pageTitle) //- page title already exists pageTitle = `${pageTitle} | ${siteTitle}` @@ -30,7 +30,6 @@ doctype html meta(http-equiv='X-UA-Compatible' content='ie=edge') link(rel='stylesheet' href='/css/main.css') - link(rel='stylesheet' href='https://i.icomoon.io/public/temp/42d0a687e8/Bankogaca/style.css') style. html { diff --git a/views/transfer.complete.pug b/views/transfer.complete.pug index 744b90c..aa9cf42 100644 --- a/views/transfer.complete.pug +++ b/views/transfer.complete.pug @@ -3,16 +3,29 @@ include partials/header.pug - origin = accounts.find((acct) => acct.number === query.origin) + originIndex = accounts.indexOf(origin) destination = accounts.find((acct) => acct.number === query.destination) + destinationIndex = accounts.indexOf(destination) + amt = +query.amount - transfers.push({ - origin: accounts.indexOf(accounts.find((acc) => +acc.number === +query.origin)), - destination: accounts.indexOf(accounts.find((acc) => +acc.number === +query.destination)), - amount: +query.amount, + transfers.unshift({ + origin: originIndex, + destination: destinationIndex, + amount: amt, memo: query.memo, date: new Date() }) + transactions.unshift({ + description: `XFER FROM ACCT x${origin.number}`, + amount: amt, + date: new Date(), + account: destinationIndex + }) + + origin.balance = origin.balance - amt + destination.balance = destination.balance + amt + div.container(class='my-5 mx-auto') div.columns div.column.is-two-fifths @@ -36,6 +49,7 @@ div.container(class='my-5 mx-auto') td= query.memo a.button.is-info.is-fullwidth(href="/b/transfer") Make Another Transfer + a.button.is-info.is-fullwidth(href="/b/accounts") Accounts div.column h1.title Transfer History