d4rkbot: API v1 mit Key-System, Env-Diät, Rebranding
- API-Keys (SHA-256-Hash, Scopes, last_used) — Verwaltung auf der Setup-Seite, Klartext-Key wird genau einmal angezeigt - /api/v1: message, dm, roles (add/remove), member/:id, stats — Bearer-Auth mit Scope-Prüfung, Embed-Sanitizing, README-Doku mit Python-Beispiel - Env-Diät: PUBLIC_URL + GITEA_URL jetzt Settings (Env nur Fallback), OAuth-Redirect dynamisch; Env enthält nur noch Secrets/Bootstrap - Rebranding ecobot → d4rkbot (Packages, Container, Cookies, README); Volume-Name bleibt ecobot_data (Datenerhalt), Portainer-Stack-Name bleibt Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// Release-Ankündigungen: großes Embed in den konfigurierten Kanal (Setup-Seite)
|
||||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } from 'discord.js';
|
||||
import { releaseChannelId } from '../runtime-settings.js';
|
||||
import { releaseChannelId, publicUrl } from '../runtime-settings.js';
|
||||
import { config } from '../config.js';
|
||||
|
||||
const BRAND_ORANGE = 0xff4d00;
|
||||
@@ -36,7 +36,7 @@ export async function postReleaseEmbed(client, release) {
|
||||
|
||||
const buttons = new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder().setStyle(ButtonStyle.Link).setLabel('Changelog').setEmoji('📋')
|
||||
.setURL(`${config.publicUrl}/changelog`)
|
||||
.setURL(`${publicUrl()}/changelog`)
|
||||
);
|
||||
if (release.url) {
|
||||
buttons.addComponents(
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ export async function watchdogTick(client, { failsBeforeAlert = FAILS_BEFORE_ALE
|
||||
method: 'GET',
|
||||
redirect: 'follow',
|
||||
signal: AbortSignal.timeout(TIMEOUT_MS),
|
||||
headers: { 'User-Agent': 'ecobot-watchdog/1.0' },
|
||||
headers: { 'User-Agent': 'd4rkbot-watchdog/1.0' },
|
||||
});
|
||||
ok = res.status < 500;
|
||||
detail = `HTTP ${res.status}`;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// eine Zusammenfassung der Woche in den Devlog-Kanal.
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import { weeklyStats, getSetting, setSetting } from '../db.js';
|
||||
import { devlogChannelId } from '../runtime-settings.js';
|
||||
import { devlogChannelId, publicUrl } from '../runtime-settings.js';
|
||||
import { config } from '../config.js';
|
||||
|
||||
const BRAND_YELLOW = 0xf5c518;
|
||||
@@ -48,7 +48,7 @@ export async function postWeeklyRecap(client) {
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(BRAND_YELLOW)
|
||||
.setTitle('📊 Wochen-Rückblick')
|
||||
.setURL(`${config.publicUrl}/devlogs`)
|
||||
.setURL(`${publicUrl()}/devlogs`)
|
||||
.setDescription(
|
||||
`\`\`\`\n${buildBars(stats.perDay)}\n\`\`\``
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user