Skip to content

Commit fa4f565

Browse files
author
rn-h
committed
Init
1 parent 9fdbcb2 commit fa4f565

File tree

26 files changed

+1695
-4
lines changed

26 files changed

+1695
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
config/app.dev.json

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Launch Package",
9+
"type": "go",
10+
"request": "launch",
11+
"mode": "auto",
12+
"program": "${workspaceFolder}/main.go"
13+
}
14+
]
15+
}

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Code-Push-Server-Go
2-
CodePush Server Go is a CodePush progam server,Use with [code-push-go]()
2+
CodePush Server Go is a CodePush progam server,Use with [code-push-go](https://github.com/htdcx/code-push-go)
33

44
## Support Version
55
- mysql >= 8.0
@@ -13,12 +13,13 @@ CodePush Server Go is a CodePush progam server,Use with [code-push-go]()
1313
- Local
1414
- AWS S3
1515
- FTP
16+
1617
## Before installation, please ensure that the following procedures have been installed
1718
- mysql
1819
- golang
1920
- redis
20-
## HOW TO INSTALL code-push-server
2121

22+
## Install code-push-server
2223
```shell
2324
git clone https://github.com/htdcx/code-push-server-go.git
2425
cd code-push-server-go
@@ -89,10 +90,18 @@ set GOARCH=amd64
8990
set GOOS=linux #windows,darwin
9091
go build -o code-push-server-go(.exe) main.go
9192

92-
#copy config/app.(model).json and config/app.json to run dir and run
93+
#copy config/app.(model).json and config/app.json to run dir
94+
#run
9395
./code-push-server-go
9496
```
95-
#### Use [code-push-go]()
97+
### Default user name and password
98+
- Username:admin
99+
- Password:admin
100+
101+
### change password and user name
102+
- Change mysql users tables (password need md5)
103+
104+
#### Use [code-push-go](https://github.com/htdcx/code-push-go)
96105
``` shell
97106
./code-push-go login -u (userName) -p (password) -h (serverUrl)
98107
```

code-push.sql

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
CREATE DATABASE IF NOT EXISTS `code-push` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */;
2+
USE `code-push`;
3+
-- MySQL dump 10.13 Distrib 8.0.34, for macos13 (arm64)
4+
--
5+
-- Host: localhost Database: code-push
6+
-- ------------------------------------------------------
7+
-- Server version 8.0.27
8+
9+
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10+
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11+
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12+
/*!50503 SET NAMES utf8 */;
13+
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
14+
/*!40103 SET TIME_ZONE='+00:00' */;
15+
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
16+
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
17+
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
18+
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
19+
20+
--
21+
-- Table structure for table `apps`
22+
--
23+
24+
DROP TABLE IF EXISTS `apps`;
25+
/*!40101 SET @saved_cs_client = @@character_set_client */;
26+
/*!50503 SET character_set_client = utf8mb4 */;
27+
CREATE TABLE `apps` (
28+
`id` int NOT NULL AUTO_INCREMENT,
29+
`uid` int DEFAULT NULL,
30+
`app_name` varchar(256) DEFAULT NULL,
31+
`os` int DEFAULT NULL,
32+
`create_time` bigint DEFAULT NULL,
33+
PRIMARY KEY (`id`)
34+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
35+
/*!40101 SET character_set_client = @saved_cs_client */;
36+
37+
--
38+
-- Dumping data for table `apps`
39+
--
40+
41+
LOCK TABLES `apps` WRITE;
42+
/*!40000 ALTER TABLE `apps` DISABLE KEYS */;
43+
/*!40000 ALTER TABLE `apps` ENABLE KEYS */;
44+
UNLOCK TABLES;
45+
46+
--
47+
-- Table structure for table `deployment`
48+
--
49+
50+
DROP TABLE IF EXISTS `deployment`;
51+
/*!40101 SET @saved_cs_client = @@character_set_client */;
52+
/*!50503 SET character_set_client = utf8mb4 */;
53+
CREATE TABLE `deployment` (
54+
`id` int NOT NULL AUTO_INCREMENT,
55+
`app_id` int DEFAULT NULL,
56+
`name` varchar(256) DEFAULT NULL,
57+
`key` varchar(256) DEFAULT NULL,
58+
`version_id` int DEFAULT NULL,
59+
`update_time` bigint DEFAULT NULL,
60+
`create_time` bigint DEFAULT NULL,
61+
PRIMARY KEY (`id`)
62+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
63+
/*!40101 SET character_set_client = @saved_cs_client */;
64+
65+
--
66+
-- Dumping data for table `deployment`
67+
--
68+
69+
LOCK TABLES `deployment` WRITE;
70+
/*!40000 ALTER TABLE `deployment` DISABLE KEYS */;
71+
/*!40000 ALTER TABLE `deployment` ENABLE KEYS */;
72+
UNLOCK TABLES;
73+
74+
--
75+
-- Table structure for table `deployment_version`
76+
--
77+
78+
DROP TABLE IF EXISTS `deployment_version`;
79+
/*!40101 SET @saved_cs_client = @@character_set_client */;
80+
/*!50503 SET character_set_client = utf8mb4 */;
81+
CREATE TABLE `deployment_version` (
82+
`id` int NOT NULL AUTO_INCREMENT,
83+
`deployment_id` int DEFAULT NULL,
84+
`app_version` varchar(45) DEFAULT NULL,
85+
`current_package` int DEFAULT NULL,
86+
`update_time` bigint DEFAULT NULL,
87+
`create_time` bigint DEFAULT NULL,
88+
PRIMARY KEY (`id`)
89+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
90+
/*!40101 SET character_set_client = @saved_cs_client */;
91+
92+
--
93+
-- Dumping data for table `deployment_version`
94+
--
95+
96+
LOCK TABLES `deployment_version` WRITE;
97+
/*!40000 ALTER TABLE `deployment_version` DISABLE KEYS */;
98+
/*!40000 ALTER TABLE `deployment_version` ENABLE KEYS */;
99+
UNLOCK TABLES;
100+
101+
--
102+
-- Table structure for table `package`
103+
--
104+
105+
DROP TABLE IF EXISTS `package`;
106+
/*!40101 SET @saved_cs_client = @@character_set_client */;
107+
/*!50503 SET character_set_client = utf8mb4 */;
108+
CREATE TABLE `package` (
109+
`id` int NOT NULL AUTO_INCREMENT,
110+
`deployment_id` int DEFAULT NULL,
111+
`size` bigint DEFAULT NULL,
112+
`hash` varchar(256) DEFAULT NULL,
113+
`download` varchar(256) DEFAULT NULL,
114+
`active` int DEFAULT '0',
115+
`failed` int DEFAULT '0',
116+
`installed` int DEFAULT '0',
117+
`create_time` bigint DEFAULT NULL,
118+
PRIMARY KEY (`id`)
119+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
120+
/*!40101 SET character_set_client = @saved_cs_client */;
121+
122+
--
123+
-- Dumping data for table `package`
124+
--
125+
126+
LOCK TABLES `package` WRITE;
127+
/*!40000 ALTER TABLE `package` DISABLE KEYS */;
128+
/*!40000 ALTER TABLE `package` ENABLE KEYS */;
129+
UNLOCK TABLES;
130+
131+
--
132+
-- Table structure for table `token`
133+
--
134+
135+
DROP TABLE IF EXISTS `token`;
136+
/*!40101 SET @saved_cs_client = @@character_set_client */;
137+
/*!50503 SET character_set_client = utf8mb4 */;
138+
CREATE TABLE `token` (
139+
`id` int NOT NULL AUTO_INCREMENT,
140+
`uid` int DEFAULT NULL,
141+
`token` varchar(256) DEFAULT NULL,
142+
`expire_time` bigint DEFAULT NULL,
143+
`del` int DEFAULT NULL,
144+
PRIMARY KEY (`id`)
145+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
146+
/*!40101 SET character_set_client = @saved_cs_client */;
147+
148+
--
149+
-- Dumping data for table `token`
150+
--
151+
152+
LOCK TABLES `token` WRITE;
153+
/*!40000 ALTER TABLE `token` DISABLE KEYS */;
154+
/*!40000 ALTER TABLE `token` ENABLE KEYS */;
155+
UNLOCK TABLES;
156+
157+
--
158+
-- Table structure for table `users`
159+
--
160+
161+
DROP TABLE IF EXISTS `users`;
162+
/*!40101 SET @saved_cs_client = @@character_set_client */;
163+
/*!50503 SET character_set_client = utf8mb4 */;
164+
CREATE TABLE `users` (
165+
`id` int NOT NULL,
166+
`user_name` varchar(45) DEFAULT NULL,
167+
`password` varchar(45) DEFAULT NULL,
168+
PRIMARY KEY (`id`)
169+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
170+
/*!40101 SET character_set_client = @saved_cs_client */;
171+
172+
--
173+
-- Dumping data for table `users`
174+
--
175+
176+
LOCK TABLES `users` WRITE;
177+
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
178+
INSERT INTO `users` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3');
179+
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
180+
UNLOCK TABLES;
181+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
182+
183+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
184+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
185+
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
186+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
187+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
188+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
189+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
190+
191+
-- Dump completed on 2024-04-22 17:35:58

config/app.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"mode":"prod"
3+
}

config/app.prod.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"DBUser": {
3+
"Write": {
4+
"UserName": "root",
5+
"Password": "",
6+
"Host": "127.0.0.1",
7+
"Port": 3306,
8+
"DBname": "code-push"
9+
},
10+
"MaxIdleConns": 10,
11+
"MaxOpenConns": 100,
12+
"ConnMaxLifetime": 1
13+
},
14+
"Redis": {
15+
"Host": "127.0.0.1",
16+
"Prot": 6379,
17+
"DBIndex": 0,
18+
"UserName": "",
19+
"Password": ""
20+
},
21+
"CodePush": {
22+
"FileLocal":"local",
23+
"Local":{
24+
"SavePath":"./bundels"
25+
},
26+
"Aws":{
27+
"Endpoint":"",
28+
"Region":"",
29+
"S3ForcePathStyle":true,
30+
"KeyId":"",
31+
"Secret":"",
32+
"Bucket":""
33+
},
34+
"Ftp":{
35+
"ServerUrl":"",
36+
"UserName":"",
37+
"Password":""
38+
}
39+
},
40+
"UrlPrefix": "/",
41+
"ResourceUrl": "",
42+
"Port": ":8080",
43+
"TokenExpireTime": 30
44+
}

0 commit comments

Comments
 (0)