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
16 changes: 8 additions & 8 deletions mars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
},
"browserslist": "defaults, not ie <= 11",
"dependencies": {
"@headlessui/react": "^2.0.3",
"@headlessui/tailwindcss": "^0.2.0",
"@next/third-parties": "^14.2.3",
"@headlessui/react": "^2.1.0",
"@headlessui/tailwindcss": "^0.2.1",
"@next/third-parties": "^14.2.4",
"@tailwindcss/forms": "^0.5.7",
"@vercel/analytics": "^1.2.2",
"@vercel/analytics": "^1.3.1",
"autoprefixer": "^10.4.19",
"clsx": "^2.1.1",
"framer-motion": "^11.2.0",
"next": "^14.2.3",
"framer-motion": "^11.2.11",
"next": "^14.2.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-inlinesvg": "^4.1.3",
"tailwindcss": "^3.4.1",
"use-debounce": "^10.0.0"
"tailwindcss": "^3.4.4",
"use-debounce": "^10.0.1"
},
"devDependencies": {
"eslint": "^8.56.0",
Expand Down
929 changes: 548 additions & 381 deletions moon/package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions moon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
"lint": "next lint"
},
"dependencies": {
"@ant-design/icons": "^5.3.3",
"@headlessui/react": "^1.7.18",
"@headlessui/tailwindcss": "^0.2.0",
"@lexical/react": "^0.12.6",
"@ant-design/icons": "^5.3.7",
"@headlessui/react": "^2.1.0",
"@headlessui/tailwindcss": "^0.2.1",
"@lexical/react": "^0.16.0",
"@tailwindcss/forms": "^0.5.7",
"antd": "^5.14.1",
"axios": "^1.6.7",
"github-markdown-css": "^5.5.1",
"antd": "^5.18.3",
"axios": "^1.7.2",
"github-markdown-css": "^5.6.1",
"highlight.js": "^11.9.0",
"lexical": "^0.12.6",
"next": "14.1.1",
"lexical": "^0.16.0",
"next": "14.2.4",
"prism-react-renderer": "^2.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-markdown": "^9.0.1"
},
"devDependencies": {
Expand Down
5 changes: 3 additions & 2 deletions moon/src/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Inter } from "next/font/google";

import "./globals.css";

const inter = Inter({ subsets: ["latin"] });

export const metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "Mega - Monorepo",
description: "Mega - is an unofficial open source implementation of Google Piper",
};

