diff --git a/certidude/api/builder.py b/certidude/api/builder.py index 24ae719..d612b16 100644 --- a/certidude/api/builder.py +++ b/certidude/api/builder.py @@ -55,8 +55,9 @@ class ImageBuilderResource(object): raise falcon.HTTPInternalServerError("Build script finished with non-zero exitcode") for dname in os.listdir(build): - if dname.startswith("lede-imagebuilder-"): - for root, dirs, files in os.walk(os.path.join(build, dname, "bin", "targets")): + if dname.startswith("openwrt-imagebuilder-") and ".tar." not in dname: + subdir = os.path.join(build, dname, "bin", "targets") + for root, dirs, files in os.walk(subdir): for filename in files: if filename.endswith(suffix): path = os.path.join(root, filename) @@ -64,5 +65,6 @@ class ImageBuilderResource(object): resp.body = open(path, "rb").read() resp.set_header("Content-Disposition", ("attachment; filename=%s" % suggested_filename)) return - raise falcon.HTTPNotFound() + raise falcon.HTTPNotFound(description="Couldn't find file ending with '%s' in directory %s" % (suffix, subdir)) + raise falcon.HTTPNotFound(description="Failed to find image builder directory in %s" % build) diff --git a/certidude/builder/common.sh b/certidude/builder/common.sh index 874e193..bbdeaba 100644 --- a/certidude/builder/common.sh +++ b/certidude/builder/common.sh @@ -4,17 +4,18 @@ set -e set -x umask 022 -VERSION=17.01.4 -BASENAME=lede-imagebuilder-$VERSION-ar71xx-generic.Linux-x86_64 +VERSION=18.06.1 +BASENAME=openwrt-imagebuilder-$VERSION-ar71xx-generic.Linux-x86_64 FILENAME=$BASENAME.tar.xz -URL=http://downloads.lede-project.org/releases/$VERSION/targets/ar71xx/generic/$FILENAME +URL=http://downloads.openwrt.org/releases/$VERSION/targets/ar71xx/generic/$FILENAME -# curl of vanilla LEDE doesn't support ECDSA at the moment -BASENAME=lede-imagebuilder-ar71xx-generic.Linux-x86_64 +# curl of vanilla OpenWrt a the moment +# - doesn't support ECDSA +# - is compiled against embedded TLS library which doesn't support OCSP +BASENAME=openwrt-imagebuilder-ar71xx-generic.Linux-x86_64 FILENAME=$BASENAME.tar.xz URL=https://www.koodur.com/$FILENAME - if [ ! -e $BUILD/$FILENAME ]; then wget -q $URL -O $BUILD/$FILENAME fi diff --git a/certidude/templates/server/builder.conf b/certidude/templates/server/builder.conf index 4c94dab..b9b9ae8 100644 --- a/certidude/templates/server/builder.conf +++ b/certidude/templates/server/builder.conf @@ -61,7 +61,7 @@ enabled = no title = Comfast E380AC (Access Point), TFTP-friendly command = {{ builder_path }}/ap.sh model = cf-e380ac-v2 -filename = cf-e380ac-v2-squashfs-factory.bin +filename = cf-e380ac-v2-squashfs-sysupgrade.bin rename = firmware_auto.bin