Skip to content

Commit 07ab80d

Browse files
merge: github.com:onesoft-sudo/sudobot into feature/verification-fp
Signed-off-by: Ar Rakin <[email protected]>
2 parents cfae8e2 + 3247724 commit 07ab80d

File tree

7 files changed

+133
-73
lines changed

7 files changed

+133
-73
lines changed

.github/cra-metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"lastReadCommit": "752b1ebd34266f6e4be7f309c9a4450a40f617f8"
2+
"lastReadCommit": "42feff619909f19482db01fa7b210212a21762fb"
33
}

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,56 @@
11
# Changelog
22

3+
### 05-02-2025 - [[Conventional Release Action](mailto:[email protected])]
4+
5+
* **release:** v10.45.2 [skip ci]
6+
7+
**Signed-off-by:** Conventional Release Action <[email protected]>
8+
9+
* **release:** v10.45.1 [skip ci]
10+
11+
**Signed-off-by:** Conventional Release Action <[email protected]>
12+
13+
14+
### 05-02-2025 - [[Ar Rakin](mailto:[email protected])]
15+
16+
* **fix:** wording in the restart command error messages
17+
18+
**Signed-off-by:** Ar Rakin <[email protected]>
19+
* **fix:** keep base env variables
20+
21+
**Signed-off-by:** Ar Rakin <[email protected]>
22+
* **fix:** restart command with 2fa
23+
24+
**Signed-off-by:** Ar Rakin <[email protected]>
25+
* **chore(extensions):** build extensions [skip ci]
26+
27+
**Signed-off-by:** Ar Rakin <[email protected]>
28+
29+
30+
### 04-02-2025 - [[Conventional Release Action](mailto:[email protected])]
31+
32+
* **release:** v10.45.0 [skip ci]
33+
34+
**Signed-off-by:** Conventional Release Action <[email protected]>
35+
36+
37+
### 04-02-2025 - [[Ar Rakin](mailto:[email protected])]
38+
39+
* **feat(security):** two-factor authentication and secret encryption
40+
41+
**Signed-off-by:** GitHub <[email protected]>
42+
43+
344
### 03-02-2025 - [[Ar Rakin](mailto:[email protected])]
445

46+
* **fix:** type import error
47+
48+
**Signed-off-by:** GitHub <[email protected]>
49+
50+
* **feat(api):** status check
51+
52+
**Signed-off-by:** GitHub <[email protected]>
53+
554
* merge: branch 'main' of github.com:onesoft-sudo/sudobot
655

756
**Signed-off-by:** Ar Rakin <[email protected]>
@@ -25,6 +74,10 @@
2574

2675
### 03-02-2025 - [[Conventional Release Action](mailto:[email protected])]
2776

77+
* **release:** v10.43.0 [skip ci]
78+
79+
**Signed-off-by:** Conventional Release Action <[email protected]>
80+
2881
* **release:** v10.42.0 [skip ci]
2982

3083
**Signed-off-by:** Conventional Release Action <[email protected]>

extensions/.extbuilds/index.json

Lines changed: 65 additions & 65 deletions
Large diffs are not rendered by default.

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@osn/sudobot",
3-
"version": "10.43.0",
3+
"version": "10.45.3",
44
"exports": "./src/main/typescript/exports.ts",
55
"publish": {
66
"exclude": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@osn/sudobot",
3-
"version": "10.43.0",
3+
"version": "10.45.3",
44
"description": "A Discord bot for moderation purposes.",
55
"author": {
66
"name": "Ar Rakin",

src/main/typescript/commands/settings/RestartCommand.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,23 @@ class RestartCommand extends Command {
135135
}
136136

137137
public override async execute(context: Context): Promise<void> {
138+
const mfaKey = context.isChatInput() ? context.options.getString("credential_key") : "";
139+
140+
this.application.logger.debug("Conditions: ", !!getEnvData().TWO_FACTOR_AUTH_URL, !mfaKey);
141+
138142
if (
139143
getEnvData().TWO_FACTOR_AUTH_URL &&
140-
(!context.isChatInput() || context.options.getString("credential_key"))
144+
!mfaKey
141145
) {
142146
await context.error(
143147
"Please enter the credential server 2FA code to restart the bot" +
144-
(context.isLegacy() ? " using the slash command" : "") +
148+
(context.isLegacy() ? ", by using the slash command" : "") +
145149
"!"
146150
);
151+
147152
return;
148153
}
149154

150-
const mfaKey = context.isChatInput() ? context.options.getString("credential_key") : "";
151-
152155
const reply = await context.reply({
153156
embeds: [
154157
{

src/main/typescript/core/DiscordKernel.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,15 @@ class DiscordKernel extends Kernel {
374374
try {
375375
const data = parse(decryptedTextData);
376376

377+
setEnvData({
378+
...process.env,
379+
...data
380+
} as unknown as Record<string, string | undefined>);
381+
377382
for (const key in data) {
378383
process.env[key] = data[key];
379384
}
380385

381-
setEnvData(data);
382386
this.logger.success("Successfully loaded environment data");
383387
} catch (error) {
384388
this.logger.error(

0 commit comments

Comments
 (0)