polaris-vpn 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.0] - 2026-07-12
9
+
10
+ ### Added
11
+
12
+ - **First-Class Windows Support**: Polaris now natively binds to `wireguard.exe` NT Services on Windows, bypassing the need for `wg-quick` and `sudo`. This makes Polaris fully cross-platform.
13
+
8
14
  ## [0.5.0] - 2026-07-12
9
15
 
10
16
  ### Added
package/README.md CHANGED
@@ -4,10 +4,12 @@
4
4
 
5
5
  Your True North in Digital Privacy. `polaris` is a production-quality, open-source, self-hosted VPN CLI tool. It wraps SSH dynamic port forwarding into a beautiful CLI experience.
6
6
 
7
- ## Prerequisites
7
+ ### Prerequisites
8
8
 
9
- - SSH access to any VPS (Virtual Private Server).
10
- - Node.js >= 18
9
+ - Node.js (v18+)
10
+ - SSH access to a remote Linux VPS (Ubuntu/Debian recommended)
11
+ - **Linux/macOS**: `sudo` privileges for configuring WireGuard and network routes locally.
12
+ - **Windows**: The official [WireGuard for Windows](https://www.wireguard.com/install/) client must be installed, and `polaris` must be run from an Administrator prompt.
11
13
 
12
14
  We highly recommend **Oracle Cloud Free Tier** for your VPS.
13
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polaris-vpn",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Your True North in Digital Privacy. A self-hosted VPN CLI.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/tunnel/wg.js CHANGED
@@ -27,10 +27,27 @@ export const generateKeyPair = () => {
27
27
  };
28
28
  };
29
29
 
30
+ import os from 'os';
31
+ import path from 'path';
32
+
30
33
  export const startWgTunnel = (confPath, isJson = false) => {
31
- const sudoCheck = spawnSync('sudo', ['-n', 'true']);
32
- if (sudoCheck.status !== 0 && isJson) {
33
- throw new Error('Sudo privileges required. Please run with "sudo polaris start ..." for JSON mode.');
34
+ const isWin = os.platform() === 'win32';
35
+
36
+ if (!isWin) {
37
+ const sudoCheck = spawnSync('sudo', ['-n', 'true']);
38
+ if (sudoCheck.status !== 0 && isJson) {
39
+ throw new Error('Sudo privileges required. Please run with "sudo polaris start ..." for JSON mode.');
40
+ }
41
+ }
42
+
43
+ if (isWin) {
44
+ const res = spawnSync('wireguard', ['/installtunnelservice', confPath], {
45
+ stdio: isJson ? 'ignore' : 'inherit'
46
+ });
47
+ if (res.status !== 0) {
48
+ throw new Error(`wireguard /installtunnelservice failed (ensure Admin privileges) with code ${res.status}`);
49
+ }
50
+ return process.pid;
34
51
  }
35
52
 
36
53
  const res = spawnSync('sudo', ['wg-quick', 'up', confPath], {
@@ -44,9 +61,24 @@ export const startWgTunnel = (confPath, isJson = false) => {
44
61
  };
45
62
 
46
63
  export const stopWgTunnel = (confPath, isJson = false) => {
47
- const sudoCheck = spawnSync('sudo', ['-n', 'true']);
48
- if (sudoCheck.status !== 0 && isJson) {
49
- throw new Error('Sudo privileges required. Please run with "sudo polaris stop" for JSON mode.');
64
+ const isWin = os.platform() === 'win32';
65
+
66
+ if (!isWin) {
67
+ const sudoCheck = spawnSync('sudo', ['-n', 'true']);
68
+ if (sudoCheck.status !== 0 && isJson) {
69
+ throw new Error('Sudo privileges required. Please run with "sudo polaris stop" for JSON mode.');
70
+ }
71
+ }
72
+
73
+ if (isWin) {
74
+ const interfaceName = path.parse(confPath).name;
75
+ const res = spawnSync('wireguard', ['/uninstalltunnelservice', interfaceName], {
76
+ stdio: isJson ? 'ignore' : 'inherit'
77
+ });
78
+ if (res.status !== 0) {
79
+ throw new Error(`wireguard /uninstalltunnelservice failed with code ${res.status}`);
80
+ }
81
+ return;
50
82
  }
51
83
 
52
84
  const res = spawnSync('sudo', ['wg-quick', 'down', confPath], {