above 0.3.0 → 0.5.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: 06f99a9ac81e345a4b7298476432e22a3ea0fb3d74b83009e5635037355f6f8a
4
- data.tar.gz: 7dac2bef090f98497ba0a99e59c6cabe456e2758ec7e979e8eb91a337523f959
3
+ metadata.gz: 5612c5bffd82fc8913a314d9ffdcc68b1b0a77a13e0f1f70d1dc6d61462871e1
4
+ data.tar.gz: 5709b06bf8110367155de64452425176147987130b81c3e3e7c63380faeac750
5
5
  SHA512:
6
- metadata.gz: d60ef771694f50e5791b8aa3a62f01f46531accabbfbcbc7df9dba0df9a09951738dccd1530c145ff470a2736c7392d51a926b2b523a1dc5669bcd30270fbbfc
7
- data.tar.gz: af53e6beffc417e0ce830bee4f80dbd5f1e9d517fad26416d9cf8fe231a83ca6faa927b12fe63437fa5430c56ccc4ba38da910c87526183de5353db0159818d2
6
+ metadata.gz: 8daeed7a7d3d08adc4106fb0d0cebdb5a35e368e52909188cbba6d41ae5ec9048e337c0f35ef7b1c158e91e6fc926e5c1d6652582a5a0e0dac37db414d7dd20c
7
+ data.tar.gz: abd5f52d807b0734ff31b9228977b98c30e153fa43f6414c429ef75d0b0e9487ab85709177b5ffbf081d0f0b87c166b11624059f0430bf0aa2b9a5e8f5253c06
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Above Changelog
2
2
 
3
+ ## 0.4.0 - 6 September 2024
4
+
5
+ - breaking change - add ip address as a separate config value for the TCP listener
6
+ - add a Docker example
7
+ - refactor Config from a class to a module
8
+ - reconfigure Standard
9
+ - dependency updates, remove reek, add logger explicitly (leaving the standard library in 3.4)
10
+
3
11
  ## 0.3.0 - 27 August 2024
4
12
 
5
13
  - minor refactor, but includes the link to the repo from the Gemspec (sigh)
data/README.md CHANGED
@@ -1,44 +1,5 @@
1
1
  # Above
2
2
 
3
- An async Gemini Protocol server with support for multi-tenancy. Above supports middleware, with default middleware for blocking, naive in-memory caching, logging, redirects, & a static file server included. Also included are utilities for certificate creation & DNS-based authentication (DANE).
3
+ This gem is no longer maintained. Please see [mikekreuzer.com][mikekreuzer.com] for my more recent work.
4
4
 
5
- ## Status
6
-
7
- 3 - Alpha in Python terms.
8
-
9
- (Those Python statuses are 1 - Planning, 2 - Pre-alpha, 3 - Alpha, 4 - Beta, 5 - Production/Stable, 6 - Mature, 7 - Inactive.)
10
-
11
- Currently not handled:
12
- - user input or client certificates
13
- - proxy requests to other domains or protocols
14
- - anything not quite in the standard. Maybe...
15
-
16
- ## Why
17
-
18
- I've read that the heyday of the Gemini Protocol's passed. I don't know, even if it has passed it's still an interesting take on fixing some of what ails the web. If only to delve into the depths of TCP & TLS, & to appreciate again the wonders of HTTP.
19
-
20
- None of the other Gemini servers I looked at offered quite the same mix of features as Above in quite the same way. So here we are.
21
-
22
- ## Installation
23
-
24
- `gem install above`
25
-
26
- ## Usage
27
-
28
- ...
29
-
30
- ## Development
31
-
32
- After checking out the repo, run `bundle install` to install dependencies. Then, run `rake test` to run the tests.
33
-
34
- To install this gem locally, run `bundle exec rake local`.
35
-
36
- `bundle exec rake -T` to see the current options.
37
-
38
- ## Contributing
39
-
40
- Bug reports and pull requests are welcome at https://codeberg.org/kreuzer/above. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://codeberg.org/kreuzer/above/src/branch/main/CODE_OF_CONDUCT.md).
41
-
42
- ## Code of Conduct
43
-
44
- Everyone interacting in the Above project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://codeberg.org/kreuzer/above/src/branch/main/CODE_OF_CONDUCT.md).
5
+ [mikekreuzer.com]: https://mikekreuzer.com
data/bin/above CHANGED
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "lib")
5
5
 
6
- require 'bundler/setup'
7
- require 'above/cli'
6
+ require "bundler"
7
+ require "bundler/setup"
8
+ require "above/cli"
8
9
 
9
10
  Above::CLI.new.start
data/bin/console CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
- require 'above'
4
+ require "bundler/setup"
5
+ require "above"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -11,5 +11,5 @@ require 'above'
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require 'irb'
14
+ require "irb"
15
15
  IRB.start
data/lib/above/cli.rb CHANGED
@@ -4,6 +4,7 @@ require "optparse"
4
4
  require_relative "certs"
5
5
  require_relative "config"
6
6
  require_relative "server"
7
+ require_relative "version"
7
8
 
8
9
  module Above
9
10
  # CLI handled by optparse
@@ -75,8 +76,9 @@ module Above
75
76
  def start_server
76
77
  return unless @options[:server]
77
78
  dir = @options[:dir]
78
- config = Above::Config.new.read_config(dir:)
79
- config.each_pair do |server_name, server_hash|
79
+ Above::Config.init_dir unless dir
80
+ domains = Above::Config.read_config(dir:)
81
+ domains.each_pair do |server_name, server_hash|
80
82
  puts "Starting #{server_name}"
