Compare commits

...

5 Commits

Author SHA1 Message Date
Cedric Verstraeten
f444ae4ad6 add img to readme codespance make public 2023-03-07 22:25:26 +01:00
Cédric Verstraeten
9fa9538320 Update README.md 2023-03-07 22:15:40 +01:00
Cédric Verstraeten
943e81000e Update Dockerfile 2023-03-07 20:15:00 +01:00
Cedric Verstraeten
36b93a34b4 check if QUEUE is not null ;) 2023-02-23 15:16:41 +01:00
Cedric Verstraeten
b0d2409524 stop the motion and livestreaming threads first 2023-02-23 14:58:48 +01:00
4 changed files with 39 additions and 2 deletions

View File

@@ -1,2 +1,2 @@
FROM kerberos/devcontainer:9da0ee3
FROM kerberos/devcontainer:b2bc659
LABEL AUTHOR=Kerberos.io

View File

@@ -210,6 +210,43 @@ After a few minutes, you will see a beautiful `Visual Studio Code` shown in your
![Kerberos Agent VSCode](assets/img/codespace-vscode.png)
On opening of the GitHub Codespace, some dependencies will be installed. Once this is done go ahead to the `ui/src/config.json` file, and (un)comment following section. Make sure to replace the `externalHost` variable with the DNS name you will retrieve from the next step.
// Uncomment this when using codespaces or other special DNS names (which you can't control)
// replace this with the DNS name of the kerberos agent server (the codespace url)
const externalHost = 'cedricve-automatic-computing-machine-v647rxvj4whx9qp-80.preview.app.github.dev';
const dev = {
ENV: 'dev',
HOSTNAME: externalHost,
//API_URL: `${protocol}//${hostname}:8080/api`,
//URL: `${protocol}//${hostname}:8080`,
//WS_URL: `${websocketprotocol}//${hostname}:8080/ws`,
// Uncomment, and comment the above lines, when using codespaces or other special DNS names (which you can't control)
API_URL: `${protocol}//${externalHost}/api`,
URL: `${protocol}//${externalHost}`,
WS_URL: `${websocketprotocol}//${externalHost}/ws`,
};
Go and open two terminals one for the `ui` project and one for the `machinery` project.
1. Terminal A:
cd machinery/
go run main.go run camera 80
2. Terminal B:
cd ui/
yarn start
Once executed, a popup will show up mentioning `portforwarding`. You should see two ports being opened, one for the ui `3000` and one for the machinery `80`. `Right-click` on the port `80` and change visibility from `private` to `public`, this is required to avoid `CORS` errors.
![Codespace make public](./assets/img/codespace-make-public.png)
As mentioned above, copy the hostname of the `machinery` DNS name, and past it in the `ui/src/config.json` file. Once done reload, the `ui` page in your browser, and you should be able to access the login page with the default credentials `root` and `root`.
## Develop and build
Kerberos Agent is divided in two parts a `machinery` and `web`. Both parts live in this repository in their relative folders. For development or running the application on your local machine, you have to run both the `machinery` and the `web` as described below. When running in production everything is shipped as only one artifact, read more about this at [Building for production](#building-for-production).

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

View File

@@ -136,7 +136,7 @@ func ForwardSDStream(ctx context.Context, clientID string, connection *Connectio
logreader:
for {
var encodedImage string
if cursor != nil && decoder != nil {
if queue != nil && cursor != nil && decoder != nil {
pkt, err := cursor.ReadPacket()
if err == nil {
if !pkt.IsKeyFrame {