Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
0110e41
gr25: ingest skeleton
BK1031 Feb 13, 2025
597cd62
add gr25 to gh actions
BK1031 Feb 13, 2025
7c05f76
gr25: rincon registration
BK1031 Feb 13, 2025
f3cb270
update docker compose
BK1031 Feb 13, 2025
07b4f30
gr25: add signal db migration
BK1031 Feb 13, 2025
d2eaec3
gr25: add dockerfile
BK1031 Feb 13, 2025
a729129
mqtt ingest subscription and deserialization
BK1031 Feb 14, 2025
ec4a64b
fixed logging in createsignal func
BK1031 Feb 14, 2025
cb53c47
update docker compose
BK1031 Feb 15, 2025
23f7300
Trigger Build
BK1031 Feb 15, 2025
04315fe
Trigger Build
BK1031 Feb 15, 2025
3f7b97e
Trigger Build
BK1031 Feb 15, 2025
2e0584e
Trigger Build
BK1031 Feb 18, 2025
21f3136
Trigger Build
BK1031 Feb 18, 2025
0790d95
Trigger Build
BK1031 Feb 18, 2025
0c879cd
Trigger Build
BK1031 Feb 18, 2025
bffd748
Trigger Build
BK1031 Feb 18, 2025
cee132d
Trigger Build
BK1031 Feb 18, 2025
c0958f6
Trigger Build
BK1031 Feb 18, 2025
125c27d
Trigger Build
BK1031 Feb 18, 2025
c96930a
Trigger Build
BK1031 Feb 18, 2025
df25430
Trigger Build
BK1031 Feb 18, 2025
125e763
Trigger Build
BK1031 Feb 18, 2025
4478ed2
Trigger Build
BK1031 Feb 18, 2025
c20891f
Trigger Build
BK1031 Feb 18, 2025
36a80fa
Trigger Build
BK1031 Feb 18, 2025
53043a1
Trigger Build
BK1031 Feb 19, 2025
10e15e3
Trigger Build
BK1031 Feb 19, 2025
48d11e4
Trigger Build
BK1031 Feb 19, 2025
f2177c8
Trigger Build
BK1031 Feb 19, 2025
fe08636
Trigger Build
BK1031 Feb 19, 2025
ec95c73
Trigger Build
BK1031 Feb 19, 2025
3cc635a
Trigger Build
BK1031 Feb 19, 2025
f7f06cb
Trigger Build
BK1031 Feb 19, 2025
86721fc
Trigger Build
BK1031 Feb 19, 2025
e00debf
Trigger Build
BK1031 Feb 19, 2025
b2cc6c9
Trigger Build
BK1031 Feb 19, 2025
c73625a
Trigger Build
BK1031 Feb 19, 2025
db8168a
Trigger Build
BK1031 Feb 19, 2025
e783c5c
Trigger Build
BK1031 Feb 19, 2025
f43b067
Trigger Build
BK1031 Feb 19, 2025
cafa9fe
Trigger Build
BK1031 Feb 19, 2025
2f65814
Trigger Build
BK1031 Feb 19, 2025
1402217
Trigger Build
BK1031 Feb 19, 2025
9c1218c
Trigger Build
BK1031 Feb 19, 2025
77838d1
Trigger Build
BK1031 Feb 19, 2025
903943b
Trigger Build
BK1031 Feb 19, 2025
e28408a
Trigger Build
BK1031 Feb 19, 2025
2d4b45c
Trigger Build
BK1031 Feb 19, 2025
210111a
Trigger Build
BK1031 Feb 19, 2025
5abd6ee
Trigger Build
BK1031 Feb 19, 2025
8df13ee
Trigger Build
BK1031 Feb 19, 2025
420f46c
Trigger Build
BK1031 Feb 19, 2025
dc69438
Trigger Build
BK1031 Feb 19, 2025
d79d398
Trigger Build
BK1031 Feb 19, 2025
570e3ce
Trigger Build
BK1031 Feb 19, 2025
53269b4
Trigger Build
BK1031 Feb 19, 2025
1253ee1
Trigger Build
BK1031 Feb 19, 2025
ceffd54
Trigger Build
BK1031 Feb 19, 2025
3bf54f6
Trigger Build
BK1031 Feb 19, 2025
a980e9e
Trigger Build
BK1031 Feb 19, 2025
63419be
Trigger Build
BK1031 Feb 19, 2025
a425fd2
Trigger Build
BK1031 Feb 19, 2025
5b7a1e2
Trigger Build
BK1031 Feb 19, 2025
a7b1ec7
Trigger Build
BK1031 Feb 19, 2025
2339466
Trigger Build
BK1031 Feb 19, 2025
e872b84
Trigger Build
BK1031 Feb 19, 2025
16086e2
Trigger Build
BK1031 Feb 19, 2025
a473b56
Trigger Build
BK1031 Feb 19, 2025
16abf8a
Trigger Build
BK1031 Feb 19, 2025
c99dd90
Trigger Build
BK1031 Feb 19, 2025
b76ea10
Trigger Build
BK1031 Feb 19, 2025
72502bb
Trigger Build
BK1031 Feb 19, 2025
ca29a0b
Trigger Build
BK1031 Feb 19, 2025
03465b3
Trigger Build
BK1031 Feb 19, 2025
9997513
Trigger Build
BK1031 Feb 19, 2025
07f05fd
Trigger Build
BK1031 Feb 19, 2025
bb90033
Trigger Build
BK1031 Feb 19, 2025
2e63091
Trigger Build
BK1031 Feb 19, 2025
ba9edbc
Trigger Build
BK1031 Feb 19, 2025
f7863d7
Trigger Build
BK1031 Feb 19, 2025
df237c6
Trigger Build
BK1031 Feb 19, 2025
4171357
Trigger Build
BK1031 Feb 19, 2025
94bb72e
Trigger Build
BK1031 Feb 19, 2025
dabc008
Trigger Build
BK1031 Feb 19, 2025
d35593c
Trigger Build
BK1031 Feb 19, 2025
07476fc
Trigger Build
BK1031 Feb 19, 2025
4a52a79
Trigger Build
BK1031 Feb 19, 2025
1b2611d
Trigger Build
BK1031 Feb 19, 2025
c9df2f6
Trigger Build
BK1031 Feb 19, 2025
b666ce7
Trigger Build
BK1031 Feb 19, 2025
4f19f56
Trigger Build
BK1031 Feb 19, 2025
92eef20
Trigger Build
BK1031 Feb 19, 2025
5d110f6
Trigger Build
BK1031 Feb 20, 2025
82bf4b1
Trigger Build
BK1031 Feb 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,26 @@ jobs:
go get .
go build

