[Mod] Raspberry PI MC API for Python code [raspberryjammod]

cvincross
New member
 
Posts: 4
Joined: Thu Nov 02, 2017 13:53

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by cvincross » Tue Oct 30, 2018 02:37

have you added "secure.enable_security = true" to your minetest.conf? That is what fixed that error for me.
 

User avatar
rubenwardy
Moderator
 
Posts: 5499
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by rubenwardy » Tue Oct 30, 2018 02:41

GRudolph wrote:@jocsamazon
I would like to know what specific changes you made in order to run minetest with raspberryjammod?
I am running Windows 10, Minetest 0.4.17.1 and Python 3.6.5.
I have replaced the mcpipy files as you indicated in your post quoted above, but the mod fails to load with the following error, and as a result, I cannot even test the Python scripts.
So how do I fix this error and proceed


add this to minetest.conf:

Code: Select all
secure.trusted_mods = raspberryjammod


cvincross wrote:have you added "secure.enable_security = true" to your minetest.conf? That is what fixed that error for me.


Don't touch this setting! Mod security should never be disabled
 

cvincross
New member
 
Posts: 4
Joined: Thu Nov 02, 2017 13:53

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by cvincross » Tue Oct 30, 2018 20:45

rubenwardy wrote:
GRudolph wrote:@jocsamazon
I would like to know what specific changes you made in order to run minetest with raspberryjammod?
I am running Windows 10, Minetest 0.4.17.1 and Python 3.6.5.
I have replaced the mcpipy files as you indicated in your post quoted above, but the mod fails to load with the following error, and as a result, I cannot even test the Python scripts.
So how do I fix this error and proceed


add this to minetest.conf:

Code: Select all
secure.trusted_mods = raspberryjammod


cvincross wrote:have you added "secure.enable_security = true" to your minetest.conf? That is what fixed that error for me.


Don't touch this setting! Mod security should never be disabled


My mistake...so specifying this as "true" worked on one machine (oddly)... on another machine it only works with security disabled... which is a BAD idea for sure... but with security enabled I get a "require() is disabled" message. any ideas how to get around that?

This is on the latest 5.0.0dev on linux.
 

cvincross
New member
 
Posts: 4
Joined: Thu Nov 02, 2017 13:53

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by cvincross » Wed Oct 31, 2018 02:06

cvincross wrote:
rubenwardy wrote:
GRudolph wrote:@jocsamazon
I would like to know what specific changes you made in order to run minetest with raspberryjammod?
I am running Windows 10, Minetest 0.4.17.1 and Python 3.6.5.
I have replaced the mcpipy files as you indicated in your post quoted above, but the mod fails to load with the following error, and as a result, I cannot even test the Python scripts.
So how do I fix this error and proceed


add this to minetest.conf:

Code: Select all
secure.trusted_mods = raspberryjammod


cvincross wrote:have you added "secure.enable_security = true" to your minetest.conf? That is what fixed that error for me.


Don't touch this setting! Mod security should never be disabled


My mistake...so specifying this as "true" worked on one machine (oddly)... on another machine it only works with security disabled... which is a BAD idea for sure... but with security enabled I get a "require() is disabled" message. any ideas how to get around that?

This is on the latest 5.0.0dev on linux.


Again...my mistake... I just confirmed I can't get either machine to work with security turned on... so both return the error about require() being disabled by security. Any help would be appreciated. Does turning off security pose a serious security risk if it is being used as a self hosted single player session - ie without the server enabled?
 

User avatar
rubenwardy
Moderator
 
Posts: 5499
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by rubenwardy » Wed Oct 31, 2018 02:46

You need to change `require` this:

Code: Select all
local old_require = require
require = ie.require

local socket = require("socket")
-- any other sockets

require = old_require
 

cvincross
New member
 
Posts: 4
Joined: Thu Nov 02, 2017 13:53

Re: [Mod] Raspberry PI MC API for Python code [raspberryjamm

by cvincross » Wed Oct 31, 2018 04:03

rubenwardy wrote:You need to change `require` this:

Code: Select all
local old_require = require
require = ie.require

local socket = require("socket")
-- any other sockets

require = old_require


Ok, I am probably doing this wrong... but I made the above change to the init.lua of the mod and I'm not getting it to work. Am I wrapping just the socket "requires" with this redefinition or all of them? - there are three others that are not "sockets" sprinkled throughout the script. I'm not really clear on what this is accomplishing though...since the calls are already ie.require before I redefine require to be ie.require. please excuse my ignorance. Anyway... when I do this I end up with an error about attempting to index a nil value for "ie" - the same error I get if I don't include the mod in secure.trusted_mods
 

Previous

Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 13 guests