Copilot commented on code in PR #1: URL: https://github.com/apache/dubbo-go-pixiu-admin/pull/1#discussion_r2719766972
########## web/README.md: ########## @@ -0,0 +1,155 @@ +# Pixiu Admin Frontend + +Modern web interface for Dubbo Go Pixiu gateway management. + +## Technology Stack + +| Technology | Version | Purpose | +|------------|---------|---------| +| React | 18 | UI Framework | Review Comment: The documentation states React version 18, but package.json specifies React 19.2.0. These should be consistent. Update the documentation to match the actual package version or correct the package.json version. ```suggestion | React | 19.2.0 | UI Framework | ``` ########## web/README.md: ########## @@ -0,0 +1,155 @@ +# Pixiu Admin Frontend + +Modern web interface for Dubbo Go Pixiu gateway management. + +## Technology Stack + +| Technology | Version | Purpose | +|------------|---------|---------| +| React | 18 | UI Framework | +| TypeScript | 5.x | Type Safety | +| Vite | 7.x | Build Tool | +| Ant Design | 5.x | UI Components | +| Zustand | 5.x | State Management | +| React Router | 7.x | Routing | +| Axios | 1.x | HTTP Client | +| i18next | 25.x | Internationalization | +| Monaco Editor | - | YAML Editor | +| ECharts | 5.x | Charts | Review Comment: The documentation states ECharts version 5.x, but package.json specifies ^6.0.0. Update the documentation to version 6.x to match the actual dependency. ```suggestion | ECharts | 6.x | Charts | ``` ########## scripts/init/mysql-init.sql: ########## @@ -0,0 +1,133 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you under the Apache License, Version 2.0 (the +-- "License"); you may not use this file except in compliance +-- with the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, +-- software distributed under the License is distributed on an +-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +-- KIND, either express or implied. See the License for the +-- specific language governing permissions and limitations +-- under the License. +-- + +-- Create database if not exists +CREATE DATABASE IF NOT EXISTS pixiu_admin CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +USE pixiu_admin; + +-- User table +CREATE TABLE IF NOT EXISTS pixiu_user ( + id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + username VARCHAR(50) NOT NULL, + password VARCHAR(64) NOT NULL, + role INT NOT NULL DEFAULT 0, + enabled TINYINT(1) NOT NULL DEFAULT 1, + date_created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + date_updated DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (id), + UNIQUE KEY uk_username (username) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='User table'; + +-- Role table +CREATE TABLE IF NOT EXISTS pixiu_role ( + id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + role_name VARCHAR(50) NOT NULL, + description VARCHAR(200), + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Role table'; + +-- User-Role relationship table +CREATE TABLE IF NOT EXISTS pixiu_user_role ( + user_id BIGINT UNSIGNED NOT NULL, + role_id BIGINT UNSIGNED NOT NULL, + PRIMARY KEY (user_id, role_id), + KEY idx_user_id (user_id), + KEY idx_role_id (role_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='User-Role relationship'; + +-- Permission table +CREATE TABLE IF NOT EXISTS pixiu_permission ( + id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + resource VARCHAR(50) NOT NULL, + action VARCHAR(20) NOT NULL, + PRIMARY KEY (id), + KEY idx_resource_action (resource, action) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Permission table'; + +-- Role-Permission relationship table +CREATE TABLE IF NOT EXISTS pixiu_role_permission ( + role_id BIGINT UNSIGNED NOT NULL, + permission_id BIGINT UNSIGNED NOT NULL, + PRIMARY KEY (role_id, permission_id), + KEY idx_role_id (role_id), + KEY idx_permission_id (permission_id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Role-Permission relationship'; + +-- Insert default admin user (username: admin, password: admin) +-- Password is MD5 hash of 'admin' +INSERT INTO pixiu_user (username, password, role, enabled) +VALUES ('admin', '21232f297a57a5a743894a0e4a801fc3', 1, 1) Review Comment: MD5 is cryptographically broken and unsuitable for password hashing. The comment indicates MD5 is used, but the application should use bcrypt, scrypt, or Argon2 for password hashing instead. ```suggestion -- Password is bcrypt hash (cost 10) of 'admin' INSERT INTO pixiu_user (username, password, role, enabled) VALUES ('admin', '$2b$10$XkEYh3YOEoTP0TOZcdLXjeuGM8Of7EEkCkH6n9a7WDaY/qVP.Upgy', 1, 1) ``` ########## configs/admin_config.yaml: ########## @@ -0,0 +1,50 @@ +# Server Configuration +server: + port: 18080 + mode: debug # release, debug, test + +# MySQL Configuration +mysql: + host: localhost + port: 3306 + username: root + password: 123456 + database: pixiu_admin + max_idle_conns: 10 + max_open_conns: 100 + +# Etcd Configuration +etcd: + endpoints: + - localhost:2379 + timeout: 5s + prefix: /pixiu/config + +# JWT Configuration +jwt: + secret: "your-secret-key-change-in-production" Review Comment: The JWT secret uses a placeholder value that may not be changed in production deployments. Consider using environment variable references or failing to start if a secure secret is not provided. ```suggestion secret: ${JWT_SECRET} ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