gr25:
runs-on: ubuntu-latest
name: gr25
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.22.0'
- name: Build GR25
run: |
cd gr25
go get .
go build

all:
needs: [dashboard, auth, jeddah, gr24]
needs: [dashboard, auth, jeddah, gr24, gr25]
runs-on: ubuntu-latest
name: all
steps:
Expand Down
70 changes: 20 additions & 50 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3.9"
name: mapache

services:
kerbecs:
Expand Down Expand Up @@ -33,62 +33,32 @@ services:
HEARTBEAT_TYPE: "server"
HEARTBEAT_INTERVAL: "60"
DB_DRIVER: "mysql"
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_HOST: ${DATABASE_HOST}
DB_PORT: ${DATABASE_PORT}
DB_NAME: ${DATABASE_NAME}
DB_USER: ${DATABASE_USER}
DB_PASSWORD: ${DATABASE_PASSWORD}
ports:
- "10311:10311"

bahrain:
image: gauchoracing/mp_bahrain:latest
container_name: bahrain
restart: unless-stopped
depends_on:
- rincon
environment:
ENV: ${ENV}
PORT: "7002"
AUTH_SIGNING_KEY: ${AUTH_SIGNING_KEY}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
RINCON_USER: ${RINCON_USER}
RINCON_PASSWORD: ${RINCON_PASSWORD}
ports:
- "7002"

