From a188438ed0a270cca9935d9d16807f478aad7166 Mon Sep 17 00:00:00 2001 From: Garrett Date: Tue, 10 Oct 2023 11:58:50 -0700 Subject: [PATCH] Updated deps --- .env | 2 +- commoners.config.ts | 6 ++--- index.html | 8 +++--- package-lock.json | 50 ++++++++++++++++++------------------ package.json | 8 +++--- src/assets/commoners.png | Bin 6577 -> 0 bytes src/frontend/styles.css | 37 ++++++++++++++++---------- src/services/node/index.js | 3 ++- src/services/python/main.py | 3 ++- 9 files changed, 64 insertions(+), 53 deletions(-) delete mode 100644 src/assets/commoners.png diff --git a/.env b/.env index 54220b3..3acf885 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -COMMONERS_AUTH_STRING = 'adsfsafasdfasdfasdfsafsadfdsafasdfsda' +SHARE_SECRET_KEY = '************************************' PORT = 8080 \ No newline at end of file diff --git a/commoners.config.ts b/commoners.config.ts index 24f5cdf..86ca8fa 100644 --- a/commoners.config.ts +++ b/commoners.config.ts @@ -22,7 +22,7 @@ const defineConfig = (o) => o export default defineConfig({ - icon: './src/assets/commoners.png', + // icon: './src/assets/logo.png', electron: { window: { @@ -36,8 +36,8 @@ export default defineConfig({ bluetoothPlugin, serialPlugin, localServicesPlugin(null, (ip, env) => { - const isLocalIP = process.env.LOCAL_IP === ip - const hasAuthString = process.env.COMMONERS_AUTH_STRING === env.COMMONERS_AUTH_STRING + const isLocalIP = ip === 'localhost' + const hasAuthString = process.env.SHARE_SECRET_KEY === env.SHARE_SECRET_KEY return hasAuthString || isLocalIP }), diff --git a/index.html b/index.html index fdd3e87..ada7b97 100644 --- a/index.html +++ b/index.html @@ -20,21 +20,19 @@ -
-

Solidarity ✊

-
+
    -
    diff --git a/package-lock.json b/package-lock.json index c2978a7..043aa93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,10 +18,10 @@ "@capacitor/cli": "^5.3.0", "@capacitor/core": "^5.3.0", "@capacitor/ios": "^5.3.0", - "@commoners/bluetooth": "0.0.0", - "@commoners/local-services": "0.0.0", - "@commoners/serial": "0.0.0", - "commoners": "0.0.21" + "@commoners/bluetooth": "0.0.1", + "@commoners/local-services": "0.0.2", + "@commoners/serial": "0.0.1", + "commoners": "0.0.22" } }, "node_modules/@ampproject/remapping": { @@ -2019,15 +2019,15 @@ } }, "node_modules/@commoners/bluetooth": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@commoners/bluetooth/-/bluetooth-0.0.0.tgz", - "integrity": "sha512-42szBrZBMxxXM6nW1D7dZ6xg42YjrkiKWvrBJ9bafQ71JPHvpjVM5i55pUQ98tQV76h2QmdtRZME5S7zF1LQsA==", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@commoners/bluetooth/-/bluetooth-0.0.1.tgz", + "integrity": "sha512-EEZE855iek3eBUH8wUvBWhAnFckMqeFqzuffgMWYt9LiJyTXtbfaGOvoTY9kcDJX7UY8P37IE+8ALHwC5gB4fg==", "dev": true }, "node_modules/@commoners/local-services": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@commoners/local-services/-/local-services-0.0.0.tgz", - "integrity": "sha512-y5Cadb8T/vLnFvWTCRBZW4K+GxOokTByE2Lg0vcgcb81vfCy9XWYYO1G6ZLPPcDSjnEngLZAq8aIxRfLxfcdgA==", + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@commoners/local-services/-/local-services-0.0.2.tgz", + "integrity": "sha512-ecuuApoCdrrxoD6wYGKKGRGn8KWJnHz02/6u47ywSV1FmiL8CeUcspTSrGnyCh1oMWvpiShdGM0aA162doUW4w==", "dev": true }, "node_modules/@commoners/node-demo": { @@ -2035,9 +2035,9 @@ "link": true }, "node_modules/@commoners/serial": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@commoners/serial/-/serial-0.0.0.tgz", - "integrity": "sha512-I2CSdm56rPD8Kon5LsxsvqpEQ2kIDweHh3rYi2fUgEKYRUB0uQsHflUd7IXeL0w2kAaKnnKYZwzibM4thq6vjA==", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@commoners/serial/-/serial-0.0.1.tgz", + "integrity": "sha512-FYk+WPhFA95jctVC7PE6rBxr0LdVI8dP5qdJg08mDSVQxhLNISBb8JRPJbRbh0RZOYyMI6SQSYzOWetPFEPHgg==", "dev": true }, "node_modules/@cspotcode/source-map-support": { @@ -4294,9 +4294,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001546", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz", - "integrity": "sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==", + "version": "1.0.30001547", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001547.tgz", + "integrity": "sha512-W7CrtIModMAxobGhz8iXmDfuJiiKg1WADMO/9x7/CLNin5cpSbuBjooyoIUVB5eyCc36QuTVlkVa1iB2S5+/eA==", "dev": true, "funding": [ { @@ -4624,9 +4624,9 @@ } }, "node_modules/commoners": { - "version": "0.0.21", - "resolved": "https://registry.npmjs.org/commoners/-/commoners-0.0.21.tgz", - "integrity": "sha512-T0oEvopnoz7/ZAUI6aGfQYQ9PKlAXvi/KTl7Rh2Rs+guJDu9grTEk2HhjHBNG91feSpJ5eT8c2BNV1FOIL3Now==", + "version": "0.0.22", + "resolved": "https://registry.npmjs.org/commoners/-/commoners-0.0.22.tgz", + "integrity": "sha512-dTXzCdsL+9Qa5Joyt5GH4YNwszHWHvY8NCd9BPobzkYRFKLj2mYYBeoIMHm9R5mn2KH/fP0RluaDer5XGtMuyQ==", "dev": true, "dependencies": { "@electron-toolkit/tsconfig": "^1.0.1", @@ -5844,9 +5844,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.546", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.546.tgz", - "integrity": "sha512-cz9bBM26ZqoEmGHkdHXU3LP7OofVyEzRoMqfALQ9Au9WlB4rogAHzqj/NkNvw2JJjy4xuxS1me+pP2lbCD5Mfw==", + "version": "1.4.549", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.549.tgz", + "integrity": "sha512-gpXfJslSi4hYDkA0mTLEpYKRv9siAgSUgZ+UWyk+J5Cttpd1ThCVwdclzIwQSclz3hYn049+M2fgrP1WpvF8xg==", "dev": true }, "node_modules/electron/node_modules/@types/node": { @@ -9058,9 +9058,9 @@ "dev": true }, "node_modules/node-abi": { - "version": "3.47.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.47.0.tgz", - "integrity": "sha512-2s6B2CWZM//kPgwnuI0KrYwNjfdByE25zvAaEpq9IH4zcNsarH8Ihu/UuX6XMPEogDAxkuUFeZn60pXNHAqn3A==", + "version": "3.48.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.48.0.tgz", + "integrity": "sha512-uWR/uwQyVV2iN5+Wkf1/oQxOR9YjU7gBclJLg2qK7GDvVohcnY6LaBXKV89N79EQFyN4/e43O32yQYE5QdFYTA==", "dev": true, "dependencies": { "semver": "^7.3.5" diff --git a/package.json b/package.json index 75f89ab..9d6bbe0 100644 --- a/package.json +++ b/package.json @@ -37,9 +37,9 @@ "@capacitor/cli": "^5.3.0", "@capacitor/core": "^5.3.0", "@capacitor/ios": "^5.3.0", - "@commoners/bluetooth": "0.0.0", - "@commoners/serial": "0.0.0", - "@commoners/local-services": "0.0.0", - "commoners": "0.0.21" + "@commoners/bluetooth": "0.0.1", + "@commoners/serial": "0.0.1", + "@commoners/local-services": "0.0.2", + "commoners": "0.0.22" } } diff --git a/src/assets/commoners.png b/src/assets/commoners.png deleted file mode 100644 index 13b3d5b105b5984ec1538b568b139ecdb44a066a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6577 zcmZWuRan%4v;A$dz|vjPDcv9~DJd=GB3%mtBB8Q03P?yvBOr|+NJuRm(nt!rAgOdn z2+QC9{qB9b^K#~#Z=U91=9@V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V zK|s=kVB(arn&v!4F1^;)L~94GBnm~Ubtsp=A&QS?xUyGgKadMkP~S>a;TF6mvL_z; z&R7=7N4vDZ?VV^}Bg{;^w|kV(;*a$cuq;JtAWp}aoF0Dm5p1s00nj?!p!712P_@ie z@uog0!9q))hFGbG9lkb1SjJ7_An<{rC(&)ARm*<|LN=jq_Fo%v! zM4S*4waiD>p2&rsQl7`BIWW6Pz2~ zv0@a^!6u^WasbPPDX*}d_bazSP<`uB$Nt)t@K9zKChpsfz3)~@y#<;hC$it=2E_v% zr-G1iwLqy$9pLAYS)Nk??}djAnBD}V2ARnCa;*y_G(kn*tL$6A@wwK!BA}7qXE-xB zo}&Brqysopr|m!h5^|h^qQYK<++8<;_X~Pm^I(GRxNxa${f4n-O=hJP+ySeN1)akg zUeI9|C(mvV(ozGPjoh&v&6kWyR3g<<2w}5({CBozCH5(yquWJwOb^9ArFKU5O=8Gd4Ci<5 zq^4J$kYVii-K&?T-<@8M4@QWx@g|;`u`z7fj_0ou+=w}_Mhs$;vW_~Y?vDc_>|lwkP-=o$l?;u2 zdGK*oXDGG*;)j-tr0|Nn=(G4S_uhxK$DLo^`7vqp$a0>r zzTRhJM&=huu+TH-*#BY0VS^K|DqoF-%tzsNN^cAiy(-Ni#M3u1#AvAh`IOxSPyc%U zNZ#kfNo%IVr@l!1WsZioZ|{#z`a032_L+rF=*oSWi-CWB#peHd8u^g_vouuE>!HcZ Wfh=SKc;)|kD>@nm>NRSp@c#gL?(KX4 diff --git a/src/frontend/styles.css b/src/frontend/styles.css index 96d450b..0a598cd 100644 --- a/src/frontend/styles.css +++ b/src/frontend/styles.css @@ -7,8 +7,6 @@ color: #0f0f0f; background-color: #f6f6f6; - box-sizing: border-box; - font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; @@ -16,12 +14,32 @@ -webkit-text-size-adjust: 100%; } +* { + box-sizing: border-box; +} + [disabled] { opacity: 0.5; pointer-events: none; } +html, body { + margin: 0; +} + + +body { + margin: 0; + padding-top: 10vh; + padding: 50px; + display: flex; + flex-direction: column; + width: 100vw; + height: 100vh; +} + + main { display: flex; justify-content: center; @@ -65,15 +83,6 @@ main > * { font-size: 90%; overflow-y: auto; } - -.container { - margin: 0; - padding-top: 10vh; - padding: 50px; - display: flex; - flex-direction: column; -} - .logo { height: 6em; padding: 1.5em; @@ -100,11 +109,13 @@ a:hover { color: #535bf2; } +nav { + margin-bottom: 20px; +} h1 { margin: 0; - margin-bottom: 10px; - padding-bottom: 20px; + padding-bottom: 10px; border-bottom: 1px solid gainsboro; } diff --git a/src/services/node/index.js b/src/services/node/index.js index b150d59..68bf02e 100644 --- a/src/services/node/index.js +++ b/src/services/node/index.js @@ -11,6 +11,7 @@ const cfg = { }; const port = process.env.PORT || 3000 +const host = process.env.HOST || '127.0.0.1' const server = cfg.ssl ? createServer({ cert: readFileSync('/path/to/cert.pem'), @@ -39,4 +40,4 @@ wss.on('connection', function connection(ws) { }); }); -console.log(`Server running at http://localhost:${port}/`) +console.log(`Server running at http://${host}:${port}/`) diff --git a/src/services/python/main.py b/src/services/python/main.py index 77bc27a..ee38a33 100644 --- a/src/services/python/main.py +++ b/src/services/python/main.py @@ -33,4 +33,5 @@ def post(): if __name__ == "__main__": env_port = os.getenv('PORT') PORT = int(env_port) if env_port else 8080 - app.run(host='0.0.0.0', port = PORT) \ No newline at end of file + HOST = os.getenv('HOST') or '127.0.0.1' + app.run(host=HOST, port = PORT)