Skip to content

Commit 1c7bee1

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feature/replace-swagger
# Conflicts: # Common/DataAnnotations/StringCollectionItemMaxLengthAttribute.cs # Cron/Program.cs # Directory.Packages.props
2 parents 1cc83eb + 09451b0 commit 1c7bee1

505 files changed

Lines changed: 28897 additions & 5723 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.dockerignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
**/bin/
33
**/obj/
44
**/out/
5+
**/node_modules/
6+
API/SmtpTemplates/dist/
57

68
# files
79
**/appsettings.Development.json

‎.env‎

Lines changed: 59 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,59 @@
1-
# Required variables (uncomment and set values!)
2-
#PG_PASS=someSecurePassword
3-
4-
# Compose variables
5-
OPENSHOCK_DOMAIN=openshock.local # your public base domain
6-
OPENSHOCK_GATEWAY_SUBDOMAIN=gateway # subdomain for the included gateway
7-
OPENSHOCK_API_SUBDOMAIN=api # subdomain for the api
8-
9-
#global email config
10-
OPENSHOCK__MAIL__SENDER__NAME=OpenShock System
11-
OPENSHOCK__MAIL__SENDER__EMAIL=system@openshock.app
12-
13-
#mail configs. uncomment one of the 2 sections below and make your config changes
14-
15-
#MailJet
16-
#OPENSHOCK__MAIL__TYPE: MAILJET # MAILJET or SMTP, check Documentation
17-
#OPENSHOCK__MAIL__MAILJET__KEY: mailjetkey
18-
#OPENSHOCK__MAIL__MAILJET__SECRET: mailjetsecret
19-
#OPENSHOCK__MAIL__MAILJET__TEMPLATE__PASSWORDRESET: 9999999
20-
21-
#SMTP
22-
OPENSHOCK__MAIL__TYPE=SMTP # MAILJET or SMTP, check Documentation
23-
OPENSHOCK__MAIL__SMTP__HOST=mail.domain.zap
24-
OPENSHOCK__MAIL__SMTP__USERNAME=open@shock.zap
25-
OPENSHOCK__MAIL__SMTP__PASSWORD=SMTPPASSWORD
26-
OPENSHOCK__MAIL__SMTP__ENABLESSL=true
27-
OPENSHOCK__MAIL__SMTP__VERIFYCERTIFICATE=true
1+
# OpenShock configuration. These are simple knobs; docker-compose.yml maps them
2+
# onto the OPENSHOCK__* variables the containers read and shares them across every
3+
# service. Anything left unset falls back to the defaults defined in the compose file.
4+
5+
# --- Required ---
6+
# Database password (no default, must be set).
7+
PG_PASS=someSecurePassword
8+
9+
# --- Images ---
10+
# Tag for the backend images (api, gateway, cron) — they share the backend repo's
11+
# versioning. The frontend is a separate repo with its own versions, so it has its
12+
# own tag. Pin to a release for reproducible deploys; both default to `latest`.
13+
#OPENSHOCK_TAG=latest
14+
#OPENSHOCK_FRONTEND_TAG=latest
15+
16+
# --- Host / port / paths ---
17+
# The whole stack runs on one host and one port; services are told apart by path.
18+
# The host clients use to reach the stack.
19+
OPENSHOCK_HOST=openshock.local
20+
# External port for the stack. Leave blank for 443 (standard https). Set e.g. 8080
21+
# to serve on https://host:8080. Traefik publishes this onto its https entrypoint.
22+
#OPENSHOCK_PORT=8080
23+
# Path prefix per service. Frontend sits at the root; api and gateway on sub-paths.
24+
# Leave OPENSHOCK_FRONTEND_PATH blank to keep the web UI at the root (recommended).
25+
#OPENSHOCK_FRONTEND_PATH=
26+
OPENSHOCK_API_PATH=/api
27+
OPENSHOCK_GATEWAY_PATH=/gateway
28+
29+
# --- Database (optional, defaults shown) ---
30+
#PG_USER=openshock
31+
#PG_DB=openshock
32+
33+
# --- Feature flags (optional, defaults shown) ---
34+
#OPENSHOCK_TURNSTILE_ENABLE=false
35+
#OPENSHOCK_REGISTRATION_ENABLED=true
36+
37+
# --- TLS (optional, defaults shown) ---
38+
# Set this to true to disable TLS certificate verification for the frontend. This is useful
39+
# for testing with self-signed certs, but should not be used in production.
40+
#OPENSHOCK_FRONTEND_TLS_INSECURE=false
41+
42+
# --- E-mail ---
43+
# MAIL_TYPE is required by the app. Leave it as None to run without outbound mail,
44+
# or set it to Smtp / Mailjet and fill in the matching block below.
45+
MAIL_TYPE=None
46+
MAIL_SENDER_NAME=OpenShock System
47+
MAIL_SENDER_EMAIL=system@openshock.app
48+
49+
# SMTP (used when MAIL_TYPE=Smtp)
50+
#SMTP_HOST=mail.domain.zap
51+
#SMTP_PORT=587
52+
#SMTP_USERNAME=open@shock.zap
53+
#SMTP_PASSWORD=SMTPPASSWORD
54+
#SMTP_ENABLESSL=true
55+
#SMTP_VERIFYCERTIFICATE=true
56+
57+
# Mailjet (used when MAIL_TYPE=Mailjet)
58+
#MAILJET_KEY=mailjetkey
59+
#MAILJET_SECRET=mailjetsecret

