File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ export const WIREGUARD_COMMANDS = {
2+ ADD_PEER : ( comment : string , allowedAddress : string , key : string ) =>
3+ `/interface wireguard peers add comment="${ comment } " allowed-address=${ allowedAddress } interface=wg0 public-key="${ key } "` ,
4+ REMOVE_PEER : ( key : string ) => `/interface wireguard peers remove [find public-key="${ key } "]` ,
5+ LIST_PEERS : `/interface wireguard peers print` ,
6+ GET_INTERFACE_INFO : `/interface wireguard print` ,
7+ } ;
8+
9+ export const WIREGUARD_FIELDS = {
10+ LISTEN_PORT : 'listen-port=' ,
11+ PUBLIC_KEY : 'public-key='
12+ }
13+
14+ export const CLIENT_ADD_SUCCESS = 'VPN client added successfully' ;
15+
16+ export const CLIENT_REMOVE_SUCCESS = 'VPN client removed successfully' ;
17+
18+ export const CLIENT_ADD_FAILED = 'VPN client added failed' ;
19+
20+ export const CLIENT_REMOVE_FAILED = 'VPN client removal failed' ;
21+
22+ export const LIST_CLIENTS_ERROR = 'Error listing VPN clients' ;
23+
24+ export const PARSE_LISTEN_PORT_ERROR = 'Failed to retrieve listen-port from the WireGuard interface output' ;
25+
26+ export const PARSE_PUBLIC_KEY_ERROR = 'Failed to retrieve public-key from the WireGuard interface output' ;
27+
28+ export const NO_CLIENTS_FOUND = "No valid IP addresses found from the clients." ;
You can’t perform that action at this time.
0 commit comments