Skip to content

Commit

Permalink
Remove enviroment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
barcia committed Oct 12, 2023
1 parent d82daea commit 63e3d5b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
2 changes: 0 additions & 2 deletions .env.defaults

This file was deleted.

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.env
.DS_Store
.DS_Store
build/
deno.lock
5 changes: 5 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"tasks": {
"compile": "deno compile --allow-read --allow-write --allow-env --output './build/horcrux' index.js "
}
}
1 change: 0 additions & 1 deletion deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ export { parse } from "https://deno.land/std@0.202.0/flags/mod.ts";
export * as path from "https://deno.land/std@0.203.0/path/mod.ts";
export { encodeBase64, decodeBase64 } from "https://deno.land/std@0.203.0/encoding/base64.ts";
export { crypto } from "https://deno.land/std@0.203.0/crypto/mod.ts";
export { load } from "https://deno.land/std@0.203.0/dotenv/mod.ts";
export * as nanoid from "https://deno.land/x/nanoid/mod.ts"
export * as secrets from "npm:secrets.js-grempe@2.0.0";
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { parse, load } from "./deps.js";
import { parse } from "./deps.js";
import { create, restore, version } from "./src/commands/_index.js";
import config from "./config.js";
import * as help from "./src/utils/help.js";

await load({export: true})

const args = parse(Deno.args, {
boolean: ["help"],
string: ["output", "input"],
Expand Down
7 changes: 2 additions & 5 deletions src/utils/crypto.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { crypto } from "../../deps.js";
import { load } from "../../deps.js";
import * as mod from "https://deno.land/std@0.203.0/encoding/hex.ts";

await load({export: true})

const privateKeyHex = Deno.env.get("PRIVATE_KEY");
const privateKeyHex = "ea28519adc8a4735af3fb1f23204cc6f";
const privateKey = mod.decodeHex(privateKeyHex);

const ivHex = Deno.env.get("IV");
const ivHex = "762b4d64bac09b672015dfef0ae424a9";
const iv = mod.decodeHex(ivHex);

const key = await crypto.subtle.importKey(
Expand Down

0 comments on commit 63e3d5b

Please sign in to comment.