Compare commits

...

12 commits
v1 ... main

Author SHA1 Message Date
cb5562272c
Motd update
All checks were successful
Build a dev image / build (push) Successful in 4s
Build a dev image / build (release) Successful in 9s
2025-10-07 23:37:33 +02:00
12c970cd9f
Don't generate keys twice
All checks were successful
Build a dev image / build (push) Successful in 15s
2025-10-07 23:34:06 +02:00
a0c265c6ca
Fix SSH password access
All checks were successful
Build a dev image / build (push) Successful in 7s
2025-10-07 23:33:26 +02:00
239adbeb9c
Set environment variable for Docker Compose project name
All checks were successful
Build a dev image / build (push) Successful in 13s
Build a dev image / build (release) Successful in 11s
2025-10-05 21:50:38 +02:00
1618a74f8d
Remove cloud-init configuration to allow password authentication for SSH
All checks were successful
Build a dev image / build (push) Successful in 13s
2025-10-05 21:43:47 +02:00
4cfda0ca4b
Update SSH daemon execution to log output to a specified log file
All checks were successful
Build a dev image / build (push) Successful in 6s
2025-10-05 21:40:02 +02:00
2c3e6aca0c
Add SSH configuration setup in service.ssh.sh if not present
All checks were successful
Build a dev image / build (push) Successful in 21s
2025-10-05 21:38:28 +02:00
ec7c99328c
Docker cli only
All checks were successful
Build a dev image / build (push) Successful in 26s
2025-09-28 17:46:38 +02:00
4a3f97a5e3
Fix variable names in build and push tasks to use IMAGE instead of REPO
All checks were successful
Build a dev image / build (push) Successful in 29s
Build a dev image / build (release) Successful in 17s
2025-09-28 12:53:23 +02:00
643699c3a4
Update docker login credentials in workflows for dev and release
All checks were successful
Build a dev image / build (push) Successful in 4s
Build a dev image / build (release) Successful in 30s
2025-09-28 12:49:52 +02:00
621b38f263
Refactor release workflow to use task for tagging latest image
Some checks failed
Build a dev image / build (push) Failing after 2s
2025-09-28 12:48:56 +02:00
306325591d
Fix pipelines
Some checks failed
Build a dev image / build (push) Failing after 1s
2025-09-27 00:41:40 +02:00
7 changed files with 51 additions and 10 deletions

View file

@ -15,8 +15,8 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: docker login - name: docker login
run: | run: |
docker login gitea.ceperka.net -u "${{ secrets.REPO_USERNAME }}" -p "${{ secrets.REPO_PASSWORD }}" docker login gitea.ceperka.net -u "${{ secrets.REGISTRY_DEV_USERNAME }}" -p "${{ secrets.REGISTRY_DEV_PASSWORD }}"
- name: Build - name: Build
run: task build REPO=$IMAGE VERSION=$TAG run: task build IMAGE=$IMAGE TAG=$TAG
- name: Push - name: Push
run: task push REPO=$IMAGE VERSION=$TAG run: task push IMAGE=$IMAGE TAG=$TAG

View file

@ -30,12 +30,12 @@ jobs:
- name: docker login - name: docker login
run: | run: |
docker login harbor.rosti.cz -u "${{ secrets.HARBOR_REPO_USERNAME }}" -p "${{ secrets.HARBOR_REPO_PASSWORD }}" docker login harbor.rosti.cz -u "${{ secrets.REGISTRY_PROD_USERNAME }}" -p "${{ secrets.REGISTRY_PROD_PASSWORD }}"
- name: Build - name: Build
run: task build REPO=$IMAGE VERSION=${{ env.TAG_NAME }} run: task build IMAGE=$IMAGE TAG=${{ env.TAG_NAME }}
- name: Tag latest - name: Tag latest
run: docker tag $IMAGE:${{ env.TAG_NAME }} $IMAGE:latest run: task tag-latest IMAGE=$IMAGE TAG=${{ env.TAG_NAME }}
- name: Push - name: Push
run: task push REPO=$IMAGE VERSION=${{ env.TAG_NAME }} run: task push IMAGE=$IMAGE TAG=${{ env.TAG_NAME }}
- name: Push latest - name: Push latest
run: task push REPO=$IMAGE VERSION=latest run: task push IMAGE=$IMAGE TAG=latest

