mirror of
https://github.com/kerberos-io/agent.git
synced 2026-08-30 16:18:33 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9fa9538320 | ||
|
|
943e81000e | ||
|
|
36b93a34b4 | ||
|
|
b0d2409524 | ||
|
|
be7a231950 |
@@ -1,2 +1,2 @@
|
||||
FROM kerberos/devcontainer:9da0ee3
|
||||
FROM kerberos/devcontainer:b2bc659
|
||||
LABEL AUTHOR=Kerberos.io
|
||||
|
||||
36
README.md
36
README.md
@@ -210,6 +210,42 @@ After a few minutes, you will see a beautiful `Visual Studio Code` shown in your
|
||||
|
||||

|
||||
|
||||
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.
|
||||
|
||||
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).
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
|
||||
{
|
||||
"type": "",
|
||||
"key": "a-custom-key2",
|
||||
"name": "yolo23",
|
||||
"friendly_name": "",
|
||||
"key": "",
|
||||
"name": "agent",
|
||||
"time": "false",
|
||||
"offline": "false",
|
||||
"auto_clean": "100",
|
||||
"auto_clean": "true",
|
||||
"max_directory_size": 100,
|
||||
"timezone": "Europe/Brussels",
|
||||
"timezone": "Africa/Ceuta",
|
||||
"capture": {
|
||||
"name": "",
|
||||
"ipcamera": {
|
||||
"rtsp": "rtsp://kellyvd:cedricve123@192.168.1.64:554/Streaming/Channels/101?transportmode=multicast\u0026profile=Profile_2",
|
||||
"sub_rtsp": "rtsp://kellyvd:cedricve123@192.168.1.64:554/Streaming/Channels/102?transportmode=multicast\u0026profile=Profile_2",
|
||||
"fps": "",
|
||||
"onvif_xaddr": "192.168.1.64",
|
||||
"onvif_username": "kellyvd",
|
||||
"onvif_password": "cedricve123"
|
||||
"rtsp": "",
|
||||
"sub_rtsp": "",
|
||||
"fps": ""
|
||||
},
|
||||
"usbcamera": {
|
||||
"device": ""
|
||||
@@ -24,16 +21,15 @@
|
||||
"raspicamera": {
|
||||
"device": ""
|
||||
},
|
||||
"recording": "true",
|
||||
"continuous": "false",
|
||||
"postrecording": 10,
|
||||
"prerecording": 20,
|
||||
"maxlengthrecording": 120,
|
||||
"postrecording": 20,
|
||||
"prerecording": 10,
|
||||
"maxlengthrecording": 30,
|
||||
"transcodingwebrtc": "",
|
||||
"transcodingresolution": 0,
|
||||
"forwardwebrtc": "",
|
||||
"fragmented": "true",
|
||||
"fragmentedduration": 10,
|
||||
"fragmented": "false",
|
||||
"fragmentedduration": 8,
|
||||
"pixelChangeThreshold": 150
|
||||
},
|
||||
"timetable": [
|
||||
@@ -88,43 +84,15 @@
|
||||
"x2": 800,
|
||||
"y2": 640
|
||||
},
|
||||
"polygon": [
|
||||
{
|
||||
"id": "1676324389112",
|
||||
"coordinates": [
|
||||
{
|
||||
"x": 101.30172413793105,
|
||||
"y": 147.75
|
||||
},
|
||||
{
|
||||
"x": 450.1099137931035,
|
||||
"y": 147.75
|
||||
},
|
||||
{
|
||||
"x": 450.1099137931035,
|
||||
"y": 398.5603448275862
|
||||
},
|
||||
{
|
||||
"x": 101.30172413793105,
|
||||
"y": 398.5603448275862
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
"polygon": []
|
||||
},
|
||||
"cloud": "kstorage",
|
||||
"cloud": "s3",
|
||||
"s3": {
|
||||
"proxyuri": "http://proxy.kerberos.io",
|
||||
"bucket": "kerberosaccept",
|
||||
"region": "eu-west1",
|
||||
"username": "cedricve"
|
||||
},
|
||||
"kstorage": {
|
||||
"uri": "https://api.vault.kerberos.io",
|
||||
"access_key": "AQER!@$214m2154125!TFsdgdsddb325@#%",
|
||||
"secret_access_key": ")@#%323kTEWTG@#%@)R@TWWEG",
|
||||
"directory": "cedricve"
|
||||
"region": "eu-west1"
|
||||
},
|
||||
"kstorage": {},
|
||||
"mqtturi": "tcp://mqtt.kerberos.io:1883",
|
||||
"mqtt_username": "",
|
||||
"mqtt_password": "",
|
||||
@@ -133,9 +101,9 @@
|
||||
"turn_username": "username1",
|
||||
"turn_password": "password1",
|
||||
"heartbeaturi": "",
|
||||
"hub_uri": "http://api.cloud.kerberos.io",
|
||||
"hub_key": "AKIA5V6EGLUW6KCGC2YL",
|
||||
"hub_private_key": "+mHvJ/na+4uTUmoTqr+7oG82cpizl7Dq+245UNB6",
|
||||
"hub_uri": "https://api.cloud.kerberos.io",
|
||||
"hub_key": "",
|
||||
"hub_private_key": "",
|
||||
"hub_site": "",
|
||||
"condition_uri": ""
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user