Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update extism-runtime.wasm #15

Merged
merged 5 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: simplify update kernel regex by putting everything on one line
  • Loading branch information
zshipko committed Oct 13, 2023
commit c37cbd7b56dcb2e9b5991b09f3ac62c0171c2844
5 changes: 2 additions & 3 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,9 @@ export type HttpRequest = {
method: string;
};

export const embeddedRuntime =
'AGFzbQEAAAABMApgAX8AYAN/f38Bf2ACf38AYAF+AX5gAX4AYAF+AX9gAn5/AGACfn4AYAABfmAAAAMaGQABAQACAgMEAwUDBQMGBwcHCAgICAkECAgEBQFwAQMDBQMBABEGGQN/AUGAgMAAC38AQfiAwAALfwBBgIHAAAsHlQMWBm1lbW9yeQIADGV4dGlzbV9hbGxvYwAGC2V4dGlzbV9mcmVlAAcNZXh0aXNtX2xlbmd0aAAIDmV4dGlzbV9sb2FkX3U4AAkPZXh0aXNtX2xvYWRfdTY0AAoUZXh0aXNtX2lucHV0X2xvYWRfdTgACxVleHRpc21faW5wdXRfbG9hZF91NjQADA9leHRpc21fc3RvcmVfdTgADRBleHRpc21fc3RvcmVfdTY0AA4QZXh0aXNtX2lucHV0X3NldAAPEWV4dGlzbV9vdXRwdXRfc2V0ABATZXh0aXNtX2lucHV0X2xlbmd0aAARE2V4dGlzbV9pbnB1dF9vZmZzZXQAEhRleHRpc21fb3V0cHV0X2xlbmd0aAATFGV4dGlzbV9vdXRwdXRfb2Zmc2V0ABQMZXh0aXNtX3Jlc2V0ABUQZXh0aXNtX2Vycm9yX3NldAAWE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AAACAAAAT3V0IG9mIG1lbW9yeQAAABAAEAANAAAAc3JjL2xpYi5ycwAAKAAQAAoAAACbAAAADQAAAA==';

export const embeddedRuntimeHash = '1a8172a36acc75aa49c35663c1bb5d89c6ae681863540c7d0afc9e0b93727c59'
export const embeddedRuntimeHash = 'aab40a25b5edda3fc5c9d1de1bf17af9ce5d02cbac1bacf5bdfa495b4ab9fc39'

class Allocator {
#extism: WebAssembly.Instance;
Expand Down
28 changes: 18 additions & 10 deletions update-kernel.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
const fs = require("fs")
const crypto = require("crypto")
const fs = require("fs");
const crypto = require("crypto");

async function main() {
const pluginPath = 'src/plugin.ts'
let pluginContents = await fs.promises.readFile(pluginPath, 'utf8');
const pluginPath = "src/plugin.ts";
let pluginContents = await fs.promises.readFile(pluginPath, "utf8");

const kernelPath = 'wasm/extism-runtime.wasm'
const wasmContents = await fs.promises.readFile(kernelPath);
const kernelBase64 = wasmContents.toString('base64');
const kernelHash = await crypto.createHash('sha256').update(wasmContents).digest('hex');
const kernelPath = "wasm/extism-runtime.wasm";
const kernelContents = await fs.promises.readFile(kernelPath);
const kernelBase64 = kernelContents.toString("base64");
const kernelHash = await crypto.createHash("sha256").update(kernelContents)
.digest("hex");
console.log(kernelHash);

pluginContents = pluginContents.replace(/embeddedRuntime =\s*'.*'/, `embeddedRuntime =\n\t'${kernelBase64}'`);
pluginContents = pluginContents.replace(/embeddedRuntimeHash =\s*'.*''/, `embeddedRuntimeHash = '${kernelHash}'`);
pluginContents = pluginContents.replace(
/embeddedRuntime = '.*'/,
`embeddedRuntime = '${kernelBase64}'`,
);
pluginContents = pluginContents.replace(
/embeddedRuntimeHash = '.*'/,
`embeddedRuntimeHash = '${kernelHash}'`,
);

await fs.promises.writeFile(pluginPath, pluginContents);
}
Expand Down