Skip to content

Commit 8b98fab

Browse files
committed
Major cleanup for version 1.0
This cleans up a lot of code, enhances UI/UX and adds a lot of features that are necessary for a 1.0 release. Signed-off-by: Michael Friese <mfriese@microsoft.com>
1 parent b8ac0fd commit 8b98fab

File tree

142 files changed

+11271
-3731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+11271
-3731
lines changed

.github/actions/wails/action.yaml

Lines changed: 9 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ runs:
164164
cache: ${{ inputs.build-cache }}
165165
cache-dependency-path: 'go.sum'
166166
go-version: ${{ inputs.go-version }}
167+
- name: Pull NSIS
168+
if: runner.os == 'Windows'
169+
run: |
170+
winget install NSIS.NSIS --silent --accept-package-agreements --accept-source-agreements
171+
shell: bash
167172
- name: Install Garble
168173
if: inputs.build-obfuscate == 'true'
169174
run: go install mvdan.cc/garble@latest
@@ -194,84 +199,16 @@ runs:
194199
- name: Build App
195200
if: inputs.build == 'true'
196201
working-directory: ${{ inputs.app-working-directory }}
197-
run: OS=${{inputs.build-platform}} wails3 task build
198-
shell: bash
199-
- name: Add macOS perms
200-
if: inputs.build == 'true' && runner.os == 'macOS'
201-
working-directory: ${{ inputs.app-working-directory }}
202-
run: chmod +x bin/ig-desktop
203-
shell: bash
204-
- name: Add Linux perms
205-
if: inputs.build == 'true' && runner.os == 'Linux'
206-
working-directory: ${{ inputs.app-working-directory }}
207-
run: chmod +x bin/ig-desktop
202+
run: OS=${{inputs.build-platform}} PRODUCTION=true wails3 task package
208203
shell: bash
209-
# Package and Sign MacOS
210-
- name: Import Code-Signing Certificates for macOS
211-
if: runner.os == 'macOS' && inputs.sign != 'false' && startsWith(github.ref, 'refs/tags/')
212-
uses: Apple-Actions/import-codesign-certs@v1
213-
with:
214-
keychain-password: ${{ inputs.sign-macos-apple-password }}
215-
p12-file-base64: ${{ inputs.sign-macos-app-cert }}
216-
p12-password: ${{ inputs.sign-macos-app-cert-password }}
217-
- name: Import Code-Signing Certificates for macOS Installer
218-
if: runner.os == 'macOS' && inputs.sign != 'false' && startsWith(github.ref, 'refs/tags/')
219-
uses: Apple-Actions/import-codesign-certs@v1
220-
with:
221-
keychain-password: ${{ inputs.sign-macos-apple-password }}
222-
p12-file-base64: ${{ inputs.sign-macos-installer-cert }}
223-
p12-password: ${{ inputs.sign-macos-installer-cert-password }}
224-
create-keychain: false
225-
- name: Sign our macOS binary
226-
if: runner.os == 'macOS' && inputs.sign != 'false' && startsWith(github.ref, 'refs/tags/')
227-
shell: bash
228-
working-directory: ${{ inputs.app-working-directory }}
229-
env:
230-
APPLE_PASSWORD: ${{ inputs.sign-macos-apple-password }}
231-
run: |
232-
echo "Signing Package"
233-
gon -log-level=info ./build/darwin/gon-sign.json
234204
- name: Build .app zip file
235205
if: runner.os == 'macOS'
236206
working-directory: ${{ inputs.app-working-directory }}
237207
shell: bash
238208
run: |
239-
ditto -c -k --keepParent ${{ inputs.app-working-directory }}/build/bin/Inspektor\ Gadget\ Desktop.app ${{ inputs.app-working-directory }}/build/bin/${{inputs.build-name}}.app.zip
240-
- name: Building Installer
241-
if: runner.os == 'macOS' && inputs.sign != 'false' && inputs.sign-macos-installer-id != '' && startsWith(github.ref, 'refs/tags/')
242-
shell: bash
243-
working-directory: ${{ inputs.app-working-directory }}
244-
run: |
245-
productbuild --sign '${{inputs.sign-macos-installer-id}}' --component ${{ inputs.app-working-directory }}/build/bin/Inspektor\ Gadget\ Desktop.app /Applications ${{ inputs.app-working-directory }}/build/bin/${{inputs.build-name}}.pkg
246-
- name: Building Installer
247-
if: runner.os == 'macOS' && inputs.sign-macos-installer-id == '' && startsWith(github.ref, 'refs/tags/')
248-
shell: bash
249-
working-directory: ${{ inputs.app-working-directory }}
250-
run: |
251-
productbuild --component ${{ inputs.app-working-directory }}/build/bin/Inspektor\ Gadget\ Desktop.app /Applications ${{ inputs.app-working-directory }}/build/bin/${{inputs.build-name}}.pkg
252-
- name: Notarising Installer and zip
253-
if: runner.os == 'macOS' && inputs.sign != 'false' && startsWith(github.ref, 'refs/tags/')
254-
shell: bash
255-
working-directory: ${{ inputs.app-working-directory }}
256-
env:
257-
APPLE_PASSWORD: ${{ inputs.sign-macos-apple-password }}
258-
run: |
259-
gon -log-level=info ${{ inputs.app-working-directory }}/build/darwin/gon-notarize.json
260-
# Windows signing
261-
- name: Sign Windows binaries
262-
shell: powershell
263-
if: runner.os == 'Windows' && inputs.sign != 'false' && inputs.sign-windows-cert != ''
264-
working-directory: ${{ inputs.app-working-directory }}
265-
run: |
266-
echo "Creating certificate file"
267-
New-Item -ItemType directory -Path certificate
268-
Set-Content -Path certificate\certificate.txt -Value '${{ inputs.sign-windows-cert }}'
269-
certutil -decode certificate\certificate.txt certificate\certificate.pfx
270-
echo "Signing our binaries"
271-
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ inputs.sign-windows-cert-password }}' .\build\bin\${{inputs.build-name}}.exe
272-
echo "Signing Installer" & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/signtool.exe' sign /fd sha256 /tr http://ts.ssl.com /f certificate\certificate.pfx /p '${{ inputs.sign-windows-cert-password }}' .\build\bin\${{inputs.build-name}}-amd64-installer.exe
273-
274-
# Upload build assets
209+
ditto -c -k --keepParent ${{ inputs.app-working-directory }}/bin/ig-desktop.app ${{ inputs.app-working-directory }}/bin/${{inputs.build-name}}.app.zip
210+
rm -rf ${{ inputs.app-working-directory }}/bin/ig-desktop.app
211+
rm ${{ inputs.app-working-directory }}/bin/ig-desktop
275212
- uses: actions/upload-artifact@v4
276213
if: inputs.package == 'true'
277214
with:

