4 Commits

Author SHA1 Message Date
fd266ae24b Added README
Some checks failed
Build and deploy / Build container and manifests (push) Failing after 5m22s
2025-04-17 13:32:49 +02:00
e2475f15b8 Removed test file 2025-04-17 13:32:13 +02:00
184091c188 Changed name to Siranga 2025-04-17 13:31:33 +02:00
68df9af0da Only push on tags
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m39s
2025-04-17 12:36:12 +02:00
8 changed files with 14 additions and 13 deletions

View File

@@ -71,16 +71,18 @@ jobs:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }} SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
- name: Kustomize manifests - name: Kustomize manifests
if: gitea.ref_type == 'tag'
run: | run: |
./kustomize build ./manifests | sed "s/\${DIGEST}/${{ steps.build.outputs.digest }}/" > ./manifests.yaml ./kustomize build ./manifests | sed "s/\${DIGEST}/${{ steps.build.outputs.digest }}/" > ./manifests.yaml
- name: Push manifests - name: Push manifests
if: gitea.ref_type == 'tag'
run: | run: |
flux push artifact oci://$OCI_REPO/manifests:${{ gitea.head_ref || gitea.ref_name }} \ flux push artifact oci://$OCI_REPO/manifests:latest \
--path="./manifests.yaml" \ --path="./manifests.yaml" \
--source="$(git config --get remote.origin.url)" \ --source="$(git config --get remote.origin.url)" \
--revision="$(git rev-parse HEAD)" \ --revision="$(git rev-parse HEAD)" \
$(echo "${{ steps.meta.outputs.labels }}" | sed -e 's/^/-a /') $(echo "${{ steps.meta.outputs.labels }}" | sed -e 's/^/-a /')
flux tag artifact oci://$OCI_REPO/manifests:${{ gitea.head_ref || gitea.ref_name }} \ flux tag artifact oci://$OCI_REPO/manifests:latest \
$(echo "${{ steps.meta.outputs.tags }}" | sed -e 's/^.*:/--tag /') $(echo "${{ steps.meta.outputs.tags }}" | sed -e 's/^.*:/--tag /')

View File

@@ -18,5 +18,5 @@ ENV RUSTC_BOOTSTRAP=1
RUN cargo auditable build --release RUN cargo auditable build --release
FROM gcr.io/distroless/cc-debian12:nonroot AS runtime FROM gcr.io/distroless/cc-debian12:nonroot AS runtime
COPY --from=builder /app/target/release/siranga /siranga COPY --from=builder /app/target/release/tunnel_rs /tunnel_rs
CMD ["/siranga"] CMD ["/tunnel_rs"]

View File

@@ -40,7 +40,7 @@ By appending `-- --help` you can view the available command line options.
### Tip ### Tip
To make connecting slightly easier I recommend adding the following to `~/.ssh/config`: To make connecting slightly easier I recommend adding the following to `~/.ssh/config`.
``` ```
Host tunnel Host tunnel

View File

@@ -17,8 +17,6 @@ spec:
annotations: annotations:
kubectl.kubernetes.io/default-container: siranga kubectl.kubernetes.io/default-container: siranga
spec: spec:
# Service links cause issues with the HTTP_PORT and SSH_PORT env variables
enableServiceLinks: false
containers: containers:
- name: siranga - name: siranga
image: git.huizinga.dev/dreaded_x/siranga@${DIGEST} image: git.huizinga.dev/dreaded_x/siranga@${DIGEST}

View File

@@ -10,6 +10,6 @@ spec:
kind: Rule kind: Rule
services: services:
- name: http - name: http
port: http port: 3000
tls: tls:
secretName: tunnel-tls secretName: tunnel-tls

View File

@@ -4,7 +4,7 @@ namespace: siranga
resources: resources:
- ./namespace.yaml - ./namespace.yaml
- ./service-user.yaml - ./service-user.yaml
- ./secret-siranga-key.yaml - ./secret-tunnel-key.yaml
- ./deployment.yaml - ./deployment.yaml
- ./service.yaml - ./service.yaml
- ./certificate.yaml - ./certificate.yaml

View File

@@ -4,8 +4,9 @@ metadata:
name: http name: http
spec: spec:
ports: ports:
- name: http - name: "3000"
port: 3000 port: 3000
targetPort: 3000
selector: selector:
app: siranga app: siranga
--- ---
@@ -18,7 +19,7 @@ metadata:
spec: spec:
type: LoadBalancer type: LoadBalancer
ports: ports:
- name: ssh - name: "2222"
port: 22 port: 22
targetPort: 2222 targetPort: 2222
selector: selector:

View File

@@ -45,10 +45,10 @@ async fn main() -> color_eyre::Result<()> {
}; };
let http_port = std::env::var("HTTP_PORT") let http_port = std::env::var("HTTP_PORT")
.map(|port| port.parse().wrap_err_with(|| format!("HTTP_PORT={port}"))) .map(|port| port.parse())
.unwrap_or(Ok(3000))?; .unwrap_or(Ok(3000))?;
let ssh_port = std::env::var("SSH_PORT") let ssh_port = std::env::var("SSH_PORT")
.map(|port| port.parse().wrap_err_with(|| format!("SSH_PORT={port}"))) .map(|port| port.parse())
.unwrap_or(Ok(2222))?; .unwrap_or(Ok(2222))?;
let domain = let domain =