81
83
  server = Above::Server.new(config: server_hash)
82
84
  server.start
data/lib/above/config.rb CHANGED
@@ -7,21 +7,20 @@ require_relative "utils"
7
7
 
8
8
  module Above
9
9
  # Persist & use configuration
10
- class Config
11
- attr_reader :domains
12
-
13
- def self.config_dir
10
+ module Config
11
+ def config_dir
14
12
  File.join(Utils.home_dir, ".config/above")
15
13
  end
16
14
 
17
- def self.domains_dir
15
+ def domains_dir
18
16
  File.join(Config.config_dir, "domains")
19
17
  end
20
18
 
21
- def self.exemplar
19
+ def exemplar
22
20
  {
23
21
  "server" => {
24
22
  "domain" => "localhost",
23
+ "ip" => "0.0.0.0",
25
24
  "max_fibers" => 20,
26
25
  "port" => 1965,
27
26
  "tls_cert" => "/home/above/localhost.crt",
@@ -56,12 +55,8 @@ module Above
56
55
  }
57
56
  end
58
57
 
59
- def initialize
60
- init_dir
61
- end
62
-
63
58
  def init_dir
64
- if !File.exist?(Config.domains_dir)
59
+ unless File.exist?(Config.domains_dir)
65
60
  FileUtils.mkdir_p(Config.domains_dir)
66
61
  File.write(File.join(Config.config_dir, "example.yml"), Config.exemplar.to_yaml)
67
62
  puts "Configuration directory created"
@@ -74,7 +69,7 @@ module Above
74
69
 
75
70
  def read_config(dir: nil)
76
71
  dir ||= Config.domains_dir
77
- files = Dir[File.join(dir, "**/*.yml")]
72
+ files = Dir[File.join(dir, "*.yml")] # not subfolders
78
73
  domains = {}
79
74
  files.each do |file|
80
75
  hash = YAML.safe_load_file(file, permitted_classes: [Hash])
@@ -89,5 +84,7 @@ module Above
89
84
  end
90
85
  domains
91
86
  end
87
+
88
+ module_function :config_dir, :domains_dir, :exemplar, :init_dir, :read_config
92
89
  end
93
90
  end
@@ -60,7 +60,7 @@ module Above
60
60
  end
61
61
 
62
62
  def write(msg)
63
- # Standard library logger doesn't support write but it supports << which actually
63
+ # Standard library logger (to be removed in 3.4) doesn't support write but it supports << which actually
64
64
  # calls to write on the log device without formatting
65
65
  if @logger.respond_to?(:write)
66
66
  @logger.write(msg)
data/lib/above/server.rb CHANGED
@@ -45,7 +45,7 @@ module Above
45
45
  end
46
46
  end
47
47
 
48
- # Instantiate each middleware class with an app vairable pointing to the
48
+ # Instantiate each middleware class with an app variable pointing to the
49
49
  # next piece of middleware to call
50
50
  def middleware_init(middleware:)
51
51
  @middleware = []
@@ -128,7 +128,7 @@ module Above
128
128
  end
129
129
 
130
130
  def tls_server
131
- tcp_server = TCPServer.new(@server_config["domain"], @server_config["port"])
131
+ tcp_server = TCPServer.new(@server_config["ip"], @server_config["port"])
132
132
  ssl_ctx = OpenSSL::SSL::SSLContext.new.tap do |ctx|
133
133
  ctx.key = OpenSSL::PKey::EC.new(
134
134
  File.read(
data/lib/above/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Above
4
- VERSION = "0.3.0"
4
+ VERSION = "0.5.0"
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: above
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Kreuzer
@@ -35,7 +35,7 @@ cert_chain:
35
35
  YgqTixCwts6cQYIdYNFtJbzKvRNqyviKKxPaum7UWAv6Uy80gxgJ8p+fG81FsxbZ
36
36
  0ULnXrHlhf/CHs550TxRlXalgxBCImGdHzWjhdJeC1dZP3olgNtjO23ywtw=
37
37
  -----END CERTIFICATE-----
38
- date: 2024-08-27 00:00:00.000000000 Z
38
+ date: 2025-03-05 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: async
@@ -51,6 +51,26 @@ dependencies:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
53
  version: '2.15'
54
+ - !ruby/object:Gem::Dependency
55
+ name: logger
56
+ requirement: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.6'
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 1.6.1
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '1.6'
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 1.6.1
54
74
  - !ruby/object:Gem::Dependency
55
75
  name: marcel
56
76
  requirement: !ruby/object:Gem::Requirement
@@ -79,10 +99,10 @@ dependencies:
79
99
  - - "~>"
80
100
  - !ruby/object:Gem::Version
81
101
  version: '3.2'
82
- description: |
83
- An async Gemini Protocol server with support for multi-tenancy.
102
+ description: 'This gem is no longer maintained. Please see mikekreuzer.com for my
103
+ more recent work.
84
104
 
85
- Above supports middleware, with default middleware for blocking, naive in-memory caching, logging, redirects, & a static file server included. Also included are utilities for certificate creation & DNS-based authentication (DANE).
105
+ '
86
106
  email:
87
107
  - mike@mikekreuzer.com
88
108
  executables:
@@ -136,5 +156,6 @@ requirements: []
136
156
  rubygems_version: 3.5.17
137
157
  signing_key:
138
158
  specification_version: 4
139
- summary: A Gemini Protocol server
159
+ summary: This gem is no longer maintained. Please see mikekreuzer.com for my more
160
+ recent work.
140
161
  test_files: []
metadata.gz.sig CHANGED
Binary file