.github/workflows/build.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
- name: 'ig-desktop-win-amd64.exe'
2828
platform: 'windows'
2929
os: 'windows-latest'
30-
# - name: 'ig-desktop-macos'
31-
# platform: 'darwin'
32-
# os: 'macos-latest'
30+
- name: 'ig-desktop-macos'
31+
platform: 'darwin'
32+
os: 'macos-latest'
3333
runs-on: ${{ matrix.build.os }}
3434
steps:
3535
- name: Checkout
@@ -39,11 +39,12 @@ jobs:
3939
- name: Build wails
4040
uses: ./.github/actions/wails
4141
id: build
42+
continue-on-error: true
4243
with:
4344
build-name: ${{ matrix.build.name }}
4445
build-platform: ${{ matrix.build.platform }}
4546
build-tags: "withoutebpf"
4647
package: true
47-
go-version: '1.24'
48+
go-version: '1.25'
4849
node-version: '23.5.0'
4950
wails-build-webview2: "embed"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ build/bin
55
node_modules
66
frontend/dist
77
frontend-x
8+
.task

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
## About
66

7-
[Inspektor Gadget](https://inspektor-gadget.io) Desktop App bases on [wails](https://wails.io) and
7+
[Inspektor Gadget](https://inspektor-gadget.io) Desktop App based on [wails](https://wails.io) and
88
[Svelte](https://svelte.dev). Available for Windows, Mac and Linux.
99

1010
## Status
1111

12-
This project is in it's really early stages. Expect rough edges and bugs, but please let us know about them.
12+
This project is in its really early stages. Expect rough edges and bugs, but please let us know about them.

app.go

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,50 @@ package main
22

33
import (
44
"context"
5+
6+
"github.com/wailsapp/wails/v3/pkg/application"
7+
8+
"ig-frontend/internal/api/handlers"
9+
"ig-frontend/internal/artifacthub"
10+
"ig-frontend/internal/environment"
11+
"ig-frontend/internal/gadget"
512
)
613

714
// App struct
815
type App struct {
9-
ctx context.Context
16+
ctx context.Context
17+
handler *handlers.Handler
1018
}
1119

1220
// NewApp creates a new App application struct
1321
func NewApp() *App {
22+
ctx := context.Background()
23+
24+
// Initialize storage and services
25+
envStorage := environment.NewStorage()
26+
runtimeFactory := environment.NewRuntimeFactory(envStorage)
27+
instanceManager := gadget.NewInstanceManager()
28+
gadgetService := gadget.NewService(runtimeFactory, instanceManager)
29+
artifactHubClient := artifacthub.NewClient()
30+
31+
// Create handler with all dependencies (send function will be set in Register)
32+
handler := handlers.New(
33+
ctx,
34+
envStorage,
35+
runtimeFactory,
36+
gadgetService,
37+
instanceManager,
38+
artifactHubClient,
39+
)
40+
1441
return &App{
15-
ctx: context.Background(),
42+
ctx: ctx,
43+
handler: handler,
1644
}
1745
}
1846

19-
// // startup is called when the app starts. The context is saved
20-
// // so we can call the runtime methods
21-
// func (a *App) startup(ctx context.Context) {
22-
// a.ctx = ctx
23-
// a.Run()
24-
// }
47+
// Run initializes the event handlers with the Wails application
48+
func (a *App) Run(app *application.App) {
49+
// Register all handlers
50+
a.handler.Register(app)
51+
}

build/Taskfile.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ tasks:
4949
- go.sum
5050
generates:
5151
- "frontend/bindings/**/*"
52+
env:
53+
BUILD_FLAGS: '{{if eq .PRODUCTION "true"}}-tags production,withoutebpf -trimpath -buildvcs=false -ldflags="-w -s"{{else}}-tags withoutebpf -buildvcs=false -gcflags=all="-l"{{end}}'
5254
cmds:
5355
- wails3 generate bindings -f '{{.BUILD_FLAGS}}' -clean=true
5456

build/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ info:
99
productName: "Inspektor Gadget Desktop" # The name of the application
1010
productIdentifier: "io.inspektor-gadget.ig-desktop" # The unique product identifier
1111
description: "Desktop Frontend for Inspektor Gadget" # The application description
12-
copyright: "(C) 2025-2026 The Inspektor Gadget Contributors" # Copyright text
13-
comments: "" # Comments
14-
version: "v0.0.1" # The application version
12+
copyright: "(C) 2025 The Inspektor Gadget Contributors" # Copyright text
13+
comments: "-" # Comments
14+
version: "v0.2" # The application version
1515

1616
# Dev mode configuration
1717
dev_mode:

build/darwin/Info.dev.plist

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,31 @@
22
<plist version="1.0">
33
<dict>
44
<key>CFBundlePackageType</key>
5-
<string>APPL</string>
5+
<string>APPL</string>
66
<key>CFBundleName</key>
7-
<string>{{.Info.ProductName}}</string>
7+
<string>Inspektor Gadget Desktop</string>
88
<key>CFBundleExecutable</key>
9-
<string>ig-desktop-macos</string>
9+
<string>ig-desktop</string>
1010
<key>CFBundleIdentifier</key>
11-
<string>com.wails.{{.Name}}</string>
11+
<string>io.inspektor-gadget.ig-desktop</string>
1212
<key>CFBundleVersion</key>
13-
<string>{{.Info.ProductVersion}}</string>
13+
<string>v0.2</string>
1414
<key>CFBundleGetInfoString</key>
15-
<string>{{.Info.Comments}}</string>
15+
<string>-</string>
1616
<key>CFBundleShortVersionString</key>
17-
<string>{{.Info.ProductVersion}}</string>
17+
<string>v0.2</string>
1818
<key>CFBundleIconFile</key>
19-
<string>iconfile</string>
19+
<string>icons.icns</string>
2020
<key>LSMinimumSystemVersion</key>
21-
<string>10.13.0</string>
21+
<string>10.15.0</string>
2222
<key>NSHighResolutionCapable</key>
23-
<string>true</string>
23+
<string>true</string>
2424
<key>NSHumanReadableCopyright</key>
25-
<string>{{.Info.Copyright}}</string>
26-
{{if .Info.FileAssociations}}
27-
<key>CFBundleDocumentTypes</key>
28-
<array>
29-
{{range .Info.FileAssociations}}
30-
<dict>
31-
<key>CFBundleTypeExtensions</key>
32-
<array>
33-
<string>{{.Ext}}</string>
34-
</array>
35-
<key>CFBundleTypeName</key>
36-
<string>{{.Name}}</string>
37-
<key>CFBundleTypeRole</key>
38-
<string>{{.Role}}</string>
39-
<key>CFBundleTypeIconFile</key>
40-
<string>{{.IconName}}</string>
41-
</dict>
42-
{{end}}
43-
</array>
44-
{{end}}
45-
{{if .Info.Protocols}}
46-
<key>CFBundleURLTypes</key>
47-
<array>
48-
{{range .Info.Protocols}}
49-
<dict>
50-
<key>CFBundleURLName</key>
51-
<string>com.wails.{{.Scheme}}</string>
52-
<key>CFBundleURLSchemes</key>
53-
<array>
54-
<string>{{.Scheme}}</string>
55-
</array>
56-
<key>CFBundleTypeRole</key>
57-
<string>{{.Role}}</string>
58-
</dict>
59-
{{end}}
60-
</array>
61-
{{end}}
25+
<string>(C) 2025 The Inspektor Gadget Contributors</string>
6226
<key>NSAppTransportSecurity</key>
6327
<dict>
6428
<key>NSAllowsLocalNetworking</key>
6529
<true/>
6630
</dict>
6731
</dict>
68-
</plist>
32+
</plist>

build/darwin/Info.plist

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,26 @@
22
<plist version="1.0">
33
<dict>
44
<key>CFBundlePackageType</key>
5-
<string>APPL</string>
5+
<string>APPL</string>
66
<key>CFBundleName</key>
7-
<string>{{.Info.ProductName}}</string>
7+
<string>Inspektor Gadget Desktop</string>
88
<key>CFBundleExecutable</key>
9-
<string>ig-desktop-macos</string>
9+
<string>ig-desktop</string>
1010
<key>CFBundleIdentifier</key>
11-
<string>com.wails.{{.Name}}</string>
11+
<string>io.inspektor-gadget.ig-desktop</string>
1212
<key>CFBundleVersion</key>
13-
<string>{{.Info.ProductVersion}}</string>
13+
<string>v0.2</string>
1414
<key>CFBundleGetInfoString</key>
15-
<string>{{.Info.Comments}}</string>
15+
<string>-</string>
1616
<key>CFBundleShortVersionString</key>
17-
<string>{{.Info.ProductVersion}}</string>
17+
<string>v0.2</string>
1818
<key>CFBundleIconFile</key>
19-
<string>iconfile</string>
19+
<string>icons.icns</string>
2020
<key>LSMinimumSystemVersion</key>
21-
<string>10.13.0</string>
21+
<string>10.15.0</string>
2222
<key>NSHighResolutionCapable</key>
23-
<string>true</string>
23+
<string>true</string>
2424
<key>NSHumanReadableCopyright</key>
25-
<string>{{.Info.Copyright}}</string>
26-
{{if .Info.FileAssociations}}
27-
<key>CFBundleDocumentTypes</key>
28-
<array>
29-
{{range .Info.FileAssociations}}
30-
<dict>
31-
<key>CFBundleTypeExtensions</key>
32-
<array>
33-
<string>{{.Ext}}</string>
34-
</array>
35-
<key>CFBundleTypeName</key>
36-
<string>{{.Name}}</string>
37-
<key>CFBundleTypeRole</key>
38-
<string>{{.Role}}</string>
39-
<key>CFBundleTypeIconFile</key>
40-
<string>{{.IconName}}</string>
41-
</dict>
42-
{{end}}
43-
</array>
44-
{{end}}
45-
{{if .Info.Protocols}}
46-
<key>CFBundleURLTypes</key>
47-
<array>
48-
{{range .Info.Protocols}}
49-
<dict>
50-
<key>CFBundleURLName</key>
51-
<string>com.wails.{{.Scheme}}</string>
52-
<key>CFBundleURLSchemes</key>
53-
<array>
54-
<string>{{.Scheme}}</string>
55-
</array>
56-
<key>CFBundleTypeRole</key>
57-
<string>{{.Role}}</string>
58-
</dict>
59-
{{end}}
60-
</array>
61-
{{end}}
25+
<string>(C) 2025 The Inspektor Gadget Contributors</string>
6226
</dict>
63-
</plist>
27+
</plist>

build/darwin/icons.icns

140 KB
Binary file not shown.

0 commit comments

Comments
 (0)