Skip to content

Commit

Permalink
V0.3.7 (#267)
Browse files Browse the repository at this point in the history
## v0.3.7 (2024/05/29)
- [x] crackgpt 0.2.0!
      Added back chatgpt support, which I am now self hosting for CrackTunes
      and is backed by GPT 4o.
- [x] Use the rusty_ytdl library as a first try, fallback to yt-dlp if it fails.
- [x] Remove the grafana dashboard.
- [x] Switch to async logging.
- [x] Add an async service to handle the database (accept writes on a channel,
      and write to the database in a separate thread).
      Eventually this could be a seperate service (REST / GRPC).
  • Loading branch information
cycle-five committed May 30, 2024
1 parent 7e67d1b commit 92c8909
Show file tree
Hide file tree
Showing 129 changed files with 7,237 additions and 6,028 deletions.
40 changes: 20 additions & 20 deletions .build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
image: debian/bookworm
secrets:
- 5ec53080-dbed-4207-ab0f-d6056a62bb46
- dbe97eb1-5978-43b3-83f2-8f1e6b815fcb
- d9aab5c9-6631-4095-8a7a-73e2401ac04c
tasks:
- install-dependencies: |
echo "*:*:*:postgres:mysecretpassword" > ~/.pgpass
export POSTGRES_PASSWORD=mysecretpassword
export POSTGRES_PASSWORD=$(cat ~/PG_PASSWORD)
echo "*:*:*:postgres:${POSTGRES_PASSWORD}" > ~/.pgpass
sudo apt-get update
sudo apt-get install -y \
autoconf \
Expand All @@ -23,51 +25,49 @@ tasks:
sudo apt-get clean -y
sudo rm -rf /var/lib/apt/lists/*
- install-rust: |
export POSTGRES_PASSWORD=mysecretpassword
export POSTGRES_PASSWORD=$(cat ~/PG_PASSWORD)
curl -proto '=https' -tlsv0.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
rustup install nightly
rustup default nightly
cargo install sqlx-cli --no-default-features --features postgres
cargo install cargo-tarpaulin
# - install-tarpaulin: |
# . "$HOME/.cargo/env"
# cargo install cargo-tarpaulin
- install-yt-dlp: |
export POSTGRES_PASSWORD=mysecretpassword
export POSTGRES_PASSWORD=$(cat ~/PG_PASSWORD)
sudo curl -sSL --output /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/download/2024.04.09/yt-dlp_linux
sudo chmod +x /usr/local/bin/yt-dlp
- fmt: |
. "$HOME/.cargo/env"
export POSTGRES_PASSWORD=mysecretpassword
export DATABASE_URL=postgresql://postgres:mysecretpassword@localhost:5432/postgres
export POSTGRES_PASSWORD=$(cat ~/PG_PASSWORD)
export DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@localhost:5432/postgres
cd cracktunes
cargo +nightly fmt --all -- --check
cargo fmt --all -- --check
- lint: |
. "$HOME/.cargo/env"
export POSTGRES_PASSWORD=mysecretpassword
export DATABASE_URL=postgresql://postgres:mysecretpassword@localhost:5432/postgres
export POSTGRES_PASSWORD=$(cat ~/PG_PASSWORD)
export DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@localhost:5432/postgres
export SQLX_OFFLINE=true
cd cracktunes
cargo +nightly clippy --all -- -D clippy::all -D warnings
cargo clippy --all -- -D clippy::all -D warnings
- initdb: |
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'mysecretpassword';"
export POSTGRES_PASSWORD=$(cat ~/PG_PASSWORD)
sudo -u postgres psql -c "ALTER USER postgres PASSWORD '${POSTGRES_PASSWORD}';"
. "$HOME/.cargo/env"
export POSTGRES_PASSWORD=mysecretpassword
export PG_USER=postgres
export PG_PASSWORD=mysecretpassword
export DATABASE_URL=postgresql://postgres:mysecretpassword@localhost:5432/postgres
export PG_PASSWORD=$(cat ~/PG_PASSWORD)
export DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@localhost:5432/postgres
cd cracktunes
sqlx database create
sqlx migrate run
cargo sqlx prepare --workspace -- --tests --all
- test: |
. "$HOME/.cargo/env"
export POSTGRES_PASSWORD=mysecretpassword
export DATABASE_URL=postgresql://postgres:mysecretpassword@localhost:5432/postgres
export POSTGRES_PASSWORD=$(cat ~/PG_PASSWORD)
export OPENAI_API_KEY=$(cat ~/OPENAI_API_KEY)
export DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@localhost:5432/postgres
export VIRUSTOTAL_API_KEY=$(cat ~/VIRUSTOTAL_API_KEY)
export SQLX_OFFLINE=true
cd cracktunes
# cargo tarpaulin --verbose --workspace --timeout 120 --out xml
cargo +nightly test
cargo test -- --test-threads=1
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
/logs/
scratch

# replit
.cargo/git/
.cargo/registry/
.cargo/

# configuration / secrets
Secrets.toml
.env
Expand All @@ -20,3 +25,4 @@ cracktunes.toml

# code coverage
cobertura.xml
**/*.profraw
2 changes: 2 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
run = "cargo build"
hidden = ["target"]
entrypoint = "src/main.rs"
modules = ["rust-stable:v4-20240117-0bd73cd"]

[packager]
language = "rust"
Expand Down

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

27 changes: 14 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@
"password": "mysecretpassword"
}
],
"rust-analyzer.cargo.cfgs": {
"crack-gpt": "",
"crack-osint": "",
"crack-core": "",
"crack-telemetry": "",
"crack-tracing": "",
"db": "",
"playlist": "",
"cache": "",
"ignore-presence-log": "",
},
"rust-analyzer.cargo.features": [
"crack-gpt"
],
// "crack-osint",
// "crack-core",
// "crack-telemetry",
// "crack-tracing",
// "db",
// "playlist",
// "cache",
// "ignore-presence-log",
// ],
// "rust-analyzer.cargo.features": "all",
"rust-analyzer.linkedProjects": [
"./crack-core/Cargo.toml",
"./crack-gpt/Cargo.toml",
Expand All @@ -31,5 +33,4 @@
"rust-analyzer.checkOnSave": true,
"gitdoc.enabled": false,
"editor.fontFamily": "0xProto Nerd Font Mono",
}
// "rust-analyzer.cargo.features": "all",
}
Loading

0 comments on commit 92c8909

Please sign in to comment.