Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ repos:
hooks:
- id: generate-compose-config
name: regenerate docker compose configuration
files: ^(compose\.yml(?:\.tpl)?|images/[^/]+/(?:docker-)?compose\.ya?ml|tools/generate_compose_config\.py)$
files: ^(compose\.yml(?:\.tpl)?|images/[^/]+/((?:docker-)?compose\.ya?ml|specs\.json)|tools/generate_compose_config\.py)$
pass_filenames: false
language: python
entry: tools/generate_compose_config.py --output-file compose.yml
entry: tools/generate_compose_config.py
additional_dependencies: ['PyYAML==6.0', 'jinja2==3.1.2']
92 changes: 92 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,98 @@ services:
service: asyncssh-server-2.13.1
ports:
- '22022:22'
asyncssh-client-2.0.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.0.0
asyncssh-client-2.0.1:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.0.1
asyncssh-client-2.1.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.1.0
asyncssh-client-2.2.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.2.0
asyncssh-client-2.2.1:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.2.1
asyncssh-client-2.3.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.3.0
asyncssh-client-2.4.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.4.0
asyncssh-client-2.4.1:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.4.1
asyncssh-client-2.4.2:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.4.2
asyncssh-client-2.5.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.5.0
asyncssh-client-2.6.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.6.0
asyncssh-client-2.7.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.7.0
asyncssh-client-2.7.1:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.7.1
asyncssh-client-2.7.2:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.7.2
asyncssh-client-2.8.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.8.0
asyncssh-client-2.8.1:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.8.1
asyncssh-client-2.9.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.9.0
asyncssh-client-2.10.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.10.0
asyncssh-client-2.10.1:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.10.1
asyncssh-client-2.11.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.11.0
asyncssh-client-2.12.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.12.0
asyncssh-client-2.13.0:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.13.0
asyncssh-client-2.13.1:
extends:
file: images/asyncssh/compose.yml
service: asyncssh-client-2.13.1

bitvise-server-8.15:
extends:
Expand Down
38 changes: 27 additions & 11 deletions images/asyncssh/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
FROM python:3
# hadolint ignore=DL3049
FROM python:3 AS asyncssh-base

WORKDIR /app
COPY requirements.txt simple_server.py ./
ARG VERSION

WORKDIR /app
COPY files/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt asyncssh==$VERSION

# Server image
FROM asyncssh-base AS asyncssh-server

ARG USERNAME=sshattacker
ARG PASSWORD=secret
ARG AUTHORIZED_KEYS_FILE=authorized_keys

# Copy RSA server key
COPY ssh_host_key* ./
# Copy server script and RSA server key
COPY files/simple_server.py files/ssh_host_key* ./

# Copy authorized pubkeys
COPY "${AUTHORIZED_KEYS_FILE}" "authorized_keys"
COPY "files/${AUTHORIZED_KEYS_FILE}" "authorized_keys"

LABEL ssh.implementation.name="asyncssh" \
ssh.implementation.version="${VERSION}" \
ssh.implementation.type="server"
ENV USERNAME="${USERNAME}" PASSWORD="${PASSWORD}"
# Although the JSON notation for CMD is preferable, there is no straightforward
# way to pass env vars, so we just disable the warning here.
# hadolint ignore=DL3025
CMD python simple_server.py "${USERNAME}" --password "${PASSWORD}" --authorized-keys "authorized_keys"
# Environment variables are picked up by the simple_server.py script
ENV SSH_USERNAME="${USERNAME}" SSH_PASSWORD="${PASSWORD}"

ENTRYPOINT [ "python", "/app/simple_server.py", "-f", "authorized_keys" ]
EXPOSE 22

# Client image
FROM asyncssh-base AS asyncssh-client

# Copy client script
COPY files/simple_client.py ./

LABEL ssh.implementation.name="asyncssh" \
ssh.implementation.version="${VERSION}" \
ssh.implementation.type="client"

ENTRYPOINT [ "python", "/app/simple_client.py" ]
Loading