mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2026-11-19 21:45:24 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 52021ce058 |
@@ -1 +0,0 @@
|
|||||||
github: [burnett01]
|
|
||||||
@@ -4,7 +4,3 @@ updates:
|
|||||||
directory: /
|
directory: /
|
||||||
schedule:
|
schedule:
|
||||||
interval: monthly
|
interval: monthly
|
||||||
- package-ecosystem: github-actions
|
|
||||||
directory: /
|
|
||||||
schedule:
|
|
||||||
interval: weekly
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
name: Test BATS Suite
|
name: Test BATS Suite
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install BATS
|
- name: Install BATS
|
||||||
run: |
|
run: |
|
||||||
@@ -38,7 +38,7 @@ jobs:
|
|||||||
name: Validate Action Definition
|
name: Validate Action Definition
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Validate action.yml
|
- name: Validate action.yml
|
||||||
run: |
|
run: |
|
||||||
@@ -81,7 +81,7 @@ jobs:
|
|||||||
needs: [validate-action, action-structure]
|
needs: [validate-action, action-structure]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
@@ -94,7 +94,7 @@ jobs:
|
|||||||
name: Validate Action Structure
|
name: Validate Action Structure
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Check required files
|
- name: Check required files
|
||||||
run: |
|
run: |
|
||||||
@@ -128,7 +128,7 @@ jobs:
|
|||||||
name: Lint Shell Scripts
|
name: Lint Shell Scripts
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install ShellCheck
|
- name: Install ShellCheck
|
||||||
run: |
|
run: |
|
||||||
@@ -151,7 +151,7 @@ jobs:
|
|||||||
needs: [test, validate-action, docker-build, action-structure, lint-shell]
|
needs: [test, validate-action, docker-build, action-structure, lint-shell]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Final integration check
|
- name: Final integration check
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
name: Integration
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
integration-test:
|
|
||||||
if: github.actor == 'Burnett01'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v7
|
|
||||||
- name: Run integration test
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
switches: -avzr --dry-run
|
|
||||||
remote_path: ${{ secrets.INTEGRATION_TEST_PATH }}
|
|
||||||
remote_host: ${{ secrets.INTEGRATION_TEST_SERVER }}
|
|
||||||
remote_port: ${{ secrets.INTEGRATION_TEST_PORT }}
|
|
||||||
remote_user: ${{ secrets.INTEGRATION_TEST_USER }}
|
|
||||||
remote_key: ${{ secrets.INTEGRATION_TEST_KEY }}
|
|
||||||
remote_key_pass: ${{ secrets.INTEGRATION_TEST_KEY_PASSPHRASE }}
|
|
||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
actions: read
|
actions: read
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v4
|
||||||
- name: Build a Docker image
|
- name: Build a Docker image
|
||||||
run: docker build -t burnett01/rsync-deployments .
|
run: docker build -t burnett01/rsync-deployments .
|
||||||
- name: Run Snyk to check Docker image for vulnerabilities
|
- name: Run Snyk to check Docker image for vulnerabilities
|
||||||
|
|||||||
+3
-11
@@ -1,19 +1,11 @@
|
|||||||
FROM alpine:3.24.4@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf AS base
|
FROM alpine:3.23.0@sha256:51183f2cfa6320055da30872f211093f9ff1d3cf06f39a0bdb212314c5dc7375 AS base
|
||||||
|
|
||||||
# Add Alpine edge branch as tagged repository for rsync.
|
RUN apk update && apk add --no-cache --upgrade rsync openssh openssl busybox
|
||||||
RUN printf '%s\n' \
|
|
||||||
'@edge https://dl-cdn.alpinelinux.org/alpine/edge/main' \
|
|
||||||
'@edge https://dl-cdn.alpinelinux.org/alpine/edge/community' \
|
|
||||||
>> /etc/apk/repositories
|
|
||||||
|
|
||||||
# Install rsync from Alpine edge branch for latest upstream security patches.
|
|
||||||
# Other packages are installed from Alpine 3.24.3 branch.
|
|
||||||
RUN apk update && apk add --no-cache --upgrade 'rsync@edge>=3.5.2-r1' 'openssh-client-default@edge>=10.6_p2-r0' openssl busybox
|
|
||||||
|
|
||||||
RUN rm -rf /var/cache/apk/*
|
RUN rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
COPY docker-rsync/* /bin/
|
COPY docker-rsync/* /bin/
|
||||||
RUN chmod +x /bin/agent-* /bin/ssh-* /bin/hosts-*
|
RUN chmod +x /bin/agent-*
|
||||||
|
|
||||||
FROM base AS build
|
FROM base AS build
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2019-2022 Contention
|
Copyright (c) 2019-2022 Contention
|
||||||
Copyright (c) 2019-2026 Joshua Piper (Dr Internet)
|
Copyright (c) 2019-2025 Joshua Piper (Dr Internet)
|
||||||
Copyright (c) 2019-2026 Burnett01
|
Copyright (c) 2019-2025 Burnett01
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -10,63 +10,22 @@ This cross-platform GitHub Action deploys files in [`path`](#inputs) (relative t
|
|||||||
|
|
||||||
Use this action in a CD workflow which leaves deployable code in `GITHUB_WORKSPACE`, such [actions/checkout](https://github.com/actions/checkout).
|
Use this action in a CD workflow which leaves deployable code in `GITHUB_WORKSPACE`, such [actions/checkout](https://github.com/actions/checkout).
|
||||||
|
|
||||||
The base-image of this action is very small and based on **Alpine 3.24.4** (no cache) which results in fast deployments.
|
The base-image of this action is very small and based on **Alpine 3.23.0** (no cache) which results in fast deployments.
|
||||||
|
|
||||||
Alpine version: [3.24.4](https://alpinelinux.org/posts/alpine-3.21.10-3.22.8-3.23.8-3.24.4-released/)
|
Alpine version: [3.23.0](https://www.alpinelinux.org/posts/Alpine-3.23.0-released.html)
|
||||||
Rsync version: [3.5.2-r1](https://download.samba.org/pub/rsync/NEWS#3.5.2)
|
Rsync version: [3.4.1-r1](https://download.samba.org/pub/rsync/NEWS#3.4.1)
|
||||||
|
|
||||||
## Current Version: v9 (9.0.4)
|
|
||||||
|
|
||||||
### Release channels:
|
|
||||||
|
|
||||||
| Version | Purpose | Immutable |
|
|
||||||
| ------- | ------------------ | ------------------ |
|
|
||||||
| ``@v9`` (recommended, LTS) | latest MAJOR (pointer to 9.MINOR.PATCH) | no |
|
|
||||||
| ``@9.0.4`` | latest MAJOR+MINOR+PATCH | yes |
|
|
||||||
| ``@v8`` (ESU) | previous MAJOR (pointer to 8.MINOR.PATCH) | no |
|
|
||||||
| ``@8.0.5`` | previous MAJOR+MINOR+PATCH | yes |
|
|
||||||
|
|
||||||
You can also use ``@latest`` which always points to the latest MAJOR (currently ``v9``).
|
|
||||||
|
|
||||||
Check [SECURITY.md](SECURITY.md) for support cycles.
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## How it works
|
|
||||||
|
|
||||||
```yml
|
|
||||||
name: DEPLOY
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v7
|
|
||||||
- name: rsync deployments
|
|
||||||
uses: burnett01/rsync-deployments@v9
|
|
||||||
with:
|
|
||||||
switches: -avzr --delete
|
|
||||||
path: src/
|
|
||||||
remote_path: ${{ secrets.REMOTE_PATH }} # ex: /var/www/html/
|
|
||||||
remote_host: ${{ secrets.REMOTE_HOST }} # ex: example.com
|
|
||||||
remote_port: ${{ secrets.REMOTE_PORT }} # ex: 22
|
|
||||||
remote_user: ${{ secrets.REMOTE_USER }} # ex: ubuntu
|
|
||||||
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
- `debug`* - Whether to enable debug output. ("true" / "false") - Default: "false"
|
- `debug`* - Whether to enable debug output. ("true" / "false") - Default: "false"
|
||||||
|
|
||||||
- `switches`* - The first is for any initial/required rsync flags, eg: `-avzr --delete`
|
- `switches`* - The first is for any initial/required rsync flags, eg: `-avzr --delete`
|
||||||
|
|
||||||
- `rsh` - Custom remote shell SSH parameters via Rsync.
|
- `rsh` - Remote shell commands
|
||||||
|
|
||||||
- `strict_hostkeys_checking` - Enables support for strict hostkeys (fingerprint) checking. ("true" / "false") - Default: "false" - **DEPRECATED (use 'known_hosts')!**
|
- `strict_hostkeys_checking` - Enables support for strict hostkeys (fingerprint) checking. ("true" / "false") - Default: "false"
|
||||||
|
|
||||||
- `known_hosts` - Trusted host keys of the remote server, one per line (pinning). Enables strict hostkeys checking. Takes precedence over `strict_hostkeys_checking` - Default: "" - [See guide](#pinning-trusted-host-keys-known_hosts)
|
|
||||||
|
|
||||||
- `legacy_allow_rsa_hostkeys` - Enables support for legacy RSA host keys on OpenSSH 8.8+. ("true" / "false") - Default: "false"
|
- `legacy_allow_rsa_hostkeys` - Enables support for legacy RSA host keys on OpenSSH 8.8+. ("true" / "false") - Default: "false"
|
||||||
|
|
||||||
@@ -94,9 +53,19 @@ This action needs secret variables for the ssh private key of your key pair. The
|
|||||||
|
|
||||||
For simplicity, we are using `REMOTE_*` as the secret variables throughout the examples.
|
For simplicity, we are using `REMOTE_*` as the secret variables throughout the examples.
|
||||||
|
|
||||||
## Example usage
|
## Current Version: v8 (8.0.0)
|
||||||
|
|
||||||
For better **security** always use secrets for remote_host, remote_port, remote_user and remote_path inputs.
|
### Release channels:
|
||||||
|
|
||||||
|
| Version | Purpose | Immutable |
|
||||||
|
| ------- | ------------------ | ------------------ |
|
||||||
|
| ``v8`` | latest release (pointer to 8.x.x) | no, points to latest MINOR,PATCH |
|
||||||
|
| 8.0.0 | latest major release | yes |
|
||||||
|
| 7.1.0 | previous release | yes |
|
||||||
|
|
||||||
|
Check [SECURITY.md](SECURITY.md) for support cycles.
|
||||||
|
|
||||||
|
## Example usage
|
||||||
|
|
||||||
Simple:
|
Simple:
|
||||||
|
|
||||||
@@ -111,32 +80,56 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v6
|
||||||
- name: rsync deployments
|
- name: rsync deployments
|
||||||
uses: burnett01/rsync-deployments@v9
|
uses: burnett01/rsync-deployments@v8
|
||||||
with:
|
with:
|
||||||
switches: -avzr --delete
|
switches: -avzr --delete
|
||||||
path: src/
|
path: src/
|
||||||
remote_path: ${{ secrets.REMOTE_PATH }} # ex: /var/www/html/
|
remote_path: /var/www/html/
|
||||||
remote_host: ${{ secrets.REMOTE_HOST }} # ex: example.com
|
remote_host: example.com
|
||||||
remote_port: ${{ secrets.REMOTE_PORT }} # ex: 22
|
remote_user: debian
|
||||||
remote_user: ${{ secrets.REMOTE_USER }} # ex: ubuntu
|
|
||||||
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
|
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
|
||||||
```
|
```
|
||||||
|
|
||||||
Advanced (with filters etc) use ``switches``:
|
Advanced:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v6
|
||||||
- name: rsync deployments
|
- name: rsync deployments
|
||||||
uses: burnett01/rsync-deployments@v9
|
uses: burnett01/rsync-deployments@v8
|
||||||
with:
|
with:
|
||||||
switches: -avzr --delete --exclude="" --include="" --filter=""
|
switches: -avzr --delete --exclude="" --include="" --filter=""
|
||||||
[...redacted...]
|
path: src/
|
||||||
|
remote_path: /var/www/html/
|
||||||
|
remote_host: example.com
|
||||||
|
remote_port: 5555
|
||||||
|
remote_user: debian
|
||||||
|
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
|
||||||
|
```
|
||||||
|
|
||||||
|
For better **security**, I suggest you create additional secrets for remote_host, remote_port, remote_user and remote_path inputs.
|
||||||
|
|
||||||
|
```yml
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: rsync deployments
|
||||||
|
uses: burnett01/rsync-deployments@v8
|
||||||
|
with:
|
||||||
|
switches: -avzr --delete
|
||||||
|
path: src/
|
||||||
|
remote_path: ${{ secrets.REMOTE_PATH }}
|
||||||
|
remote_host: ${{ secrets.REMOTE_HOST }}
|
||||||
|
remote_port: ${{ secrets.REMOTE_PORT }}
|
||||||
|
remote_user: ${{ secrets.REMOTE_USER }}
|
||||||
|
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
|
||||||
```
|
```
|
||||||
|
|
||||||
If your private key is passphrase protected you should use:
|
If your private key is passphrase protected you should use:
|
||||||
@@ -146,58 +139,23 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v6
|
||||||
- name: rsync deployments
|
- name: rsync deployments
|
||||||
uses: burnett01/rsync-deployments@v9
|
uses: burnett01/rsync-deployments@v8
|
||||||
with:
|
with:
|
||||||
[...redacted...]
|
switches: -avzr --delete
|
||||||
|
path: src/
|
||||||
|
remote_path: ${{ secrets.REMOTE_PATH }}
|
||||||
|
remote_host: ${{ secrets.REMOTE_HOST }}
|
||||||
|
remote_port: ${{ secrets.REMOTE_PORT }}
|
||||||
|
remote_user: ${{ secrets.REMOTE_USER }}
|
||||||
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
|
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
|
||||||
remote_key_pass: ${{ secrets.REMOTE_PRIVATE_KEY_PASS }}
|
remote_key_pass: ${{ secrets.REMOTE_PRIVATE_KEY_PASS }}
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Pinning trusted host keys (known_hosts)
|
#### Legacy RSA Hostkeys support for OpenSSH Servers >= 8.8+
|
||||||
|
|
||||||
By default the action accepts any host key the server presents. With ``strict_hostkeys_checking: "true"`` (deprecated)
|
|
||||||
the key is fetched via `ssh-keyscan` right before the deployment, which only protects against
|
|
||||||
the key changing during the run, not against a server that is already spoofed at that moment.
|
|
||||||
|
|
||||||
To actually verify the server, pass its host key(s) via ``known_hosts``. The action then enables strict checking and skips `ssh-keyscan`. If the server presents
|
|
||||||
a different key, the deployment fails.
|
|
||||||
|
|
||||||
Get the public host key on the server itself (not over the network):
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cat /etc/ssh/ssh_host_ed25519_key.pub
|
|
||||||
# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... user@server
|
|
||||||
```
|
|
||||||
|
|
||||||
Store the output in a secret (e.g. `REMOTE_HOST_KEYS`) and pass it to the action:
|
|
||||||
|
|
||||||
```yml
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v7
|
|
||||||
- name: rsync deployments
|
|
||||||
uses: burnett01/rsync-deployments@v9
|
|
||||||
with:
|
|
||||||
[...redacted...]
|
|
||||||
known_hosts: ${{ secrets.REMOTE_HOST_KEYS }}
|
|
||||||
```
|
|
||||||
|
|
||||||
Accepted formats, one entry per line (blank lines and lines starting with `#` are ignored):
|
|
||||||
|
|
||||||
- Bare key, e.g. `ssh-ed25519 AAAAC3...`. It is bound to `remote_host` (and `remote_port`, if not 22) automatically.
|
|
||||||
- Full known_hosts line, e.g. `example.com ssh-ed25519 AAAAC3...` or a hashed `|1|...` line. Used as is, so the host part must match `remote_host`.
|
|
||||||
|
|
||||||
Multiple keys (e.g. ed25519 and ecdsa) can be listed on separate lines.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Legacy RSA Hostkeys support for OpenSSH Servers >= 8.8+
|
|
||||||
|
|
||||||
If your remote OpenSSH Server still uses RSA hostkeys, then you have to
|
If your remote OpenSSH Server still uses RSA hostkeys, then you have to
|
||||||
manually enable legacy support for this by using ``legacy_allow_rsa_hostkeys: "true"``.
|
manually enable legacy support for this by using ``legacy_allow_rsa_hostkeys: "true"``.
|
||||||
@@ -207,19 +165,25 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@v6
|
||||||
- name: rsync deployments
|
- name: rsync deployments
|
||||||
uses: burnett01/rsync-deployments@v9
|
uses: burnett01/rsync-deployments@v8
|
||||||
with:
|
with:
|
||||||
[...redacted...]
|
switches: -avzr --delete
|
||||||
legacy_allow_rsa_hostkeys: "true"
|
legacy_allow_rsa_hostkeys: "true"
|
||||||
|
path: src/
|
||||||
|
remote_path: ${{ secrets.REMOTE_PATH }}
|
||||||
|
remote_host: ${{ secrets.REMOTE_HOST }}
|
||||||
|
remote_port: ${{ secrets.REMOTE_PORT }}
|
||||||
|
remote_user: ${{ secrets.REMOTE_USER }}
|
||||||
|
remote_key: ${{ secrets.REMOTE_PRIVATE_KEY }}
|
||||||
```
|
```
|
||||||
|
|
||||||
See [#49](https://github.com/Burnett01/rsync-deployments/issues/49) and [#24](https://github.com/Burnett01/rsync-deployments/issues/24) for more information.
|
See [#49](https://github.com/Burnett01/rsync-deployments/issues/49) and [#24](https://github.com/Burnett01/rsync-deployments/issues/24) for more information.
|
||||||
|
|
||||||
**Note:** Only use this if necessary. It's recommended to upgrade your remote OpenSSH server instead.
|
**Note:** Only use this if necessary. It's recommended to upgrade your remote OpenSSH server instead.
|
||||||
|
|
||||||
---
|
--
|
||||||
|
|
||||||
## Advanced Rsync switches/flags/options
|
## Advanced Rsync switches/flags/options
|
||||||
|
|
||||||
@@ -313,75 +277,14 @@ sudo apk add rsync
|
|||||||
|
|
||||||
## Versions
|
## Versions
|
||||||
|
|
||||||
## Version 9.0.3
|
## Version 7.1.0
|
||||||
|
|
||||||
Check here:
|
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/9.0.3 (alpine 3.24.3)
|
|
||||||
|
|
||||||
## Version 9.0.2
|
|
||||||
|
|
||||||
Check here:
|
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/9.0.2 (alpine 3.24.2)
|
|
||||||
|
|
||||||
|
|
||||||
## Version 9.0.1
|
|
||||||
|
|
||||||
Check here:
|
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/9.0.1 (alpine 3.24.1)
|
|
||||||
|
|
||||||
## Version 9.0.0
|
|
||||||
|
|
||||||
Check here:
|
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/9.0.0 (alpine 3.24.1)
|
|
||||||
|
|
||||||
## Version 8.0.5
|
|
||||||
|
|
||||||
Check here:
|
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/8.0.5 (alpine 3.23.4)
|
|
||||||
|
|
||||||
## Version 8.0.4
|
|
||||||
|
|
||||||
Check here:
|
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/8.0.4 (alpine 3.23.3)
|
|
||||||
|
|
||||||
## Version 8.0.3
|
|
||||||
|
|
||||||
Check here:
|
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/8.0.3 (alpine 3.23.2)
|
|
||||||
|
|
||||||
## Version 8.0.2
|
|
||||||
|
|
||||||
Check here:
|
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/8.0.2 (alpine 3.23.0)
|
|
||||||
|
|
||||||
## Version 8.0.1 (EOL)
|
|
||||||
|
|
||||||
Check here:
|
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/8.0.1 (alpine 3.23.0)
|
|
||||||
|
|
||||||
## Version 8.0.0 (EOL due to regression -> fixed via 8.0.1 & 8.0.2)
|
|
||||||
|
|
||||||
Check here:
|
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/8.0.0 (alpine 3.23.0)
|
|
||||||
|
|
||||||
## Version 7.1.0 (EOL)
|
|
||||||
|
|
||||||
Check here:
|
Check here:
|
||||||
|
|
||||||
- https://github.com/Burnett01/rsync-deployments/tree/7.1.0 (alpine 3.22.1)
|
- https://github.com/Burnett01/rsync-deployments/tree/7.1.0 (alpine 3.22.1)
|
||||||
|
|
||||||
|
|
||||||
## Version 7.0.2 (EOL)
|
## Version 7.0.2 (DEPRECATED)
|
||||||
|
|
||||||
Check here:
|
Check here:
|
||||||
|
|
||||||
@@ -455,7 +358,7 @@ Please note that version 1.0 has reached end of life state.
|
|||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|
||||||
+ This project is a fork of [Contention/rsync-deployments](https://github.com/Contention/rsync-deployments)
|
+ This project is a fork of [Contention/rsync-deployments](https://github.com/Contention/rsync-deployments)
|
||||||
+ docker-rsync [JoshPiper/rsync-docker](https://github.com/JoshPiper/rsync-docker)
|
+ Base image [JoshPiper/rsync-docker](https://github.com/JoshPiper/rsync-docker)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
+13
-56
@@ -2,35 +2,23 @@
|
|||||||
|
|
||||||
The Docker image and code quality are regularly checked for vulnerabilities and CVEs by Snyk and CodeQL.
|
The Docker image and code quality are regularly checked for vulnerabilities and CVEs by Snyk and CodeQL.
|
||||||
|
|
||||||
Additionally, we run linter and BATS suite tests to ensure stable compatibility.
|
|
||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
|
|
||||||
The following versions are currently being supported with security updates:
|
The following versions are currently being supported with security updates:
|
||||||
|
|
||||||
| Version | Supported | Rsync version | Alpine version | Support Until |
|
| Version | Supported | Rsync version | Alpine version |
|
||||||
| ------- | ------------------ | ------------------ | ------------------ | ------------------ |
|
| ------- | ------------------ | ------------------ | ------------------ |
|
||||||
| (``v9``) 9.0.4 | :white_check_mark: | >= 3.5.2-r1 | 3.24.4 | LTS (2028-*) |
|
| 8.0.0 | :white_check_mark: | >= 3.4.1-r1 | 3.23.0 |
|
||||||
| 9.0.3 | :white_check_mark: | >= 3.5.1-r0 | 3.24.3 | LTS (Jan, 8th 2028) |
|
| 7.1.0 | :white_check_mark: | >= 3.4.1-r0 | 3.22.1 |
|
||||||
| 9.0.2 | :white_check_mark: | >= 3.5.1-r0 | 3.24.2 | LTS (Jan, 8th 2028) |
|
| 7.0.2 | :warning: DEPRECATED | >= 3.4.0-r0 | 3.22.1 |
|
||||||
| 9.0.1 | :white_check_mark: | >= 3.5.0-r0 | 3.24.1 | LTS (Jan, 8th 2028) |
|
| 7.0.1 | :x: EOL | < 3.4.0 | 3.22.1 |
|
||||||
| 9.0.0 | :white_check_mark: | >= 3.4.3-r1 | 3.24.1 | LTS (Jan, 8th 2028) |
|
| 7.0.0 | :x: EOL | < 3.4.0| 3.19.1 |
|
||||||
| (``v8``) 8.0.5 | ⚠️ ESU | >= 3.4.1-r1 | 3.23.4 | Apr, 1st 2027 ([esu notice](https://github.com/Burnett01/rsync-deployments/discussions/120)) |
|
| 6.x | :x: EOL |< 3.4.0| 3.17.2 |
|
||||||
| 8.0.4 | :warning: DEPRECATED | >= 3.4.1-r1 | 3.23.3 | Dec, 6th 2026 ([eol notice](https://github.com/Burnett01/rsync-deployments/discussions/120)) |
|
| 5.x | :x: EOL |< 3.4.0| 3.11 - 3.14.1 - 3.15 - 3.16 - 3.17.2 |
|
||||||
| 8.0.3 | :warning: DEPRECATED | >= 3.4.1-r1 | 3.23.2 | Dec, 6th 2026 ([eol notice](https://github.com/Burnett01/rsync-deployments/discussions/120)) |
|
| 4.x | :x: EOL |< 3.4.0| 3.11 |
|
||||||
| 8.0.2 | :warning: DEPRECATED | >= 3.4.1-r1 | 3.23.0 | Dec, 6th 2026 ([eol notice](https://github.com/Burnett01/rsync-deployments/discussions/120)) |
|
| 3.0 | :x: EOL |< 3.4.0| N/A |
|
||||||
| 8.0.1 | :x: EOL | >= 3.4.1-r1 | 3.23.0 | † Apr, 1st 2026 |
|
| 2.0 | :x: EOL |< 3.4.0| Ubuntu |
|
||||||
| 8.0.0 | :x: EOL (due to regression #90) | >= 3.4.1-r1 | 3.23.0 | † Dec, 6th 2025 |
|
| 1.0 | :x: EOL |< 3.4.0| Ubuntu |
|
||||||
| 7.1.0 | :x: EOL | >= 3.4.1-r0 | 3.22.1 | † June, 1st 2026 ([eol notice](https://github.com/Burnett01/rsync-deployments/discussions/96)) |
|
|
||||||
| 7.0.2 | :x: EOL | >= 3.4.0-r0 | 3.22.1 | † June, 1st 2026 ([eol notice](https://github.com/Burnett01/rsync-deployments/discussions/96)) |
|
|
||||||
| 7.0.1 | :x: EOL | < 3.4.0 | 3.22.1 | † Dec, 6th 2025 |
|
|
||||||
| 7.0.0 | :x: EOL | < 3.4.0| 3.19.1 | † Dec, 6th 2025 |
|
|
||||||
| 6.x | :x: EOL |< 3.4.0| 3.17.2 | † 2024 |
|
|
||||||
| 5.x | :x: EOL |< 3.4.0| 3.11 - 3.14.1 - 3.15 - 3.16 - 3.17.2 | † 2024 |
|
|
||||||
| 4.x | :x: EOL |< 3.4.0| 3.11 | † |
|
|
||||||
| 3.0 | :x: EOL |< 3.4.0| N/A | † |
|
|
||||||
| 2.0 | :x: EOL |< 3.4.0| Ubuntu | † |
|
|
||||||
| 1.0 | :x: EOL |< 3.4.0| Ubuntu | † |
|
|
||||||
|
|
||||||
### Terminology
|
### Terminology
|
||||||
|
|
||||||
@@ -38,37 +26,6 @@ EOL = End of life (no support/no updates)
|
|||||||
|
|
||||||
DEPRECATED = Close to EOL (support/no updates)
|
DEPRECATED = Close to EOL (support/no updates)
|
||||||
|
|
||||||
ESU = Close to DEPRECATED (support/updates)
|
|
||||||
|
|
||||||
## Release cycles
|
|
||||||
|
|
||||||
Our aim is to follow the [Alpine Linux release cycles](https://alpinelinux.org/releases/).
|
|
||||||
|
|
||||||
Whenever a new Alpine version is released, we will release a new action version.
|
|
||||||
|
|
||||||
You can indicate the Alpine minor-version in our major-version number:
|
|
||||||
|
|
||||||
| Alpine Version | Action Version |
|
|
||||||
| ------- | ------------------ |
|
|
||||||
| 3.**24**.4 | **9**.0.4 |
|
|
||||||
| 3.**24**.3 | **9**.0.3 |
|
|
||||||
|
|
||||||
You can indicate the Alpine patch-version in our patch-version number:
|
|
||||||
|
|
||||||
| Alpine Version | Action Version |
|
|
||||||
| ------- | ------------------ |
|
|
||||||
| 3.24.**4** | 9.0.**4** |
|
|
||||||
| 3.24.**3** | 9.0.**3** |
|
|
||||||
|
|
||||||
If we release an OOB patch for a specific package update, our minor-version number increases:
|
|
||||||
|
|
||||||
| Alpine Version | Action Version |
|
|
||||||
| ------- | ------------------ |
|
|
||||||
| 3.24.4 | 9.**1**.4 |
|
|
||||||
| 3.24.3 | 9.**2**.3 |
|
|
||||||
|
|
||||||
**Note:** This is subject to change because we want to align our versioning with Alpines versioning.
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
You can report a vulnerability by creating an issue.
|
You can report a vulnerability by creating an issue.
|
||||||
|
|||||||
+2
-10
@@ -1,5 +1,5 @@
|
|||||||
name: 'Rsync Deployments Action'
|
name: 'Rsync Deployments Action'
|
||||||
description: 'GitHub Action for deploying code via rsync over ssh securely - used by 5k+ workflows!'
|
description: 'GitHub Action for deploying code via rsync over ssh'
|
||||||
author: 'Burnett01'
|
author: 'Burnett01'
|
||||||
inputs:
|
inputs:
|
||||||
switches:
|
switches:
|
||||||
@@ -13,12 +13,8 @@ inputs:
|
|||||||
description: 'Enables support for legacy RSA host keys on OpenSSH 8.8+'
|
description: 'Enables support for legacy RSA host keys on OpenSSH 8.8+'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
known_hosts:
|
|
||||||
description: 'Enables strict host keys checking against the hostkey you set.'
|
|
||||||
required: false
|
|
||||||
default: ''
|
|
||||||
strict_hostkeys_checking:
|
strict_hostkeys_checking:
|
||||||
description: 'DEPRECATED: Controls strict host keys checking'
|
description: 'Controls strict host keys checking'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
path:
|
path:
|
||||||
@@ -49,10 +45,6 @@ inputs:
|
|||||||
description: 'Debug the action'
|
description: 'Debug the action'
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'false'
|
||||||
log_level:
|
|
||||||
description: 'The log-level that is used in the rsh-switch'
|
|
||||||
required: false
|
|
||||||
default: 'ERROR'
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
# Scripts
|
|
||||||
|
|
||||||
Shell-scripts to help with managing SSH agents and known hosts files.
|
|
||||||
|
|
||||||
### SSH Management
|
|
||||||
|
|
||||||
#### ssh-init
|
|
||||||
This command create the ``$HOME/.ssh`` folder with default permissions ``700``.
|
|
||||||
|
|
||||||
### SSH-Agent Management
|
|
||||||
|
|
||||||
#### agent-start
|
|
||||||
This command starts the SSH agent, if it isn't already started (SSH_AGENT_PID set or ssh agent ID file found).
|
|
||||||
It takes one optional argument, for the name of the agent to be started. Defaults to "default".
|
|
||||||
This program needs to be source'd to work correctly.
|
|
||||||
`source agent-start "default"`
|
|
||||||
|
|
||||||
#### agent-stop
|
|
||||||
This command stops the SSH agent, if it is started (SSH_AGENT_PID set or ssh agent ID file found).
|
|
||||||
It takes one optional argument, for the name of the agent to be stopped. Defaults to "default".
|
|
||||||
`agent-stop "my-agent-name"`
|
|
||||||
|
|
||||||
#### agent-add
|
|
||||||
This command adds a key to the currently running SSH agent. The key is taken from stdin, and the agent used is that in SSH_AGENT_PID.
|
|
||||||
|
|
||||||
#### agent-askpass
|
|
||||||
This command is called by ssh-add when the [SSH_ASKPASS](https://man.openbsd.org/ssh-add.1#ENVIRONMENT) variable is set active. The command returns the SSH_PASS to [ssh-askpass(1)](https://man.openbsd.org/ssh-askpass.1).
|
|
||||||
|
|
||||||
This command is ignored by ssh-add if the key does not require a passphrase.
|
|
||||||
|
|
||||||
### known_hosts management
|
|
||||||
|
|
||||||
#### hosts-init
|
|
||||||
This command creates the known_hosts file (``$HOME/.ssh/known_hosts``) with default permission ``600``.
|
|
||||||
|
|
||||||
#### hosts-add
|
|
||||||
This command adds an entry to the known hosts file, and ensures its permissions are correct. It takes one argument, which is the new key to add.
|
|
||||||
|
|
||||||
#### hosts-clear
|
|
||||||
This command truncates the known_hosts file.
|
|
||||||
@@ -2,4 +2,4 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
echo "$@" >> $HOME/.ssh/known_hosts
|
printf '%s\n' "$@" >> $HOME/.ssh/known_hosts
|
||||||
|
|||||||
@@ -2,8 +2,5 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
if [ ! -f "$HOME/.ssh/known_hosts" ]; then
|
touch $HOME/.ssh/known_hosts
|
||||||
touch $HOME/.ssh/known_hosts
|
|
||||||
fi
|
|
||||||
|
|
||||||
chmod 600 $HOME/.ssh/known_hosts
|
chmod 600 $HOME/.ssh/known_hosts
|
||||||
|
|||||||
@@ -2,6 +2,4 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
if [ ! -d "$HOME/.ssh" ]; then
|
mkdir -m 700 $HOME/.ssh
|
||||||
mkdir -m 700 $HOME/.ssh
|
|
||||||
fi
|
|
||||||
|
|||||||
+6
-34
@@ -2,11 +2,8 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
LOG_LEVEL="${INPUT_LOGLEVEL:-ERROR}"
|
|
||||||
|
|
||||||
if [ "${INPUT_DEBUG:-false}" = "true" ]; then
|
if [ "${INPUT_DEBUG:-false}" = "true" ]; then
|
||||||
set -x
|
set -x
|
||||||
LOG_LEVEL=""
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$(echo "$INPUT_REMOTE_PATH" | awk '{$1=$1};1')" ]; then
|
if [ -z "$(echo "$INPUT_REMOTE_PATH" | awk '{$1=$1};1')" ]; then
|
||||||
@@ -14,13 +11,15 @@ if [ -z "$(echo "$INPUT_REMOTE_PATH" | awk '{$1=$1};1')" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "::error title=EOL::Version 8.0.0 has reached end of life! Use v9! See eol notice https://github.com/Burnett01/rsync-deployments/security/policy"
|
||||||
|
|
||||||
# Initialize SSH and known hosts.
|
# Initialize SSH and known hosts.
|
||||||
source ssh-init
|
source ssh-init
|
||||||
source hosts-init
|
source hosts-init
|
||||||
|
|
||||||
# Start the SSH agent and load key.
|
# Start the SSH agent and load key.
|
||||||
source agent-start "$GITHUB_ACTION"
|
source agent-start "$GITHUB_ACTION"
|
||||||
echo "$INPUT_REMOTE_KEY" | SSH_PASS="$INPUT_REMOTE_KEY_PASS" agent-add
|
printf '%s' "$INPUT_REMOTE_KEY" | SSH_PASS="${INPUT_REMOTE_KEY_PASS}" agent-add >/dev/null 2>&1
|
||||||
|
|
||||||
# Variables.
|
# Variables.
|
||||||
LEGACY_RSA_HOSTKEYS=""
|
LEGACY_RSA_HOSTKEYS=""
|
||||||
@@ -29,11 +28,7 @@ if [ "${INPUT_LEGACY_ALLOW_RSA_HOSTKEYS:-false}" = "true" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
STRICT_HOSTKEYS_CHECKING="-o StrictHostKeyChecking=no"
|
STRICT_HOSTKEYS_CHECKING="-o StrictHostKeyChecking=no"
|
||||||
# If no 'known_hosts' input is provided and 'strict_hostkeys_checking: true',
|
if [ "${INPUT_STRICT_HOSTKEYS_CHECKING:-false}" = "true" ]; then
|
||||||
# then use exisiting keyscan functionality. DEPRECATED: Will be no-op in next major.
|
|
||||||
if [[ -z "${INPUT_KNOWN_HOSTS:-}" && "${INPUT_STRICT_HOSTKEYS_CHECKING:-false}" = "true" ]]; then
|
|
||||||
echo "::warning title=DEPRECATION::Input 'strict_hostkeys_checking' will be a no-op in the next major version! Use 'known_hosts'."
|
|
||||||
|
|
||||||
STRICT_HOSTKEYS_CHECKING="-o UserKnownHostsFile=$HOME/.ssh/known_hosts -o StrictHostKeyChecking=yes"
|
STRICT_HOSTKEYS_CHECKING="-o UserKnownHostsFile=$HOME/.ssh/known_hosts -o StrictHostKeyChecking=yes"
|
||||||
|
|
||||||
key="$(ssh-keyscan -p "$INPUT_REMOTE_PORT" "$INPUT_REMOTE_HOST" 2>/dev/null | sed '/^#/d')" || key=""
|
key="$(ssh-keyscan -p "$INPUT_REMOTE_PORT" "$INPUT_REMOTE_HOST" 2>/dev/null | sed '/^#/d')" || key=""
|
||||||
@@ -43,35 +38,12 @@ if [[ -z "${INPUT_KNOWN_HOSTS:-}" && "${INPUT_STRICT_HOSTKEYS_CHECKING:-false}"
|
|||||||
# add to known hosts
|
# add to known hosts
|
||||||
echo "$key" | while IFS= read -r line; do hosts-add "$line"; done
|
echo "$key" | while IFS= read -r line; do hosts-add "$line"; done
|
||||||
else
|
else
|
||||||
echo "Warning: failed to fetch host key for remote host" >&2
|
echo "Warning: failed to fetch host key for $INPUT_REMOTE_HOST" >&2
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# If 'known_hosts' is provided, strict hostkeys checking is auto enforced:
|
|
||||||
elif [ -n "${INPUT_KNOWN_HOSTS:-}" ]; then
|
|
||||||
STRICT_HOSTKEYS_CHECKING="-o UserKnownHostsFile=$HOME/.ssh/known_hosts -o StrictHostKeyChecking=yes"
|
|
||||||
|
|
||||||
if [ "$INPUT_REMOTE_PORT" = "22" ]; then
|
|
||||||
host_pattern="$INPUT_REMOTE_HOST"
|
|
||||||
else
|
|
||||||
host_pattern="[$INPUT_REMOTE_HOST]:$INPUT_REMOTE_PORT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf '%s\n' "$INPUT_KNOWN_HOSTS" | tr -d '\r' | while IFS= read -r line; do
|
|
||||||
line="$(echo "$line" | awk '{$1=$1};1')"
|
|
||||||
case "$line" in
|
|
||||||
''|'#'*) continue ;;
|
|
||||||
ssh-*|ecdsa-*|sk-*) hosts-add "$host_pattern $line" ;;
|
|
||||||
*) hosts-add "$line" ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
if ! ssh-keygen -lf "$HOME/.ssh/known_hosts" >/dev/null 2>&1; then
|
|
||||||
echo "Error: Input 'known_hosts' contains no valid host key" >&2
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RSH="ssh $LOG_LEVEL $STRICT_HOSTKEYS_CHECKING $LEGACY_RSA_HOSTKEYS -p $INPUT_REMOTE_PORT $INPUT_RSH"
|
RSH="ssh $STRICT_HOSTKEYS_CHECKING $LEGACY_RSA_HOSTKEYS -p $INPUT_REMOTE_PORT $INPUT_RSH"
|
||||||
LOCAL_PATH="$GITHUB_WORKSPACE/$INPUT_PATH"
|
LOCAL_PATH="$GITHUB_WORKSPACE/$INPUT_PATH"
|
||||||
DSN="$INPUT_REMOTE_USER@$INPUT_REMOTE_HOST"
|
DSN="$INPUT_REMOTE_USER@$INPUT_REMOTE_HOST"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user