Compare commits

..

13 Commits

Author SHA1 Message Date
b5fab1489a
Added env
Some checks failed
ci/woodpecker/manual/prepare Pipeline failed
2023-11-06 20:43:46 +01:00
7e75c4e9d8
feat(ci)!: Switch to woodpecker
Some checks failed
ci/woodpecker/manual/prepare Pipeline failed
2023-11-06 20:40:59 +01:00
17286551ad 🚀New package version 1.0.3 [CI SKIP] 2023-04-15 17:24:01 +00:00
174931f154 🚀New package version 1.0.2 [CI SKIP]
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 17:21:45 +00:00
1108c2be76
update packagerConfig for icon
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 19:20:32 +02:00
2cadf66da7 🚀New package version 1.0.1 [CI SKIP] 2023-04-15 17:16:16 +00:00
5468e5ab59
Bumped ci node
All checks were successful
continuous-integration/drone Build is passing
2023-04-15 19:07:24 +02:00
48da695413 🚀New package version 1.0.0 [CI SKIP] 2023-04-15 17:05:00 +00:00
a648277dae Merge branch 'main' of https://git.odit.services/lfk/scanclient-electron
All checks were successful
continuous-integration/drone Build is passing
2023-03-27 18:27:49 +02:00
cb6a84568e improved msi building + branding 2023-03-27 18:26:07 +02:00
cdaa3edfa6
Basic readme update 2023-03-27 18:21:27 +02:00
de0e26e9ae MSI bundle 2023-03-27 18:11:35 +02:00
671409c6af pnpm migration 2023-03-27 18:10:36 +02:00
15 changed files with 3765 additions and 529 deletions

View File

