Merge remote-tracking branch 'origin/dev-v0.9' into sawka/connnserver-router

This commit is contained in:
sawka 2024-10-22 10:02:38 -07:00
commit 734fb1fa4d
10 changed files with 89 additions and 54 deletions

View File

@ -3,11 +3,12 @@
# For more information on the Windows Code Signing, see https://docs.digicert.com/en/digicert-keylocker/ci-cd-integrations/plugins/github-custom-action-for-keypair-signing.html and https://docs.digicert.com/en/digicert-keylocker/signing-tools/sign-authenticode-with-electron-builder-using-ksp-integration.html
name: Build Helper
run-name: Build ${{ github.ref_name }}
run-name: Build ${{ github.ref_name }}${{ github.event_name == 'workflow_dispatch' && ' - Manual'}}
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
workflow_dispatch:
env:
GO_VERSION: "1.22"
NODE_VERSION: "20"
@ -39,11 +40,8 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libarchive-tools libopenjp2-tools rpm squashfs-tools
# We use Zig instead of glibc for cgo compilation as it is more-easily statically linked
- name: Setup Zig (Linux only)
if: matrix.platform == 'linux'
run: sudo snap install zig --classic --beta
sudo snap install snapcraft --classic
sudo snap install zig --classic --beta # We use Zig instead of glibc for cgo compilation as it is more-easily statically linked
# The pre-installed version of the AWS CLI has a segfault problem so we'll install it via Homebrew instead.
- name: Upgrade AWS CLI (Mac only)
@ -84,12 +82,12 @@ jobs:
# Windows Code Signing Setup
- name: Set up certificate (Windows only)
if: matrix.platform == 'windows'
if: matrix.platform == 'windows' && github.event_name != 'workflow_dispatch'
run: |
echo "${{ secrets.SM_CLIENT_CERT_FILE_B64 }}" | base64 --decode > /d/Certificate_pkcs12.p12
shell: bash
- name: Set signing variables (Windows only)
if: matrix.platform == 'windows'
if: matrix.platform == 'windows' && github.event_name != 'workflow_dispatch'
id: variables
run: |
echo "SM_HOST=${{ secrets.SM_HOST }}" >> "$GITHUB_ENV"
@ -103,7 +101,7 @@ jobs:
echo "C:\Program Files\DigiCert\DigiCert Keylocker Tools" >> $GITHUB_PATH
shell: bash
- name: Setup Keylocker KSP (Windows only)
if: matrix.platform == 'windows'
if: matrix.platform == 'windows' && github.event_name != 'workflow_dispatch'
run: |
curl -X GET https://one.digicert.com/signingmanager/api-ui/v1/releases/Keylockertools-windows-x64.msi/download -H "x-api-key:%SM_API_KEY%" -o Keylockertools-windows-x64.msi
msiexec /i Keylockertools-windows-x64.msi /quiet /qn
@ -121,8 +119,15 @@ jobs:
path: ${{env.STATIC_DOCSITE_PATH}}
# Build and upload packages
- name: Build (not Windows)
if: matrix.platform != 'windows'
- name: Build (Linux)
if: matrix.platform == 'linux'
run: task package
env:
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}}
SNAPCRAFT_BUILD_ENVIRONMENT: host
- name: Build (Darwin)
if: matrix.platform == 'darwin'
run: task package
env:
USE_SYSTEM_FPM: true # Ensure that the installed version of FPM is used rather than the bundled one.
@ -132,7 +137,7 @@ jobs:
APPLE_APP_SPECIFIC_PASSWORD: ${{ matrix.platform == 'darwin' && secrets.PROD_MACOS_NOTARIZATION_PWD_2 }}
APPLE_TEAM_ID: ${{ matrix.platform == 'darwin' && secrets.PROD_MACOS_NOTARIZATION_TEAM_ID_2 }}
STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}}
- name: Build (Windows only)
- name: Build (Windows)
if: matrix.platform == 'windows'
run: task package
env:
@ -141,14 +146,16 @@ jobs:
CSC_KEY_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
STATIC_DOCSITE_PATH: ${{env.STATIC_DOCSITE_PATH}}
shell: powershell # electron-builder's Windows code signing package has some compatibility issues with pwsh, so we need to use Windows Powershell
- name: Upload to S3 staging
if: github.event_name != 'workflow_dispatch'
run: task artifacts:upload
env:
AWS_ACCESS_KEY_ID: "${{ secrets.ARTIFACTS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.ARTIFACTS_KEY_SECRET }}"
AWS_DEFAULT_REGION: us-west-2
- name: Create draft release
if: github.event_name != 'workflow_dispatch'
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ contains(github.ref_name, '-beta') }}
@ -166,3 +173,9 @@ jobs:
make/*.snap
make/*.flatpak
make/*.AppImage
- name: Upload build artifacts to workflow (manual runs only)
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: ${{matrix.runner}}
path: make

View File

@ -58,7 +58,7 @@ const config = {
artifactName: "${name}-${platform}-${arch}-${version}.${ext}",
category: "TerminalEmulator",
executableName: pkg.name,
target: ["zip", "deb", "rpm", "AppImage", "pacman"],
target: ["zip", "deb", "rpm", "snap", "AppImage", "pacman"],
synopsis: pkg.description,
description: null,
desktop: {
@ -84,6 +84,11 @@ const config = {
appImage: {
license: "LICENSE",
},
snap: {
base: "core22",
confinement: "classic",
allowNativeWayland: true,
},
publish: {
provider: "generic",
url: "https://dl.waveterm.dev/releases-w2",

View File

@ -95,7 +95,7 @@ const ModalPage1 = () => {
<div className="content-section-title">Telemetry</div>
<div className="content-section-text">
We collect minimal anonymous{" "}
<a target="_blank" href="https://docs.waveterm.dev/reference/telemetry" rel={"noopener"}>
<a target="_blank" href="https://docs.waveterm.dev/telemetry" rel={"noopener"}>
telemetry data
</a>{" "}
to help us understand how people are using Wave (

View File

@ -55,8 +55,8 @@
"@types/ws": "^8",
"@vitejs/plugin-react-swc": "^3.7.1",
"@vitest/coverage-istanbul": "^2.1.3",
"electron": "^32.2.0",
"electron-builder": "^25.1.7",
"electron": "^33.0.1",
"electron-builder": "^25.1.8",
"electron-vite": "^2.3.0",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",

View File

@ -380,7 +380,10 @@ func (bc *BlockController) DoRunShellCommand(rc *RunShellOpts, blockMeta waveobj
go func() {
// handles outputCh -> shellInputCh
for msg := range wshProxy.ToRemoteCh {
encodedMsg := wshutil.EncodeWaveOSCBytes(wshutil.WaveServerOSC, msg)
encodedMsg, err := wshutil.EncodeWaveOSCBytes(wshutil.WaveServerOSC, msg)
if err != nil {
log.Printf("error encoding OSC message: %v\n", err)
}
shellInputCh <- &BlockInputUnion{InputData: encodedMsg}
}
}()

View File

@ -14,8 +14,6 @@ import (
"github.com/wavetermdev/waveterm/pkg/wps"
)
var configDirAbsPath = wavebase.GetWaveConfigDir()
var instance *Watcher
var once sync.Once
@ -38,6 +36,7 @@ func GetWatcher() *Watcher {
log.Printf("failed to create file watcher: %v", err)
return
}
configDirAbsPath := wavebase.GetWaveConfigDir()
instance = &Watcher{watcher: watcher}
err = instance.watcher.Add(configDirAbsPath)
const failedStr = "failed to add path %s to watcher: %v"

View File

@ -16,6 +16,7 @@ import (
"strings"
"github.com/wavetermdev/waveterm/pkg/util/utilfn"
"github.com/wavetermdev/waveterm/pkg/wavebase"
"github.com/wavetermdev/waveterm/pkg/waveobj"
"github.com/wavetermdev/waveterm/pkg/wconfig/defaultconfig"
)
@ -183,8 +184,6 @@ func readConfigHelper(fileName string, barr []byte, readErr error) (waveobj.Meta
return rtn, cerrs
}
var configDirFsys = os.DirFS(configDirAbsPath)
func readConfigFileFS(fsys fs.FS, logPrefix string, fileName string) (waveobj.MetaMapType, []ConfigError) {
barr, readErr := fs.ReadFile(fsys, fileName)
return readConfigHelper(logPrefix+fileName, barr, readErr)
@ -195,10 +194,13 @@ func ReadDefaultsConfigFile(fileName string) (waveobj.MetaMapType, []ConfigError
}
func ReadWaveHomeConfigFile(fileName string) (waveobj.MetaMapType, []ConfigError) {
configDirAbsPath := wavebase.GetWaveConfigDir()
configDirFsys := os.DirFS(configDirAbsPath)
return readConfigFileFS(configDirFsys, "", fileName)
}
func WriteWaveHomeConfigFile(fileName string, m waveobj.MetaMapType) error {
configDirAbsPath := wavebase.GetWaveConfigDir()
fullFileName := filepath.Join(configDirAbsPath, fileName)
barr, err := jsonMarshalConfigInOrder(m)
if err != nil {
@ -283,6 +285,8 @@ func readConfigPartForFS(fsys fs.FS, logPrefix string, partName string, simpleMe
// Combine files from the defaults and home directory for the specified config part name
func readConfigPart(partName string, simpleMerge bool) (waveobj.MetaMapType, []ConfigError) {
configDirAbsPath := wavebase.GetWaveConfigDir()
configDirFsys := os.DirFS(configDirAbsPath)
defaultConfigs, cerrs := readConfigPartForFS(defaultconfig.ConfigFS, "defaults:", partName, simpleMerge)
homeConfigs, cerrs1 := readConfigPartForFS(configDirFsys, "", partName, simpleMerge)
@ -326,6 +330,7 @@ func GetConfigSubdirs() []string {
var fullConfig FullConfigType
configRType := reflect.TypeOf(fullConfig)
var retVal []string
configDirAbsPath := wavebase.GetWaveConfigDir()
for fieldIdx := 0; fieldIdx < configRType.NumField(); fieldIdx++ {
field := configRType.Field(fieldIdx)
if field.PkgPath != "" {

View File

@ -79,10 +79,12 @@ func AdaptMsgChToPty(outputCh chan []byte, oscEsc string, output io.Writer) erro
panic("oscEsc must be 5 characters")
}
for msg := range outputCh {
barr := EncodeWaveOSCBytes(oscEsc, msg)
_, err := output.Write(barr)
barr, err := EncodeWaveOSCBytes(oscEsc, msg)
if err != nil {
return fmt.Errorf("error writing to output: %w", err)
return fmt.Errorf("error encoding osc message (AdaptMsgChToPty): %w", err)
}
if _, err := output.Write(barr); err != nil {
return fmt.Errorf("error writing osc message (AdaptMsgChToPty): %w", err)
}
}
return nil

View File

@ -68,9 +68,13 @@ func makeOscPrefix(oscNum string) []byte {
return output
}
func EncodeWaveOSCBytes(oscNum string, barr []byte) []byte {
func EncodeWaveOSCBytes(oscNum string, barr []byte) ([]byte, error) {
if len(oscNum) != 5 {
panic("oscNum must be 5 characters")
return nil, fmt.Errorf("oscNum must be 5 characters")
}
const maxSize = 64 * 1024 * 1024 // 64 MB
if len(barr) > maxSize {
return nil, fmt.Errorf("input data too large")
}
hasControlChars := false
for _, b := range barr {
@ -86,7 +90,7 @@ func EncodeWaveOSCBytes(oscNum string, barr []byte) []byte {
copyOscPrefix(output, oscNum)
copy(output[oscPrefixLen(oscNum):], barr)
output[len(output)-1] = BEL
return output
return output, nil
}
var buf bytes.Buffer
@ -102,7 +106,7 @@ func EncodeWaveOSCBytes(oscNum string, barr []byte) []byte {
}
}
buf.WriteByte(BEL)
return buf.Bytes()
return buf.Bytes(), nil
}
func EncodeWaveOSCMessageEx(oscNum string, msg *RpcMessage) ([]byte, error) {
@ -113,7 +117,7 @@ func EncodeWaveOSCMessageEx(oscNum string, msg *RpcMessage) ([]byte, error) {
if err != nil {
return nil, fmt.Errorf("error marshalling message to json: %w", err)
}
return EncodeWaveOSCBytes(oscNum, barr), nil
return EncodeWaveOSCBytes(oscNum, barr)
}
var termModeLock = sync.Mutex{}
@ -195,7 +199,11 @@ func SetupTerminalRpcClient(serverImpl ServerImpl) (*WshRpc, io.Reader) {
rpcClient := MakeWshRpc(messageCh, outputCh, wshrpc.RpcContext{}, serverImpl)
go func() {
for msg := range outputCh {
barr := EncodeWaveOSCBytes(WaveOSC, msg)
barr, err := EncodeWaveOSCBytes(WaveOSC, msg)
if err != nil {
fmt.Fprintf(os.Stderr, "Error encoding OSC message: %v\n", err)
continue
}
os.Stdout.Write(barr)
os.Stdout.Write([]byte{'\n'})
}

View File

@ -3493,9 +3493,9 @@ __metadata:
languageName: node
linkType: hard
"app-builder-lib@npm:25.1.7":
version: 25.1.7
resolution: "app-builder-lib@npm:25.1.7"
"app-builder-lib@npm:25.1.8":
version: 25.1.8
resolution: "app-builder-lib@npm:25.1.8"
dependencies:
"@develar/schema-utils": "npm:~2.6.5"
"@electron/notarize": "npm:2.5.0"
@ -3530,9 +3530,9 @@ __metadata:
tar: "npm:^6.1.12"
temp-file: "npm:^3.4.0"
peerDependencies:
dmg-builder: 25.1.7
electron-builder-squirrel-windows: 25.1.7
checksum: 10c0/f1428c330d5220f84d3648ae5dd7a5a812012d14d516d5ac073481e63b8e8668746ae61958851670537b89901bdae64ccf6a3e958ea0ebf1ed10e3d6f00e5b2d
dmg-builder: 25.1.8
electron-builder-squirrel-windows: 25.1.8
checksum: 10c0/e646d4b45872b51ae562788df87024cf0b0c09db66538712837043561712976dbd511ecc56c1172114f676b14518c23b78c412db22173a91cc42f23e88c556d0
languageName: node
linkType: hard
@ -5002,11 +5002,11 @@ __metadata:
languageName: node
linkType: hard
"dmg-builder@npm:25.1.7":
version: 25.1.7
resolution: "dmg-builder@npm:25.1.7"
"dmg-builder@npm:25.1.8":
version: 25.1.8
resolution: "dmg-builder@npm:25.1.8"
dependencies:
app-builder-lib: "npm:25.1.7"
app-builder-lib: "npm:25.1.8"
builder-util: "npm:25.1.7"
builder-util-runtime: "npm:9.2.10"
dmg-license: "npm:^1.0.11"
@ -5016,7 +5016,7 @@ __metadata:
dependenciesMeta:
dmg-license:
optional: true
checksum: 10c0/a449c0afe051a61bee12069d2e02896cef49e0ddbed63920bd74c86ff1e6cd7039b9fb02725cbbcfea87972e5d4bdd8c3bb5514d9469f335c9acc63c9caa6c53
checksum: 10c0/a472aba3398664259713f4baf6557509ce0a3832ff49fae2f580e97168a33dcee8f99be2f990a15d795cd28b5477b10fbb8a17bed4f8d410c8181b4b9e2d0063
languageName: node
linkType: hard
@ -5123,15 +5123,15 @@ __metadata:
languageName: node
linkType: hard
"electron-builder@npm:^25.1.7":
version: 25.1.7
resolution: "electron-builder@npm:25.1.7"
"electron-builder@npm:^25.1.8":
version: 25.1.8
resolution: "electron-builder@npm:25.1.8"
dependencies:
app-builder-lib: "npm:25.1.7"
app-builder-lib: "npm:25.1.8"
builder-util: "npm:25.1.7"
builder-util-runtime: "npm:9.2.10"
chalk: "npm:^4.1.2"
dmg-builder: "npm:25.1.7"
dmg-builder: "npm:25.1.8"
fs-extra: "npm:^10.1.0"
is-ci: "npm:^3.0.0"
lazy-val: "npm:^1.0.5"
@ -5140,7 +5140,7 @@ __metadata:
bin:
electron-builder: cli.js
install-app-deps: install-app-deps.js
checksum: 10c0/19ca437486c9200e10f8e21aff02af6438c786093bd90b383c3b57a68a8de0946e23ac402da9ec28a0626a36db4ec615886edc1c56572374dff26cd86ba035d9
checksum: 10c0/9602a19f8c647fb75b07e44dc856012d2b1fe1afcb257ffd24cf17e07d7ae3b51405cf31da10403965ddcc7b194d60aca6bc5d7890e367b1be2ec95219edcbe8
languageName: node
linkType: hard
@ -5217,16 +5217,16 @@ __metadata:
languageName: node
linkType: hard
"electron@npm:^32.2.0":
version: 32.2.0
resolution: "electron@npm:32.2.0"
"electron@npm:^33.0.1":
version: 33.0.1
resolution: "electron@npm:33.0.1"
dependencies:
"@electron/get": "npm:^2.0.0"
"@types/node": "npm:^20.9.0"
extract-zip: "npm:^2.0.1"
bin:
electron: cli.js
checksum: 10c0/28d988a9d05c89e93d70cc790bd53ecc97135cc3fa9efe3617f10b87cdf85ada468d383afd7858bcf8f064aa189ea7f8987e32c7ebaac70bda64e8f9f85621e8
checksum: 10c0/cd5e5cef21df2d5e1ffc95cfe90397c984152db54ac1032deb97f1716f778d41f5fa7c83e42bc86ae3c509a6d45f578515a540b6453ebf818310cc303e95f083
languageName: node
linkType: hard
@ -11688,8 +11688,8 @@ __metadata:
css-tree: "npm:^3.0.0"
dayjs: "npm:^1.11.13"
debug: "npm:^4.3.7"
electron: "npm:^32.2.0"
electron-builder: "npm:^25.1.7"
electron: "npm:^33.0.1"
electron-builder: "npm:^25.1.8"
electron-updater: "npm:6.3.9"
electron-vite: "npm:^2.3.0"
env-paths: "npm:^3.0.0"