Switch to root user for Dokku commands
This commit is contained in:
18
.github/workflows/test.yml
vendored
18
.github/workflows/test.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y bats ssh netcat-openbsd
|
sudo apt-get install -y bats
|
||||||
|
|
||||||
- name: Set up SSH
|
- name: Set up SSH
|
||||||
run: |
|
run: |
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
Host dokku-test
|
Host dokku-test
|
||||||
HostName localhost
|
HostName localhost
|
||||||
Port 2222
|
Port 2222
|
||||||
User dokku
|
User root
|
||||||
StrictHostKeyChecking no
|
StrictHostKeyChecking no
|
||||||
UserKnownHostsFile /dev/null
|
UserKnownHostsFile /dev/null
|
||||||
IdentityFile ~/.ssh/id_ed25519
|
IdentityFile ~/.ssh/id_ed25519
|
||||||
@@ -80,14 +80,14 @@ jobs:
|
|||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
# Add the key to the dokku user
|
# Add the key to the root user
|
||||||
echo "Adding SSH key to dokku user..."
|
echo "Adding SSH key to root user..."
|
||||||
docker exec -i $CONTAINER_ID bash -c '
|
docker exec -i $CONTAINER_ID bash -c '
|
||||||
mkdir -p /home/dokku/.ssh
|
mkdir -p /root/.ssh
|
||||||
chmod 700 /home/dokku/.ssh
|
chmod 700 /root/.ssh
|
||||||
cat >> /home/dokku/.ssh/authorized_keys
|
cat >> /root/.ssh/authorized_keys
|
||||||
chmod 600 /home/dokku/.ssh/authorized_keys
|
chmod 600 /root/.ssh/authorized_keys
|
||||||
chown -R dokku:dokku /home/dokku/.ssh
|
chown -R root:root /root/.ssh
|
||||||
' < ~/.ssh/id_ed25519.pub || true
|
' < ~/.ssh/id_ed25519.pub || true
|
||||||
|
|
||||||
# Test SSH connection
|
# Test SSH connection
|
||||||
|
|||||||
Reference in New Issue
Block a user