Skip to content

Commit 0ff6b6c

Browse files
committed
refactor
1 parent 8e822ce commit 0ff6b6c

10 files changed

Lines changed: 264 additions & 2 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- main
77
tags:
88
- "v*.*.*" # SemVer Tags wie v1.0.0, v1.2.3, etc.
9+
paths:
10+
- "src/**"
911
workflow_dispatch:
1012

1113
env:
@@ -43,13 +45,13 @@ jobs:
4345
type=ref,event=pr
4446
type=semver,pattern={{version}}
4547
type=semver,pattern={{major}}.{{minor}}
46-
type=sha,prefix={{branch}}-
48+
type=sha,prefix={{branch}}-,format=long,enable={{is_default_branch}}
4749
type=raw,value=latest,enable={{is_default_branch}}
4850
4951
- name: Build and push Docker image
5052
uses: docker/build-push-action@v5
5153
with:
52-
context: .
54+
context: ./src
5355
push: true
5456
tags: ${{ steps.meta.outputs.tags }}
5557
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/helm-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
uses: azure/setup-helm@v3
3131
with:
3232
version: "latest"
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3335

3436
- name: Configure Helm OCI Registry
3537
run: |

README.md

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# Satis
2+
3+
Self-hosted Composer repository (Satis) with Nginx, Auth-Proxy and Webhook support.
4+
5+
## Project Structure
6+
7+
```
8+
.
9+
├── src/ # Docker image source files
10+
│ ├── Dockerfile
11+
│ ├── nginx.conf
12+
│ ├── default.conf
13+
│ ├── webhook.py
14+
│ └── start.sh
15+
├── satis/ # Helm chart
16+
│ ├── Chart.yaml
17+
│ ├── values.yaml
18+
│ └── templates/
19+
├── README.md # This file
20+
└── helmfile.yaml.example # Helmfile example
21+
```
22+
23+
## Docker Image
24+
25+
The Docker image is built from files in the `src/` directory and automatically published to GitHub Container Registry on push.
26+
27+
## Helm Chart Installation
28+
29+
### Prerequisites
30+
31+
- Kubernetes cluster (1.19+)
32+
- Helm 3.8+ (for OCI registry support)
33+
- Access to GitHub Container Registry (ghcr.io)
34+
35+
### Add Helm Registry (optional)
36+
37+
If using a private repository, authenticate with GitHub Container Registry:
38+
39+
```bash
40+
helm registry login ghcr.io -u YOUR_GITHUB_USERNAME
41+
```
42+
43+
### Install from OCI Registry
44+
45+
```bash
46+
helm install my-satis oci://ghcr.io/splintnet/satis/satis --version 0.1.0
47+
```
48+
49+
### Install with Custom Values
50+
51+
```bash
52+
helm install my-satis oci://ghcr.io/splintnet/satis/satis \
53+
--version 0.1.0 \
54+
-f values.yaml
55+
```
56+
57+
### Upgrade
58+
59+
```bash
60+
helm upgrade my-satis oci://ghcr.io/splintnet/satis/satis --version 0.2.0
61+
```
62+
63+
## Configuration
64+
65+
### Required Values
66+
67+
At minimum, configure the Docker image and Satis configuration:
68+
69+
```yaml
70+
image:
71+
repository: ghcr.io/splintnet/satis/satis
72+
tag: "latest"
73+
74+
satis:
75+
configJson: |
76+
{
77+
"name": "my/composer-repository",
78+
"description": "My Composer Repository",
79+
"homepage": "https://repo.example.com",
80+
"repositories": [
81+
{ "type": "vcs", "url": "https://github.com/myorg/myrepo.git" }
82+
],
83+
"require-all": true
84+
}
85+
```
86+
87+
### Authentication (Optional)
88+
89+
To protect packages with authentication:
90+
91+
```yaml
92+
ingress:
93+
enabled: true
94+
authUrl: "https://auth.example.com" # Base URL (without /api/auth)
95+
hosts:
96+
- host: repo.example.com
97+
paths:
98+
- path: /
99+
pathType: Prefix
100+
tls:
101+
- secretName: repo-tls
102+
hosts:
103+
- repo.example.com
104+
```
105+
106+
### Webhook (Optional)
107+
108+
Enable webhook for manual rebuild triggers:
109+
110+
```yaml
111+
webhook:
112+
enabled: true
113+
authSecret: "your-secret-here" # MUST be set if enabled
114+
rebuildCommand: "/satis/bin/satis build /build/config/satis.json /build/output"
115+
```
116+
117+
### GitHub OAuth (Optional)
118+
119+
For private repositories:
120+
121+
```yaml
122+
github:
123+
oauth:
124+
enabled: true
125+
token: "ghp_YOUR_TOKEN_HERE"
126+
```
127+
128+
### Persistence
129+
130+
Persistent storage for Satis output:
131+
132+
```yaml
133+
persistence:
134+
enabled: true
135+
size: 2Gi
136+
storageClass: "" # Use default storage class
137+
```
138+
139+
## Complete Example
140+
141+
See `helmfile.yaml.example` for a complete configuration example.
142+
143+
## Values Reference
144+
145+
| Parameter | Description | Default |
146+
| --------------------------- | -------------------------------- | ------------------------------- |
147+
| `image.repository` | Docker image repository | `ghcr.io/splintnet/satis/satis` |
148+
| `image.tag` | Docker image tag | `latest` |
149+
| `satis.configPath` | Path to Satis config.json | `/build/config/satis.json` |
150+
| `satis.outputPath` | Path for Satis output | `/build/output` |
151+
| `satis.forceBuildOnStartup` | Force build on container startup | `true` |
152+
| `satis.configJson` | Satis configuration JSON | See values.yaml |
153+
| `ingress.enabled` | Enable ingress | `false` |
154+
| `ingress.authUrl` | Auth API base URL | `""` |
155+
| `webhook.enabled` | Enable webhook service | `false` |
156+
| `webhook.authSecret` | Webhook auth secret | `CHANGE_ME` |
157+
| `persistence.enabled` | Enable persistent storage | `true` |
158+
| `persistence.size` | Storage size | `2Gi` |
159+
160+
## Uninstall
161+
162+
```bash
163+
helm uninstall my-satis
164+
```
165+
166+
## Troubleshooting
167+
168+
### Check Pod Status
169+
170+
```bash
171+
kubectl get pods -l app.kubernetes.io/name=satis
172+
```
173+
174+
### View Logs
175+
176+
```bash
177+
kubectl logs -l app.kubernetes.io/name=satis
178+
```
179+
180+
### Check ConfigMap
181+
182+
```bash
183+
kubectl get configmap my-satis-config -o yaml
184+
```
185+
186+
### Test Webhook
187+
188+
```bash
189+
curl -X POST https://repo.example.com/webhook \
190+
-H "X-Satis-Auth-Secret: your-secret"
191+
```
192+
193+
## License
194+
195+
See LICENSE file in the repository.

