Skip to content

Commit 172b1a2

Browse files
committed
chore: format yaml files
1 parent be57c28 commit 172b1a2

10 files changed

Lines changed: 59 additions & 52 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ body:
106106
description: Does this bug have security implications?
107107
options:
108108
- label: This bug has security implications (please also email dstack@phala.network)
109-
required: false
109+
required: false

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ contact_links:
1111
about: Check the official Dstack documentation
1212
- name: ❓ GitHub Discussions
1313
url: https://github.com/Dstack-TEE/dstack-examples/discussions
14-
about: Ask questions and discuss ideas with the community
14+
about: Ask questions and discuss ideas with the community

.github/ISSUE_TEMPLATE/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ body:
9090
label: Contribution
9191
options:
9292
- label: I'm willing to submit a PR to fix this documentation issue
93-
required: false
93+
required: false

.github/ISSUE_TEMPLATE/example_submission.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ body:
140140
- Special considerations
141141
- Future improvements planned
142142
- Related examples
143-
- etc.
143+
- etc.

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ body:
9191
- label: I can provide testing and feedback
9292
required: false
9393
- label: I can help with documentation
94-
required: false
94+
required: false

.github/workflows/security-scan.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Security Scan
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88
schedule:
99
# Run security scan weekly
1010
- cron: '0 2 * * 1'
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
20-
20+
2121
- name: Run TruffleHog OSS
2222
uses: trufflesecurity/trufflehog@main
2323
with:
@@ -35,25 +35,25 @@ jobs:
3535
- name: Scan for vulnerable dependencies
3636
run: |
3737
echo "Scanning for vulnerable dependencies..."
38-
38+
3939
# Find all package.json files
4040
find . -name "package.json" -not -path "./node_modules/*" | while read -r package_file; do
4141
echo "Scanning: $package_file"
4242
dir=$(dirname "$package_file")
43-
43+
4444
if command -v npm >/dev/null 2>&1; then
4545
cd "$dir"
4646
npm audit --audit-level=high || echo "❌ Vulnerabilities found in $package_file"
4747
cd - > /dev/null
4848
fi
4949
done
50-
50+
5151
# Find all requirements.txt files
5252
find . -name "requirements.txt" -not -path "./venv/*" | while read -r req_file; do
5353
echo "Found Python requirements: $req_file"
5454
echo "⚠️ Consider using 'pip-audit' for Python dependency scanning"
5555
done
56-
56+
5757
# Find all go.mod files
5858
find . -name "go.mod" | while read -r go_file; do
5959
echo "Found Go module: $go_file"
@@ -89,35 +89,35 @@ jobs:
8989
- name: Security check for Docker Compose files
9090
run: |
9191
echo "Checking Docker Compose files for security issues..."
92-
92+
9393
# Find all docker-compose files
9494
find . -name "docker-compose.y*ml" | while read -r compose_file; do
9595
echo "Checking: $compose_file"
96-
96+
9797
# Check for privileged containers
9898
if grep -q "privileged.*true" "$compose_file"; then
9999
echo "❌ Privileged container found in: $compose_file"
100100
fi
101-
101+
102102
# Check for host network mode
103103
if grep -q "network_mode.*host" "$compose_file"; then
104104
echo "⚠️ Host network mode found in: $compose_file"
105105
fi
106-
106+
107107
# Check for dangerous volume mounts
108108
if grep -q "/var/run/docker.sock" "$compose_file"; then
109109
echo "❌ Docker socket mount found in: $compose_file"
110110
fi
111-
111+
112112
if grep -q ":/proc" "$compose_file"; then
113113
echo "⚠️ /proc mount found in: $compose_file"
114114
fi
115-
115+
116116
# Check for exposed sensitive ports
117117
if grep -E "ports:.*:(22|3306|5432|6379|27017|9200)" "$compose_file"; then
118118
echo "⚠️ Sensitive ports exposed in: $compose_file"
119119
fi
120-
120+
121121
# Check for missing restart policies
122122
if ! grep -q "restart:" "$compose_file"; then
123123
echo "ℹ️ No restart policy specified in: $compose_file"
@@ -149,20 +149,20 @@ jobs:
149149
needs: [secret-scan, dependency-scan, dockerfile-scan, compose-security, code-security]
150150
if: always()
151151
name: Security Summary
152-
152+
153153
steps:
154154
- name: Security Scan Summary
155155
run: |
156156
echo "## Security Scan Results" >> $GITHUB_STEP_SUMMARY
157157
echo "" >> $GITHUB_STEP_SUMMARY
158-
158+
159159
# Check job results
160160
secret_result="${{ needs.secret-scan.result }}"
161161
dependency_result="${{ needs.dependency-scan.result }}"
162162
dockerfile_result="${{ needs.dockerfile-scan.result }}"
163163
compose_result="${{ needs.compose-security.result }}"
164164
code_result="${{ needs.code-security.result }}"
165-
165+
166166
echo "| Security Check | Status |" >> $GITHUB_STEP_SUMMARY
167167
echo "|----------------|--------|" >> $GITHUB_STEP_SUMMARY
168168
echo "| Secret Detection | $secret_result |" >> $GITHUB_STEP_SUMMARY
@@ -171,10 +171,10 @@ jobs:
171171
echo "| Compose Security | $compose_result |" >> $GITHUB_STEP_SUMMARY
172172
echo "| Code Analysis | $code_result |" >> $GITHUB_STEP_SUMMARY
173173
echo "" >> $GITHUB_STEP_SUMMARY
174-
174+
175175
# Overall status
176176
if [[ "$secret_result $dependency_result $dockerfile_result $compose_result $code_result" == *"failure"* ]]; then
177177
echo "🔴 **Security issues detected!** Please review the scan results." >> $GITHUB_STEP_SUMMARY
178178
else
179179
echo "🟢 **All security scans passed successfully.**" >> $GITHUB_STEP_SUMMARY
180-
fi
180+
fi

