-
Notifications
You must be signed in to change notification settings - Fork 13
fix: migration-process #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 16 commits
c46c301
ee7016d
bb45c19
38a3274
2c5c805
092f760
2d44b62
b269d98
d7958e0
61c7224
5c35375
bfe63d7
5f57969
6edf289
cef38e9
60c1d9a
2414954
14caae8
cc163c2
e990e3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,7 +9,8 @@ services: | |||||
| - .:/app | ||||||
| - cargo-registry:/usr/local/cargo/registry | ||||||
| - cargo-git:/usr/local/cargo/git | ||||||
| - ./databases.json:/config/config.json | ||||||
| - /Users/charlesgauthereau/Desktop/test-portabase/databases.json:/config/config.json | ||||||
| # - ./databases.json:/config/config.json | ||||||
| #- ./databases.toml:/config/config.toml | ||||||
| #- /var/run/docker.sock:/var/run/docker.sock | ||||||
| #- cargo-target:/app/target | ||||||
|
|
@@ -19,7 +20,7 @@ services: | |||||
| APP_ENV: development | ||||||
| LOG: debug | ||||||
| TZ: "Europe/Paris" | ||||||
| EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiNzM0NjU3Y2YtMGQzYy00Y2UwLTkyODQtZDJmOGYyMjI2MzgzIiwibWFzdGVyS2V5QjY0IjoiMUh0djdtWCtYVkJxL0IzUEV2WDlZZjlQeUdVZW5oRHlXemo5THRqNW90WT0ifQ==" | ||||||
| EDGE_KEY: "eyJzZXJ2ZXJVcmwiOiJodHRwOi8vbG9jYWxob3N0Ojg4ODciLCJhZ2VudElkIjoiNjIyNWFlMzMtODQwMy00NmE3LWEyNDEtMjU4MTI2MjVlYTA4IiwibWFzdGVyS2V5QjY0IjoiQlhWM1hvbEM2NTZTVjdkTmdjV1BHUWxrKytycExJNmxHRGk3Q1BCNWllbz0ifQ==" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likely credential leak — rotate immediately. The new
🔒 Proposed fix- EDGE_KEY: "eyJzZXJ2ZXJVcmwi...=="
+ EDGE_KEY: ${EDGE_KEY:?EDGE_KEY must be provided via .env}📝 Committable suggestion
Suggested change
🧰 Tools🪛 Betterleaks (1.1.2)[high] 23-23: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) [high] 23-23: Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (generic-api-key) 🤖 Prompt for AI Agents |
||||||
| #CHUNK_SIZE_MB: "1" | ||||||
| #POOLING: 1 | ||||||
| #DATABASES_CONFIG_FILE: "config.toml" | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -33,6 +33,7 @@ pub async fn run( | |||||||||||||||||||||
| let mariadb_dump = select_mariadb_path(&version).join("mariadb-dump"); | ||||||||||||||||||||||
| info!("Mariadb dump found: {}", mariadb_dump.display()); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| let output = Command::new("mariadb-dump") | ||||||||||||||||||||||
|
Comment on lines
33
to
37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Lines 33–34 compute and log a version-specific path, then line 37 spawns the bare string 🔧 Proposed fix- let output = Command::new("mariadb-dump")
+ let output = Command::new(&mariadb_dump)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| .arg("--host").arg(&cfg.host) | ||||||||||||||||||||||
| .arg("--port").arg(cfg.port.to_string()) | ||||||||||||||||||||||
|
|
@@ -43,18 +44,18 @@ pub async fn run( | |||||||||||||||||||||
| .arg("--single-transaction") | ||||||||||||||||||||||
| .arg("--quick") | ||||||||||||||||||||||
| .arg("--skip-lock-tables") | ||||||||||||||||||||||
| .arg("--add-drop-database") | ||||||||||||||||||||||
| .arg("--databases").arg(&cfg.database) | ||||||||||||||||||||||
| .arg("--no-create-db") | ||||||||||||||||||||||
| .arg("--skip-add-drop-table") | ||||||||||||||||||||||
| .arg("--compress") | ||||||||||||||||||||||
| .arg("--max-allowed-packet=512M") | ||||||||||||||||||||||
| .arg("--net-buffer-length=16K") | ||||||||||||||||||||||
| .arg("--default-character-set=utf8mb4") | ||||||||||||||||||||||
| .arg(&cfg.database) | ||||||||||||||||||||||
| .arg("-r").arg(&file_path) | ||||||||||||||||||||||
| .envs(env) | ||||||||||||||||||||||
| .output() | ||||||||||||||||||||||
| .with_context(|| format!("Failed to run mariadb-dump for {}", cfg.name))?; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| if !output.status.success() { | ||||||||||||||||||||||
| let stderr = String::from_utf8_lossy(&output.stderr); | ||||||||||||||||||||||
| anyhow::bail!("Mariadb backup failed for {}: {}", cfg.name, stderr); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.