helmfile.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
repositories:
2+
- name: satis
3+
url: oci://ghcr.io/splintnet/satis/satis
4+
oci: true
5+
6+
releases:
7+
- name: satis
8+
namespace: default
9+
chart: satis/satis
10+
version: 0.1.0
11+
values:
12+
- satis:
13+
configPath: /build/config/satis.json
14+
outputPath: /build/output
15+
forceBuildOnStartup: true
16+
configJson: |
17+
{
18+
"name": "my/composer-repository",
19+
"description": "My Composer Repository",
20+
"homepage": "https://repo.example.com",
21+
"repositories": [
22+
{ "type": "vcs", "url": "https://github.com/myorg/myrepo.git" }
23+
],
24+
"require-all": true
25+
}
26+
27+
- persistence:
28+
enabled: true
29+
size: 2Gi
30+
storageClass: ""
31+
32+
- ingress:
33+
enabled: true
34+
className: "nginx"
35+
authUrl: "https://auth.example.com"
36+
hosts:
37+
- host: repo.example.com
38+
paths:
39+
- path: /
40+
pathType: Prefix
41+
tls:
42+
- secretName: repo-tls
43+
hosts:
44+
- repo.example.com
45+
46+
- webhook:
47+
enabled: true
48+
authSecret: "your-webhook-secret-here"
49+
rebuildCommand: "/satis/bin/satis build /build/config/satis.json /build/output"
50+
51+
- github:
52+
oauth:
53+
enabled: false
54+
token: ""

src/.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
satis/
2+
helm/
3+
helm_neu/
4+
.git/
5+
.gitignore
6+
*.md
7+
.DS_Store
8+
helmfile.yaml*
9+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)