localvault 1.10.0 → 1.11.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89b873121ec4642cd62fc4b8e7d18fb5bf4dd7f456d0b25b9690a154d3392d51
4
- data.tar.gz: 90915ed8508f056077cc64ed5c06e9d6925f9c893c70daaf71727fcf4c5d852c
3
+ metadata.gz: 026a87452013bc8910082a3b582dcbdea76eb0bfccb0730f419e4f1a244b8d3d
4
+ data.tar.gz: 5365ca55bf39269fe4e722054a1d4e0af4ddbe3cf21de4027dcf09f004df6530
5
5
  SHA512:
6
- metadata.gz: dfcff8362dfd3ec7cbfa25fa4f8b0c599fe6584eedcea0c53f8e6515b028bfada2576cdcf7ef03e1ac130a083b4a869fbb5fe3ec282ab909a9a6f72a0affcdbb
7
- data.tar.gz: 85ba5c571866b4aa78ad40394d8ffcc3aedfaf6c8c9b5b1013042d1bc3e63ee5d9deb324e0fe8b52ddea8df7026cfa107d1e2b076b9cbf3e741d74d703d8f7aa
6
+ metadata.gz: 441807ea68cd2f70b0e746a320f7fd1ece69adb13ff3727b5357a4c43de3a077cb52827d57e60003624ef5b7a04f8200acb71f2ca197d1d5b34ce416cecdd0ce
7
+ data.tar.gz: 300fdd00e8b103ee0926ffcf4f45ce95a39a3a3cc0745c7f392177938dded7096518cfc9e014709304fc25b47305e3c38bc8ce3e01767d386fa220d2f554b186
@@ -468,8 +468,8 @@ module LocalVault
468
468
  $stderr.puts " localvault login YOUR_TOKEN"
469
469
  $stderr.puts
470
470
  $stderr.puts "Get your token at: https://inventlist.com/@YOUR_HANDLE/edit#developer"
471
- $stderr.puts "New to InventList? Sign up free at https://inventlist.com"
472
- $stderr.puts "Docs: https://inventlist.com/sites/localvault/series/localvault"
471
+ $stderr.puts "Or use your own server: localvault config set server URL (free InventList account: https://inventlist.com)"
472
+ $stderr.puts "Docs: https://kuickr.co/localvault/series"
473
473
  false
474
474
  end
475
475
 
@@ -94,8 +94,8 @@ module LocalVault
94
94
  $stderr.puts " localvault login YOUR_TOKEN"
95
95
  $stderr.puts
96
96
  $stderr.puts "Get your token at: https://inventlist.com/@YOUR_HANDLE/edit#developer"
97
- $stderr.puts "New to InventList? Sign up free at https://inventlist.com"
98
- $stderr.puts "Docs: https://inventlist.com/sites/localvault/series/localvault"
97
+ $stderr.puts "Or use your own server: localvault config set server URL (free InventList account: https://inventlist.com)"
98
+ $stderr.puts "Docs: https://kuickr.co/localvault/series"
99
99
  return
100
100
  end
101
101
 
@@ -119,9 +119,10 @@ module LocalVault
119
119
  super
120
120
  shell.say ""
121
121
  shell.say "GETTING STARTED"
122
- shell.say " localvault login [TOKEN] Log in to InventList (enables sync + team features)"
123
122
  shell.say " localvault init [NAME] Create a new encrypted vault"
124
123
  shell.say " localvault demo Create a demo vault to explore commands"
124
+ shell.say " localvault login [TOKEN] Log in to a sync server (enables sync + team features)"
125
+ shell.say " localvault config set server URL Use your own sync host (default: inventlist.com)"
125
126
  shell.say ""
126
127
  shell.say "SAFE SECRET INPUT (preferred over passing values as arguments)"
127
128
  shell.say " printf '%s' \"$SECRET\" | localvault set KEY --stdin"
@@ -760,13 +761,16 @@ module LocalVault
760
761
  $stdout.puts "Public key: #{Identity.public_key}"
761
762
  end
762
763
 
763
- desc "login [TOKEN]", "Log in to InventList — validate token, auto-keygen, publish public key"
764
+ desc "login [TOKEN]", "Log in to a sync server — validate token, auto-keygen, publish public key"
764
765
  method_option :status, type: :boolean, default: false, desc: "Show current login status"
766
+ method_option :server, type: :string, desc: "Sync server URL (persisted; defaults to https://inventlist.com)"
765
767
  def login(token = nil)
768
+ Config.api_url = options[:server] if options[:server]
769
+
766
770
  if options[:status]
767
771
  handle = Config.inventlist_handle
768
772
  if handle
769
- $stdout.puts "Logged in as @#{handle}"
773
+ $stdout.puts "Logged in as @#{handle} (server: #{Config.api_url})"
770
774
  else
771
775
  $stdout.puts "Not logged in. Run: localvault login TOKEN"
772
776
  end
@@ -776,13 +780,26 @@ module LocalVault
776
780
  unless token
777
781
  $stdout.puts "Usage: localvault login YOUR_TOKEN"
778
782
  $stdout.puts
