Skip to content

Commit

Permalink
Updated deps
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmflynn committed Oct 10, 2023
1 parent 770def4 commit a188438
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
COMMONERS_AUTH_STRING = 'adsfsafasdfasdfasdfsafsadfdsafasdfsda'
SHARE_SECRET_KEY = '************************************'
PORT = 8080
6 changes: 3 additions & 3 deletions commoners.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const defineConfig = (o) => o

export default defineConfig({

icon: './src/assets/commoners.png',
// icon: './src/assets/logo.png',

electron: {
window: {
Expand All @@ -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
}),

Expand Down
8 changes: 3 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,19 @@
</head>

<body>
<div class="container">
<h1>Solidarity ✊</h1>
<hr/>
<nav>
<h1>Solidarity ✊</h1>
</nav>
<main>
<div id="console">
<ul id="messages"></ul>
</div>
<div id="sidebar">
<h3>Available Commands</h3>
<ul id="commands">
<li>Connect to Serial Device <button id="testSerialConnection">Run</button></li>
<li>Connect to Bluetooth Device <button id="testBluetoothConnection">Run</button></li>
</ul>
</div>
</main>
</div>
</body>
</html>
50 changes: 25 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Binary file removed src/assets/commoners.png
Binary file not shown.
37 changes: 24 additions & 13 deletions src/frontend/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,39 @@
color: #0f0f0f;
background-color: #f6f6f6;

box-sizing: border-box;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion src/services/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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}/`)
3 changes: 2 additions & 1 deletion src/services/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
HOST = os.getenv('HOST') or '127.0.0.1'
app.run(host=HOST, port = PORT)

0 comments on commit a188438

Please sign in to comment.