Skip to content

Commit b2b12a7

Browse files
Merge remote-tracking branch 'upstream/master' into main
2 parents a8e2daf + 7d05b18 commit b2b12a7

31 files changed

+19196
-0
lines changed

.gitignore

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
.DS_Store
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# TypeScript cache
43+
*.tsbuildinfo
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
.env.test
63+
64+
# parcel-bundler cache (https://parceljs.org/)
65+
.cache
66+
67+
# next.js build output
68+
.next
69+
70+
# nuxt.js build output
71+
.nuxt
72+
73+
# vuepress build output
74+
.vuepress/dist
75+
76+
# Serverless directories
77+
.serverless/
78+
79+
# FuseBox cache
80+
.fusebox/
81+
82+
# DynamoDB Local files
83+
.dynamodb/
84+
85+
# Webpack
86+
.webpack/
87+
.webpack_*
88+
89+
# Vite
90+
.vite/
91+
92+
# Electron-Forge
93+
out/
94+
95+
# electron-builder
96+
dist/
97+
98+
# external resources
99+
vnc-software/tigervnc-linux-x86_64
100+
101+
# trashcan
102+
trash/

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,43 @@ Here's a list of some key, free and open-source technologies that make this poss
2525
- LNBits, for quickly building reusable payment QR codes using the LNURLp standard.
2626
- Electron, for building standalone applications using open web standards.
2727
- Bitcoin and Lightning, for accepting payments without needing anyone's permission or approval.
28+
29+
# Development
30+
31+
## Install dependencies
32+
33+
To install the dependencies from package.json using the specific version from package-lock.json, run:
34+
35+
`npm install`
36+
37+
## Download and extract TigerVNC
38+
39+
Before starting the app, first make sure you have downloaded and extracted the TigerVNC software:
40+
41+
`./vnc-software/download_tigervnc.sh`
42+
43+
## Start the app
44+
45+
To start the PeerViewer standalone Electron app, do:
46+
47+
`npm run # which runs the "start" script from package.json`
48+
49+
You can enable Chrome Developer Tools by setting "devTools: true" in src/main.js and then pressing CTRL-SHIFT-i in the app.
50+
51+
## Build a release
52+
53+
To build a release, have a look at the interactive script:
54+
55+
`./release.sh`
56+
57+
## Run as webapp
58+
59+
To run it as a webapp on http://localhost:8000/, do:
60+
61+
`./serve_dev_website.sh`
62+
63+
Note that HolePunch and the VNC client and server binaries don't work in the webapp.
64+
65+
To get this working in a webbrowser as a webapp, it should be possible to integrate https://novnc.com/ as the VNC Client and use the HolePunch DHT websocket relay for connections.
66+
For the server-side, it might be possible to build a browser-based VNC server using https://developer.mozilla.org/en-US/docs/Web/API/Screen_Capture_API/
67+

build.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
4+
# If you run it in dev mode first with:
5+
# npm run start
6+
# Then the app tries to connect to localhost:3000 instead of packaging the actual files when building with:
7+
#./node_modules/.bin/electron-builder
8+
9+
# Therefore, first make sure the correct files are packaged with electron-forge like:
10+
./node_modules/.bin/electron-forge package
11+
12+
export DEBUG=electron-builder
13+
./node_modules/.bin/electron-builder -l appimage
14+
15+
# build more:
16+
#./node_modules/.bin/electron-builder -l appimage zip deb snap rpm
17+
18+
# NOTE: Don't use prepackage because the electron-builder will not add the tigervnc/ folder:
19+
#./node_modules/.bin/electron-builder --prepackaged out/peerviewer-linux-x64/ -l appimage
20+

build/icons/512x512.png

17.3 KB
Loading

copy_http.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
sources=src
4+
5+
for tocopy in index.css index.html images/ ; do
6+
cp -R "$sources"/"$tocopy" ../website/
7+
done

electron-builder.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
appId: "com.peerviewer.app"
2+
linux: { "category": "Network" }
3+
# only include .webpack, as that's enough:
4+
"files": [
5+
".webpack/**/*"
6+
]
7+
# these are added to the package:
8+
"extraResources": [
9+
{
10+
"from": "vnc-software",
11+
"to": "vnc-software",
12+
"filter": ["**/*"]
13+
}
14+
]
15+

forge.config.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
module.exports = {
2+
packagerConfig: {
3+
asar: true,
4+
},
5+
rebuildConfig: {},
6+
makers: [
7+
{
8+
name: '@electron-forge/maker-squirrel',
9+
config: {},
10+
},
11+
{
12+
name: '@electron-forge/maker-zip',
13+
platforms: ['linux'],
14+
},
15+
{
16+
name: '@electron-forge/maker-deb',
17+
config: {
18+
options: {
19+
maintainer: 'Thomas Farstrike',
20+
homepage: 'https://peerviewer.github.io/'
21+
}
22+
},
23+
},
24+
],
25+
plugins: [
26+
{
27+
name: '@electron-forge/plugin-auto-unpack-natives',
28+
config: {},
29+
},
30+
{
31+
name: '@electron-forge/plugin-webpack',
32+
config: {
33+
mainConfig: './webpack.main.config.js',
34+
renderer: {
35+
config: './webpack.renderer.config.js',
36+
entryPoints: [
37+
{
38+
html: './src/index.html',
39+
js: './src/renderer.js',
40+
name: 'main_window',
41+
preload: {
42+
js: './src/preload.js',
43+
},
44+
},
45+
],
46+
},
47+
},
48+
},
49+
],
50+
};

0 commit comments

Comments
 (0)