Skip to content

Commit

Permalink
Merge branch 'main' into gs-upload-test
Browse files Browse the repository at this point in the history
  • Loading branch information
benptc committed Mar 7, 2024
2 parents 4383f4e + ff23fce commit 21e3fae
Show file tree
Hide file tree
Showing 22 changed files with 430 additions and 233 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,44 @@ jobs:
run: ./scripts/ci.sh

- name: Run tests
run: npm test
env:
CI: true
ALLOW_SECURE_MODE: true

- uses: actions/upload-artifact@v3
if: always()
with:
name: test-screenshots
path: screenshots/

build-insecure:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Configure git
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://${TOKEN}:[email protected]/".insteadOf "https://github.com/"

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Download and install supplementary addons and test data
run: ./scripts/ci.sh

- name: Run tests (http mode)
run: npm test
env:
CI: true
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ Finally, configure and generate a local self-signed certificate.
cp scripts/cert.conf.template scripts/cert.conf
# edit scripts/cert.conf to include your local ip address if desired
vim scripts/cert.conf
./scripts/generate_certificate.sh
./scripts/generate_cert.sh or ./scripts/generate_cert.ps1 (for windows)
```

If desired, you can now add this certificate (cert.pem) to your local trusted
certificate store (e.g. Keychain on macOS) to not have to manually add it to
each browser's cert store.
each browser's cert store. For more information on trusting on iOS, see [this
guide](./docs/ios-cert-install.md)

You can now run the server using the following command:

Expand Down
6 changes: 6 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const argv = yargs
description: 'The port on which udp discovery broadcasts occur (default 52316)',
type: 'number',
})
.option('secure', {
description: 'Enable the server\'s secure (https) mode',
type: 'boolean',
})
.help()
.argv;

Expand Down Expand Up @@ -54,3 +58,5 @@ module.exports.beatPort = argv.udpPort || 52316;

// Whether to enable the offline clone functionality
module.exports.persistToCloud = false;

module.exports.allowSecureMode = argv.secure || process.env.ALLOW_SECURE_MODE === 'true';
Binary file added docs/assets/downloading-certpem-clicked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/downloading-certpem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/python3-http-server.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/settings-profile-install.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/settings-with-profile-downloaded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions docs/ios-cert-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: doc
title: Installing Self-signed Certificates on iOS
permalink: /docs/dive-deeper/internals/ios-self-signed-certificates
---

The overall process to trusting a local edge server's self-signed certificates
is to download the cert onto the phone then trust the "Profile" this cert
provides in the phone's settings.

### Download cert.pem onto phone
We need to get the file `cert.pem` onto the phone. One such tool is python's built-in http server:

![terminal window showing results of running python3's http server module](./assets/python3-http-server.png)

Next, navigate to http://your-edge-server-ip-address:8000/ to see a listing of
all files in this directory and download cert.pem from the list.

![a directory listing in Safari on iOS](./assets/downloading-certpem.png)

The page will prompt you if you trust this configuration profile. Accept this prompt and open the Settings app to finish trusting the profile.

![a popup from Safari asking whether you trust the configuration profile](./assets/downloading-certpem-clicked.png)

### Trust configuration profile in Settings

In the Settings app there will be a helpful shortcut "Profile Downloaded" to
navigate directly to trusting the newly downloaded profile.

![Settings app with "Profile Downloaded" shortcut button visible](./assets/settings-with-profile-downloaded.png)

Tap this shortcut to move onto trusting the profile. Press "Install" on this
next screen and enter your passcode to finish the trusting process.

![A prompt to the user to install the new configuration profile](./assets/settings-profile-install.png)

With this entire process complete, you should now see the Configuration Profile
reflected in the Settings - VPN and Device Management list of profiles.

2 changes: 1 addition & 1 deletion libraries/objectDefaultFiles/toolsocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ function ToolboxUtilities_parseUrl(url, schema) {
}
}

const fileEnum = ["jpg", "jpeg", "gif", "zip", "glb", "html", "map", "htm", "xml", "dat", "png", "js", "json", "obj", "fbx", "svg", "mp4", "pdf", "csv", "css", "woff", "otf", "webm", "webp", "ttf", "wasm"];
const fileEnum = ["html", "htm", "js", "json", "jpg", "jpeg", "gif", "zip", "glb", "map", "xml", "dat", "png","obj", "splat", "ply", "3dt", "fbx", "svg", "mp4", "pdf", "csv", "css", "woff", "otf", "webm", "webp", "ttf", "wasm"];
let res = {};
let route = "";
let querySplit = [];
Expand Down
Loading

0 comments on commit 21e3fae

Please sign in to comment.