* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 9d4921e021d8ef14b2bbd9a5c4a89938397dae07
@ 2026-05-14 16:46 Michael Tremer
0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2026-05-14 16:46 UTC (permalink / raw)
To: ipfire-scm
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, next has been updated
via 9d4921e021d8ef14b2bbd9a5c4a89938397dae07 (commit)
via 0e39214dee0945f743fc24158fe7c611af75f549 (commit)
from 7aae8f6849d117f366520839737951815cb5c8cd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9d4921e021d8ef14b2bbd9a5c4a89938397dae07
Author: Michael Tremer <michael.tremer@ipfire.org>
Date: Thu May 14 16:46:11 2026 +0000
core203: Ship AWS setup script
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
commit 0e39214dee0945f743fc24158fe7c611af75f549
Author: Michael Tremer <michael.tremer@ipfire.org>
Date: Thu Apr 30 18:47:35 2026 +0000
aws: Use IMDBv2 for the initial setup
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
-----------------------------------------------------------------------
Summary of changes:
config/rootfiles/core/203/filelists/files | 1 +
src/initscripts/helper/aws-setup | 24 +++++++++++++++++++++++-
2 files changed, 24 insertions(+), 1 deletion(-)
Difference in files:
diff --git a/config/rootfiles/core/203/filelists/files b/config/rootfiles/core/203/filelists/files
index e69de29bb2..41dded32ec 100644
--- a/config/rootfiles/core/203/filelists/files
+++ b/config/rootfiles/core/203/filelists/files
@@ -0,0 +1 @@
+etc/rc.d/helper/aws-setup
diff --git a/src/initscripts/helper/aws-setup b/src/initscripts/helper/aws-setup
index 7b3371ac3a..6ad2a64796 100644
--- a/src/initscripts/helper/aws-setup
+++ b/src/initscripts/helper/aws-setup
@@ -28,10 +28,32 @@ export PATH=/usr/local/sbin:/usr/local/bin:${PATH}
# AWS supports an MTU of up to 9001 bytes
DEFAULT_MTU=9001
+# IMDSv2 token
+IMDS_TOKEN=""
+
get() {
local file="${1}"
+ local args=(
+ "--silent"
+ )
+
+ # Fetch the token if we don't have one, yet
+ if [ -z "${IMDS_TOKEN}" ]; then
+ IMDS_TOKEN="$(curl \
+ --silent \
+ --request "PUT" \
+ --header "X-aws-ec2-metadata-token-ttl-seconds: 3600" \
+ "http://169.254.169.254/latest/api/token")"
+ fi
+
+ # Pass the token if we have been able to obtain it
+ if [ -n "${IMDS_TOKEN}" ]; then
+ args+=(
+ "--header" "X-aws-ec2-metadata-token: ${IMDS_TOKEN}"
+ )
+ fi
- wget -qO - "http://169.254.169.254/latest/${file}"
+ curl "${args[@]}" "http://169.254.169.254/latest/${file}"
}
to_address() {
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-14 16:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-14 16:46 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 9d4921e021d8ef14b2bbd9a5c4a89938397dae07 Michael Tremer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox