public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <git@ipfire.org>
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 9d4921e021d8ef14b2bbd9a5c4a89938397dae07
Date: Thu, 14 May 2026 16:46:23 +0000 (UTC)	[thread overview]
Message-ID: <4gGbnW5b5Xz2xTv@people01.haj.ipfire.org> (raw)

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


                 reply	other threads:[~2026-05-14 16:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4gGbnW5b5Xz2xTv@people01.haj.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox