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 13b3d5b..0000000 Binary files a/src/assets/commoners.png and /dev/null differ 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)