From 41bb37b3c6caa5ccae6664a43f805805758d731a Mon Sep 17 00:00:00 2001 From: mewrrythekibby Date: Sat, 7 Feb 2026 17:36:50 -0600 Subject: [PATCH] make mildly safer --- mewny.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mewny.rb b/mewny.rb index 6dd35e6..827f1b4 100755 --- a/mewny.rb +++ b/mewny.rb @@ -17,11 +17,11 @@ options = { } OptionParser.new do |opt| opt.on('-pPORT', '--port PORT', Integer, - 'Port to serve/listen on (defaults to 7570)') do |o| + 'Port to serve/listen on (defaults to 7570)') do |o| options[:port] = o end opt.on('-S', '--server', - 'Make this instance function as a server.' + 'Make this instance function as a server' ) do options[:server] = true end @@ -44,11 +44,13 @@ OptionParser.new do |opt| ) do |o| options[:cols] = o end - opt.on('-X', '--public', + opt.on('--expose-this-instance-for-the-world-to-see-because-I-know-what-I\'m-doing [please]', # X -- eXposed - '(server only) Serve publicly, rather than privately' - ) do - options[:server_host] = PUBLIC_HOST + '(server only) Serve publicly, rather than privately. Please ONLY add this option if you entierly know what you\'re doing and have permission from/are the server owner. Say please to expose.' + ) do |o| + if o == "please" + options[:server_host] = PUBLIC_HOST + end end opt.on('-x', '--private', # x -- not visible @@ -80,6 +82,7 @@ def do_server puts "PORT: #{PORT}" puts "GRID SIZE: #{ROWS}r#{COLS}c" + if SRV_HOST == PUBLIC_HOST then puts "EXPOSED" end puts 'Listening...' pre = "#{ROWS}r#{COLS}c >>> "