@ -1,108 +0,0 @@
---
kind: secret
name: gitea_token
get:
path: odit-git-bot
name: apikey
---
kind: secret
name: git_ssh
get:
path: odit-git-bot
name: sshkey
---
kind: secret
name: ci_token
get:
path: odit-ci-bot
name: apikey
---
kind: pipeline
type: kubernetes
name: build:tag
steps:
- name: run packager
depends_on: ["clone"]
image: node:19.8.1.0-alpine3.17
commands:
- apk add git zip -f
- npm i -g pnpm
- pnpm i
- pnpm build
- mkdir dist
- zip -r dist/@lfkscan-linux-x64.zip dist/@lfkscan-linux_x64
- name: gitea_release
depends_on: ["run packager"]
image: plugins/gitea-release
settings:
title: Release ${DRONE_TAG}
api_key:
from_secret: gitea_token
base_url: https://git.odit.services
files: dist/*
checksum:
- md5
- sha1
- sha256
- sha512
- adler32
- crc32
- name: trigger live build
depends_on: ["gitea_release"]
image: idcooldi/drone-webhook
settings:
urls: https://ci.odit.services/api/repos/lfk/scanclient-live/builds?SOURCE_TAG=${DRONE_TAG}
bearer:
from_secret: ci_token
trigger:
event:
- tag
---
kind: pipeline
type: kubernetes
name: prepare:tag
steps:
- name: bump package version
image: node:alpine
commands:
- npm --no-git-tag-version version ${SOURCE_TAG}
- name: push new version to repo
image: appleboy/drone-git-push
settings:
commit: true
commit_message: 🚀New package version ${SOURCE_TAG} [CI SKIP]
author_email: bot@odit.services
followtags: false
branch: main
remote: git@git.odit.services:lfk/scanclient-electron.git
skip_verify: true
ssh_key:
from_secret: git_ssh
- name: tag
image: alpine/git
commands:
- git tag ${SOURCE_TAG} -a -m "Release ${SOURCE_TAG}"
- name: push to repo
image: appleboy/drone-git-push
settings:
commit: false
author_email: bot@odit.services
followtags: true
branch: main
remote: git@git.odit.services:lfk/scanclient-electron.git
skip_verify: true
ssh_key:
from_secret: git_ssh
trigger:
event:
exclude:
- push
- tag
include:
- custom

181
.gitignore vendored
View File

@ -1,8 +1,175 @@
/bin
/dist
node_modules
.storage
# ---> Node
# Logs
logs
*.log
.tmp
appcode.zip
appcode
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# ---> Windows
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# ---> macOS
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
app.zip
/appcode

1
.npmrc Normal file
View File

@ -0,0 +1 @@
node-linker=hoisted

37
.woodpecker/prepare.yml Normal file
View File

@ -0,0 +1,37 @@
steps:
- name: bump package version
image: registry.odit.services/hub/library/node:19.9.0-alpine3.16
commands:
- npm --no-git-tag-version version ${SOURCE_TAG}
- name: push new version to repo
image: appleboy/drone-git-push
settings:
commit: true
commit_message: 🚀New package version ${SOURCE_TAG} [CI SKIP]
author_email: bot@odit.services
followtags: false
branch: main
remote: git@git.odit.services:lfk/scanclient-electron.git
skip_verify: true
ssh_key:
from_secret: odit-git-bot-sshkey
- name: tag
image: alpine/git
commands:
- git tag ${SOURCE_TAG} -a -m "Release ${SOURCE_TAG}"
environment:
SOURCE_TAG: "${SOURCE_TAG}"
- name: push to repo
image: appleboy/drone-git-push
settings:
commit: false
author_email: bot@odit.services
followtags: true
branch: main
remote: git@git.odit.services:lfk/scanclient-electron.git
skip_verify: true
ssh_key:
from_secret: odit-git-bot-sshkey
when:
event:
- manual

37
.woodpecker/release.yml Normal file
View File

@ -0,0 +1,37 @@
platform: linux/amd64
steps:
- name: build dist zip
image: registry.odit.services/hub/library/node:19.9.0-alpine3.16
commands:
- apk add git zip -f
- yarn
- yarn build
- mkdir dist
- zip -r dist/@lfk-scanclient-electron-linux-x64.zip out/@lfk-scanclient-electron-linux-x64
- name: gitea add packages to build
image: woodpeckerci/plugin-gitea-release
settings:
api_key:
from_secret: odit-git-bot-apikey
base_url: https://git.odit.services
files: dist/*
title: Release ${CI_COMMIT_TAG}
checksum:
- md5
- sha1
- sha256
- sha512
- adler32
- crc32
- name: trigger app.gutfeel.de build
image: woodpeckerci/plugin-trigger
settings:
repositories:
- lfk/scanclient-live
params:
- "SOURCE_TAG=${CI_COMMIT_TAG}"
token:
from_secret: odit-ci-bot-apikey
when:
event: tag

19
README.md Normal file
View File

@ -0,0 +1,19 @@
# scanclient-electron
electron packaged scanclient
## Package
> Automagicly discovers your os and selects the right packager
```
pnpm i
pnpm build
```
## Bundle as MSI
> You need to install the [WiX MSI Buildtools](https://wixtoolset.org/docs/wix3/) first
```
pnpm i
pnpm build:msi
```

View File

@ -1,3 +0,0 @@
const fs = require('fs');
fs.copyFileSync("./neutralino.js", "./appcode/dist/neutralino.js");

View File

@ -1,20 +1,14 @@
const axios = require('axios').default;
const unzip = require('unzip-stream');
const fs = require('fs');
//
(async function () {
const releaseInfo = await (await fetch("https://git.odit.services/api/v1/repos/lfk/scanclient/releases")).json();
if (releaseInfo.length > 0) {
const download_file = releaseInfo[0].assets.find((a) => a.name === 'dist.zip').browser_download_url;
//
const { Readable } = require('stream');
const { finished } = require('stream/promises');
const download = require('download');
const stream = fs.createWriteStream('./appcode.zip');
const { body } = await fetch(download_file);
await finished(Readable.fromWeb(body).pipe(stream));
//
fs.createReadStream('appcode.zip').pipe(unzip.Parse()).on('entry', () => {
fs.createReadStream('appcode.zip').pipe(unzip.Extract({ path: './appcode/' }));
axios.get('https://git.odit.services/api/v1/repos/lfk/scanclient/releases').then(({ data }) => {
(async () => {
const download_file = data[0].assets.find((a) => a.name === 'dist.zip').browser_download_url;
fs.writeFileSync('app.zip', await download(download_file));
fs.createReadStream('app.zip').pipe(unzip.Parse()).on('entry', () => {
fs.createReadStream('app.zip').pipe(unzip.Extract({ path: './appcode/' }));
});
}
})()
})();
});

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

39
main.js Normal file
View File

@ -0,0 +1,39 @@
const { app, BrowserWindow } = require('electron');
const path = require('path');
function createWindow() {
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
fullscreen: true
// webPreferences: {
// preload: path.join(__dirname, 'preload.js')
// }
});
mainWindow.loadFile('appcode/dist/index.html');
// mainWindow.removeMenu();
// mainWindow.webContents.openDevTools()
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(() => {
createWindow();
app.on('activate', function() {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
});
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function() {
if (process.platform !== 'darwin') app.quit();
});
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@ -1,64 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/neutralinojs/neutralinojs/main/schemas/neutralino.config.schema.json",
"applicationId": "lfk.odit.services",
"version": "1.0.0",
"defaultMode": "window",
"port": 0,
"documentRoot": "/appcode/dist/",
"url": "/",
"enableServer": true,
"enableNativeAPI": true,
"tokenSecurity": "one-time",
"logging": {
"enabled": true,
"writeToLogFile": true
},
"nativeAllowList": [
"app.*",
"os.*",
"debug.log"
],
"modes": {
"window": {
"title": "LfK!Scan",
"width": 800,
"height": 500,
"minWidth": 400,
"minHeight": 400,
"fullScreen": true,
"alwaysOnTop": false,
"icon": "/appcode/dist/favicon.png",
"enableInspector": false,
"borderless": false,
"maximize": true,
"hidden": false,
"resizable": true,
"exitProcessOnClose": true
},
"browser": {
"globalVariables": {
"TEST": "Test value browser"
},
"nativeBlockList": [
"filesystem.*"
]
},
"chrome": {
"width": 800,
"height": 500,
"args": "--user-agent=\"Neutralinojs chrome mode\"",
"nativeBlockList": [
"filesystem.*",
"os.*"
]
}
},
"cli": {
"binaryName": "lfkscan",
"resourcesPath": "/appcode/",
"extensionsPath": "/extensions/",
"clientLibrary": "/appcode/dist/neutralino.js",
"binaryVersion": "4.10.0",
"clientVersion": "3.8.2"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,13 +1,65 @@
{
"name": "@lfk/scanclient-electron",
"version": "0.2.0",
"description": "minimal packaged lfkscan application",
"version": "1.0.3",
"description": "minimal electron application",
"main": "main.js",
"scripts": {
"build": "neu update && node download.js && node build--neutralino.js && neu build"
"download": "node download.js",
"build:msi": "node download.js && electron-forge make",
"build": "yarn download && yarn electron-forge package",
"electron:start": "electron-forge start"
},
"devDependencies": {
"@neutralinojs/neu": "^9.5.0",
"@electron-forge/cli": "^6.0.0-beta.54",
"@electron-forge/maker-deb": "^6.0.0-beta.54",
"@electron-forge/maker-rpm": "^6.0.0-beta.54",
"@electron-forge/maker-squirrel": "^6.0.0-beta.54",
"@electron-forge/maker-wix": "^6.0.5",
"@electron-forge/maker-zip": "^6.0.0-beta.54",
"@taraus-he/tdunzip": "^1.0.4",
"axios": "^0.21.1",
"download": "^8.0.0",
"electron-nightly": "14.0.0-nightly.20210319",
"extract-zip": "^2.0.1",
"js-file-downloader": "^1.1.16",
"unzip-stream": "^0.3.1"
},
"dependencies": {
"electron-squirrel-startup": "1.0.0"
},
"config": {
"forge": {
"packagerConfig": {
"icon": "./favicon.ico"
},
"makers": [
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin"
],
"config": {
"name": "lfk__scanclient"
}
},
{
"name": "@electron-forge/maker-wix",
"config": {
"manufacturer": "ODIT.Services",
"shortname": "LfKScan",
"name": "LfKScan",
"icon": "./favicon.ico"
}
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
}
]
}
}
}

3624
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

92
tmp.json Normal file
View File

@ -0,0 +1,92 @@
{
"id": 112,
"tag_name": "0.1.1",
"target_commitish": "main",
"name": "0.1.1",
"body": "Husky 🐶\r\nCI build",
"url": "https://git.odit.services/api/v1/repos/lfk/scanclient/releases/112",
"html_url": "https://git.odit.services/lfk/scanclient/releases/tag/0.1.1",
"tarball_url": "https://git.odit.services/lfk/scanclient/archive/0.1.1.tar.gz",
"zipball_url": "https://git.odit.services/lfk/scanclient/archive/0.1.1.zip",
"draft": false,
"prerelease": false,
"created_at": "2021-03-19T17:51:46Z",
"published_at": "2021-03-19T17:51:46Z",
"author": {
"id": 2,
"login": "philipp",
"full_name": "Philipp Dormann",
"email": "philipp@philippdormann.de",
"avatar_url": "https://git.odit.services/user/avatar/philipp/-1",
"language": "en-US",
"is_admin": true,
"last_login": "2021-03-17T15:29:38Z",
"created": "2020-10-30T14:18:23Z",
"username": "philipp"
},
"assets": [
{
"id": 52,
"name": "sha512sum.txt",
"size": 143,
"download_count": 0,
"created_at": "2021-03-19T17:52:11Z",
"uuid": "acda3b63-6b2b-40f3-89d1-8cf2b255b18d",
"browser_download_url": "https://git.odit.services/attachments/acda3b63-6b2b-40f3-89d1-8cf2b255b18d"
},
{
"id": 51,
"name": "dist.zip",
"size": 99014,
"download_count": 1,
"created_at": "2021-03-19T17:52:11Z",
"uuid": "4b00c80a-ac17-4ad7-a5ba-5aed2e24b29a",
"browser_download_url": "https://git.odit.services/attachments/4b00c80a-ac17-4ad7-a5ba-5aed2e24b29a"
},
{
"id": 53,
"name": "adler32sum.txt",
"size": 25,
"download_count": 0,
"created_at": "2021-03-19T17:52:11Z",
"uuid": "a6183b19-71fc-485c-81f1-819d356f7526",
"browser_download_url": "https://git.odit.services/attachments/a6183b19-71fc-485c-81f1-819d356f7526"
},
{
"id": 54,
"name": "crc32sum.txt",
"size": 24,
"download_count": 0,
"created_at": "2021-03-19T17:52:11Z",
"uuid": "f39318ed-f92a-4fac-b5df-468cafd2df2f",
"browser_download_url": "https://git.odit.services/attachments/f39318ed-f92a-4fac-b5df-468cafd2df2f"
},
{
"id": 55,
"name": "md5sum.txt",
"size": 47,
"download_count": 0,
"created_at": "2021-03-19T17:52:11Z",
"uuid": "88601f1d-647a-40cc-ae44-55105eafa2f1",
"browser_download_url": "https://git.odit.services/attachments/88601f1d-647a-40cc-ae44-55105eafa2f1"
},
{
"id": 56,
"name": "sha1sum.txt",
"size": 55,
"download_count": 0,
"created_at": "2021-03-19T17:52:12Z",
"uuid": "04b67d7c-10f5-4e13-a11a-015eddf4591e",
"browser_download_url": "https://git.odit.services/attachments/04b67d7c-10f5-4e13-a11a-015eddf4591e"
},
{
"id": 57,
"name": "sha256sum.txt",
"size": 79,
"download_count": 0,
"created_at": "2021-03-19T17:52:12Z",
"uuid": "77252928-127c-4cb6-b69c-956c5b8c0708",
"browser_download_url": "https://git.odit.services/attachments/77252928-127c-4cb6-b69c-956c5b8c0708"
}
]
}