Skip to content

Commit

Permalink
Cracktunes v0.3.11 (#296)
Browse files Browse the repository at this point in the history
-  Test Coverage > 23%.
- Codebase architecture documentation.
- Support discordbotlist.com (voting service).
- Remove prefix commands for verification (Bot is fully verified!)
- mute all admin command
- Fix numerous performance issues and youtube playing issues
  • Loading branch information
cycle-five authored Aug 25, 2024
1 parent 9220645 commit a48d0b4
Show file tree
Hide file tree
Showing 112 changed files with 2,698 additions and 3,804 deletions.
13 changes: 12 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
#
# [REQUIRED] To authenticate with Discord, you must create a Discord app.
# See more: https://discord.com/developers/applications
export DISCORD_TOKEN=XXXXXX
export DISCORD_APP_ID=XXXXXX

#
# [REQUIRED] Postgres database URL for the bot to use.
#
export DATABASE_URL=postgresql://postgres:mysecretpassword@localhost:5432/postgres
export PG_USER=postgres
export PG_PASSWORD=mysecretpassword

#
# [Optional] To support Spotify links, you must create a Spotify app.
# See more: https://developer.spotify.com/dashboard/applications
export SPOTIFY_CLIENT_ID=XXXXXX
export SPOTIFY_CLIENT_SECRET=XXXXXX

#
# [Optional] OpenAI API key for the chatgpt feature.
#
export OPENAI_API_KEY=XXXXXX
Expand All @@ -27,4 +31,11 @@ export PGADMIN_PW=XXXXXX
#
# [Optional] VirusTotal API key for the url scanning.
#
export VIRUSTOTAL_API_KEY=XXXXXX
export VIRUSTOTAL_API_KEY=XXXXXX

#
# [Optional] top.gg and discordbotlist.com integration.
#
export TOPGG_TOKEN=XXXXXX
export DBL_TOKEN=XXXXXX
export WEBHOOK_SECRET=XXXXXX
41 changes: 41 additions & 0 deletions .env.example.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# [REQUIRED] To authenticate with Discord, you must create a Discord app.
# See more: https://discord.com/developers/applications
set -x DISCORD_TOKEN XXXXXX
set -x DISCORD_APP_ID XXXXXX

#
# [REQUIRED] Postgres database URL for the bot to use.
#
set -x DATABASE_URL postgresql://postgres:mysecretpassword@localhost:5432/postgres
set -x PG_USER postgres
set -x PG_PASSWORD mysecretpassword

#
# [Optional] To support Spotify links, you must create a Spotify app.
# See more: https://developer.spotify.com/dashboard/applications
set -x SPOTIFY_CLIENT_ID XXXXXX
set -x SPOTIFY_CLIENT_SECRET XXXXXX

#
# [Optional] OpenAI API key for the chatgpt feature.
#
set -x OPENAI_API_KEY XXXXXX

#
# [Optional] pgadmin support
#
set -x PGADMIN_MAIL XXXXXX
set -x PGADMIN_PW XXXXXX

#
# [Optional] VirusTotal API key for the url scanning.
#
set -x VIRUSTOTAL_API_KEY XXXXXX

#
# [Optional] top.gg and discordbotlist.com integration.
#
set -x TOPGG_TOKEN XXXXXX
set -x DBL_TOKEN XXXXXX
set -x WEBHOOK_SECRET XXXXXX
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.zip filter=lfs diff=lfs merge=lfs -text
data/** filter=lfs diff=lfs merge=lfs -text
8 changes: 5 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: "Install yt-dlp"
run: |
curl -sSL --output /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/download/2024.04.09/yt-dlp_linux
curl -sSL --output /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/download/latest/yt-dlp_linux
chmod +x /usr/local/bin/yt-dlp
shell: bash

Expand Down Expand Up @@ -56,6 +56,7 @@ jobs:
PG_USER: postgres
PG_PASSWORD: mysecretpassword
VIRUSTOTAL_API_KEY: ${{secrets.VIRUSTOTAL_API_KEY}}
WEBHOOK_SECRET: ${{secrets.WEBHOOK_SECRET}}
run: |
sqlx database create
sqlx migrate run --source migrations/
Expand All @@ -67,11 +68,12 @@ jobs:
PG_USER: postgres
PG_PASSWORD: mysecretpassword
VIRUSTOTAL_API_KEY: ${{secrets.VIRUSTOTAL_API_KEY}}
WEBHOOK_SECRET: ${{secrets.WEBHOOK_SECRET}}
run: |
cargo tarpaulin --verbose --all --timeout 120 --out xml
cargo tarpaulin --ignore-tests --verbose --all --timeout 120 --out xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}} # not required for public repos
fail_ci_if_error: true
fail_ci_if_error: false
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
PG_USER: postgres
PG_PASSWORD: mysecretpassword
VIRUSTOTAL_API_KEY: ${{secrets.VIRUSTOTAL_API_KEY}}
run: cargo +nightly fmt --all -- --check
run: cargo fmt --all -- --check

- name: Run clippy
env:
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
# title/body based on your changelogs.

name: Release

permissions:
contents: write
"contents": "write"

# This task will run whenever you push a git tag that looks like a version
# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
Expand Down Expand Up @@ -62,7 +61,7 @@ jobs:
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
shell: bash
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.17.0/cargo-dist-installer.sh | sh"
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.21.0/cargo-dist-installer.sh | sh"
- name: Cache cargo-dist
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -116,10 +115,6 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: swatinem/rust-cache@v2
with:
key: ${{ join(matrix.targets, '-') }}
cache-provider: ${{ matrix.cache_provider }}
- name: Install cargo-dist
run: ${{ matrix.install_dist }}
# Get the dist-manifest
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/*/target/

# data generated during runtime
/data/
/*/data/
data/
crack-core/data/
/logs/
scratch

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"crack-gpt",
"crack-osint",
"crack-bf",
"crack-activity",
],
"rust-analyzer.linkedProjects": [
"./crack-core/Cargo.toml",
Expand Down
4 changes: 3 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"--profile=release",
"--",
"--exact",
"--show-output"
"--show-output",
"--threads",
"1"
],
"problemMatcher": [
"$rustc"
Expand Down
Loading

0 comments on commit a48d0b4

Please sign in to comment.