Skip to content

Commit cc86bc9

Browse files
authored
Remove S6 Overlay and convert to Debian (#8)
* Removed S6 and converted to Debian * Hardened the SSH connection * Created build script * Updated README with changes * Adjusted builds
1 parent 4a6845b commit cc86bc9

28 files changed

+720
-380
lines changed

.cursorrules

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
You are an expert in Linux server administration and cyber security. You have a deep knowledge of distributed systems, containers, and cloud infrastructure. You possess deep knowledge of best practices and performance optimizations techniques for writing Bash and managing SSH servers.
2+
3+
The project you're working on is called serversideup/docker-ssh. This is a highly secure and lightweight Docker image that allows people to securely connect into their clusters for management and development.
4+
5+
Code Style and Structure
6+
- Write clean, maintainable and technically accurate code.
7+
- All bash must be POSIX compliant.
8+
- All bash must be compatible with Linux
9+
- Never use an approach you're not confident about. If you're unsure about something, ask for clarity.
10+
- Always follow best practices for Bash, Docker, and SSH.
11+
12+
This project is open source and the code is available on GitHub, so be sure to follow best practices to make it easy for others to understand, modify, and contribute to the project.

.github/header.png

-56.1 KB
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Docker Publish (Beta Images)
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [prereleased]
7+
jobs:
8+
build-beta-images:
9+
uses: ./.github/workflows/service_docker-build-and-publish.yml
10+
secrets: inherit
11+
with:
12+
release_type: 'beta'

.github/workflows/publish_docker-images-production.yml renamed to .github/workflows/action_publish-images-edge.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
name: Docker Publish
1+
name: Docker Publish (Edge Images)
22

33
on:
44
workflow_dispatch:
5-
release:
6-
types: [released]
7-
schedule:
8-
- cron: '0 8 * * 2'
9-
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- src/**
10+
- .github/workflows/**
11+
- generate-tags.sh
1012
jobs:
11-
12-
ssh:
13+
build-edge-images:
1314
uses: ./.github/workflows/service_docker-build-and-publish.yml
14-
with:
15-
upstream-channel-prefix: ''
16-
checkout-type: latest-stable
1715
secrets: inherit
16+
with:
17+
release_type: 'edge'
1818

1919
update_container_readme:
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-24.04
2121
name: Push README to Docker Hub
2222
steps:
2323
- name: git checkout
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Docker Publish (Production Images)
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [released]
7+
# Commenting out until ready
8+
# schedule:
9+
# - cron: '0 8 * * 2'
10+
11+
jobs:
12+
build-production-images:
13+
uses: ./.github/workflows/service_docker-build-and-publish.yml
14+
secrets: inherit
15+
with:
16+
release_type: 'latest'

.github/workflows/publish_docker-images-beta.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/scheduled-task_update-sponsors.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,22 @@ on:
55
- cron: 30 15 * * 0-6
66
jobs:
77
deploy:
8-
runs-on: ubuntu-latest
8+
runs-on: ubuntu-22.04
99
steps:
1010
- name: Checkout 🛎️
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
12+
13+
- name: Generate Sponsors 💖
14+
uses: JamesIves/github-sponsors-readme-action@v1
15+
with:
16+
organization: true
17+
minimum: 4900
18+
maximum: 5100
19+
fallback: 'No bronze sponsors yet. <a href="https://github.com/sponsors/serversideup">Become a sponsor →</a>'
20+
token: ${{ secrets.SPONSORS_README_ACTION_PERSONAL_ACCESS_TOKEN }}
21+
marker: 'bronze'
22+
template: '<a href="https://github.com/{{{ login }}}"><img src="https://github.com/{{{ login }}}.png" width="40px" alt="{{{ login }}}" /></a>&nbsp;&nbsp;'
23+
file: 'README.md'
1224

1325
- name: Generate Sponsors 💖
1426
uses: JamesIves/github-sponsors-readme-action@v1
Lines changed: 43 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,69 @@
1+
name: Build and Publish Docker Images
2+
13
on:
24
workflow_call:
35
inputs:
4-
upstream-channel-prefix:
5-
required: true
6+
release_type:
67
type: string
7-
default: ''
8-
dockerhub-repository:
9-
required: false
10-
type: string
11-
default: 'serversideup/docker-ssh'
12-
checkout-type:
138
required: true
14-
type: string
9+
description: 'Release type (latest, beta, edge, dev, etc)'
10+
default: 'edge'
1511

1612
jobs:
17-
docker-publish:
18-
runs-on: ubuntu-22.04
19-
steps:
20-
##
21-
# Checkout branch (for push deployments)
22-
##
23-
- name: Get branch name
24-
if: inputs.checkout-type == 'branch'
25-
id: branch-name
26-
uses: tj-actions/branch-names@v6
27-
28-
- uses: actions/checkout@v3
29-
if: inputs.checkout-type == 'branch'
30-
with:
31-
ref: ${{ steps.branch-name.outputs.current_branch }}
32-
33-
##
34-
# Checkout latest stable release (for production releases)
35-
##
36-
- name: Get latest stable release
37-
if: inputs.checkout-type == 'latest-stable'
38-
id: latest-stable-version
39-
run: |
40-
echo "LATEST_STABLE_VERSION=$(curl --silent --header "Accept: application/vnd.github.v3.sha" "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')" >> $GITHUB_OUTPUT
4113

42-
- name: Confirm release tag
43-
if: inputs.checkout-type == 'latest-stable'
44-
run: |
45-
echo "Latest Stable Release Tag: ${{ steps.latest-stable-version.outputs.LATEST_STABLE_VERSION }}"
46-
47-
- name: Checkout latest stable tag
48-
if: inputs.checkout-type == 'latest-stable'
49-
uses: actions/checkout@v3
50-
with:
51-
ref: ${{ steps.latest-stable-version.outputs.LATEST_STABLE_VERSION }}
14+
build-and-push:
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Check out code.
18+
uses: actions/checkout@v4
5219

53-
##
54-
# Docker build & publish
55-
##
5620
- name: Login to DockerHub
57-
uses: docker/login-action@v2
21+
uses: docker/login-action@v3
5822
with:
5923
username: ${{ secrets.DOCKER_HUB_USERNAME }}
6024
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
6125

26+
- name: Login to GitHub Container Registry
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
6233
- name: Set up QEMU
63-
uses: docker/setup-qemu-action@v2
34+
uses: docker/setup-qemu-action@v3
6435

6536
- name: Set up Docker Buildx
66-
uses: docker/setup-buildx-action@v2
67-
68-
- name: "👨‍🔬 Set docker tags: Non-Release "
69-
if: inputs.checkout-type == 'branch'
70-
run: echo "DOCKER_TAGS=${{ inputs.dockerhub-repository }}:${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV
37+
uses: docker/setup-buildx-action@v3
38+
39+
- name: "📦 Assemble the Docker Tags"
40+
run: |
41+
bash build.sh \
42+
--release-type ${{ inputs.release_type }} \
43+
--print-tags-only
7144
72-
- name: "🚀 Set docker tags: Release"
73-
if: inputs.checkout-type == 'latest-stable'
74-
run: echo "DOCKER_TAGS=${{ inputs.dockerhub-repository }}:latest, ${{ inputs.dockerhub-repository }}:${{ steps.latest-stable-version.outputs.LATEST_STABLE_VERSION }}" >> $GITHUB_ENV
45+
- name: Set REPOSITORY_BUILD_VERSION
46+
id: set_version
47+
run: |
48+
if [ "${{ github.ref_type }}" == "tag" ]; then
49+
echo "🚀 Setting REPOSITORY_BUILD_VERSION to Tag"
50+
echo "REPOSITORY_BUILD_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
51+
else
52+
echo "👨‍🔬 Setting REPOSITORY_BUILD_VERSION to GIT Short SHA and GitHub Run ID"
53+
SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)
54+
echo "REPOSITORY_BUILD_VERSION=git-${SHORT_SHA}-${{ github.run_id }}" >> $GITHUB_ENV
55+
fi
7556
7657
- name: Build and push
77-
uses: docker/build-push-action@v3
58+
uses: docker/build-push-action@v6
7859
with:
79-
build-args: |
80-
UPSTREAM_CHANNEL=${{ inputs.upstream-channel-prefix }}
81-
context: src/
60+
file: src/Dockerfile
61+
cache-from: type=gha,mode=max
62+
cache-to: type=gha,mode=max
8263
platforms: |
8364
linux/amd64
84-
linux/arm/v7
8565
linux/arm64/v8
8666
pull: true
8767
push: true
88-
tags: ${{ env.DOCKER_TAGS }}
68+
tags: ${{ env.DOCKER_TAGS }}
69+
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Run SSH anywhere with the power of Docker

0 commit comments

Comments
 (0)