Skip to content

Commit fe6bd1c

Browse files
committed
Merge pre-release into main for v1.2.5 'Accolade Watch'
2 parents 64d51d3 + 76db201 commit fe6bd1c

8 files changed

Lines changed: 46 additions & 11 deletions

File tree

.github/workflows/build-qbzd.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ on:
1010
# - 'qbzd-v*'
1111
workflow_dispatch:
1212

13+
# Default to read-only; the `release` job below opts in to `contents: write`
14+
# explicitly. Without this top-level block the build jobs would inherit the
15+
# repository-wide write token. Closes CodeQL actions/missing-workflow-permissions.
16+
permissions:
17+
contents: read
18+
1319
jobs:
1420
build-x86_64:
1521
runs-on: ubuntu-22.04

.github/workflows/release-updater-manifest.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,19 @@ jobs:
2525
steps:
2626
- name: Resolve version from tag
2727
id: version
28+
# `head_branch` on a `workflow_run` event is attacker-controllable
29+
# (an outside contributor could push a branch with an injection
30+
# payload as its name). Route it through an env var and validate
31+
# the shape before letting it flow into shell or $GITHUB_OUTPUT.
32+
env:
33+
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
2834
run: |
29-
TAG="${{ github.event.workflow_run.head_branch }}"
35+
set -euo pipefail
36+
if ! printf '%s' "$HEAD_BRANCH" | grep -Eq '^v[0-9][0-9A-Za-z._-]{0,63}$'; then
37+
echo "::error::Rejected head_branch for manifest job: $HEAD_BRANCH"
38+
exit 1
39+
fi
40+
TAG="$HEAD_BRANCH"
3041
VERSION="${TAG#v}"
3142
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
3243
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

crates/Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/qbzd/src/daemon.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ pub async fn run(mut config: DaemonConfig) -> Result<(), String> {
8787
// Try auto-login from saved OAuth token
8888
match try_auto_login(&core).await {
8989
Some(user_id) => {
90-
log::info!("[qbzd] Auto-login successful (user_id: {})", user_id);
90+
// Demoted from info to debug to keep user_id out of default-level
91+
// logs (CodeQL rust/cleartext-logging). Set RUST_LOG=debug to see.
92+
log::debug!("[qbzd] Auto-login successful (user_id: {})", user_id);
9193
// Activate per-user session (initialize stores, sync settings)
9294
match crate::session::activate_session(user_id, &core, &event_tx).await {
9395
Ok(session) => {
@@ -214,7 +216,9 @@ async fn try_auto_login(core: &QbzCore<DaemonAdapter>) -> Option<u64> {
214216

215217
match core.login_with_token(&token).await {
216218
Ok(session) => {
217-
log::info!(
219+
// Demoted from info to debug to keep user_id out of default-level
220+
// logs (CodeQL rust/cleartext-logging). Set RUST_LOG=debug to see.
221+
log::debug!(
218222
"[qbzd] Session restored for user {} ({})",
219223
session.display_name,
220224
session.user_id

crates/qbzd/src/session.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ pub async fn activate_session(
2222
core: &qbz_core::QbzCore<crate::adapter::DaemonAdapter>,
2323
event_tx: &tokio::sync::broadcast::Sender<DaemonEvent>,
2424
) -> Result<UserSession, String> {
25-
log::info!("[qbzd/session] Activating session for user {}", user_id);
25+
// Demoted from info to debug to keep user_id out of default-level logs
26+
// (CodeQL rust/cleartext-logging). Set RUST_LOG=debug to see.
27+
log::debug!("[qbzd/session] Activating session for user {}", user_id);
2628

2729
// Resolve per-user directories (same layout as desktop app)
2830
let global_data = dirs::data_dir()

src-tauri/src/commands_v2/legacy_compat.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@ use crate::AppState;
2929

3030
use super::{
3131
download_audio, v2_cache_notification_artwork, v2_format_notification_quality,
32-
v2_prepare_notification_icon_bytes, v2_teardown_type_alias_state,
32+
v2_teardown_type_alias_state,
3333
};
34+
// Linux-only: turns an artwork PNG into the raw bytes Ayatana notifications
35+
// expect. Only called inside the `cfg(target_os = "linux")` arm below, so the
36+
// import must match.
37+
#[cfg(target_os = "linux")]
38+
use super::v2_prepare_notification_icon_bytes;
3439

3540
#[tauri::command]
3641
pub async fn v2_show_track_notification(

src-tauri/src/commands_v2/playback.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ use crate::runtime::{CommandRequirement, RuntimeError, RuntimeManagerState};
1414
use crate::AppState;
1515

1616
use super::{
17-
cached_audio_incompatible_with_hw, cached_quality_below_requested, download_with_backoff,
18-
limit_quality_for_device, parse_quality, try_cmaf_full_download, try_cmaf_streaming_setup,
19-
v2_cmaf_stream, v2_download_and_stream, v2_get_stream_info, v2_library_get_tracks_by_ids,
17+
cached_quality_below_requested, download_with_backoff, limit_quality_for_device,
18+
parse_quality, try_cmaf_full_download, try_cmaf_streaming_setup, v2_cmaf_stream,
19+
v2_download_and_stream, v2_get_stream_info, v2_library_get_tracks_by_ids,
2020
};
21+
// Linux-only: ALSA hardware capability check. The callsites that use it are
22+
// already gated on `cfg(target_os = "linux")`, so the import has to match or
23+
// macOS fails with "unresolved import".
24+
#[cfg(target_os = "linux")]
25+
use super::cached_audio_incompatible_with_hw;
2126

2227
// ==================== Prefetch (V2) ====================
2328

src-tauri/src/tray.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use crate::tray_linux_ksni;
1111
#[cfg(not(target_os = "linux"))]
1212
use image::GenericImageView;
1313
#[cfg(not(target_os = "linux"))]
14+
use std::path::PathBuf;
15+
#[cfg(not(target_os = "linux"))]
1416
use tauri::{
1517
image::Image,
1618
menu::{Menu, MenuItem, PredefinedMenuItem},

0 commit comments

Comments
 (0)