.github/workflows/validate-examples.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Validate Examples
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [main, develop]
66
pull_request:
7-
branches: [ main, develop ]
7+
branches: [main, develop]
88
schedule:
99
# Run weekly to catch dependency issues
1010
- cron: '0 0 * * 0'
@@ -40,21 +40,21 @@ jobs:
4040
matrix:
4141
example: ${{ fromJson(needs.detect-changes.outputs.examples) }}
4242
fail-fast: false
43-
43+
4444
steps:
4545
- uses: actions/checkout@v4
4646

4747
- name: Validate example structure
4848
run: |
4949
example="${{ matrix.example }}"
5050
echo "Validating structure for: $example"
51-
51+
5252
# Check if directory exists
5353
if [ ! -d "$example" ]; then
5454
echo "❌ Example directory does not exist: $example"
5555
exit 1
5656
fi
57-
57+
5858
# Check for required files
5959
required_files=("README.md")
6060
for file in "${required_files[@]}"; do
@@ -63,15 +63,14 @@ jobs:
6363
exit 1
6464
fi
6565
done
66-
66+
6767
# Check for docker-compose file
6868
if [ ! -f "$example/docker-compose.yml" ] && [ ! -f "$example/docker-compose.yaml" ]; then
6969
echo "❌ Missing docker-compose file in: $example"
7070
exit 1
7171
fi
72-
73-
echo "✅ Structure validation passed for: $example"
7472
73+
echo "✅ Structure validation passed for: $example"
7574
7675
validate-docker-compose:
7776
runs-on: ubuntu-latest
@@ -81,17 +80,17 @@ jobs:
8180
matrix:
8281
example: ${{ fromJson(needs.detect-changes.outputs.examples) }}
8382
fail-fast: false
84-
83+
8584
steps:
8685
- uses: actions/checkout@v4
8786

8887
- name: Validate Docker Compose files
8988
run: |
9089
example="${{ matrix.example }}"
9190
echo "Validating Docker Compose for: $example"
92-
91+
9392
cd "$example"
94-
93+
9594
# Find docker-compose file
9695
compose_file=""
9796
if [ -f "docker-compose.yml" ]; then
@@ -102,13 +101,13 @@ jobs:
102101
echo "❌ No docker-compose file found in: $example"
103102
exit 1
104103
fi
105-
104+
106105
# Validate compose file syntax
107106
if ! docker compose -f "$compose_file" config > /dev/null; then
108107
echo "❌ Invalid docker-compose syntax in: $example/$compose_file"
109108
exit 1
110109
fi
111-
110+
112111
echo "✅ Docker Compose validation passed for: $example"
113112
114113
security-scan:
@@ -119,30 +118,30 @@ jobs:
119118
matrix:
120119
example: ${{ fromJson(needs.detect-changes.outputs.examples) }}
121120
fail-fast: false
122-
121+
123122
steps:
124123
- uses: actions/checkout@v4
125124