export default function RootLayout({ children }) {
Expand Down
1 change: 0 additions & 1 deletion moon/src/components/TopNavbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../styles/TopNavbar.css';
// import '../styles/globals.css';

const TopNavbar = () => {
return (
Expand Down
7 changes: 1 addition & 6 deletions moon/src/pages/api/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,18 @@
import axios from 'axios';

export default async function handler(req, res) {
// 从 req.query 中提取 repo_path 和 object_id 参数
const { repo_path, object_id } = req.query;

try {
// 构建请求 URL
const apiUrl = `http://localhost:8000/api/v1/tree?path=${encodeURIComponent(repo_path)}`;

// 发起对外部 API 的请求
const response = await axios.get(apiUrl);

// 提取响应数据
const treeData = response.data;

// 返回数据给客户端
res.status(200).json(treeData);
} catch (error) {
// 如果发生错误,返回错误信息给客户端

console.error('Error fetching tree data:', error);
res.status(500).json({ error: 'Error fetching tree data' });
}
Expand Down
2 changes: 1 addition & 1 deletion moon/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const HomePage = ({ rootDirectory, directory, readmeContent, fileContent, TreeDa
const [currentPath, setCurrentPath] = useState([]); // for breadcrumb
const { DirectoryTree } = Tree;
const [expandedKeys, setExpandedKeys] = useState([]);
const fileCodeContainerStyle = showTree ? { width: '80%', marginLeft: '17%', borderRadius: '0.5rem', marginTop: '10px' } : { width: '90%', margin: '0 auto', borderRadius: '0.5rem', marginTop: '10px', marginTop: '40px' };
const fileCodeContainerStyle = showTree ? { width: '80%', marginLeft: '17%', borderRadius: '0.5rem', marginTop: '10px' } : { width: '90%', margin: '0 auto', borderRadius: '0.5rem', marginTop: '10px' };
const dirShowTrStyle = { borderBottom: '1px solid rgba(0, 0, 0, 0.1)', }

useEffect(() => {
Expand Down
6 changes: 3 additions & 3 deletions vault/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ edition = "2021"
rusty_vault = "0.1.0"
serde_json = "1.0.117"
go-defer = "0.1.0"
openssl = "0.10.63"
openssl = "0.10.64"
hex = "0.4.3"
lazy_static = "1.4.0"
secp256k1 = { version = "0.27.0", features = ["serde", "bitcoin-hashes", "bitcoin-hashes-std", "rand"] }
lazy_static = "1.5.0"
secp256k1 = { version = "0.29.0", features = ["serde", "rand"] }
bs58 = "0.5.1"
serde = { version = "1.0.117", features = ["derive"] }
1 change: 1 addition & 0 deletions vault/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Vault Module
3 changes: 0 additions & 3 deletions vault/src/main.rs

This file was deleted.

2 changes: 1 addition & 1 deletion vault/src/nostr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mod tests {
assert_eq!(PublicKey::from_slice(&nostr_decode).unwrap(), public_key);
// verify
let secp = Secp256k1::new();
let message = Message::from_slice(&[0xab; 32]).expect("32 bytes");
let message = Message::from_digest_slice(&[0xab; 32]).expect("32 bytes");
let sig = secp.sign_ecdsa(&message, &secret_key);
assert_eq!(secp.verify_ecdsa(&message, &sig, &public_key), Ok(()));
}
Expand Down
12 changes: 0 additions & 12 deletions vault/src/pki.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,6 @@ fn generate_root(core: Arc<RwLock<Core>>, token: &str, exported: bool) {
Some(req_data),
);
assert!(resp.is_ok());
// let resp_body = resp.unwrap();
// let data = resp_body.unwrap().data;
// let key_data = data.unwrap();
// println!("generate root result: {:?}", key_data);

// let resp_ca_pem = read_api(&core, token, "pki/ca/pem");
// let resp_ca_pem_cert_data = resp_ca_pem.unwrap().unwrap().data.unwrap();
//
// println!("resp_ca_pem_cert_data: {:?}", resp_ca_pem_cert_data);
}

/// issue certificate
Expand All @@ -118,7 +109,6 @@ pub fn issue_cert(data: Value) -> (String, String) {
assert!(resp.is_ok());
let resp_body = resp.unwrap();
let cert_data = resp_body.unwrap().data.unwrap();
// println!("cert_data: {:?}", cert_data);

(
cert_data["certificate"].as_str().unwrap().to_owned(), // TODO may add root cert (chain) in it
Expand Down Expand Up @@ -170,7 +160,6 @@ mod tests {
let (cert_pem, private_key) = issue_cert(json!({
"ttl": "10d",
"common_name": "oqpXWgEhXa1WDqMWBnpUW4jvrxGqJKVuJATy4MSPdKNS", //nostr id
// "alt_names": "a.test.com,b.test.com",
}));

println!("cert_pem: {}", cert_pem);
Expand Down Expand Up @@ -319,7 +308,6 @@ mod tests_raw {
let data = resp_body.unwrap().data;
assert!(data.is_some());
let key_data = data.unwrap();
// println!("generate root result: {:?}", key_data);

let resp_ca_pem = test_read_api(&core, token, "pki/ca/pem", true);
let resp_ca_pem_cert_data = resp_ca_pem.unwrap().unwrap().data.unwrap();
Expand Down