mirror of
https://github.com/kerberos-io/agent.git
synced 2026-08-29 16:08:33 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9694ac1a3 | ||
|
|
08f589586d | ||
|
|
192f78ae78 | ||
|
|
ef20d4c0b1 | ||
|
|
af95c0f798 | ||
|
|
0e32a10ff5 | ||
|
|
e5d03f19de | ||
|
|
58c3e73f6f | ||
|
|
b16d028293 | ||
|
|
07646e483d |
3
.github/workflows/docker-dev.yml
vendored
3
.github/workflows/docker-dev.yml
vendored
@@ -34,7 +34,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [arm64, arm/v7, arm/v6]
|
||||
#architecture: [arm64, arm/v7, arm/v6]
|
||||
architecture: [arm64, arm/v7]
|
||||
steps:
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
|
||||
1
.github/workflows/docker.yml
vendored
1
.github/workflows/docker.yml
vendored
@@ -62,6 +62,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
architecture: [arm64, arm-v7, arm-v6]
|
||||
#architecture: [arm64, arm-v7]
|
||||
steps:
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
|
||||
@@ -185,6 +185,9 @@ Next to attaching the configuration file, it is also possible to override the co
|
||||
| `AGENT_HUB_PRIVATE_KEY` | The secret access key linked to your account in Kerberos Hub. | "" |
|
||||
| `AGENT_HUB_USERNAME` | Your Kerberos Hub username, which owns the above access and secret keys. | "" |
|
||||
| `AGENT_HUB_SITE` | The site ID of a site you've created in your Kerberos Hub account. | "" |
|
||||
| `AGENT_HUB_TIME` | Enable the timetable for Kerberos Agent | "false" |
|
||||
| `AGENT_HUB_TIMETABLE` | A (weekly) time table to specify when to make recordings "start1,end1,start2,end2;start1.. | "" |
|
||||
| `AGENT_HUB_REGION_POLYGON` | A single polygon set for motion detection: "x1,y1;x2,y2;x3,y3;... | "" |
|
||||
| `AGENT_MQTT_URI` | A MQTT broker endpoint that is used for bi-directional communication (live view, onvif, etc) | "tcp://mqtt.kerberos.io:1883" |
|
||||
| `AGENT_MQTT_USERNAME` | Username of the MQTT broker. | "" |
|
||||
| `AGENT_MQTT_PASSWORD` | Password of the MQTT broker. | "" |
|
||||
|
||||
@@ -19,6 +19,7 @@ func UploadKerberosVault(configuration *models.Configuration, fileName string, d
|
||||
config.KStorage.Directory == "" ||
|
||||
config.KStorage.URI == "" {
|
||||
log.Log.Info("UploadKerberosVault: Kerberos Vault not properly configured.")
|
||||
return false
|
||||
}
|
||||
|
||||
//fmt.Println("Uploading...")
|
||||
|
||||
@@ -44,6 +44,12 @@ func UploadS3(configuration *models.Configuration, fileName string, directory st
|
||||
aws_secret_access_key = config.HubPrivateKey
|
||||
}
|
||||
|
||||
// Check if we have some credentials otherwise we abort the request.
|
||||
if aws_access_key_id == "" || aws_secret_access_key == "" {
|
||||
log.Log.Error("UploadS3: Uploading Failed, as no credentials found")
|
||||
return false
|
||||
}
|
||||
|
||||
s3Client, err := minio.NewWithRegion("s3.amazonaws.com", aws_access_key_id, aws_secret_access_key, true, aws_region)
|
||||
if err != nil {
|
||||
log.Log.Error(err.Error())
|
||||
|
||||
@@ -47,8 +47,7 @@ func ReadUserConfig() (userConfig models.User) {
|
||||
for {
|
||||
jsonFile, err := os.Open("./data/config/user.json")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
fmt.Println("Config file is not found " + "./data/config/user.json" + ", trying again in 5s.")
|
||||
fmt.Println("Config file is not found " + "./data/config/user.json, trying again in 5s: " + err.Error())
|
||||
time.Sleep(5 * time.Second)
|
||||
} else {
|
||||
fmt.Println("Successfully Opened user.json")
|
||||
@@ -292,6 +291,84 @@ func OverrideWithEnvironmentVariables(configuration *models.Configuration) {
|
||||
configuration.Config.HubSite = value
|
||||
break
|
||||
|
||||
/* Conditions */
|
||||
|
||||
case "AGENT_HUB_TIME":
|
||||
configuration.Config.Time = value
|
||||
break
|
||||
case "AGENT_HUB_TIMETABLE":
|
||||
var timetable []*models.Timetable
|
||||
|
||||
// Convert value to timetable array with (start1, end1, start2, end2)
|
||||
// Where days are limited by ; and time by ,
|
||||
// su;mo;tu;we;th;fr;sa
|
||||
// 0,43199,43200,86400;0,43199,43200,86400
|
||||
|
||||
// Split days
|
||||
daysString := strings.Split(value, ";")
|
||||
for _, dayString := range daysString {
|
||||
// Split time
|
||||
timeString := strings.Split(dayString, ",")
|
||||
if len(timeString) == 4 {
|
||||
start1, err := strconv.ParseInt(timeString[0], 10, 64)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
end1, err := strconv.ParseInt(timeString[1], 10, 64)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
start2, err := strconv.ParseInt(timeString[2], 10, 64)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
end2, err := strconv.ParseInt(timeString[3], 10, 64)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
timetable = append(timetable, &models.Timetable{
|
||||
Start1: int(start1),
|
||||
End1: int(end1),
|
||||
Start2: int(start2),
|
||||
End2: int(end2),
|
||||
})
|
||||
}
|
||||
}
|
||||
configuration.Config.Timetable = timetable
|
||||
break
|
||||
|
||||
case "AGENT_HUB_REGION_POLYGON":
|
||||
var coordinates []models.Coordinate
|
||||
|
||||
// Convert value to coordinates array
|
||||
// 0,0;1,1;2,2;3,3
|
||||
coordinatesString := strings.Split(value, ";")
|
||||
for _, coordinateString := range coordinatesString {
|
||||
coordinate := strings.Split(coordinateString, ",")
|
||||
if len(coordinate) == 2 {
|
||||
x, err := strconv.ParseFloat(coordinate[0], 64)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
y, err := strconv.ParseFloat(coordinate[1], 64)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
coordinates = append(coordinates, models.Coordinate{
|
||||
X: x,
|
||||
Y: y,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
configuration.Config.Region.Polygon = []models.Polygon{
|
||||
{
|
||||
Coordinates: coordinates,
|
||||
ID: "0",
|
||||
},
|
||||
}
|
||||
break
|
||||
|
||||
/* MQTT settings for bi-directional communication */
|
||||
case "AGENT_MQTT_URI":
|
||||
configuration.Config.MQTTURI = value
|
||||
|
||||
@@ -132,24 +132,27 @@ func ProcessMotion(motionCursor *pubsub.QueueCursor, configuration *models.Confi
|
||||
|
||||
// Check if within time interval
|
||||
detectMotion := true
|
||||
now := time.Now().In(loc)
|
||||
weekday := now.Weekday()
|
||||
hour := now.Hour()
|
||||
minute := now.Minute()
|
||||
second := now.Second()
|
||||
timeInterval := config.Timetable[int(weekday)]
|
||||
if timeInterval != nil {
|
||||
start1 := timeInterval.Start1
|
||||
end1 := timeInterval.End1
|
||||
start2 := timeInterval.Start2
|
||||
end2 := timeInterval.End2
|
||||
currentTimeInSeconds := hour*60*60 + minute*60 + second
|
||||
if (currentTimeInSeconds >= start1 && currentTimeInSeconds <= end1) ||
|
||||
(currentTimeInSeconds >= start2 && currentTimeInSeconds <= end2) {
|
||||
timeEnabled := config.Time
|
||||
if timeEnabled != "false" {
|
||||
now := time.Now().In(loc)
|
||||
weekday := now.Weekday()
|
||||
hour := now.Hour()
|
||||
minute := now.Minute()
|
||||
second := now.Second()
|
||||
timeInterval := config.Timetable[int(weekday)]
|
||||
if timeInterval != nil {
|
||||
start1 := timeInterval.Start1
|
||||
end1 := timeInterval.End1
|
||||
start2 := timeInterval.Start2
|
||||
end2 := timeInterval.End2
|
||||
currentTimeInSeconds := hour*60*60 + minute*60 + second
|
||||
if (currentTimeInSeconds >= start1 && currentTimeInSeconds <= end1) ||
|
||||
(currentTimeInSeconds >= start2 && currentTimeInSeconds <= end2) {
|
||||
|
||||
} else {
|
||||
detectMotion = false
|
||||
log.Log.Debug("ProcessMotion: Time interval not valid, disabling motion detection.")
|
||||
} else {
|
||||
detectMotion = false
|
||||
log.Log.Info("ProcessMotion: Time interval not valid, disabling motion detection.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
204
ui/public/locales/ja/translation.json
Normal file
204
ui/public/locales/ja/translation.json
Normal file
@@ -0,0 +1,204 @@
|
||||
{
|
||||
"breadcrumb": {
|
||||
"watch_recordings": "録画を見る",
|
||||
"configure": "設定"
|
||||
},
|
||||
"buttons": {
|
||||
"save": "保存"
|
||||
},
|
||||
"navigation": {
|
||||
"profile": "プロフィール",
|
||||
"admin": "管理者",
|
||||
"management": "管理",
|
||||
"dashboard": "ダッシュボード",
|
||||
"recordings": "録画",
|
||||
"settings": "設定",
|
||||
"help_support": "ヘルプ",
|
||||
"swagger": "Swagger API",
|
||||
"documentation": "ドキュメンテーション",
|
||||
"ui_library": "UI ライブラリ",
|
||||
"layout": "言語",
|
||||
"choose_language": "言語を選択"
|
||||
},
|
||||
"dashboard": {
|
||||
"title": "ダッシュボード",
|
||||
"heading": "ビデオ監視の概要",
|
||||
"number_of_days": "日数",
|
||||
"total_recordings": "録画一覧",
|
||||
"connected": "接続済み",
|
||||
"not_connected": "接続されていません",
|
||||
"offline_mode": "オフラインモード",
|
||||
"latest_events": "最新のイベント",
|
||||
"configure_connection": "接続の構成",
|
||||
"no_events": "イベントなし",
|
||||
"no_events_description": "記録が見つかりません。Kerberos エージェントが正しく構成されていることを確認してください。",
|
||||
"motion_detected": "モーションが検出されました",
|
||||
"live_view": "ライブビュー",
|
||||
"loading_live_view": "ライブビューを読み込んでいます",
|
||||
"loading_live_view_description": "ライブ ビューをロードしています。お待ちください。",
|
||||
"time": "時間",
|
||||
"description": "説明",
|
||||
"name": "名前"
|
||||
},
|
||||
"recordings": {
|
||||
"title": "録画",
|
||||
"heading": "すべての録音を 1 か所に",
|
||||
"search_media": "メディアを検索"
|
||||
},
|
||||
"settings": {
|
||||
"title": "設定",
|
||||
"heading": "搭載カメラ",
|
||||
"submenu": {
|
||||
"all": "全て",
|
||||
"overview": "概要",
|
||||
"camera": "カメラ",
|
||||
"recording": "録音",
|
||||
"streaming": "ストリーミング",
|
||||
"conditions": "条件",
|
||||
"persistence": "持続性"
|
||||
},
|
||||
"info": {
|
||||
"kerberos_hub_demo": "Kerberos Hub のデモ環境を見て、Kerberos Hub の動作を確認してください。",
|
||||
"configuration_updated_success": "構成が正常に更新されました。",
|
||||
"configuration_updated_error": "保存中にエラーが発生しました。",
|
||||
"verify_hub": "Kerberos Hub の設定を確認しています。",
|
||||
"verify_hub_success": "Kerberos Hub 設定が正常に検証されました。",
|
||||
"verify_hub_error": "Kerberos Hub の検証中に問題が発生しました",
|
||||
"verify_persistence": "持続性設定を確認しています。",
|
||||
"verify_persistence_success": "持続性設定が正常に検証されました。",
|
||||
"verify_persistence_error": "持続性の検証中に問題が発生しました",
|
||||
"verify_camera": "カメラの設定を確認しています。",
|
||||
"verify_camera_success": "カメラの設定が正常に検証されました。",
|
||||
"verify_camera_error": "カメラ設定の確認中に問題が発生しました"
|
||||
},
|
||||
"overview": {
|
||||
"general": "全般的",
|
||||
"description_general": "Kerberos エージェントの一般設定",
|
||||
"key": "鍵",
|
||||
"camera_name": "カメラ名",
|
||||
"timezone": "タイムゾーン",
|
||||
"select_timezone": "タイムゾーンを選択",
|
||||
"advanced_configuration": "詳細設定",
|
||||
"description_advanced_configuration": "Kerberos エージェントの特定の部分を有効または無効にするための詳細な構成オプション",
|
||||
"offline_mode": "オフラインモード",
|
||||
"description_offline_mode": "すべての送信トラフィックを無効にする"
|
||||
},
|
||||
"camera": {
|
||||
"camera": "カメラ",
|
||||
"description_camera": "選択したカメラに接続するには、カメラの設定が必要です。",
|
||||
"only_h264": "現在、H264 RTSP ストリームのみがサポートされています。",
|
||||
"rtsp_url": "RTSP URL",
|
||||
"rtsp_h264": "カメラへの H264 RTSP 接続。",
|
||||
"sub_rtsp_url": "Sub RTSP url (ライブストリーミングに使用)",
|
||||
"sub_rtsp_h264": "カメラの低解像度へのセカンダリ RTSP 接続。",
|
||||
"onvif": "ONVIF",
|
||||
"description_onvif": "ONVIF 機能と通信するための資格情報",
|
||||
"onvif_xaddr": "ONVIF xaddr",
|
||||
"onvif_username": "ONVIF ユーザー名",
|
||||
"onvif_password": "ONVIF パスワード",
|
||||
"verify_connection": "接続の確認",
|
||||
"verify_sub_connection": "サブ接続の確認"
|
||||
},
|
||||
"recording": {
|
||||
"recording": "録画",
|
||||
"description_recording": "録画方法を指定します。",
|
||||
"continuous_recording": "連続記録",
|
||||
"description_continuous_recording": "24 時間またはモーション ベースの録画を行います。",
|
||||
"max_duration": "動画の最大再生時間 (秒)",
|
||||
"description_max_duration": "録音の最大継続時間。",
|
||||
"pre_recording": "事前録画 (キー フレームのバッファリング)",
|
||||
"description_pre_recording": "イベントが発生する数秒前。",
|
||||
"post_recording": "ポストレコーディング (秒)",
|
||||
"description_post_recording": "イベントが発生してからの秒数。",
|
||||
"threshold": "記録閾値(ピクセル)",
|
||||
"description_threshold": "記録するために変更されたピクセル数",
|
||||
"autoclean": "オートクリーン",
|
||||
"description_autoclean": "特定のストレージ容量 (MB) に達したときに、Kerberos エージェントが記録をクリーンアップできるかどうかを指定します。",
|
||||
"autoclean_enable": "自動クリーニングを有効にする",
|
||||
"autoclean_description_enable": "容量に達したら、最も古い記録を削除します。",
|
||||
"autoclean_max_directory_size": "最大ディレクトリ サイズ (MB)",
|
||||
"autoclean_description_max_directory_size": "保存された録音の最大 MB。",
|
||||
"fragmentedrecordings": "断片化された録音",
|
||||
"description_fragmentedrecordings": "録音が断片化されている場合、HLS ストリームに適しています。",
|
||||
"fragmentedrecordings_enable": "断片化を有効にする",
|
||||
"fragmentedrecordings_description_enable": "HLS には断片化された録音が必要です。",
|
||||
"fragmentedrecordings_duration": "フラグメント期間",
|
||||
"fragmentedrecordings_description_duration": "1 つのフラグメントの持続時間。"
|
||||
},
|
||||
"streaming": {
|
||||
"stun_turn": "WebRTCのSTUN/TURN",
|
||||
"description_stun_turn": "フル解像度のライブ ストリーミングには、WebRTC の概念を使用します。",
|
||||
"stun_server": "STUNサーバー",
|
||||
"turn_server": "TURNサーバー",
|
||||
"turn_username": "ユーザー名",
|
||||
"turn_password": "パスワード",
|
||||
"stun_turn_forward": "転送とトランスコーディング",
|
||||
"stun_turn_description_forward": "TURN/STUN 通信の最適化と機能強化。",
|
||||
"stun_turn_webrtc": "WebRTC ブローカーへの転送",
|
||||
"stun_turn_description_webrtc": "MQTT を介して h264 ストリームを転送する",
|
||||
"stun_turn_transcode": "トランスコード ストリーム",
|
||||
"stun_turn_description_transcode": "ストリームを低解像度に変換する",
|
||||
"stun_turn_downscale": "解像度のダウンスケール (% または元の解像度)",
|
||||
"mqtt": "MQTT",
|
||||
"description_mqtt": "それらの通信にはMQTT ブローカーが使用されます。",
|
||||
"description2_mqtt": "たとえば、ライブストリーミングや ONVIF (PTZ) 機能を実現するために、Kerberos エージェントに送信します。",
|
||||
"mqtt_brokeruri": "ブローカー URI",
|
||||
"mqtt_username": "ユーザー名",
|
||||
"mqtt_password": "パスワード"
|
||||
},
|
||||
"conditions": {
|
||||
"timeofinterest": "特定の時間",
|
||||
"description_timeofinterest": "特定の時間間隔 (タイムゾーンに基づく) の間のみ録画を行います。",
|
||||
"timeofinterest_enabled": "有効",
|
||||
"timeofinterest_description_enabled": "有効にすると、時間枠を指定できます",
|
||||
"sunday": "日曜日",
|
||||
"monday": "月曜日",
|
||||
"tuesday": "火曜日",
|
||||
"wednesday": "水曜日",
|
||||
"thursday": "木曜日",
|
||||
"friday": "金曜日",
|
||||
"saturday": "土曜日",
|
||||
"externalcondition": "外部条件",
|
||||
"description_externalcondition": "外部 Web サービスに応じて、記録を有効または無効にすることができます。",
|
||||
"regionofinterest": "検出領域",
|
||||
"description_regionofinterest": "1 つまたは複数の領域を定義すると、定義した領域でのみモーションが追跡されます。"
|
||||
},
|
||||
"persistence": {
|
||||
"kerberoshub": "ケルベロス ハブ",
|
||||
"description_kerberoshub": "Kerberos エージェントはハートビートを中央に送信できます。",
|
||||
"description2_kerberoshub": "インストール。",
|
||||
"persistence": "持続性",
|
||||
"saasoffering": "Kerberos ハブ (SAAS オファリング)",
|
||||
"description_persistence": "録音を保存する機能を持つことは、すべての始まりです。",
|
||||
"description2_persistence": "、またはサードパーティのプロバイダ",
|
||||
"select_persistence": "永続性を選択",
|
||||
"kerberoshub_proxyurl": "Kerberos ハブ プロキシ URL",
|
||||
"kerberoshub_description_proxyurl": "記録をアップロードするためのプロキシ エンドポイント。",
|
||||
"kerberoshub_apiurl": "ケルベロス ハブ API URL",
|
||||
"kerberoshub_description_apiurl": "録音をアップロードするための API エンドポイント。",
|
||||
"kerberoshub_publickey": "公開鍵",
|
||||
"kerberoshub_description_publickey": "Kerberos Hub アカウントに付与された公開鍵。",
|
||||
"kerberoshub_privatekey": "秘密鍵",
|
||||
"kerberoshub_description_privatekey": "Kerberos Hub アカウントに付与された秘密鍵。",
|
||||
"kerberoshub_site": "サイト",
|
||||
"kerberoshub_description_site": "Kerberos Hub で Kerberos エージェントが属しているサイト ID。",
|
||||
"kerberoshub_region": "領域",
|
||||
"kerberoshub_description_region": "録音を保存しているリージョン。",
|
||||
"kerberoshub_bucket": "bucket",
|
||||
"kerberoshub_description_bucket": "録音を保存しているbucket",
|
||||
"kerberoshub_username": "ユーザー名/ディレクトリ",
|
||||
"kerberoshub_description_username": "Kerberos Hub アカウントのユーザー名。",
|
||||
"kerberosvault_apiurl": "Kerberos ボールト API URL",
|
||||
"kerberosvault_description_apiurl": "Kerberos ボールト API",
|
||||
"kerberosvault_provider": "プロバイダ",
|
||||
"kerberosvault_description_provider": "録音の送信先のプロバイダー。",
|
||||
"kerberosvault_directory": "ディレクトリ",
|
||||
"kerberosvault_description_directory": "録音がプロバイダーに保存されるサブディレクトリ。",
|
||||
"kerberosvault_accesskey": "アクセスキー",
|
||||
"kerberosvault_description_accesskey": "Kerberos Vault アカウントのアクセス キー。",
|
||||
"kerberosvault_secretkey": "秘密鍵",
|
||||
"kerberosvault_description_secretkey": "Kerberos Vault アカウントの秘密鍵。",
|
||||
"verify_connection": "接続の確認"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ const LanguageSelect = () => {
|
||||
de: { label: 'Deutsch', dir: 'ltr', active: false },
|
||||
pt: { label: 'Português', dir: 'ltr', active: false },
|
||||
es: { label: 'Español', dir: 'ltr', active: false },
|
||||
ja: { label: '日本', dir: 'rlt', active: false },
|
||||
};
|
||||
|
||||
if (!languageMap[selected]) {
|
||||
|
||||
@@ -14,7 +14,7 @@ i18n
|
||||
escapeValue: false,
|
||||
},
|
||||
load: 'languageOnly',
|
||||
whitelist: ['de', 'en', 'nl', 'fr', 'pl', 'es', 'pt'],
|
||||
whitelist: ['de', 'en', 'nl', 'fr', 'pl', 'es', 'pt', 'ja'],
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
|
||||
Reference in New Issue
Block a user