Skip to content

Commit 282b0bb

Browse files
authored
Merge branch 'master' into trustca
2 parents a5b6122 + 86cd37a commit 282b0bb

15 files changed

Lines changed: 446 additions & 214 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Read, and fill the Pull Request template
77
* If this is a fix for a typo (in code, documentation, or the README) please file an issue and let us sort it out. We do not need a PR
88
* If the PR is addressing an existing issue include, closes #\<issue number>, in the body of the PR commit message
9-
* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://discord.gg/YWrKVTn)
9+
* If you want to discuss changes, you can also bring it up in [#dev-talk](https://discordapp.com/channels/354974912613449730/757585807061155840) in our [Discord server](https://linuxserver.io/discord)
1010

1111
## Common files
1212

@@ -105,10 +105,10 @@ docker build \
105105
-t linuxserver/openssh-server:latest .
106106
```
107107

108-
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
108+
The ARM variants can be built on x86_64 hardware and vice versa using `lscr.io/linuxserver/qemu-static`
109109

110110
```bash
111-
docker run --rm --privileged multiarch/qemu-user-static:register --reset
111+
docker run --rm --privileged lscr.io/linuxserver/qemu-static --reset
112112
```
113113

114114
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Discord chat support
4-
url: https://discord.gg/YWrKVTn
4+
url: https://linuxserver.io/discord
55
about: Realtime support / chat with the community and the team.
66

77
- name: Discourse discussion forum

.github/workflows/external_trigger.yml

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,25 @@ jobs:
1515
SKIP_EXTERNAL_TRIGGER: ${{ vars.SKIP_EXTERNAL_TRIGGER }}
1616
run: |
1717
printf "# External trigger for docker-openssh-server\n\n" >> $GITHUB_STEP_SUMMARY
18-
if grep -q "^openssh-server_master" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
18+
if grep -q "^openssh-server_master_" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
19+
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
20+
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`openssh-server_master_\`; will skip trigger if version matches." >> $GITHUB_STEP_SUMMARY
21+
elif grep -q "^openssh-server_master" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
1922
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
2023
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` contains \`openssh-server_master\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
2124
exit 0
2225
fi
2326
echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY
2427
echo "> External trigger running off of master branch. To disable this trigger, add \`openssh-server_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY
2528
printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY
26-
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
29+
EXT_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.21/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
2730
&& awk '/^P:'"openssh-server-pam"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://')
2831
echo "Type is \`alpine_repo\`" >> $GITHUB_STEP_SUMMARY
32+
if grep -q "^openssh-server_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then
33+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
34+
echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY
35+
exit 0
36+
fi
2937
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
3038
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3139
echo "> Can't retrieve external version, exiting" >> $GITHUB_STEP_SUMMARY
@@ -44,16 +52,35 @@ jobs:
4452
token=$(curl -sX GET \
4553
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fopenssh-server%3Apull" \
4654
| jq -r '.token')
47-
multidigest=$(curl -s \
48-
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
49-
--header "Authorization: Bearer ${token}" \
50-
"https://ghcr.io/v2/${image}/manifests/${tag}" \
51-
| jq -r 'first(.manifests[].digest)')
52-
digest=$(curl -s \
55+
multidigest=$(curl -s \
56+
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
57+
--header "Accept: application/vnd.oci.image.index.v1+json" \
58+
--header "Authorization: Bearer ${token}" \
59+
"https://ghcr.io/v2/${image}/manifests/${tag}")
60+
if jq -e '.layers // empty' <<< "${multidigest}" >/dev/null 2>&1; then
61+
# If there's a layer element it's a single-arch manifest so just get that digest
62+
digest=$(jq -r '.config.digest' <<< "${multidigest}")
63+
else
64+
# Otherwise it's multi-arch or has manifest annotations
65+
if jq -e '.manifests[]?.annotations // empty' <<< "${multidigest}" >/dev/null 2>&1; then
66+
# Check for manifest annotations and delete if found
67+
multidigest=$(jq 'del(.manifests[] | select(.annotations))' <<< "${multidigest}")
68+
fi
69+
if [[ $(jq '.manifests | length' <<< "${multidigest}") -gt 1 ]]; then
70+
# If there's still more than one digest, it's multi-arch
71+
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
72+
else
73+
# Otherwise it's single arch
74+
multidigest=$(jq -r ".manifests[].digest?" <<< "${multidigest}")
75+
fi
76+
if digest=$(curl -s \
5377
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
78+
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
5479
--header "Authorization: Bearer ${token}" \
55-
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
56-
| jq -r '.config.digest')
80+
"https://ghcr.io/v2/${image}/manifests/${multidigest}"); then
81+
digest=$(jq -r '.config.digest' <<< "${digest}");
82+
fi
83+
fi
5784
image_info=$(curl -sL \
5885
--header "Authorization: Bearer ${token}" \
5986
"https://ghcr.io/v2/${image}/blobs/${digest}")
@@ -77,7 +104,7 @@ jobs:
77104
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
78105
echo "Version \`${EXT_RELEASE}\` already pushed, exiting" >> $GITHUB_STEP_SUMMARY
79106
exit 0
80-
elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"openssh-server-pam"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
107+
elif [[ $(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.21/main/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && awk '/^P:'"openssh-server-pam"'$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://') != "${EXT_RELEASE}" ]]; then
81108
echo "New version \`${EXT_RELEASE}\` found; but not all arch repos updated yet; exiting" >> $GITHUB_STEP_SUMMARY
82109
FAILURE_REASON="New version ${EXT_RELEASE} for openssh-server tag latest is detected, however not all arch repos are updated yet. Will try again later."
83110
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
@@ -98,7 +125,7 @@ jobs:
98125
else
99126
printf "\n## Trigger new build\n\n" >> $GITHUB_STEP_SUMMARY
100127
echo "New version \`${EXT_RELEASE}\` found; old version was \`${IMAGE_VERSION}\`. Triggering new build" >> $GITHUB_STEP_SUMMARY
101-
if "${artifacts_found}" == "true" ]]; then
128+
if [[ "${artifacts_found}" == "true" ]]; then
102129
echo "All artifacts seem to be uploaded." >> $GITHUB_STEP_SUMMARY
103130
fi
104131
response=$(curl -iX POST \

.github/workflows/package_trigger_scheduler.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,26 @@ jobs:
2727
fi
2828
printf "\n## Evaluating \`%s\`\n\n" ${br} >> $GITHUB_STEP_SUMMARY
2929
JENKINS_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-openssh-server/${br}/jenkins-vars.yml)
30-
if [[ "${br}" == $(yq -r '.ls_branch' <<< "${JENKINS_VARS}") ]]; then
30+
if ! curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-openssh-server/${br}/Jenkinsfile >/dev/null 2>&1; then
31+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
32+
echo "> No Jenkinsfile found. Branch is either deprecated or is an early dev branch." >> $GITHUB_STEP_SUMMARY
33+
skipped_branches="${skipped_branches}${br} "
34+
elif [[ "${br}" == $(yq -r '.ls_branch' <<< "${JENKINS_VARS}") ]]; then
3135
echo "Branch appears to be live; checking workflow." >> $GITHUB_STEP_SUMMARY
32-
if [[ $(yq -r '.skip_package_check' <<< "${JENKINS_VARS}") == "true" ]]; then
36+
README_VARS=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-openssh-server/${br}/readme-vars.yml)
37+
if [[ $(yq -r '.project_deprecation_status' <<< "${README_VARS}") == "true" ]]; then
38+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
39+
echo "> Branch appears to be deprecated; skipping trigger." >> $GITHUB_STEP_SUMMARY
40+
skipped_branches="${skipped_branches}${br} "
41+
elif [[ $(yq -r '.skip_package_check' <<< "${JENKINS_VARS}") == "true" ]]; then
3342
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3443
echo "> Skipping branch ${br} due to \`skip_package_check\` being set in \`jenkins-vars.yml\`." >> $GITHUB_STEP_SUMMARY
3544
skipped_branches="${skipped_branches}${br} "
3645
elif grep -q "^openssh-server_${br}" <<< "${SKIP_PACKAGE_TRIGGER}"; then
3746
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
3847
echo "> Github organizational variable \`SKIP_PACKAGE_TRIGGER\` contains \`openssh-server_${br}\`; skipping trigger." >> $GITHUB_STEP_SUMMARY
3948
skipped_branches="${skipped_branches}${br} "
40-
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openssh-server/job/${br}/lastBuild/api/json | jq -r '.building') == "true" ]; then
49+
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openssh-server/job/${br}/lastBuild/api/json | jq -r '.building' 2>/dev/null) == "true" ]; then
4150
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
4251
echo "> There already seems to be an active build on Jenkins; skipping package trigger for ${br}" >> $GITHUB_STEP_SUMMARY
4352
skipped_branches="${skipped_branches}${br} "
@@ -49,18 +58,26 @@ jobs:
4958
response=$(curl -iX POST \
5059
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-openssh-server/job/${br}/buildWithParameters?PACKAGE_CHECK=true \
5160
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
61+
if [[ -z "${response}" ]]; then
62+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
63+
echo "> Jenkins build could not be triggered. Skipping branch."
64+
continue
65+
fi
5266
echo "Jenkins [job queue url](${response%$'\r'})" >> $GITHUB_STEP_SUMMARY
5367
echo "Sleeping 10 seconds until job starts" >> $GITHUB_STEP_SUMMARY
5468
sleep 10
5569
buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url')
5670
buildurl="${buildurl%$'\r'}"
5771
echo "Jenkins job [build url](${buildurl})" >> $GITHUB_STEP_SUMMARY
5872
echo "Attempting to change the Jenkins job description" >> $GITHUB_STEP_SUMMARY
59-
curl -iX POST \
73+
if ! curl -ifX POST \
6074
"${buildurl}submitDescription" \
6175
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \
6276
--data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
63-
--data-urlencode "Submit=Submit"
77+
--data-urlencode "Submit=Submit"; then
78+
echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY
79+
echo "> Unable to change the Jenkins job description."
80+
fi
6481
sleep 20
6582
fi
6683
else
@@ -70,13 +87,14 @@ jobs:
7087
if [[ -n "${triggered_branches}" ]] || [[ -n "${skipped_branches}" ]]; then
7188
if [[ -n "${triggered_branches}" ]]; then
7289
NOTIFY_BRANCHES="**Triggered:** ${triggered_branches} \n"
90+
NOTIFY_BUILD_URL="**Build URL:** https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-openssh-server/activity/ \n"
91+
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
7392
fi
7493
if [[ -n "${skipped_branches}" ]]; then
7594
NOTIFY_BRANCHES="${NOTIFY_BRANCHES}**Skipped:** ${skipped_branches} \n"
7695
fi
77-
echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****"
7896
echo "**** Notifying Discord ****"
7997
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
80-
"description": "**Package Check Build(s) Triggered for openssh-server** \n'"${NOTIFY_BRANCHES}"'**Build URL:** '"https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-openssh-server/activity/"' \n"}],
98+
"description": "**Package Check Build(s) for openssh-server** \n'"${NOTIFY_BRANCHES}"''"${NOTIFY_BUILD_URL}"'"}],
8199
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
82100
fi

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
3+
FROM ghcr.io/linuxserver/baseimage-alpine:3.21
44

55
# set version label
66
ARG BUILD_DATE
@@ -18,7 +18,7 @@ RUN \
1818
sudo && \
1919
echo "**** install openssh-server ****" && \
2020
if [ -z ${OPENSSH_RELEASE+x} ]; then \
21-
OPENSSH_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp && \
21+
OPENSSH_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.21/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp && \
2222
awk '/^P:openssh-server-pam$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
2323
fi && \
2424
apk add --no-cache \

Dockerfile.aarch64

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.20
3+
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.21
44

55
# set version label
66
ARG BUILD_DATE
@@ -18,7 +18,7 @@ RUN \
1818
sudo && \
1919
echo "**** install openssh-server ****" && \
2020
if [ -z ${OPENSSH_RELEASE+x} ]; then \
21-
OPENSSH_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.20/main/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && \
21+
OPENSSH_RELEASE=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.21/main/aarch64/APKINDEX.tar.gz" | tar -xz -C /tmp && \
2222
awk '/^P:openssh-server-pam$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
2323
fi && \
2424
apk add --no-cache \

0 commit comments

Comments
 (0)