-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Pieloaf/BSF-Custom-Server i…
…nto Atmakuja_DB_Changes
- Loading branch information
Showing
33 changed files
with
3,096 additions
and
1,096 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Docker Build and Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- src/** | ||
- Dockerfile | ||
- package.json | ||
- tsconfig.json | ||
- yarn.lock | ||
|
||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
paths: | ||
- src/** | ||
- Dockerfile | ||
- package.json | ||
- tsconfig.json | ||
- yarn.lock | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build_publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
# TODO: add docker meta data step for tagging and versioning | ||
|
||
- name: Login to Docker registry | ||
if: ${{ github.ref == 'refs/heads/main' }} # skip login if not main | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: docker.pieloaf.com | ||
username: ${{ vars.REGISTRY_PIELOAF_USER }} | ||
password: ${{ secrets.REGISTRY_PIELOAF_PASSWD }} | ||
|
||
- name: Dockerize and Push Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: ${{ github.ref == 'refs/heads/main' }} # only publish if main | ||
platforms: linux/amd64 | ||
# TODO: tagged semver releases | ||
tags: docker.pieloaf.com/bsf-server:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Create Issue on new TODO | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
MANUAL_COMMIT_REF: | ||
description: "The SHA of the commit to get the diff for" | ||
required: true | ||
MANUAL_BASE_REF: | ||
description: "By default, the commit entered above is compared to the one directly before it; to go back further, enter an earlier SHA here" | ||
required: false | ||
jobs: | ||
build: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v3" | ||
- name: "TODO to Issue" | ||
uses: "alstr/todo-to-issue-action@master" | ||
with: | ||
IDENTIFIERS: '[{"name": "TODO", "labels": ["help wanted"]}, {"name": "FIXME", "labels": ["bug"]}]' | ||
env: | ||
MANUAL_COMMIT_REF: ${{ inputs.MANUAL_COMMIT_REF }} | ||
MANUAL_BASE_REF: ${{ inputs.MANUAL_BASE_REF }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
node_modules | ||
.env | ||
package-lock.json | ||
package-lock.json | ||
*.code-workspace | ||
build/ | ||
*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 4, | ||
"semi": true, | ||
"singleQuote": false, | ||
"printWidth": 120, | ||
"overrides": [ | ||
{ | ||
"files": "**/*.yml", | ||
"options": { | ||
"tabWidth": 2 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## build environment | ||
FROM node:20-alpine as node_server | ||
WORKDIR /src | ||
# Copy entire project | ||
COPY . . | ||
# Install build dependencies | ||
RUN yarn install --frozen-lockfile && yarn cache clean | ||
# Build project | ||
RUN yarn run build | ||
|
||
# production environment | ||
FROM node:20-alpine | ||
ENV NODE_ENV=production | ||
# Copy build output to working dir | ||
WORKDIR /app | ||
COPY --from=node_server /src/build ./ | ||
# HACK: THIS IS A WORKAROUND FOR MOCKED DATA | ||
COPY --from=node_server /src/data ./data | ||
# Copy required packages and app config | ||
COPY --from=node_server /src/yarn.lock ./ | ||
COPY --from=node_server /src/package.json ./ | ||
RUN yarn install --frozen-lockfile --production && yarn cache clean | ||
RUN printenv | ||
CMD node ./index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[ | ||
{ | ||
"username": "test", | ||
"user_id": "123456" | ||
"user_id": 123456 | ||
}, | ||
{ | ||
"username": "Pieloaf", | ||
"user_id": "293850" | ||
"user_id": 293850 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Development Notes | ||
|
||
## Overview of Client <-> Server Data Flow | ||
|
||
The client communicates with the server over HTTP(S). All request URLs end with the clients session key with the exception of the login and steam overlay requests. When the client has data to send to the server, it makes a POST request to a given route, in most cases the server responds with status 200 and no data however there are some exceptions, such as posting to the leaderboards route. To receive data which is not returned after making a POST request the client makes GET requests to the server every 2 seconds. If the server has new data for the client it is returned in the response otherwise the server responds with status 200 and no data. All data returned from the server is JSON formatted. All data sent to the server is JSON formatted with the exception of the location update and chat message send requests, these are plaintext strings. | ||
|
||
Detailed Information: | ||
1. [Game Flow](gameFlow.md) | ||
2. [Data Structures](dataStructures.md) | ||
3. [Server Endpoints](serverEndpoints.md) | ||
4. [Other Notes](notes.md) | ||
|
Oops, something went wrong.