Skip to content

Commit

Permalink
Merge branch 'develop' into release/v.1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arkuznetsov committed May 12, 2022
2 parents 8d38a6b + 4ee7b66 commit eed6834
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
SFTP_TEST_USER: ${{ secrets.SFTP_TEST_USER }}
SFTP_TEST_PWD: ${{ secrets.SFTP_TEST_PWD }}
run: |
docker-compose --file ./tools/docker-compose.yml up -d
docker-compose --file ./tools/docker-compose.yml up --build -d
oscript ./tools/nextcloud/checkenv.os
# Запуск тестов и сбор покрытия кода
Expand Down
4 changes: 2 additions & 2 deletions tools/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ services:
build:
context: "./openssh"
args:
SSH_TEST_USER: ${SFTP_TEST_USER}
SSH_TEST_PWD: ${SFTP_TEST_PWD}
SFTP_TEST_USER: ${SFTP_TEST_USER}
SFTP_TEST_PWD: ${SFTP_TEST_PWD}
container_name: test_ssh
ports:
- "2222:22"
8 changes: 4 additions & 4 deletions tools/openssh/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM debian:bullseye

ARG SSH_TEST_USER=user
ARG SSH_TEST_PWD=P@ssw0rd
ENV SSH_TEST_USER=${SFTP_TEST_USER}
ENV SSH_TEST_PWD=${SFTP_TEST_PWD}
ARG SFTP_TEST_USER=user
ARG SFTP_TEST_PWD=P@ssw0rd
ENV SFTP_TEST_USER=${SFTP_TEST_USER}
ENV SFTP_TEST_PWD=${SFTP_TEST_PWD}

COPY files/sshd_config /etc/ssh/sshd_config
COPY files/prepare-ssh.sh /tmp/
Expand Down
18 changes: 9 additions & 9 deletions tools/openssh/files/prepare-ssh.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash

# Create user if needed
getent passwd ${SSH_TEST_USER} > /dev/null
getent passwd ${SFTP_TEST_USER} > /dev/null
if [ $? != 0 ]; then
useradd -m -s /bin/bash ${SSH_TEST_USER}
passwd ${SSH_TEST_USER} <<EOF
${SSH_TEST_PWD}
${SSH_TEST_PWD}
useradd -m -s /bin/bash ${SFTP_TEST_USER}
passwd ${SFTP_TEST_USER} <<EOF
${SFTP_TEST_PWD}
${SFTP_TEST_PWD}
EOF
fi

Expand All @@ -18,7 +18,7 @@ fi
# Restrict access from other users
chmod 600 /etc/ssh/id_key

mkdir -p /home/${SSH_TEST_USER}/.ssh
cat /tmp/sftp-key.pub >> /home/${SSH_TEST_USER}/.ssh/authorized_keys
chmod -R 700 /home/${SSH_TEST_USER}/.ssh && chmod -R 600 /home/${SSH_TEST_USER}/.ssh/*
chown -R ${SSH_TEST_USER} /home/${SSH_TEST_USER}/.ssh
mkdir -p /home/${SFTP_TEST_USER}/.ssh
cat /tmp/sftp-key.pub >> /home/${SFTP_TEST_USER}/.ssh/authorized_keys
chmod -R 700 /home/${SFTP_TEST_USER}/.ssh && chmod -R 600 /home/${SFTP_TEST_USER}/.ssh/*
chown -R ${SFTP_TEST_USER} /home/${SFTP_TEST_USER}/.ssh

0 comments on commit eed6834

Please sign in to comment.