Skip to content

Commit b8290a8

Browse files
authored
Merge pull request #48 from Omniaevo/develop
Add Flatpak packaging and custom client ID per connection
2 parents c209e0b + fa38d91 commit b8290a8

File tree

6 files changed

+50
-4
lines changed

6 files changed

+50
-4
lines changed

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ npm run lint
4646

4747
## Compiles and minifies for production
4848

49-
**N.B.**: the build process includes **electron publish**, a *.env* file with the `GITHUB_TOKEN` environment variable set is required.
49+
**N.B.**: the build process includes **electron publish**, a _.env_ file with the `GITHUB_TOKEN` environment variable set is required.
5050

5151
```bash
5252
# Linux
@@ -60,6 +60,12 @@ npm run electron:build -- --mac -p always # With GitHub publish
6060
# Windows
6161
npm run electron:build -- --win # Without publish
6262
npm run electron:build -- --win -p always # With GitHub publish
63+
64+
# Flatpak
65+
# ⚠️ The flatpak and flatpak-builder packages need to be installed in order to build Flatpak bundles. ⚠️
66+
npm run electron:build -- --linux flatpak
67+
# Install and run the flatpak package
68+
flatpak install --user mqtt5-explorer-[VERSION]-linux-x86_64.flatpak && flatpak run com.omniaevo.mqtt5_explorer
6369
```
6470

6571
## Customize configuration

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mqtt5-explorer",
3-
"version": "1.15.0",
3+
"version": "1.16.0",
44
"private": false,
55
"license": "GPLv3",
66
"description": "A simple MQTT client that supports MQTT5 protocol.",

src/components/ConnectionForm.vue

+17
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,23 @@
125125
</div>
126126
</div>
127127
<v-divider class="mb-2" />
128+
<div row>
129+
<v-text-field
130+
v-bind:value="clientId"
131+
v-bind:outlined="outline"
132+
label="Current client ID"
133+
style="max-width: 35%"
134+
readonly
135+
disabled
136+
/>
137+
<v-text-field
138+
v-model="connectionData.clientId"
139+
v-bind:outlined="outline"
140+
label="Override client ID"
141+
clearable
142+
/>
143+
</div>
144+
<v-divider class="mb-2" />
128145
<div row>
129146
<v-combobox
130147
v-model="connectionData.topics"

src/models/ConnectionProperties.js

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ConnectionProperties {
1313
password = undefined;
1414
tls = false;
1515
caCert = undefined;
16+
clientId = undefined;
1617
clientCert = undefined;
1718
clientKey = undefined;
1819
caCertPath = undefined;
@@ -53,6 +54,7 @@ class ConnectionProperties {
5354
this.username = properties.username;
5455
this.password = properties.password;
5556
this.caCert = properties.caCert;
57+
this.clientId = properties.clientId;
5658
this.clientCert = properties.clientCert;
5759
this.clientKey = properties.clientKey;
5860
this.caCertPath = properties.caCertPath;

src/utils/Connection.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Connection {
5353

5454
connect(clientProps, onConnect, onClose) {
5555
const options = {
56-
clientId: clientProps.clientId,
56+
clientId: this.#properties.clientId || clientProps.clientId,
5757
protocolVersion: this.#properties.version,
5858
rejectUnauthorized: this.#properties.validateCertificate,
5959
keepalive: clientProps.keepalive,
@@ -63,6 +63,8 @@ class Connection {
6363
clean: true,
6464
};
6565

66+
console.log(options);
67+
6668
if (this.#properties.username) {
6769
options.username = this.#properties.username;
6870
}

vue.config.js

+20-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ module.exports = {
5454
nodeIntegration: true,
5555
contextIsolation: true,
5656
builderOptions: {
57-
appId: "com.omniaevo.${name}",
57+
appId: `com.omniaevo.${builderOpts.appStrings.executableName}`,
5858
artifactName: "${name}-${version}-${platform}-${arch}.${ext}",
5959
productName: "MQTT5 Explorer",
6060
publish: [...builderOpts.appRepos],
@@ -63,6 +63,25 @@ module.exports = {
6363
icon: "build/icon/",
6464
target: ["AppImage"],
6565
},
66+
flatpak: {
67+
runtime: "org.freedesktop.Platform",
68+
runtimeVersion: "23.08",
69+
sdk: "org.freedesktop.Sdk",
70+
base: "org.electronjs.Electron2.BaseApp",
71+
baseVersion: "23.08",
72+
category: builderOpts.appCategories.linux,
73+
description: builderOpts.appStrings.description,
74+
desktop: {
75+
StartupWMClass: builderOpts.appStrings.executableName,
76+
},
77+
finishArgs: [
78+
"--share=ipc",
79+
"--socket=x11",
80+
"--socket=pulseaudio",
81+
"--share=network",
82+
],
83+
synopsis: builderOpts.appStrings.synopsis,
84+
},
6685
appImage: {
6786
category: builderOpts.appCategories.linux,
6887
description: builderOpts.appStrings.description,

0 commit comments

Comments
 (0)