-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger.yml
More file actions
786 lines (784 loc) · 20.4 KB
/
Copy pathswagger.yml
File metadata and controls
786 lines (784 loc) · 20.4 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
basePath: /api/v1.0
consumes:
- application/json
- application/x-protobuf
definitions:
Client:
properties:
address:
description: Address range client must will assigned
example:
- 10.0.0.2/32
items:
type: string
type: array
x-go-name: Address
allowedIPs:
description: IP addresses allowed to connect
example:
- 0.0.0.0/0
- ::/0
items:
type: string
type: array
x-go-name: AllowedIPs
created:
description: Time the client is created
example: 1642409076544
format: int64
type: integer
x-go-name: Created
createdBy:
description: Denoting person creates the client
example: jonsnow@mail.com
type: string
x-go-name: CreatedBy
email:
description: Email that the client device belongs
example: jonsnow@mail.com
type: string
x-go-name: Email
enable:
description: Status signal for client
example: true
type: boolean
x-go-name: Enable
ignorePersistentKeepalive:
example: true
type: boolean
x-go-name: IgnorePersistentKeepalive
name:
description: Name of the client
example: jon snow
type: string
x-go-name: Name
presharedKey:
description: Preshared key for the client
example: twDZk0lehYtst3Zclb+SRniVfoHnug9N6gjxuaipcvc=
type: string
x-go-name: PresharedKey
privateKey:
description: Private key for the client
example: KFOyCoR9Eq+LpqT9VzJCilXYmFwhMFw7UDkdRRxoWVg=
type: string
x-go-name: PrivateKey
publicKey:
description: Public key for the client
example: YeT/lG9L4AeYOHNrkohnmXfljx3/JgThulskllayxi4=
type: string
x-go-name: PublicKey
tags:
description: Tags for client device
example:
- laptop
- PC
items:
type: string
type: array
x-go-name: Tags
updated:
description: Time the client is last updated
example: 1642409076544
format: int64
type: integer
x-go-name: Updated
updatedBy:
description: Denoting person updates the client
example: jonsnow@mail.com
type: string
x-go-name: UpdatedBy
uuid:
description: Client identifier
example: 6c8ff96f-ce8a-4c64-a76d-07e9af0b75ab
type: string
x-go-name: UUID
type: object
x-go-package: _/home/sambath/Golang/Revotic-Engineering/erebrus/api/v1/client
ClientReq:
properties:
address:
description: Address range client must will assigned
example:
- 10.0.0.0/24
items:
type: string
type: array
x-go-name: Address
allowedIPs:
description: IP addresses allowed to connect
example:
- 0.0.0.0/0
- ::/0
items:
type: string
type: array
x-go-name: AllowedIPs
createdBy:
description: Denoting person creates the client
example: jonsnow@mail.com
type: string
x-go-name: CreatedBy
email:
description: Email that the client device belongs
example: jonsnow@mail.com
type: string
x-go-name: Email
enable:
description: Status signal for client
example: true
type: boolean
x-go-name: Enable
name:
example: jon snow
type: string
x-go-name: Name
tags:
description: Tags for client device
example:
- laptop
- PC
items:
type: string
type: array
x-go-name: Tags
updatedBy:
description: Denoting person updates the client
example: jonsnow@mail.com
type: string
x-go-name: UpdatedBy
required:
- name
- tags
- email
- enable
- allowedIPs
- address
- createdBy
- updatedBy
type: object
x-go-package: _/home/sambath/Golang/Revotic-Engineering/erebrus/api/v1/client
ClientUpdateReq:
properties:
address:
description: IP addresses allowed to connect
example:
- 10.0.0.2/32
items:
type: string
type: array
x-go-name: Address
allowedIPs:
description: IP addresses allowed to connect
example:
- 0.0.0.0/0
- ::/0
items:
type: string
type: array
x-go-name: AllowedIPs
created:
description: Time the client is created
example: 1642409076544
format: int64
type: integer
x-go-name: Created
createdBy:
description: Denoting person creates the client
example: jonsnow@mail.com
type: string
x-go-name: CreatedBy
email:
description: Email that the client device belongs
example: jonsnow@mail.com
type: string
x-go-name: Email
enable:
description: Status signal for client
example: true
type: boolean
x-go-name: Enable
ignorePersistentKeepalive:
example: true
type: boolean
x-go-name: IgnorePersistentKeepalive
name:
description: Name of the client
example: jon snow
type: string
x-go-name: Name
presharedKey:
description: Preshared key for the client
example: twDZk0lehYtst3Zclb+SRniVfoHnug9N6gjxuaipcvc=
type: string
x-go-name: PresharedKey
privateKey:
description: Private key for the client
example: KFOyCoR9Eq+LpqT9VzJCilXYmFwhMFw7UDkdRRxoWVg=
type: string
x-go-name: PrivateKey
publicKey:
description: Public key for the client
example: YeT/lG9L4AeYOHNrkohnmXfljx3/JgThulskllayxi4=
type: string
x-go-name: PublicKey
tags:
description: Tags for client device
example:
- laptop
- PC
items:
type: string
type: array
x-go-name: Tags
updated:
description: Time the client is last updated
example: 1642409076544
format: int64
type: integer
x-go-name: Updated
updatedBy:
description: Denoting person updates the client
example: jonsnow@mail.com
type: string
x-go-name: UpdatedBy
uuid:
description: Client identifier
example: 6c8ff96f-ce8a-4c64-a76d-07e9af0b75ab
type: string
x-go-name: UUID
required:
- uuid
- name
- tags
- email
- enable
- allowedIPs
- address
- updatedBy
type: object
x-go-package: _/home/sambath/Golang/Revotic-Engineering/erebrus/api/v1/client
Server:
properties:
address:
description: Server address
example:
- 10.0.0.1/24
items:
type: string
type: array
x-go-name: Address
allowedips:
description: IP addresses allowed to connect
example:
- 0.0.0.0/0
- ::/0
items:
type: string
type: array
x-go-name: AllowedIPs
created:
description: Time when server is created
example: 26103870
format: int64
type: integer
x-go-name: Created
dns:
description: DNS of the VPN server
example:
- 1.1.1.1
items:
type: string
type: array
x-go-name: DNS
endpoint:
description: Endpoint of the server
example: region.example.com
type: string
x-go-name: Endpoint
listenPort:
description: Port the server listens
example: 51280
format: int64
type: integer
x-go-name: ListenPort
mtu:
format: int64
type: integer
x-go-name: Mtu
persistentKeepalive:
description: Persistent keep alive for server
example: 16
format: int64
type: integer
x-go-name: PersistentKeepalive
postDown:
description: Post down command
example: iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j
ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
type: string
x-go-name: PostDown
postUp:
description: Post up command
example: iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j
ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
type: string
x-go-name: PostUp
preDown:
description: Pre down command
example: echo WireGuard PreDown
type: string
x-go-name: PreDown
preUp:
description: Pre up command
example: echo WireGuard PreUp
type: string
x-go-name: PreUp
privateKey:
description: Private key for the server
example: UFWsgb/Ax5B8zZGx0YtHBAuQVRrOHrxKz2zS2p1LuUE=
type: string
x-go-name: PrivateKey
publicKey:
description: Public key for the server
example: T5ZMOnik3YuaRhZgAhcxXrmn2+C0B7qFaqnCypMMcks=
type: string
x-go-name: PublicKey
updated:
description: Time when server is created
example: 26103870
format: int64
type: integer
x-go-name: Updated
updatedBy:
description: Updater email address
example: admin@mail.com
type: string
x-go-name: UpdatedBy
type: object
x-go-package: _/home/sambath/Golang/Revotic-Engineering/erebrus/api/v1/server
Status:
properties:
Domain:
description: Domain which server is running
example: vpn.example.com
type: string
Hostname:
description: Server Hostname
example: ubuntu
type: string
HttpPort:
description: Port which HTTP service is running
example: "4000"
type: string
PrivateIP:
description: Private IP of server host
example: 10.0.1.5
type: string
PublicIP:
description: Server's public IP
example: 14.10.35.65
type: string
Region:
description: Region where server running
example: India/Banglore
type: string
VPNPort:
description: VPN port
example: "5128"
type: string
Version:
description: Server version
example: "1.0"
type: string
gRPCPort:
description: Port which gRPC service is running
example: "5000"
type: string
x-go-name: GRPCPort
type: object
x-go-package: _/home/sambath/Golang/Revotic-Engineering/erebrus/api/v1/server
host: localhost
info:
contact:
email: sachinmugu@gmail.com
name: Sambath Kumar
description: |-
Erebrus is an open source VPN solution from The NetSepio, that helps to deploy your own VPN solution in
minutes.The vision of Erebrus is to deliver Cyber security to everyone .
Features of Erebrus were, Easy Client and Server management, Supports REST and gRPC, Email VPN configuration to clients easily.
This documentation guides you, How to use Erebrus endpoints and It's Request and Response briefly.
license:
name: GPL-3.0
url: https://opensource.org/licenses/GPL-3.0
title: Erebrus
version: 1.0.0
paths:
/client:
get:
description: Get all clients in the server.
operationId: readClients
responses:
"200":
$ref: '#/responses/clientsSucessResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
summary: Read All Clients
tags:
- Client
post:
description: Create client based on the given client model.
operationId: createClient
parameters:
- description: Requestbody used for create and update client operations.
in: body
name: client
schema:
$ref: '#/definitions/ClientReq'
x-go-name: Body
responses:
"201":
$ref: '#/responses/clientSucessResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
summary: Create client
tags:
- Client
/client/{id}:
delete:
description: Delete client based on the given uuid.
operationId: deleteClient
parameters:
- description: The Identifier of the Client
in: path
name: id
required: true
type: string
x-go-name: Id
responses:
"200":
$ref: '#/responses/sucessResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
summary: Delete client
tags:
- Client
get:
description: Return client based on the given uuid.
operationId: readClient
parameters:
- description: The Identifier of the Client
in: path
name: id
required: true
type: string
x-go-name: Id
responses:
"200":
$ref: '#/responses/clientSucessResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
summary: Read client
tags:
- Client
patch:
description: Update client based on the given uuid and client model.
operationId: updateClient
parameters:
- description: The Identifier of the Client
in: path
name: id
required: true
type: string
x-go-name: Id
- description: Requestbody used for create and update client operations.
in: body
name: client
schema:
$ref: '#/definitions/ClientUpdateReq'
x-go-name: Body
responses:
"200":
$ref: '#/responses/clientSucessResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
summary: Update client
tags:
- Client
/client/{id}/config:
get:
description: Return client configuration file in byte format based on the given
uuid.
operationId: configClient
parameters:
- description: The Identifier of the Client
in: path
name: id
required: true
type: string
x-go-name: Id
produces:
- application/octet-stream
- application/json
responses:
"200":
$ref: '#/responses/configResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
summary: Get client configuration
tags:
- Client
/client/{id}/email:
get:
description: Email the configuration file of the client to the email associated
with client.
operationId: emailClient
parameters:
- description: The Identifier of the Client
in: path
name: id
required: true
type: string
x-go-name: Id
responses:
"200":
$ref: '#/responses/sucessResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
summary: Email client Configuration
tags:
- Client
/server:
get:
description: Retrieves the server details.
operationId: readServer
responses:
"200":
$ref: '#/responses/serverSucessResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
summary: Read Server
tags:
- Server
patch:
description: Update the server with given details.
operationId: updateServer
parameters:
- description: Requestbody used for update server operations.
in: body
name: server
schema:
$ref: '#/definitions/Server'
x-go-name: Body
responses:
"200":
$ref: '#/responses/serverSucessResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
summary: Update Server
tags:
- Server
/server/config:
get:
description: |-
Get Server Configuration
Retrieves the server configuration details.
operationId: configServer
responses:
"200":
$ref: '#/responses/configResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
tags:
- Server
/server/status:
get:
description: Retrieves the server status details.
operationId: statusServer
responses:
"200":
$ref: '#/responses/serverStatusResponse'
"400":
$ref: '#/responses/badRequestResponse'
"401":
$ref: '#/responses/unauthorizedResponse'
"500":
$ref: '#/responses/serverErrorResponse'
summary: Get Server status
tags:
- Server
produces:
- application/json
- application/x-protobuf
- application/config
responses:
badRequestResponse:
description: ""
schema:
properties:
Error:
example: error message
type: string
Status:
example: 400
format: int64
type: integer
Sucess:
example: false
type: boolean
type: object
clientSucessResponse:
description: ""
schema:
properties:
Message:
example: sucess message
type: string
Status:
example: 201
format: int64
type: integer
Sucess:
example: true
type: boolean
client:
$ref: '#/definitions/Client'
type: object
clientsSucessResponse:
description: ""
schema:
properties:
Message:
example: sucess message
type: string
Status:
example: 201
format: int64
type: integer
Sucess:
example: true
type: boolean
clients:
items:
$ref: '#/definitions/Client'
type: array
x-go-name: Body
type: object
configResponse:
description: ""
schema:
properties:
content:
example: File Download
type: string
x-go-name: Data
type: object
serverErrorResponse:
description: ""
schema:
properties:
Error:
example: error message
type: string
Status:
example: 500
format: int64
type: integer
Sucess:
example: false
type: boolean
type: object
serverStatusResponse:
description: ""
schema:
$ref: '#/definitions/Status'
serverSucessResponse:
description: ""
schema:
properties:
Message:
example: sucess message
type: string
Status:
example: 201
format: int64
type: integer
Sucess:
example: true
type: boolean
server:
$ref: '#/definitions/Server'
type: object
sucessResponse:
description: ""
schema:
properties:
Message:
example: sucess message
type: string
Status:
example: 200
format: int64
type: integer
Sucess:
example: true
type: boolean
type: object
unauthorizedResponse:
description: ""
schema:
properties:
Error:
example: error message
type: string
Status:
example: 401
format: int64
type: integer
Sucess:
example: false
type: boolean
type: object
schemes:
- http
- https
swagger: "2.0"