2023-03-16 12:01:10 +00:00
# Fleetd Chrome Extension
2023-06-09 17:03:01 +00:00
## Packaging the extension
Generate a .pem file to be the key for the chrome extension.
2023-03-16 12:01:10 +00:00
(In parent dir)
2023-06-09 17:03:01 +00:00
Run the following command to generate an extension.
2023-03-16 12:01:10 +00:00
``` sh
2023-06-09 17:03:01 +00:00
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --pack-extension=./fleetd-chrome --pack-extension-key=path/to/chrome.pem
2023-03-16 12:01:10 +00:00
```
2023-06-09 17:03:01 +00:00
## Adding Chrome to Fleet
To learn how to package and add hosts to Fleet, visit: https://fleetdm.com/docs/using-fleet/adding-hosts#add-chromebooks-with-the-fleetd-chrome-extension.
2023-03-16 12:01:10 +00:00
## Debugging
### Service worker
View service worker logs in chrome://serviceworker-internals/?devtools (in production), or in chrome://extensions (only during development).
2023-05-26 18:32:01 +00:00
2023-06-14 12:36:18 +00:00
### Manual Enroll
> Steps 1 and 2 can be performed on your workstation. Step 3 and 4 are to be executed on the target Chromebook.
2023-05-26 18:32:01 +00:00
1. Create your .env file:
2023-06-14 12:36:18 +00:00
> IMPORTANT: The address in `FLEET_URL` must have a valid TLS certificate.
```sh
echo 'FLEET_URL="https://your-fleet-server.example.com"' >> .env
2023-05-26 18:32:01 +00:00
echo 'FLEET_ENROLL_SECRET="< your enroll secret > "' >> .env
```
2023-06-14 12:36:18 +00:00
To test with your local Fleet server, you can use ngrok:
```sh
ngrok http https://localhost:8080
2023-05-26 18:32:01 +00:00
```
2023-06-14 12:36:18 +00:00
2. Build the "unpacked extension":
```sh
2023-05-26 18:32:01 +00:00
npm install & & npm run build
```
2023-06-14 12:36:18 +00:00
The above command will generate an unpacked extension in `./dist` .
3. Send the `./dist` folder to the target Chromebook.
4. In the target Chromebook, go to `chrome://settings` , toggle `Developer mode` and click on `Load unpacked` and select the `dist` folder.