已开启
fix(security): 移除示例代码中硬编码的真实凭证和内外网IP #102
sunshuang1866创建于 7月31日
fix(security): 移除示例代码中硬编码的真实凭证和内外网IP #102
已开启
共 4 个文件变更+14-14
| @@ -1,9 +1,9 @@ | |||
| 1 | server.port=8080 | 1 | server.port=8080 |
| 2 | 2 | ||
| 3 | -#spring.datasource.url=jdbc:postgresql://103.91.210.232:11343/db_department | 3 | +#spring.datasource.url=jdbc:postgresql://127.0.0.1:11343/db_department |
| 4 | -spring.datasource.url=jdbc:postgresql://192.168.161.18:5432/db_department | 4 | +spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/db_department |
| 5 | -spring.datasource.username=admin_department | 5 | +spring.datasource.username=user |
| 6 | -spring.datasource.password=OpenGauss@123 | 6 | +spring.datasource.password=password123 |
| 7 | spring.datasource.driver-class-name=org.postgresql.Driver | 7 | spring.datasource.driver-class-name=org.postgresql.Driver |
| 8 | 8 | ||
| 9 | mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl | 9 | mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl |
| @@ -14,9 +14,9 @@ public class jdbcTest { | |||
| 14 | //驱动类。 | 14 | //驱动类。 |
| 15 | String driver = "org.opengauss.Driver"; | 15 | String driver = "org.opengauss.Driver"; |
| 16 | //数据库连接描述符。 | 16 | //数据库连接描述符。 |
| 17 | - String sourceURL = "jdbc:opengauss://139.159.187.78:15400/mydb"; | 17 | + String sourceURL = "jdbc:opengauss://127.0.0.1:15400/mydb"; |
| 18 | - String username = "coder"; | 18 | + String username = "user"; |
| 19 | - String passwd = "qwE_23sz123"; | 19 | + String passwd = "password123"; |
| 20 | Connection conn = null; | 20 | Connection conn = null; |
| 21 | 21 | ||
| 22 | try { | 22 | try { |
| @@ -11,9 +11,9 @@ import java.util.List; | |||
| 11 | 11 | ||
| 12 | public class ShellTest { | 12 | public class ShellTest { |
| 13 | public static void main(String[] args) { | 13 | public static void main(String[] args) { |
| 14 | - String hostname = "139.159.187.78";//远程机器IP | 14 | + String hostname = "127.0.0.1";//远程机器IP |
| 15 | - String username = "root";//登录用户名 | 15 | + String username = "user";//登录用户名 |
| 16 | - String password = "keMd@!vD24dSf2r";//登录密码 | 16 | + String password = "password123";//登录密码 |
| 17 | 17 | ||
| 18 | try { | 18 | try { |
| 19 | Connection conn = new Connection(hostname); | 19 | Connection conn = new Connection(hostname); |
| @@ -24,7 +24,7 @@ public class ShellTest { | |||
| 24 | throw new IOException("登录失败!!!"); | 24 | throw new IOException("登录失败!!!"); |
| 25 | } | 25 | } |
| 26 | SCPClient scpClient = conn.createSCPClient(); | 26 | SCPClient scpClient = conn.createSCPClient(); |
| 27 | - scpClient.get("/home/omm/test.html","C:\\Users\\luoy\\Desktop"); | 27 | + scpClient.get("/home/omm/test.html","C:\\Users\\user\\Desktop"); |
| 28 | // Session sess = conn.openSession(); | 28 | // Session sess = conn.openSession(); |
| 29 | // //执行命令 | 29 | // //执行命令 |
| 30 | // sess.execCommand("uname -a && date && uptime && who"); | 30 | // sess.execCommand("uname -a && date && uptime && who"); |
| @@ -1,6 +1,6 @@ | |||
| 1 | [connect] | 1 | [connect] |
| 2 | -host = 192.168.226.130 | 2 | +host = 127.0.0.1 |
| 3 | port = 15400 | 3 | port = 15400 |
| 4 | database = mydb | 4 | database = mydb |
| 5 | -username = omm | 5 | +username = user |
| 6 | -password = 123456 | 6 | +password = password123 |