779
- $stdout.puts "Get your token at: https://inventlist.com/@YOUR_HANDLE/edit#developer"
780
- $stdout.puts "New to InventList? Sign up free at https://inventlist.com"
783
+ $stdout.puts "Local vault encryption works without any account or server."
784
+ $stdout.puts "Sync and team features need a sync server. LocalVault is server-agnostic —"
785
+ $stdout.puts "pick either:"
786
+ $stdout.puts
787
+ $stdout.puts " 1. Your own host (any server implementing the 4-endpoint protocol):"
788
+ $stdout.puts " localvault config set server https://vaulthost.example"
789
+ $stdout.puts " localvault login YOUR_TOKEN"
790
+ $stdout.puts " (or one-shot: localvault login YOUR_TOKEN --server https://vaulthost.example)"
791
+ $stdout.puts
792
+ $stdout.puts " 2. InventList (free account):"
793
+ $stdout.puts " Sign up at https://inventlist.com, then get your token at"
794
+ $stdout.puts " https://inventlist.com/@YOUR_HANDLE/edit#developer"
781
795
  $stdout.puts
782
- $stdout.puts "LocalVault sync and team features require a free InventList account."
783
- $stdout.puts "Local vault encryption works without an account."
796
+ $stdout.puts "Login generates your X25519 keypair and publishes the public key"
797
+ $stdout.puts "automatically. To do it manually:"
798
+ $stdout.puts " localvault keys generate # create keypair in ~/.localvault/keys/"
799
+ $stdout.puts " localvault keys publish # upload public key so others can share with you"
800
+ $stdout.puts " localvault keys show # print your public key"
784
801
  $stdout.puts
785
- $stdout.puts "Docs: https://inventlist.com/sites/localvault/series/localvault"
802
+ $stdout.puts "Docs: https://kuickr.co/localvault/series"
786
803
  return
787
804
  end
788
805
 
@@ -798,15 +815,53 @@ module LocalVault
798
815
 
799
816
  client.publish_public_key(Identity.public_key)
800
817
 
801
- $stdout.puts "Logged in as @#{handle}"
802
- $stdout.puts "Public key published to your InventList profile."
818
+ $stdout.puts "Logged in as @#{handle} (server: #{Config.api_url})"
819
+ $stdout.puts "Public key published to your profile."
803
820
  $stdout.puts
804
- $stdout.puts "Next: localvault sync push # sync your vault to the cloud"
821
+ $stdout.puts "Next: localvault sync push # sync your vault to the server"
805
822
  rescue ApiClient::ApiError => e
806
823
  if e.status == 401
807
- $stdout.puts "Invalid token. Check your token at: https://inventlist.com/@YOUR_HANDLE/edit#developer"
824
+ $stdout.puts "Invalid token for #{Config.api_url}."
825
+ $stdout.puts "InventList tokens: https://inventlist.com/@YOUR_HANDLE/edit#developer"
826
+ else
827
+ $stdout.puts "Error connecting to #{Config.api_url}: #{e.message}"
828
+ end
829
+ end
830
+
831
+ desc "config SUBCOMMAND ...", "Get or set CLI configuration (currently: server)"
832
+ long_desc <<~DESC
833
+ Read or write LocalVault configuration in ~/.localvault/config.yml.
834
+
835
+ LocalVault is server-agnostic — point it at any host implementing the
836
+ sync protocol:
837
+
838
+ \x05 localvault config get server
839
+ \x05 localvault config set server https://vaulthost.example
840
+ \x05 localvault config unset server # back to https://inventlist.com
841
+ DESC
842
+ def config(action = "get", field = nil, value = nil)
843
+ unless field == "server" || (action == "get" && field.nil?)
844
+ return abort_with "Unknown config field '#{field}'. Supported: server"
845
+ end
846
+
847
+ case action
848
+ when "get"
849
+ $stdout.puts "server: #{Config.api_url}"
850
+ when "set"
851
+ return abort_with "Usage: localvault config set server URL" unless value
852
+ unless value.match?(%r{\Ahttps?://\S+\z})
853
+ return abort_with "Server must be an http(s) URL, e.g. https://vaulthost.example"
854
+ end
855
+ Config.api_url = value
856
+ $stdout.puts "server set to #{value}"
857
+ $stdout.puts "Note: tokens are per-server — run `localvault login YOUR_TOKEN` for this host."
858
+ when "unset"
859
+ data = Config.load
860
+ data.delete("api_url")
861
+ Config.save(data)
862
+ $stdout.puts "server reset to #{Config.api_url}"
808
863
  else
809
- $stdout.puts "Error connecting to InventList: #{e.message}"
864
+ abort_with "Usage: localvault config [get|set|unset] server [URL]"
810
865
  end
811
866
  end
812
867
 
@@ -1143,8 +1198,8 @@ module LocalVault
1143
1198
  $stderr.puts " localvault login YOUR_TOKEN"
1144
1199
  $stderr.puts
1145
1200
  $stderr.puts "Get your token at: https://inventlist.com/@YOUR_HANDLE/edit#developer"
1146
- $stderr.puts "New to InventList? Sign up free at https://inventlist.com"
1147
- $stderr.puts "Docs: https://inventlist.com/sites/localvault/series/localvault"
1201
+ $stderr.puts "Or use your own server: localvault config set server URL (free InventList account: https://inventlist.com)"
1202
+ $stderr.puts "Docs: https://kuickr.co/localvault/series"
1148
1203
  return
1149
1204
  end
1150
1205
 
@@ -1,3 +1,3 @@
1
1
  module LocalVault
2
- VERSION = "1.10.0"
2
+ VERSION = "1.11.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localvault
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nauman Tariq