Skip to content

Commit c45c5ca

Browse files
committed
feat: configuration files and initial proto definitions
1 parent 0c68df6 commit c45c5ca

8 files changed

Lines changed: 326 additions & 0 deletions

File tree

.github/workflows/buf-publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Buf publish
2+
on:
3+
push:
4+
branches: [main]
5+
tags: ["*"]
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: bufbuild/buf-setup-action@v1
12+
# - uses: bufbuild/buf-lint-action@v1
13+
- uses: bufbuild/buf-breaking-action@v1
14+
with:
15+
# The 'main' branch of the GitHub repository that defines the module.
16+
against: "https://github.com/${GITHUB_REPOSITORY}.git#branch=main,ref=HEAD~1"
17+
- uses: bufbuild/buf-push-action@v1
18+
with:
19+
buf_token: ${{ secrets.BUF_TOKEN }}

.gitignore

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
### JetBrains template
2+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
3+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
4+
5+
# User-specific stuff
6+
.idea/**/workspace.xml
7+
.idea/**/tasks.xml
8+
.idea/**/usage.statistics.xml
9+
.idea/**/dictionaries
10+
.idea/**/shelf
11+
12+
# AWS User-specific
13+
.idea/**/aws.xml
14+
15+
# Generated files
16+
.idea/**/contentModel.xml
17+
18+
# Sensitive or high-churn files
19+
.idea/**/dataSources/
20+
.idea/**/dataSources.ids
21+
.idea/**/dataSources.local.xml
22+
.idea/**/sqlDataSources.xml
23+
.idea/**/dynamic.xml
24+
.idea/**/uiDesigner.xml
25+
.idea/**/dbnavigator.xml
26+
27+
# Gradle
28+
.idea/**/gradle.xml
29+
.idea/**/libraries
30+
31+
# Gradle and Maven with auto-import
32+
# When using Gradle or Maven with auto-import, you should exclude module files,
33+
# since they will be recreated, and may cause churn. Uncomment if using
34+
# auto-import.
35+
# .idea/artifacts
36+
# .idea/compiler.xml
37+
# .idea/jarRepositories.xml
38+
# .idea/modules.xml
39+
# .idea/*.iml
40+
# .idea/modules
41+
# *.iml
42+
# *.ipr
43+
44+
# CMake
45+
cmake-build-*/
46+
47+
# Buf lock
48+
buf.lock
49+
50+
# Buf gen
51+
gen/
52+
53+
# Mongo Explorer plugin
54+
.idea/**/mongoSettings.xml
55+
56+
# File-based project format
57+
*.iws
58+
59+
# IntelliJ
60+
out/
61+
62+
# mpeltonen/sbt-idea plugin
63+
.idea_modules/
64+
65+
# JIRA plugin
66+
atlassian-ide-plugin.xml
67+
68+
# Cursive Clojure plugin
69+
.idea/replstate.xml
70+
71+
# SonarLint plugin
72+
.idea/sonarlint/
73+
74+
# Crashlytics plugin (for Android Studio and IntelliJ)
75+
com_crashlytics_export_strings.xml
76+
crashlytics.properties
77+
crashlytics-build.properties
78+
fabric.properties
79+
80+
# Editor-based Rest Client
81+
.idea/httpRequests
82+
83+
# Android studio 3.1+ serialized cache file
84+
.idea/caches/build_file_checksums.ser
85+
86+
### Eclipse template
87+
.metadata
88+
bin/
89+
tmp/
90+
*.tmp
91+
*.bak
92+
*.swp
93+
*~.nib
94+
local.properties
95+
.settings/
96+
.loadpath
97+
.recommenders
98+
99+
# External tool builders
100+
.externalToolBuilders/
101+
102+
# Locally stored "Eclipse launch configurations"
103+
*.launch
104+
105+
# PyDev specific (Python IDE for Eclipse)
106+
*.pydevproject
107+
108+
# CDT-specific (C/C++ Development Tooling)
109+
.cproject
110+
111+
# CDT- autotools
112+
.autotools
113+
114+
# Java annotation processor (APT)
115+
.factorypath
116+
117+
# PDT-specific (PHP Development Tools)
118+
.buildpath
119+
120+
# sbteclipse plugin
121+
.target
122+
123+
# Tern plugin
124+
.tern-project
125+
126+
# TeXlipse plugin
127+
.texlipse
128+
129+
# STS (Spring Tool Suite)
130+
.springBeans
131+
132+
# Code Recommenders
133+
.recommenders/
134+
135+
# Annotation Processing
136+
.apt_generated/
137+
.apt_generated_test/
138+
139+
# Scala IDE specific (Scala & Java development for Eclipse)
140+
.cache-main
141+
.scala_dependencies
142+
.worksheet
143+
144+
# Uncomment this line if you wish to ignore the project description file.
145+
# Typically, this file would be tracked if it contains build/dependency configurations:
146+
#.project

