โ๏ธ Configuration
One of the most important features in an Indirecta product is the ability to configure the most out of the product.
This document will document all TagRead configuration sections
๐ฐ๏ธ Idle Behaviorโ
Label
stringโDefault Room Name to display in the "Idle" frame along with the clock"Example Room"
IDLE_INTERVAL
numberโHow many seconds of inactivity after last mouse movement on display before the screen automatically turns off20
FORCE_CLOCK
booleanโIf enabled, forces the "Idle" frame and screen to remain off during inactivity.false
Use this in conjunction withNUM_KEYPAD
to display label & clock when TagRead is inactive, and numpad when the display is focusedCLOCK_FORMAT
string patternโos.date clock string format shown in "Idle" frame with room name"%H:%M"
Set to 24h by default, use"%I:%M %p"
for 12h (eg. 02:30 PM) and"%H:%M"
for 24h (eg. 14:40)
๐ถ NFC Behaviorโ
NFC_READING
booleanโtrue
Whether or not to listen passively for NFC-enabled keycards, fobs and devices. Turning this off will completely disable NFC functionality.
NFC_KEY
tableโ{"1234"}
The secret keys transmitted via NFC that should automatically unlock the connected doors or devices.
cautionMake sure to use a very long and unique secret key that will be the same contained in NFC Cards alike.
Since the NFC Protocol communicates from client to server, it allows for clients to send whatever they want.
Creating endless possibilities for integrations, and unfortunately also allowing key bruteforcing.
Future TagRead versions might reject NFC Keys that have low shannon entropy values.NFC_MAXWAIT
numberโ8
How much time to wait before relocking door after an authentication attempt (also timeout duration for data transmission)
NFC_SAVEBANDWITH
booleanโtrue
Attempts to figure out to which client the NFC tag belongs to instead of firing all clients
SECURITY_KICK
booleanโtrue
This will kick any player who responds to the data transfer remote
without providing the correct NFC part that touched the reader.
Use in pair with the previous setting for maximal NFC security.
๐ Localizationโ
Allows you to change the most important display strings
MSG_READING
stringโ"Hold your card near the screen"
MSG_UNLOCK
stringโ"Authenticated successfully"
MSG_FAIL
stringโ"Try bringing the device closer"
MSG_NUMPAD
stringโ"Input passcode"
MSG_TOTP
stringโ"One time pass"
MSG_KICK
stringโ"Detected NFC Remote Tampering"
๐ข Numpadโ
NUM_KEYPAD
booleanโfalse
Whether or not to enable number keypad mode, this will turn on instead of the clock and room name if
FORCE_CLOCK
is set to false.NUM_CODE
tableโ{"1234"}
One or more 6-10 digit pins. Players will have to input one of the codes correctly to unlock the system.
IfNUM_EXTRA_KEYS
is not enabled, this string of numbers should not contain 0.NUM_WAIT
numberโ8
How much time to wait (keep the door open) after authenticating, before relocking
If the authentication attempt fails (passcode is wrong!) the numpad will wait 0.45 seconds, clear the screen and automatically relock.NUM_EXTRA_KEYS
booleanโfalse
Whether or not to display extra numpad keys for more complex passcodes (, 0, #)
The and # keys are currently unused and are replaced by two dots.
๐ One Time Pass Authenticationโ
NUM_TOTP
booleanโWhenfalse
NUM_KEYPAD
is enabled, changes the valid passcode to that of a pre-configured one time pass.
This is the same 2FA Protocol used by services like Discord and offered by apps like Google Authenticator and Authy.
Pro tip: You can also use the 2FA iComm App for authentication!NUM_TOTP_INTERVAL
numberโDefault TOTP Interval (code change frequency), do not change this unless you know what you are doing30
NUM_TOTP_LENGTH
numberโDefault TOTP Length (code digit length), do not change this unless you know what you are doing6
NUM_TOTP_SECRET
stringโDefault TOTP Secret that generates all valid passcodes. This is 2FASTEST by default because it's also present on the iComm 2FA app and it can be tested"2FASTEST"
online using https://2fas.com/check-token/.
To use a custom secret on a 2FA App like Google Authenticator, you must use the sameNUM_TOTP_SECRET
chosen in this config and generate a valid 2FA QR Code
to scan with your phone using a website like this: https://stefansundin.github.io/2fa-qr/
๐ช Unlock & Relock Functions FUNCS
โ
The essential part to configure.
Since TagRead doesn't include any communicating door, you will have to integrate an existing door system's API using these two functions.
๐
UNLOCK
functionโFired when:
- โ NFC authenticates successfully
- Passcode is correct
- One time pass is correct
The connected door should open when this function is fired.
๐
RELOCK
functionโFired when:
- โ NFC authentication fails
- Passcode is wrong
- One time pass is wrong
- โฒ๏ธ Timeout: max time passes without any input
- Max time passes after successful authentication
The connected door should close if not already when this function is fired.
Make sure your UNLOCK
& RELOCK
are working! Infinite yields caused by code using :WaitForChild()
will cause
TagRead to freeze after attemtping to unlock or relock!
๐
_INTEGRATION_ON_NFC_TOUCH
functionโFired when any part touches the NFC Antenna (created only if NFC is enabled) This function can be used to integrate other card protocols and make them compatible with TagRead, implement whitelists, blacklists, the possibilities are endless!
If the function returns nil, the code will continue executing the ๐ NFC Authentication procedure
If it returns true, the reader will โ unlock the connected system, and false locks it as a โ failed auth attempt.
If the function returns something that's neither of those (e.g. an empty string), the NFC Authentication will halt,
but TagRead won't show any unlock or fail message.
๐ Add sound to TagReadโ
TagRead doesn't plan to include any built-in audios or media.
To add sound effects, you will have to create a Sound
instance, configure it, parent it to any part inside TagRead,
and handle sound playing inside the UNLOCK
& RELOCK
functions.
๐ Use the On NFC Touch Integrationโ
This section will include some examples for _ON_NFC_TOUCH integrations:
๐ฎ Try your luck!โ
This integration will unlock the connected system with a random 50/50 chance!
["_INTEGRATION_ON_NFC_TOUCH"] = function(self, script, part, config, notify)
-- Fired when NFC Antenna is touched by any part
notify(true, "๐ฎ", "Let's test your luck!", "")
wait(2)
if math.random(0,1) > 0 then return false end
return true
end,
๐ชช Whitelistโ
This integration will halt the NFC Authentication procedure if the player is not in the whitelist!
["_INTEGRATION_ON_NFC_TOUCH"] = function(self, script, part, config, notify)
-- Fired when NFC Antenna is touched by any part
local whitelist = {"Lxi099"}
local function FindPlayerAncestor(part)
local parent = part.Parent
if parent == nil then
return nil
end
if parent:FindFirstChild("Humanoid") then
return game:GetService("Players"):GetPlayerFromCharacter(parent)
elseif parent:IsA("DataModel") then
return nil
else
return FindPlayerAncestor(parent)
end
end
local Player = FindPlayerAncestor(part)
if Player and table.find(whitelist, Player.Name) then
return nil -- Continue with auth procedure
else
return "" -- Do absolutely nothing if the player is not whitelisted
end
end,
โ Error Screenโ
When a critical error is encountered, TagRead will completely halt it's own script to prevent security issues from arising.
The error screen contains similarly to other Indirecta products like the iComm, a QR Code and error hash to facilitate sharing.
Please send any unknown error screens over in a private ticket in our Discord server.
It is speculated that an error could occur between an unlock and relock cycle. This could leave the TagRead reader defenseless and the door unlocked.
It looks like this is impossible at the moment because of some countermeasures, but if it somehow happens, please also open a ticket.