diff --git a/.gitignore b/.gitignore index 484ef4b..6039e6a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ htmlEmail_templates yarn-error.log src/keys.json dist -securesign_genrsa.ts \ No newline at end of file +securesign_genrsa.ts +.idea +.vscode diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6be4d86 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +# 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 typescript + +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 + +typescript: + tsc -p ./tsconfig.json 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 diff --git a/package.json b/package.json index e710b4a..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 && sh ./build.sh", + "build": "make", "lint-find": "eslint ./ --ext ts" }, "author": "Library of Code sp-us Engineering Team", 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