Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/web-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Test Web UI
on:
pull_request_target:
push:
branches:
- main
Expand All @@ -18,6 +19,8 @@ jobs:

- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}

- uses: actions/setup-node@v4
with:
Expand Down
10 changes: 8 additions & 2 deletions common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use std::collections::HashMap;
use std::path::PathBuf;
use std::rc::Rc;

use crate::utils;

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Config {
pub base_dir: PathBuf,
Expand Down Expand Up @@ -92,8 +94,12 @@ impl Default for Config {
);
std::fs::create_dir_all(&base_dir).unwrap();

// use mega/config.toml because mega use sqlite as default db
let default_config = include_str!("../../mega/config.toml");
let bin_name = utils::get_current_bin_name();
let default_config = match bin_name.as_str() {
"mono" => include_str!("../../config/config.toml"),
"mega" => include_str!("../../mega/config.toml"),
_ => include_str!("../../mega/config.toml"),
};
let default_config = default_config
.lines()
.map(|line| {
Expand Down
9 changes: 9 additions & 0 deletions common/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ pub fn check_conventional_commits_message(msg: &str) -> bool {
false
}

pub fn get_current_bin_name() -> String {
let bin_path = std::env::args().next().unwrap_or_default();
std::path::Path::new(&bin_path)
.file_name()
.and_then(|os_str| os_str.to_str())
.unwrap_or("unknown")
.to_owned()
}

#[cfg(test)]
mod test {
use super::*;
Expand Down
2 changes: 1 addition & 1 deletion docker/start-mono.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CONFIG_FILE="$MEGA_BASE_DIR/etc/config.toml"
# check if config file exists
if [ -f "$CONFIG_FILE" ]; then
echo "Using config file: $CONFIG_FILE"
exec /usr/local/bin/mono -c "$CONFIG_FILE" service multi http ssh --host 0.0.0.0 --http-port 8000 --ssh-port 9000
exec /usr/local/bin/mono -c "$CONFIG_FILE" service multi http ssh --host 0.0.0.0 --port 8000 --ssh-port 9000
else
exec /usr/local/bin/mono service multi http ssh --host 0.0.0.0 --ssh-port 22
fi
2 changes: 2 additions & 0 deletions libra/src/internal/protocol/lfs_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,8 @@ mod tests {
}

#[tokio::test]
#[ignore]
// Do not use mega repo in unit test, because mega exceeded its LFS budget. The account responsible for the budget should increase it to restore access
async fn test_github_batch() {
let batch_request = BatchRequest {
operation: Operation::Download,
Expand Down