View file

@ -2,7 +2,8 @@ FROM alpine:3.22
RUN apk update && apk upgrade && apk add --no-cache \ RUN apk update && apk upgrade && apk add --no-cache \
git \ git \
docker \ docker-cli \
docker-cli-compose \
bash \ bash \
fish \ fish \
zsh \ zsh \
@ -29,9 +30,15 @@ COPY service.ssh.sh /app/
COPY service.ttyd.sh /app/ COPY service.ttyd.sh /app/
RUN chmod +x /app/entrypoint.sh /app/service.ssh.sh /app/service.ttyd.sh RUN chmod +x /app/entrypoint.sh /app/service.ssh.sh /app/service.ttyd.sh
COPY motd.txt /etc/motd
RUN mkdir -p /srv/stack RUN mkdir -p /srv/stack
WORKDIR /srv/stack WORKDIR /srv/stack
# Set environment variable for Docker Compose project name
# This is needed because inside ttyd docker compose defaults to hostname + directory for the project name
ENV COMPOSE_PROJECT_NAME=stack
EXPOSE 22 1234 EXPOSE 22 1234
ENTRYPOINT ["/app/entrypoint.sh"] ENTRYPOINT ["/app/entrypoint.sh"]

View file

@ -10,6 +10,9 @@ tasks:
build: build:
cmds: cmds:
- docker build -t {{ .IMAGE }}:{{ .TAG }} . - docker build -t {{ .IMAGE }}:{{ .TAG }} .
tag-latest:
cmds:
- docker tag {{ .IMAGE }}:{{ .TAG }} {{ .IMAGE }}:latest
push: push:
cmds: cmds:
- docker push {{ .IMAGE }}:{{ .TAG }} - docker push {{ .IMAGE }}:{{ .TAG }}

View file

@ -22,6 +22,22 @@ if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
ssh-keygen -A ssh-keygen -A
fi fi
if [ -f /etc/ssh/sshd_config -a `cat /etc/ssh/sshd_config | wc -l` = 1 ]; then
echo "sshd_config is not complete, regenerating..."
rm -f /etc/ssh/sshd_config
fi
if [ ! -f /etc/ssh/sshd_config ]; then
echo "Include /etc/ssh/sshd_config.d/*.conf" > /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "AuthorizedKeysFile .ssh/authorized_keys" >> /etc/ssh/sshd_config
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
echo "AllowTcpForwarding no" >> /etc/ssh/sshd_config
echo "GatewayPorts no" >> /etc/ssh/sshd_config
echo "X11Forwarding no" >> /etc/ssh/sshd_config
echo "Subsystem sftp internal-sftp" >> /etc/ssh/sshd_config
fi
# Array to store child PIDs # Array to store child PIDs
declare -a CHILD_PIDS=() declare -a CHILD_PIDS=()

0
motd.txt Normal file
View file

View file

@ -1,3 +1,18 @@
#!/bin/sh #!/bin/sh
exec /usr/sbin/sshd -D if [ ! -e /etc/ssh/sshd_config ]; then
mkdir -p /etc/ssh/sshd_config.d
echo "Include /etc/ssh/sshd_config.d/*.conf
PermitRootLogin yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication yes
AllowTcpForwarding yes
GatewayPorts no
X11Forwarding no
Subsystem sftp internal-sftp" > /etc/ssh/sshd_config
fi
# Cloud image generates this file which prevents sshd from accepting passwords
rm -f /etc/ssh/sshd_config.d/50-cloud-init.conf
exec /usr/sbin/sshd -E /var/log/sshd.log -D