itsi-server 0.2.4 → 0.2.5

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: '09f3db1a1f234effca0f069532c406269afd5d97fd94f2bd84e0897794111c94'
4
- data.tar.gz: 9b58b1c27aa1be97ffbcda9f58d7d10773c34ec17ed2f8266f7b4515a1916866
3
+ metadata.gz: e905bf6be508587ee73d0f537d422cb9dac5649529784b9009d7b206f4e1f338
4
+ data.tar.gz: 850add0021ebbace5ff48a990ddbef13154355cc9009d09275d9ebf3d11064dd
5
5
  SHA512:
6
- metadata.gz: 4b0adee39683e6aa6d8fde02c7caeb448924090c85db779cd210ddc01a6b1ded6944604e16b17a9e18cf8833a8565c6473d3761c0015ab13af56570f0b769850
7
- data.tar.gz: 2733bfcbb217c88fb2c49f577eb764952551c2c0f6f0be6435505eb55334276367d3ef854bb3aed054f33c192c4c7b5ee02a2ca90d0abf2249b991b1d9a531fd
6
+ metadata.gz: a0569596062fafb1a7613e6dad2db993c99b9e0bec881eedb068938cba60a4646d0b8cd91ff9b74e2bbb25fb2ec6698e58f566265cb6a89a65d088cffbc66b3d
7
+ data.tar.gz: 8f0d9a03c1997da8c03752453af45b7732c13dcf44e6c939b7ad010b919052851f411269c6a0b7427ec53c4a1cbf2fd73f0d8a778e5e1ddc715e4c287c009d92
data/Cargo.lock CHANGED
@@ -1644,7 +1644,7 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
1644
1644
 
1645
1645
  [[package]]
1646
1646
  name = "itsi-server"
1647
- version = "0.2.4"
1647
+ version = "0.2.5"
1648
1648
  dependencies = [
1649
1649
  "argon2",
1650
1650
  "async-channel",
@@ -159,7 +159,6 @@ where
159
159
  eprintln!("Thread killed");
160
160
  break;
161
161
  }
162
- eprintln!("Killing thread {:?}", thr.as_value());
163
162
  thr.funcall::<_, _, Value>("terminate", ())
164
163
  .expect("Failed to kill thread");
165
164
  }
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "itsi-scheduler"
3
- version = "0.2.4"
3
+ version = "0.2.5"
4
4
  edition = "2021"
5
5
  authors = ["Wouter Coppieters <wc@pico.net.nz>"]
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "itsi-server"
3
- version = "0.2.4"
3
+ version = "0.2.5"
4
4
  edition = "2021"
5
5
  authors = ["Wouter Coppieters <wc@pico.net.nz>"]
6
6
  license = "MIT"
@@ -33,12 +33,12 @@ module Itsi
33
33
  @params[:key_id_source] = nil
34
34
  end
35
35
 
36
- if File.exist?(".itsi-credentials") && !@params[:credential_file]
37
- @params[:credential_file] = ".itsi-credentials"
36
+ if File.exist?(".itsi-credentials") && !@params[:credentials_file]
37
+ @params[:credentials_file] = ".itsi-credentials"
38
38
  end
39
39
 
40
- if @params[:credential_file] && File.exist?(@params[:credential_file])
41
- @params[:valid_keys] = Passfile.load(@params[:credential_file])
40
+ if @params[:credentials_file] && File.exist?(@params[:credentials_file])
41
+ @params[:valid_keys] = Passfile.load(@params[:credentials_file])
42
42
  end
43
43
 
44
44
  unless @params[:valid_keys]&.any?
@@ -21,16 +21,18 @@ module Itsi
21
21
 
22
22
  def initialize(location, params={})
23
23
  super
24
+
24
25
  unless @params[:credential_pairs]&.any?
25
- if File.exist?(".itsi-credentials") && !@params[:credential_file]
26
- @params[:credential_file] = ".itsi-credentials"
26
+ if File.exist?(".itsi-credentials") && !@params[:credentials_file]
27
+ @params[:credentials_file] = ".itsi-credentials"
27
28
  end
28
29
 
29
- if @params[:credential_file] && File.exist?(@params[:credential_file])
30
- @params[:credential_pairs] = Passfile.load(@params[:credential_file])
30
+ if @params[:credentials_file] && File.exist?(@params[:credentials_file])
31
+ @params[:credential_pairs] = Passfile.load(@params[:credentials_file])
31
32
  end
32
33
  end
33
34
 
35
+ raise "No credentials provided" unless @params[:credential_pairs]
34
36
  @params[:credential_pairs].compact!
35
37
 
36
38
  unless @params[:credential_pairs]&.any?
@@ -63,9 +63,9 @@ module Itsi
63
63
  root_dir = @params[:root_dir] || "."
64
64
 
65
65
  if !File.exist?(root_dir)
66
- warn "Warning: static_assets root_dir '#{root_dir}' does not exist!"
66
+ raise "Warning: static_assets root_dir '#{root_dir}' does not exist!"
67
67
  elsif !File.directory?(root_dir)
68
- warn "Warning: static_assets root_dir '#{root_dir}' is not a directory!"
68
+ raise "Warning: static_assets root_dir '#{root_dir}' is not a directory!"
69
69
  end
70
70
 
71
71
  @params[:relative_path] = true unless @params.key?(:relative_path)
@@ -18,20 +18,24 @@ For the best development experience, be sure to use [RubyLSP](https://shopify.gi
18
18
 
19
19
  ```ruby {filename="Itsi.rb"}
20
20
  workers 2
21
+
21
22
  threads 2
22
- scheduler_threads 3
23
23
 
24
24
  fiber_scheduler true
25
25
 
26
- rate_limiter requests: 100, seconds: 10
26
+ auth_basic realm: "Restricted Area", credentials_file: "./credentials.txt"
27
+
28
+ auto_reload_config! # Auto-reload the server configuration each time it changes.
27
29
 
28
- auth_basic realm: "Restricted Area", credentials_file: "credentials.txt"
30
+ location "/app*" do
31
+ rate_limit requests: 3, seconds: 5
32
+ rackup_file "config.ru"
33
+ end
29
34
 
30
- location "/app" do
35
+ location "/inline*" do
31
36
  get "/" do |req|
32
37
  req.ok "Hello, World!"
33
38
  end
34
39
  end
35
-
36
40
  ```
37
41
  {{< /details >}}
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Itsi
4
4
  class Server
5
- VERSION = "0.2.4"
5
+ VERSION = "0.2.5"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itsi-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter Coppieters