From cab6be3f401c4ab7927244b195c2b2c64dca138a Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 18 Jan 2020 00:11:32 -0500 Subject: [PATCH 1/7] add makefile --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f620957 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +check_certificate_files := $(wildcard src/go/checkCertificate/*.go) +check_certificate_signatures_files := $(wildcard src/go/checkCertSignatures/*.go) +storage_files := $(wildcard src/go/storage/*.go) + +all: check_certificate check_cert_signatures storage + +check_certificate: + HOME=/root go build -v -ldflags="-s -w" -o dist/bin/checkCertificate ${check_certificate_files} + @chmod 740 dist/bin/checkCertificate + file dist/bin/checkCertificate + +check_cert_signatures: + HOME=/root go build -v -ldflags="-s -w" -o dist/bin/checkCertSignatures ${check_certificate_signatures_files} + @chmod 740 dist/bin/checkCertSignatures + file dist/bin/checkCertSignatures + +storage: + HOME=/root go build -v -ldflags="-s -w" -o dist/bin/storage ${storage_files} + @chmod 740 dist/bin/storage + file dist/bin/storage From 30714fb625af46fa2cd7ceb270b2763f46bf2482 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 18 Jan 2020 00:11:44 -0500 Subject: [PATCH 2/7] deprecate build.sh --- build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 2972b52..b6536fc 100644 --- a/build.sh +++ b/build.sh @@ -1,7 +1,8 @@ # This file builds the Go binaries. Hardcoded by LOC Engineering -go build -o dist/bin/storage src/go/storage/storage.go src/go/storage/dirsize.go +# DEPRECATED, USE MAKEFILE INSTEAD +go build -ldflags="-s -w" -o dist/bin/storage src/go/storage/storage.go src/go/storage/dirsize.go file dist/bin/storage -go build -o dist/bin/checkCertificate src/go/checkCertificate/checkCertificate.go +go build -ldflags="-s -w" -o dist/bin/checkCertificate src/go/checkCertificate/checkCertificate.go file dist/bin/checkCertificate -go build -o dist/bin/checkCertSignatures src/go/checkCertSignatures/checkCertSignatures.go +go build -ldflags="-s -w" -o dist/bin/checkCertSignatures src/go/checkCertSignatures/checkCertSignatures.go file dist/bin/checkCertSignatures From 751490a8b9d1c8cc0d42bac730a0ab12ec118dbb Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 18 Jan 2020 00:12:50 -0500 Subject: [PATCH 3/7] change email address in cmds that send notification mail --- src/commands/createaccount.ts | 2 +- src/commands/cwg_create.ts | 2 +- src/commands/deleteaccount.ts | 2 +- src/commands/lock.ts | 2 +- src/commands/notify.ts | 2 +- src/commands/warn.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/commands/createaccount.ts b/src/commands/createaccount.ts index 6ca42a7..93f85e6 100644 --- a/src/commands/createaccount.ts +++ b/src/commands/createaccount.ts @@ -48,7 +48,7 @@ export default class CreateAccount extends Command { this.client.util.transport.sendMail({ to: args[1], - from: 'Library of Code sp-us | Cloud Services ', + from: 'Library of Code sp-us | Cloud Services ', subject: 'Your account has been created', html: ` diff --git a/src/commands/cwg_create.ts b/src/commands/cwg_create.ts index ef145c1..7ac1ee0 100644 --- a/src/commands/cwg_create.ts +++ b/src/commands/cwg_create.ts @@ -68,7 +68,7 @@ export default class CWG_Create extends Command { this.client.getDMChannel(account.userID).then((r) => r.createMessage({ embed })); await this.client.util.transport.sendMail({ to: account.emailAddress, - from: 'Library of Code sp-us | Support Team ', + from: 'Library of Code sp-us | Support Team ', subject: 'Your domain has been binded', html: `

Library of Code sp-us | Cloud Services

diff --git a/src/commands/deleteaccount.ts b/src/commands/deleteaccount.ts index 5abe7d2..694fb79 100644 --- a/src/commands/deleteaccount.ts +++ b/src/commands/deleteaccount.ts @@ -44,7 +44,7 @@ export default class DeleteAccount extends Command { this.client.util.transport.sendMail({ to: account.emailAddress, - from: 'Library of Code sp-us | Cloud Services ', + from: 'Library of Code sp-us | Cloud Services ', subject: 'Your account has been deleted', html: `

Library of Code | Cloud Services

diff --git a/src/commands/lock.ts b/src/commands/lock.ts index 239cc4b..b85ec33 100644 --- a/src/commands/lock.ts +++ b/src/commands/lock.ts @@ -35,7 +35,7 @@ export default class Lock extends Command { this.client.util.transport.sendMail({ to: account.emailAddress, - from: 'Library of Code sp-us | Cloud Services ', + from: 'Library of Code sp-us | Cloud Services ', subject: 'Your account has been locked', html: `

Library of Code | Cloud Services

diff --git a/src/commands/notify.ts b/src/commands/notify.ts index e326a0f..ff3ff1e 100644 --- a/src/commands/notify.ts +++ b/src/commands/notify.ts @@ -34,7 +34,7 @@ export default class Notify extends Command { this.client.createMessage('580950455581147146', { embed }); this.client.util.transport.sendMail({ to: account.emailAddress, - from: 'Library of Code sp-us | Cloud Services ', + from: 'Library of Code sp-us | Cloud Services ', subject: 'Notification', html: `

Library of Code sp-us | Cloud Services

diff --git a/src/commands/warn.ts b/src/commands/warn.ts index bd5ce22..49d66af 100644 --- a/src/commands/warn.ts +++ b/src/commands/warn.ts @@ -25,7 +25,7 @@ export default class Warn extends Command { edit.edit(`***${this.client.stores.emojis.success} Account ${account.username} has been warned by Moderator ${message.author.username}#${message.author.discriminator}.***`); this.client.util.transport.sendMail({ to: account.emailAddress, - from: 'Library of Code sp-us | Cloud Services ', + from: 'Library of Code sp-us | Cloud Services ', subject: 'Your account has been warned', html: `

Library of Code sp-us | Cloud Services

From 711e924109a33e253819ce80b8d44868d77a6ff1 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 18 Jan 2020 00:13:46 -0500 Subject: [PATCH 4/7] run make command instead of build.sh --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e710b4a..1785d79 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/Client.js", "scripts": { "lint": "eslint ./ --ext ts --fix", - "build": "tsc -p ./tsconfig.json && sh ./build.sh", + "build": "tsc -p ./tsconfig.json && make", "lint-find": "eslint ./ --ext ts" }, "author": "Library of Code sp-us Engineering Team", From c15f2c62d58e2ddcf835ee15b75a54af600dbc3c Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 18 Jan 2020 00:15:42 -0500 Subject: [PATCH 5/7] ignore .idea --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 484ef4b..2873450 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ htmlEmail_templates yarn-error.log src/keys.json dist -securesign_genrsa.ts \ No newline at end of file +securesign_genrsa.ts +.idea From 9544e231eebda58dbc5de9783c84dce9946a4ec4 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 18 Jan 2020 00:17:19 -0500 Subject: [PATCH 6/7] ignore .vscode --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2873450..6039e6a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ src/keys.json dist securesign_genrsa.ts .idea +.vscode From 36f7660afdfa3db8f79db8cc530ed6079dc11f69 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sat, 18 Jan 2020 02:05:22 -0500 Subject: [PATCH 7/7] Add TS building in makefile; yarn run build now just runs HOME=/root go build -v -ldflags="-s -w" -o dist/bin/checkCertificate src/go/checkCertificate/checkCertificate.go --- Makefile | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f620957..6be4d86 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,10 @@ +# Builds TypeScript & Go + check_certificate_files := $(wildcard src/go/checkCertificate/*.go) check_certificate_signatures_files := $(wildcard src/go/checkCertSignatures/*.go) storage_files := $(wildcard src/go/storage/*.go) -all: check_certificate check_cert_signatures storage +all: check_certificate check_cert_signatures storage typescript check_certificate: HOME=/root go build -v -ldflags="-s -w" -o dist/bin/checkCertificate ${check_certificate_files} @@ -18,3 +20,6 @@ storage: HOME=/root go build -v -ldflags="-s -w" -o dist/bin/storage ${storage_files} @chmod 740 dist/bin/storage file dist/bin/storage + +typescript: + tsc -p ./tsconfig.json diff --git a/package.json b/package.json index 1785d79..8a7d054 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/Client.js", "scripts": { "lint": "eslint ./ --ext ts --fix", - "build": "tsc -p ./tsconfig.json && make", + "build": "make", "lint-find": "eslint ./ --ext ts" }, "author": "Library of Code sp-us Engineering Team",