buf.gen.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
version: v2
2+
plugins:
3+
# Java/Kotlin
4+
- remote: buf.build/protocolbuffers/java
5+
out: gen/java
6+
- remote: buf.build/grpc/java
7+
out: gen/java
8+
9+
- remote: buf.build/bufbuild/es:v2.2.3
10+
out: ../app/proto/gen
11+
opt:
12+
- target=ts
13+
- import_extension=ts
14+
- json_types=true
15+
16+
# TypeScript (ts-proto)
17+
- remote: buf.build/community/stephenh-ts-proto
18+
out: gen/ts
19+
opt:
20+
- esModuleInterop=true
21+
- forceLong=string
22+
- useOptionals=messages
23+
- outputServices=grpc-js

buf.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: v2
2+
name: buf.build/vulpescloud/protospecs
3+
deps:
4+
- buf.build/googleapis/googleapis
5+
lint:
6+
use:
7+
- STANDARD
8+
except:
9+
- FIELD_NOT_REQUIRED
10+
- PACKAGE_NO_IMPORT_CYCLE
11+
disallow_comment_ignores: true
12+
13+
breaking:
14+
use:
15+
- FILE
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
syntax = "proto3";
2+
3+
package vulpescloud.node.v1;
4+
5+
option java_package = "de.vulpescloud.proto.node.v1";
6+
option java_multiple_files = true;
7+
8+
import "vulpescloud/node/v1/template.proto";
9+
import "google/protobuf/timestamp.proto";
10+
11+
message TaskDefinition {
12+
string name = 1;
13+
uint64 minimum_memory = 2;
14+
uint64 maximum_memory = 3;
15+
uint64 start_port = 4;
16+
repeated TemplateDefinition templates = 5;
17+
bool static_services = 6;
18+
uint32 min_online_services = 7;
19+
uint32 max_online_services = 8;
20+
bool maintenance = 9;
21+
bool copy_template_to_static = 10;
22+
string service_factory_name = 11;
23+
string preferred_node = 12;
24+
uint32 max_players = 13;
25+
}
26+
27+
message ServiceDefinition {
28+
TaskDefinition task = 1;
29+
string uuid = 2;
30+
uint32 ordered_id = 3;
31+
uint32 port = 4;
32+
string node = 5;
33+
ServiceState state = 6;
34+
uint32 player_count = 7;
35+
google.protobuf.Timestamp start_time = 8;
36+
}
37+
38+
enum ServiceState {
39+
SERVICE_STATE_UNSPECIFIED = 0;
40+
SERVICE_STATE_RUNNING = 1;
41+
SERVICE_STATE_STARTING = 2;
42+
SERVICE_STATE_PREPARED = 3;
43+
SERVICE_STATE_STOPPED = 4;
44+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
syntax = "proto3";
2+
3+
package vulpescloud.node.v1;
4+
5+
option java_package = "de.vulpescloud.proto.node.v1";
6+
option java_multiple_files = true;
7+
8+
message ServerSoftware {
9+
string name = 1;
10+
string version = 2;
11+
string url = 3;
12+
string plugin_dir = 4;
13+
SoftwareType type = 5;
14+
}
15+
16+
enum SoftwareType {
17+
SOFTWARE_TYPE_UNSPECIFIED = 0;
18+
SOFTWARE_TYPE_SERVER = 1;
19+
SOFTWARE_TYPE_PROXY = 2;
20+
}

vulpescloud/node/v1/services.proto

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
syntax = "proto3";
2+
3+
package vulpescloud.node.v1;
4+
5+
option java_package = "de.vulpescloud.proto.node.v1";
6+
option java_multiple_files = true;
7+
8+
import "vulpescloud/node/v1/node_types.proto";
9+
10+
message CreateServiceRequest {
11+
TaskDefinition task = 1;
12+
}
13+
14+
message CreateServiceResponse {
15+
ServiceDefinition service = 1;
16+
}
17+
18+
message StartServiceRequest {
19+
ServiceDefinition service = 1;
20+
}
21+
22+
message StartServiceResponse {
23+
ServiceDefinition service = 1;
24+
}
25+
26+
message RestartServiceRequest {
27+
ServiceDefinition service = 1;
28+
}
29+
30+
message RestartServiceResponse {
31+
ServiceDefinition service = 1;
32+
}
33+
34+
message StopServiceRequest {
35+
ServiceDefinition service = 1;
36+
}
37+
38+
message StopServiceResponse {
39+
ServiceDefinition service = 1;
40+
}
41+
42+
service NodeService {
43+
rpc CreateService(CreateServiceRequest) returns (CreateServiceResponse);
44+
rpc StartService(StartServiceRequest) returns (StartServiceResponse);
45+
rpc RestartService(RestartServiceRequest) returns (RestartServiceResponse);
46+
rpc StopService(StopServiceRequest) returns (StopServiceResponse);
47+
}

vulpescloud/node/v1/template.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
syntax = "proto3";
2+
3+
package vulpescloud.node.v1;
4+
5+
option java_package = "de.vulpescloud.proto.node.v1";
6+
option java_multiple_files = true;
7+
8+
message TemplateDefinition {
9+
string name = 1;
10+
string storage = 2;
11+
int32 weight = 3;
12+
}

0 commit comments

Comments
 (0)