]> git.r.bdr.sh - rbdr/junction/blame - README.md
Bump version
[rbdr/junction] / README.md
CommitLineData
02bc8bc5
RBR
1# Junction
2
bab26a4d 3Connect people through any URL.
1ed219c8 4
bab26a4d
RBR
5Junction is a web extension for Firefox, Chrome and Safari that lets you start
6an audio call at any URL.
1ed219c8 7
bab26a4d
RBR
8## Building
9
10Running `make` or `make package` will regenerate the content script, and
11package the extension for all browsers in the `./build/` directory with
12the following outputs:
13
14- `junction.xpi`: The firefox extension
15- `junction.zip`: The chrome extension
16- `Junction.app`: The safari extension app
17
18## Developing
19
20The project is divided into three main parts:
21
22- `server`: A server that handles message passing to establish the WebRTC
23 connections.
24- `extension`: The main code of the extension itself.
25- `safari`: The safari app, it wraps the extension using symlinks.
26
27### Dependencies
28
5d2c4ecb
RBR
29- `make` to run the build commands. It's included in `macos`
30- `xcode` to build the safari extension. Can be downloaded from the
31 [apple developer portal][xcode-download].
bab26a4d 32- `node` and `pnpm` to build the extension, and if you want to run the server
5d2c4ecb
RBR
33 directly. Node can be installed via brew with `brew install node`, or with
34 a version manager like [asdf][asdf]. For `pnpm` check the [website][pnpm].
bab26a4d 35- `podman` and `podman-compose` if you want to run the server as a container.
5d2c4ecb
RBR
36 Both can be installed with homebrew `brew install podman podman-compose`
37- `prettier` to format Javascript, JSON, Yaml, and Markdown. Will automatically
38 install when running `make format`.
39- `xcbeautify` to format swift. Can be installed with homebrew
40 `brew install xcbeautify`
41
42If you're running macos and using homebrew, you can install them all with
43`make prepare-environment`.
bab26a4d
RBR
44
45### Server
46
47The server is a socket.io server that relays messages between peers to help
48establish a WebRTC connection.
49
50#### Configuration
51
52You can use environment variables to control the server.
53
54- `JUNCTION_SERVER_PORT` which port to listen on. Defaults to `8000`.
55
56### Extension
57
58The extension uses WebExtension manifest v2 and is compatible with Firefox,
59Chrome and Safari.
60
61You can build all extensions using `make` in the root of the directory.
62
63If you want to run manually then you can run `pnpm install` from the
64`extension` folder to install dependencies, and `pnpm build` to generate the
65content script.
e3dca99b 66
67```
80172072 68$ pnpm install && pnpm build
e3dca99b 69```
70
bab26a4d 71#### Testing on Firefox
1ed219c8
RBR
72
73In order to test on firefox, first go to `about:debugging`, then click
74on the `This Firefox` option. Then click on `Load Temporary Add-On` and
bab26a4d
RBR
75point the browser to the `build/junction.xpi` file if you're using `make`, or
76`extension/manifest.json` file if you're testing without packaging.
1ed219c8 77
bab26a4d
RBR
78This will enable the extension and will allow you to use the inspector to
79debug.
a94a5407 80
bab26a4d 81#### Testing on Chrome
a94a5407
RBR
82
83In order to test on chrome, first go to `chrome://extensions/`. Make sure
bab26a4d
RBR
84`Developer mode` is enabled. You can drag the `build/junction.zip` file or
85click `Load Unpacked` and point the browser to the `extension` directory.
86
87#### Testing on Safari
88
89Open `Junction.app` and then enable the extension in Safari.
ec4adc33 90
bab26a4d 91### Formatting
ec4adc33 92
bab26a4d 93Running `make format` will format the code with prettify and xcbeautify
5d2c4ecb
RBR
94
95[xcode-download]: https://developer.apple.com/xcode/resources/
96[asdf]: https://asdf-vm.com/
97[pnpm]: https://pnpm.io/installation