|
|
@ -5,7 +5,16 @@ require 'json' |
|
|
|
require 'uri' |
|
|
|
require 'openssl' |
|
|
|
|
|
|
|
norxondor_gorgonax = URI::MailTo::EMAIL_REGEXP |
|
|
|
shitlist_f = File.open(Dir.pwd+"/providers.json", "r") |
|
|
|
SHITLIST = shitlist_f.read |
|
|
|
shitlist_f.close |
|
|
|
def norxondor_gorgonax(email) |
|
|
|
# Step 1: |
|
|
|
return false unless email.match URI::MailTo::EMAIL_REGEXP |
|
|
|
# Step 2: |
|
|
|
return false unless (SHITLIST.include? "\"#{(email.match /(?<=@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\z/)[0]}\"") |
|
|
|
return true |
|
|
|
end |
|
|
|
config_file = File.new Dir.pwd+"/.config.json", "r" |
|
|
|
CONFIG = JSON.load(config_file) |
|
|
|
config_file.close |
|
|
@ -82,7 +91,7 @@ server = Hyde::Server.new Host: "192.168.1.27", Port: HTTP_PORT do |
|
|
|
expires_on = Time.now+60*60*2 |
|
|
|
# Match query parameters against given rules |
|
|
|
unless user.match /^[\w_-]+$/ and |
|
|
|
email.match norxondor_gorgonax and |
|
|
|
norxondor_gorgonax(email) and |
|
|
|
password.match /^.{8,}$/ then |
|
|
|
redirect server_uri+"/register/error.html" |
|
|
|
end |
|
|
|