This repository was archived by the owner on Feb 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdoc.go
More file actions
78 lines (47 loc) · 2.14 KB
/
doc.go
File metadata and controls
78 lines (47 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
UpdateServer package ships releases and manage update requests
Prerequisites
Before diving into the install section ensure you have:
- Postgresql
- golang (1.5 or later)
Installing
Nothing fancy, just use teh golang go get
$ go get code.videolan.org/GSoC2017/Marco/UpdateServer
Configuration
The configuration comes in JSON format, you either edit the default config.json attached or give the path of the configuration file through flags Example :
{
"psqlinfo": {
"psqlhost" : "host" ,
"psqlname" : "updater" ,
"psqluser" : "postgres" ,
"psqlpassword" : "postgres" ,
"psqlport" : "5432"
}
}
Flags
The UpdateServer uses -port flag to customize port web application will be running on (8080 default)
and -config to add a path for the configuration file
Usage
cd $GOPATH/src/code.videolan.org/GSoC2017/Marco/UpdateServer
go build to build a binary UpdateServer
./UpdateServer to run the Server
Optional flags:
./UpdateServer -port 80
./UpdateServer -config $HOME/config.json
Default admin authentication : username:admin , password:admin
<host>/admin/dashboard/channels to add new channel .
[secure] Add only public key, and sign the metadata at every release's action.
[less secure] Add both public and private key, and the server would auto-sign the releases .
<host>/admin/dashboard/releases to add new release
insert the needed fields and choose a channel and you can add rules against it later .
add <host>/u/update to you client with a querystring for the update_request paramaters.
Example : <host>/u/update?product=vlc&channel=stable&os=Win&os_ver=7&os_arch=64&product_ver=2.1.4
Expected release content :
{"id":17,"channel":"stable","os":"Linux","os_ver":"Linux","os_arch":"32","product_ver":"2.1.1","url":"localhost","title":"Title","desc":"Description","product":"vlc"}
Note: the signed status is the JSON release without ID field.
so, at verifying the releases at client remove the "id":<id>, part .
also add <host>/u/signature to get the signature for the associated release
Example : <host>/u/signature?id=<release_id>
Monitor the incoming update_requests through <host>/u/requests
*/
package main