126125
- name: Security scan
127126
run: |
128127
example="${{ matrix.example }}"
129128
echo "Running security scan for: $example"
130-
129+
131130
# Check for common security issues
132131
security_issues=0
133-
132+
134133
# Check for hardcoded secrets (basic patterns)
135134
if grep -r -i -E "(password|secret|key|token).*=.*['\"][^'\"]{8,}['\"]" "$example/" 2>/dev/null; then
136135
echo "⚠️ Potential hardcoded secrets found in: $example"
137136
security_issues=$((security_issues + 1))
138137
fi
139-
138+
140139
# Check for exposed sensitive ports
141140
if grep -E "ports:.*:(22|3306|5432|6379|27017)" "$example"/*.yml "$example"/*.yaml 2>/dev/null; then
142141
echo "⚠️ Potentially sensitive ports exposed in: $example"
143142
security_issues=$((security_issues + 1))
144143
fi
145-
144+
146145
if [ $security_issues -gt 0 ]; then
147146
echo "⚠️ Security scan completed with $security_issues potential issues in: $example"
148147
else
@@ -153,28 +152,28 @@ jobs:
153152
runs-on: ubuntu-latest
154153
needs: [detect-changes, validate-structure, validate-docker-compose, security-scan]
155154
if: always()
156-
155+
157156
steps:
158157
- name: Validation Summary
159158
run: |
160159
echo "## Validation Summary" >> $GITHUB_STEP_SUMMARY
161160
echo "" >> $GITHUB_STEP_SUMMARY
162-
161+
163162
examples="${{ needs.detect-changes.outputs.examples }}"
164163
if [ "$examples" == "[]" ] || [ "$examples" == "" ]; then
165164
echo "No examples were modified or detected for validation." >> $GITHUB_STEP_SUMMARY
166165
else
167166
echo "Validated examples: $examples" >> $GITHUB_STEP_SUMMARY
168167
echo "" >> $GITHUB_STEP_SUMMARY
169-
168+
170169
# Check job results
171170
structure_result="${{ needs.validate-structure.result }}"
172171
compose_result="${{ needs.validate-docker-compose.result }}"
173172
security_result="${{ needs.security-scan.result }}"
174-
173+
175174
echo "| Check | Status |" >> $GITHUB_STEP_SUMMARY
176175
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
177176
echo "| Structure | $structure_result |" >> $GITHUB_STEP_SUMMARY
178177
echo "| Docker Compose | $compose_result |" >> $GITHUB_STEP_SUMMARY
179178
echo "| Security Scan | $security_result |" >> $GITHUB_STEP_SUMMARY
180-
fi
179+
fi

.yamlfmt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
formatter:
2+
type: basic
3+
retain_line_breaks: true
4+
trim_trailing_whitespace: true
5+
scan_folded_as_literal: true
6+
include_document_start: false
7+
line_ending: lf
8+
indent: 2

lightclient/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ configs:
3333
3434
# Let it sync #TODO do this smarter
3535
sleep 5
36-
36+
3737
# Then run some queries. This would be a good place to run an api server.
3838
# Cast <-> Helios <-> Untrusted RPCs
3939
cast block --rpc-url=localhost:8545 | tee response.txt
@@ -43,6 +43,6 @@ configs:
4343
PAYLOAD="{\"report_data\": \"$$(echo -n $$HASH | od -A n -t x1 | tr -d ' \n')\"}"
4444
ATTEST=$$(curl -X POST --unix-socket /var/run/tappd.sock -d "$$PAYLOAD" http://localhost/prpc/Tappd.TdxQuote?json)
4545
# TODO: Fallback to the dummy remote attestation
46-
46+
4747
echo ATTEST=$${ATTEST} >> response.txt
4848
cat response.txt

timelock-nts/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ services:
1616

1717
configs:
1818
run.sh:
19-
content: |
19+
content: |-
2020
#!/bin/bash
2121
key=$$(openssl genpkey -algorithm Ed25519)
2222
echo "Public Key:"; echo "$$key" | openssl pkey -pubout
23-
23+
2424
# Get timestamp from cloudflare and add 5 minutes
2525
get_time() { ntpdate -4q time.cloudflare.com 2>/dev/null | head -1 | cut -d' ' -f1,2 | date +%s -f -; }
2626
deadline=$$(($$(get_time) + 300))
2727
deadline_str=$$(date -d @$${deadline})
2828
echo "Release: $$deadline_str"
2929
3030
# Fetch the quote
31-
get_quote() {
31+
get_quote() {
3232
PAYLOAD="{\"report_data\": \"$$(echo -n $$1 | od -A n -t x1 | tr -d ' \n')\"}"
3333
curl -X POST --unix-socket /var/run/tappd.sock -d "$$PAYLOAD" http://localhost/prpc/Tappd.TdxQuote?json
3434
}

0 commit comments

Comments
 (0)