‎.github/actions/build-app/action.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
steps:
2424
- name: Extract metadata (tags, labels) for Docker
2525
id: meta
26-
uses: docker/metadata-action@v5
26+
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
2727
with:
2828
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ inputs.image }}
2929
flavor: |
@@ -32,7 +32,7 @@ runs:
3232
type=raw,value=${{ inputs.tag-prefix }}-${{ github.run_number }}-a${{ github.run_attempt }}
3333
3434
- name: Build and push
35-
uses: docker/build-push-action@v6
35+
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
3636
with:
3737
context: .
3838
file: ${{ inputs.dockerfile }}

‎.github/actions/promote-image/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717

1818
- name: Extract metadata (tags, labels) for Promotion
1919
id: remeta
20-
uses: docker/metadata-action@v5
20+
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
2121
with:
2222
images: ${{ inputs.image }}
2323
flavor: |

‎.github/dependabot.yml‎

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,43 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
16
version: 2
7+
updates:
28

3-
multi-ecosystem-groups:
4-
maintenance:
9+
# Check for Nuget package updates
10+
- package-ecosystem: nuget
11+
directory: /
512
schedule:
613
interval: weekly
714
day: monday
8-
time: '06:00'
9-
10-
updates:
11-
- package-ecosystem: nuget
12-
directory: /
13-
patterns:
14-
- '*'
15-
multi-ecosystem-group: maintenance
16-
15+
time: '08:00'
16+
groups:
17+
nuget:
18+
patterns:
19+
- '*' # Group all updates together
20+
21+
# Check for Github Actions version updates (for CI/CD)
1722
- package-ecosystem: github-actions
1823
directory: /
19-
patterns:
20-
- '*'
21-
multi-ecosystem-group: maintenance
24+
schedule:
25+
interval: weekly
26+
day: monday
27+
time: '08:00'
28+
groups:
29+
github-actions:
30+
patterns:
31+
- '*' # Group all updates together
32+
33+
# Check for Docker base image updates
34+
- package-ecosystem: docker
35+
directory: /docker
36+
schedule:
37+
interval: weekly
38+
day: monday
39+
time: '08:00'
40+
groups:
41+
docker:
42+
patterns:
43+
- '*' # Group all updates together

‎.github/workflows/ci-build.yml‎

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
pull_request:
66
branches:
77
- '**'
8-
types: [ opened, reopened, synchronize ]
98
workflow_call:
109
inputs:
1110
platforms:
@@ -38,29 +37,33 @@ env:
3837
jobs:
3938

4039
tests:
41-
name: Tests (${{ matrix.name }})
40+
name: Tests
4241
runs-on: ubuntu-latest
43-
strategy:
44-
fail-fast: false
45-
matrix:
46-
include:
47-
- name: common-unit
48-
project: Common.Tests/Common.Tests.csproj
49-
- name: api-integration
50-
project: API.IntegrationTests/API.IntegrationTests.csproj
5142

5243
steps:
5344
- name: Checkout
54-
uses: actions/checkout@v6
45+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5546

56-
- uses: actions/setup-dotnet@v5
47+
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
5748
with:
5849
dotnet-version: '${{ env.DOTNET_VERSION }}'
5950

60-
- name: Run ${{ matrix.name }} tests
51+
- name: Run tests
6152
run: |
6253
set -euo pipefail
63-
dotnet test -c Release --project ${{ matrix.project }}
54+
dotnet test -c Release --solution OpenShockBackend.slnx \
55+
--results-directory "artifacts/test-results" \
56+
-- \
57+
--report-trx \
58+
--report-trx-filename test-results.trx
59+
60+
- name: Upload test artifacts
61+
if: always()
62+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
63+
with:
64+
name: test-results
65+
path: artifacts/test-results
66+
if-no-files-found: warn
6467

6568
build:
6669
name: Build (${{ matrix.image }})
@@ -78,13 +81,13 @@ jobs:
7881

7982
steps:
8083
- name: Checkout
81-
uses: actions/checkout@v6
84+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
8285

8386
- name: Set up Docker Buildx
84-
uses: docker/setup-buildx-action@v3
87+
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
8588