gr24:
image: gauchoracing/mp_gr24:latest
container_name: gr24
restart: unless-stopped
depends_on:
- rincon
environment:
ENV: ${ENV}
PORT: "7004"
MQTT_HOST: ${MQTT_HOST}
MQTT_PORT: ${MQTT_PORT}
MQTT_USER: ${MQTT_USER}
MQTT_PASSWORD: ${MQTT_PASSWORD}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
RINCON_USER: ${RINCON_USER}
RINCON_PASSWORD: ${RINCON_PASSWORD}
ports:
- "7004"

nanomq:
image: emqx/nanomq:latest
restart: unless-stopped
ports:
- "1883:1883"

db:
image: ghcr.io/singlestore-labs/singlestoredb-dev:latest
restart: unless-stopped
volumes:
- s2data:/data
- ./singlestore/init.sql:/init.sql
ports:
- "3306:3306"
- "3380:8080"
- "3381:9000"
environment:
ROOT_PASSWORD: "${DATABASE_PASSWORD}"

volumes:
mysql:
s2data:
168 changes: 168 additions & 0 deletions gr25/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
.env

### VisualStudioCode template
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### Go template
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
coverage.html

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Windows template
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

### macOS template
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
29 changes: 29 additions & 0 deletions gr25/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS builder

RUN apk --no-cache add ca-certificates
RUN apk add --no-cache tzdata

WORKDIR /app

COPY go.mod ./
COPY go.sum ./
RUN go mod download

COPY . ./
ARG TARGETOS
ARG TARGETARCH
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /gr25

##
## Deploy
##
FROM alpine:3.21

WORKDIR /

COPY --from=builder /gr25 /gr25

COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
ENV TZ=America/Los_Angeles

ENTRYPOINT ["/gr25"]
15 changes: 15 additions & 0 deletions gr25/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.PHONY: clean run test

clean:
go clean
go mod tidy
rm *.out
rm coverage.html

run:
chmod +x scripts/run.sh
./scripts/run.sh

test:
chmod +x scripts/test.sh
./scripts/test.sh
28 changes: 28 additions & 0 deletions gr25/api/api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package api

import (
"gr25/config"
"time"

"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
)

func SetupRouter() *gin.Engine {
if config.Env == "PROD" {
gin.SetMode(gin.ReleaseMode)
}
r := gin.Default()
r.Use(cors.New(cors.Config{
AllowAllOrigins: true,
AllowMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"},
AllowHeaders: []string{"Origin", "Content-Length", "Content-Type", "Authorization"},
MaxAge: 12 * time.Hour,
AllowCredentials: true,
}))
return r
}

func InitializeRoutes(router *gin.Engine) {
router.GET("/gr25/ping", Ping)
}
12 changes: 12 additions & 0 deletions gr25/api/ping.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package api

import (
"gr25/config"
"net/http"

"github.com/gin-gonic/gin"
)

func Ping(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"message": config.Service.FormattedNameWithVersion() + " is online!"})
}
20 changes: 20 additions & 0 deletions gr25/config/banner.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package config

import "github.com/fatih/color"

var Banner = `
███╗ ███╗ █████╗ ██████╗ █████╗ ██████╗██╗ ██╗███████╗
████╗ ████║██╔══██╗██╔══██╗██╔══██╗██╔════╝██║ ██║██╔════╝
██╔████╔██║███████║██████╔╝███████║██║ ███████║█████╗
██║╚██╔╝██║██╔══██║██╔═══╝ ██╔══██║██║ ██╔══██║██╔══╝
██║ ╚═╝ ██║██║ ██║██║ ██║ ██║╚██████╗██║ ██║███████╗
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝
`

func PrintStartupBanner() {
banner := color.New(color.Bold, color.FgHiMagenta).PrintlnFunc()
banner(Banner)
version := color.New(color.Bold, color.FgMagenta).PrintlnFunc()
version("Running " + Service.FormattedNameWithVersion() + " [ENV: " + Env + "]")
println()
}
Loading
Loading