iniquity 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/iniquity +85 -19
- metadata +4 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68911b879d4b7ef47ea9e1821a4f932514291821
|
4
|
+
data.tar.gz: ade9c48c3ea882765e6aa0a4cf1f73b65b2becff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c53f05b75f6f707c24f8aa3d4e637dc69d36377e04aa1ae5d88116f884ac53439872182f71b647881b25199ad4c4a9adb7a122cc226b7d2dc62de70922a2548f
|
7
|
+
data.tar.gz: bde980d8dbad9becadc5f412410495319f786aedbea8af12ca25841129bd4d44b87427e6bb1e998ce0548f2d352f61f885813e6be49fa1b71413ea822f629058
|
data/bin/iniquity
CHANGED
@@ -2,48 +2,114 @@
|
|
2
2
|
# encoding: UTF-8
|
3
3
|
|
4
4
|
BEGIN {
|
5
|
-
unless ARGV[0] || ENV["
|
6
|
-
abort "Please set the
|
5
|
+
unless ARGV[0] || ENV["INIQUITY_SYSTEM"]
|
6
|
+
abort "Please set the INIQUITY_SYSTEM environment variable."
|
7
7
|
end
|
8
8
|
}
|
9
9
|
|
10
|
-
HOME = ARGV[0] || ENV["
|
11
|
-
ENV["
|
10
|
+
HOME = ARGV[0] || ENV["INIQUITY_SYSTEM"]
|
11
|
+
ENV["INIQUITY_SYSTEM"] = HOME
|
12
12
|
|
13
|
-
require "iniquity"
|
14
13
|
require "inifile"
|
15
14
|
require "thin"
|
15
|
+
require "socksify"
|
16
16
|
|
17
|
-
|
17
|
+
if File.exists?(HOME+ "/iniquity.ini")
|
18
|
+
CONFIG = IniFile.load(HOME+ "/iniquity.ini")
|
19
|
+
else
|
20
|
+
abort "An Iniquity system must have an iniquity.ini file."
|
21
|
+
|
22
|
+
if CONFIG["tor"]["enabled"] == "yes"
|
23
|
+
TCPSocket::socks_server = CONFIG["tor"]["address"]
|
24
|
+
TCPSocket::socks_port = CONFIG["tor"]["port"]
|
25
|
+
end
|
26
|
+
|
27
|
+
class Telnet < EM::Connection
|
28
|
+
|
29
|
+
def initialize
|
30
|
+
super
|
31
|
+
send_data "\nIniquity BBS 0.0.3 - Telnet/UTF_8\n"
|
32
|
+
end
|
33
|
+
|
34
|
+
def post_init
|
35
|
+
|
36
|
+
puts "-- Someone connected to the Iniquity Telnet service."
|
37
|
+
|
38
|
+
#IO.readlines("./modules/welcome.ans").each do |line|
|
39
|
+
# send_data line.force_encoding(Encoding::IBM437).encode(Encoding::UTF_8)
|
40
|
+
#end
|
41
|
+
|
42
|
+
#def wrap(s, width=78)
|
43
|
+
# s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
|
44
|
+
#end
|
45
|
+
|
46
|
+
#send_data wrap("Eu duis consequat laborum sunt incididunt deserunt dolor nisi eu occaecat commodo ad. Reprehenderit aute laboris Lorem ex cillum ipsum laborum irure excepteur sint do pariatur Lorem sit. Aliqua ipsum dolor quis ea. Tempor non ipsum consequat proident fugiat ad id laboris aliquip amet magna.\n", 78)
|
47
|
+
end
|
48
|
+
|
49
|
+
def receive_data data
|
50
|
+
#send_data ">>>you sent: #{data}"
|
51
|
+
close_connection if data =~ /quit|q|goodbye|g|logoff|l/i
|
52
|
+
end
|
53
|
+
|
54
|
+
def unbind
|
55
|
+
puts "-- Someone disconnected from the Iniquity Telnet service."
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class Http < EM::Connection
|
60
|
+
def initialize
|
61
|
+
super
|
62
|
+
end
|
63
|
+
def post_init
|
64
|
+
end
|
65
|
+
def receive_data
|
66
|
+
end
|
67
|
+
def unbind
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
class Rest < EM::Connection
|
72
|
+
def initialize
|
73
|
+
super
|
74
|
+
end
|
75
|
+
def post_init
|
76
|
+
end
|
77
|
+
def receive_data
|
78
|
+
end
|
79
|
+
def unbind
|
80
|
+
end
|
81
|
+
end
|
18
82
|
|
19
83
|
EM.run do
|
20
84
|
|
21
|
-
###
|
85
|
+
### Events
|
22
86
|
|
23
87
|
EM.add_periodic_timer(15) do
|
24
|
-
puts "
|
88
|
+
puts "Event: Nothing to see here..."
|
25
89
|
end
|
26
90
|
|
27
|
-
|
91
|
+
### Services
|
28
92
|
|
29
|
-
|
93
|
+
CONFIG.each_section do |section|
|
30
94
|
|
31
|
-
if section == "
|
32
|
-
if
|
33
|
-
EM.start_server "0.0.0.0",
|
95
|
+
if section == "telnet"
|
96
|
+
if CONFIG[section]["enabled"] == "yes"
|
97
|
+
EM.start_server "0.0.0.0", CONFIG[section]["port"], Telnet
|
34
98
|
end
|
35
99
|
end
|
36
100
|
|
37
|
-
if section == "
|
38
|
-
if
|
39
|
-
EM.start_server "0.0.0.0",
|
101
|
+
if section == "http"
|
102
|
+
if CONFIG[section]["enabled"] == "yes"
|
103
|
+
EM.start_server "0.0.0.0", CONFIG[section]["port"], Http
|
40
104
|
end
|
41
105
|
end
|
42
106
|
|
43
|
-
if section == "
|
44
|
-
if
|
45
|
-
EM.start_server "0.0.0.0",
|
107
|
+
if section == "rest"
|
108
|
+
if CONFIG[section]["enabled"] == "yes"
|
109
|
+
EM.start_server "0.0.0.0", CONFIG[section]["port"], Rest
|
46
110
|
end
|
47
111
|
end
|
48
112
|
end
|
49
113
|
end
|
114
|
+
|
115
|
+
trap("INT") {exit}
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iniquity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Stephenson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: A re-imagining of the iconic BBS software.
|
14
14
|
email: ispyhumanfly@gmail.com
|
15
15
|
executables:
|
16
16
|
- iniquity
|
@@ -26,8 +26,6 @@ metadata:
|
|
26
26
|
post_install_message:
|
27
27
|
rdoc_options: []
|
28
28
|
require_paths:
|
29
|
-
- "./bin"
|
30
|
-
- "./lib"
|
31
29
|
- "./examples"
|
32
30
|
- "./docs"
|
33
31
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -45,5 +43,5 @@ rubyforge_project:
|
|
45
43
|
rubygems_version: 2.6.14
|
46
44
|
signing_key:
|
47
45
|
specification_version: 4
|
48
|
-
summary:
|
46
|
+
summary: Iniquity BBS
|
49
47
|
test_files: []
|