8689
- name: Log in to Container Registry
87-
uses: docker/login-action@v3
90+
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
8891
with:
8992
registry: ${{ env.REGISTRY }}
9093
username: ${{ github.actor }}
@@ -101,7 +104,7 @@ jobs:
101104

102105
promote-image:
103106
name: Promote Image (${{ matrix.image }})
104-
needs: [build, tests]
107+
needs: [build]
105108
runs-on: ubuntu-latest
106109
if: ${{ inputs.push || (github.ref_protected && github.event_name != 'pull_request') }}
107110
strategy:
@@ -114,10 +117,10 @@ jobs:
114117

115118
steps:
116119
- name: Checkout
117-
uses: actions/checkout@v6
120+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
118121

119122
- name: Log in to Container Registry
120-
uses: docker/login-action@v3
123+
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
121124
with:
122125
registry: ${{ env.REGISTRY }}
123126
username: ${{ github.actor }}
@@ -137,15 +140,13 @@ jobs:
137140
environment: production
138141
steps:
139142
- name: Send repository dispatch
140-
uses: peter-evans/repository-dispatch@v4
143+
uses: OpenShock/actions/repository-dispatch@21ca2d511bca92cf24fb502fa302f82700822584 # v1.1.1
141144
with:
142-
token: ${{ secrets.GITOPS_PAT }}
143-
repository: openshock/kubernetes-cluster-gitops
145+
repo: openshock/kubernetes-cluster-gitops
144146
event-type: update-backend-prod
145147
client-payload: |
146-
{
147-
"tag": "${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"
148-
}
148+
{"tag": "${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"}
149+
token: ${{ secrets.GITOPS_PAT }}
149150

150151
deploy-staging:
151152
runs-on: ubuntu-latest
@@ -155,15 +156,13 @@ jobs:
155156

156157
steps:
157158
- name: Send repository dispatch
158-
uses: peter-evans/repository-dispatch@v4
159+
uses: OpenShock/actions/repository-dispatch@21ca2d511bca92cf24fb502fa302f82700822584 # v1.1.1
159160
with:
160-
token: ${{ secrets.GITOPS_PAT }}
161-
repository: openshock/kubernetes-cluster-gitops
161+
repo: openshock/kubernetes-cluster-gitops
162162
event-type: update-backend-staging
163163
client-payload: |
164-
{
165-
"tag": "${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"
166-
}
164+
{"tag": "${{ inputs.tag-prefix || 'rn' }}-${{ github.run_number }}-a${{ github.run_attempt }}"}
165+
token: ${{ secrets.GITOPS_PAT }}
167166

168167
deploy-dev:
169168
runs-on: ubuntu-latest
@@ -172,12 +171,12 @@ jobs:
172171
environment: development
173172

174173
steps:
175-
- uses: actions/checkout@v6
174+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
176175
with:
177176
sparse-checkout: |
178177
.github
179178
180179
- uses: ./.github/actions/watchtower-update
181180
with:
182181
url: ${{ vars.WATCHTOWER_URL }}
183-
token: ${{ secrets.WATCHTOWER_TOKEN }}
182+
token: ${{ secrets.WATCHTOWER_TOKEN }}

‎.github/workflows/ci-tag.yml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ jobs:
2121
steps:
2222
- name: Find latest tag
2323
id: latest-tag
24-
uses: oprypin/find-latest-tag@v1
24+
uses: OpenShock/actions/find-latest-tag@21ca2d511bca92cf24fb502fa302f82700822584 # v1.1.1
2525
with:
26-
repository: ${{ github.repository }}
27-
regex: '^\d+\.\d+\.\d+$'
28-
releases-only: false
26+
regex: '^[0-9]+\.[0-9]+\.[0-9]+$'
2927

3028
# Delegate building and containerizing to a single workflow.
3129
build-and-containerize:

‎.github/workflows/codeql.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ jobs:
2727
contents: read
2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v6
30+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3131

3232
# Initializes the CodeQL tools for scanning.
3333
- name: Initialize CodeQL
34-
uses: github/codeql-action/init@v4
34+
uses: github/codeql-action/init@e58424170fb0262c8d7ed60a2e84b9bffe205c67 # codeql-bundle-v2.26.1
3535
with:
3636
languages: csharp
3737
build-mode: manual
3838

3939
- name: Setup .NET SDK ${{ env.DOTNET_VERSION }}
40-
uses: actions/setup-dotnet@v5
40+
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
4141
with:
4242
dotnet-version: ${{ env.DOTNET_VERSION }}
4343

@@ -50,6 +50,6 @@ jobs:
5050
dotnet publish Cron/Cron.csproj -c Release
5151
5252
- name: Perform CodeQL Analysis
53-
uses: github/codeql-action/analyze@v4
53+
uses: github/codeql-action/analyze@e58424170fb0262c8d7ed60a2e84b9bffe205c67 # codeql-bundle-v2.26.1
5454
with:
5555
category: "/language:csharp"

0 commit comments

Comments
 (0)