Skip to content

Commit

Permalink
build: don't add public key by default
Browse files Browse the repository at this point in the history
The key shouldn't be add by default but rather via an external package.
Currently the package `attendedsysupgrade-common` contains the servers
key.

Signed-off-by: Paul Spooren <mail@aparcar.org>
  • Loading branch information
aparcar committed Jun 18, 2021
1 parent 58828d9 commit 9a146cf
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion asu/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ def api_build():
req["store_path"] = current_app.config["STORE_PATH"]
req["cache_path"] = current_app.config["CACHE_PATH"]
req["upstream_url"] = current_app.config["UPSTREAM_URL"]
req["ca_pubkey"] = current_app.config["CA_PUBKEY"]
req["branch_data"] = get_branches()[req["branch"]]

job = get_queue().enqueue(
Expand Down
1 change: 0 additions & 1 deletion asu/asu.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def create_app(test_config: dict = None) -> Flask:

app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
CA_PUBKEY=None,
STORE_PATH=app.instance_path + "/public/store",
JSON_PATH=app.instance_path + "/public/json",
CACHE_PATH=app.instance_path + "/cache/",
Expand Down
13 changes: 3 additions & 10 deletions asu/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,13 @@ def setup_ib():
repos_path.write_text(repos)
log.debug(f"Repos:\n{repos}")

# if a CA pubkey is defined, add it to the created images
# enabling CA requires each worker to find a seckey, pubkey and newcert
if req.get("ca_pubkey"):
fingerprint = fingerprint_pubkey_usign(req["ca_pubkey"])
opkg_key_path = cache / subtarget / "files/etc/opkg/keys"
opkg_key_path.mkdir(parents=True, exist_ok=True)
(opkg_key_path / fingerprint).write_text(
f"untrusted comment: ASU CA pubkey {fingerprint}\n{req['ca_pubkey']}"
)

if (Path.cwd() / "seckey").exists():
# link key-build to imagebuilder
(cache / subtarget / "key-build").symlink_to(Path.cwd() / "seckey")
if (Path.cwd() / "pubkey").exists():
# link key-build.pub to imagebuilder
(cache / subtarget / "key-build.pub").symlink_to(Path.cwd() / "pubkey")
if (Path.cwd() / "newcert").exists():
# link key-build.ucert to imagebuilder
(cache / subtarget / "key-build.ucert").symlink_to(Path.cwd() / "newcert")

Expand Down
3 changes: 0 additions & 3 deletions misc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
TESTING = False
DEBUG = False

CA_PUBKEY = "RWSGJBpwejDLf4OApA5SOavh0GBlBFY9FhqxnivUQHpi0/t0QRI98LPW"

# where to find the ImageBuildes
UPSTREAM_URL = "https://downloads.cdn.openwrt.org"


# where to store created images
STORE_PATH = Path.cwd() / "public/store/"

Expand Down

0 comments on commit 9a146cf

Please sign in to comment.