Compare commits
8 Commits
20bf6afee4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c4339f22d | |||
| 1e764719ca | |||
| 9e92254492 | |||
| 3a5333330c | |||
| da9be91d51 | |||
| 9daa35178f | |||
| 8427663d71 | |||
| 22472c633d |
@@ -4,10 +4,11 @@ FROM debian:bookworm-slim
|
|||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# Update and install Swiss Army Knife tools
|
# Update and install Swiss Army Knife tools
|
||||||
RUN apt-get update && apt-get install -y curl wget git jq unzip tar vim nano python3 python3-pip python3-venv build-essential iputils-ping dnsutils net-tools nodejs npm ffmpeg openssh-server sudo && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y curl wget git jq unzip tar vim nano python3 python3-pip python3-venv build-essential iputils-ping dnsutils net-tools nodejs npm ffmpeg openssh-server ripgrep ncdu sudo && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install yq (binary release for latest version)
|
# Install yq (binary release for latest version)
|
||||||
RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
|
RUN wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq && chmod +x /usr/bin/yq
|
||||||
|
RUN wget https://downloads-openshift-console.apps.lab.apilab.us/amd64/linux/oc.tar -O /tmp/oc.tar && tar -xvf /tmp/oc.tar -C /usr/bin/ && rm /tmp/oc.tar && chmod +x /usr/bin/oc
|
||||||
|
|
||||||
# Setup SSH directory & Config for OpenShift (Random UID support)
|
# Setup SSH directory & Config for OpenShift (Random UID support)
|
||||||
RUN mkdir -p /var/run/sshd && chmod 775 /var/run/sshd
|
RUN mkdir -p /var/run/sshd && chmod 775 /var/run/sshd
|
||||||
@@ -36,4 +37,4 @@ USER claw
|
|||||||
|
|
||||||
# Start SSH daemon
|
# Start SSH daemon
|
||||||
# Fix: StrictModes no handles permissions, but chmod 600 helps sanity.
|
# Fix: StrictModes no handles permissions, but chmod 600 helps sanity.
|
||||||
CMD ["/bin/bash", "-c", "mkdir -p /data/ssh && if [ ! -f /data/ssh/ssh_host_rsa_key ]; then echo 'Generating persistent host keys...'; ssh-keygen -f /data/ssh/ssh_host_rsa_key -N '' -t rsa; ssh-keygen -f /data/ssh/ssh_host_ecdsa_key -N '' -t ecdsa; ssh-keygen -f /data/ssh/ssh_host_ed25519_key -N '' -t ed25519; fi && chmod 600 /data/ssh/ssh_host_*_key && /usr/sbin/sshd -D -f /etc/ssh/sshd_config"]
|
CMD ["/bin/bash", "-c", "mkdir -p /data/ssh && if [ ! -f /data/ssh/ssh_host_rsa_key ]; then echo 'Generating persistent host keys...'; ssh-keygen -f /data/ssh/ssh_host_rsa_key -N '' -t rsa; ssh-keygen -f /data/ssh/ssh_host_ecdsa_key -N '' -t ecdsa; ssh-keygen -f /data/ssh/ssh_host_ed25519_key -N '' -t ed25519; fi && chmod 600 /data/ssh/ssh_host_*_key && /usr/sbin/sshd -D -f /etc/ssh/sshd_config"]
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ spec:
|
|||||||
- |
|
- |
|
||||||
# 1. Fix data volume permissions
|
# 1. Fix data volume permissions
|
||||||
chown -R 1000:0 /data && chmod -R 775 /data
|
chown -R 1000:0 /data && chmod -R 775 /data
|
||||||
|
|
||||||
# 2. Setup writable SSH tirectory from Secret
|
# 2. Setup writable SSH tirectory from Secret
|
||||||
cp /mnt/keys/authorized_keys /working-ssh/
|
cp /mnt/keys/authorized_keys /working-ssh/
|
||||||
chown 1000:0 /working-ssh/authorized_keys
|
chown 1000:0 /working-ssh/authorized_keys
|
||||||
@@ -37,7 +37,7 @@ spec:
|
|||||||
mountPath: /data
|
mountPath: /data
|
||||||
- name: ssh-keys-secret
|
- name: ssh-keys-secret
|
||||||
mountPath: /mnt/keys
|
mountPath: /mnt/keys
|
||||||
- name: ssh-working
|
- name: ssh-working
|
||||||
mountPath: /working-ssh
|
mountPath: /working-ssh
|
||||||
containers:
|
containers:
|
||||||
- name: clawdbox
|
- name: clawdbox
|
||||||
@@ -65,20 +65,22 @@ spec:
|
|||||||
name: data-volume
|
name: data-volume
|
||||||
- mountPath: /home/claw/.ssh
|
- mountPath: /home/claw/.ssh
|
||||||
name: ssh-working
|
name: ssh-working
|
||||||
|
- mountPath: /home/claw/.kube
|
||||||
|
name: kubeconfig-secret
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: "2Gi"
|
memory: "1Gi"
|
||||||
cpu: "1000m"
|
cpu: "1000m"
|
||||||
requests:
|
requests:
|
||||||
memory: "512Mi"
|
memory: "128Mi"
|
||||||
cpu: "250m"
|
cpu: "250m"
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 1000
|
runAsUser: 1000
|
||||||
runAsGroup: 1000
|
runAsGroup: 1000
|
||||||
fsGroup: 1000
|
fsGroup: 1000
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: true
|
||||||
capabilities:
|
capabilities:
|
||||||
drop: ["ALL"]
|
add: ["CAP_AUDIT_WRITE"]
|
||||||
volumes:
|
volumes:
|
||||||
- name: data-volume
|
- name: data-volume
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
@@ -86,6 +88,8 @@ spec:
|
|||||||
- name: ssh-keys-secret
|
- name: ssh-keys-secret
|
||||||
secret:
|
secret:
|
||||||
secretName: clawdbox-ssh-keys
|
secretName: clawdbox-ssh-keys
|
||||||
defaultMode: 0600
|
- name: kubeconfig-secret
|
||||||
|
secret:
|
||||||
|
secretName: kube
|
||||||
- name: ssh-working
|
- name: ssh-working
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user