{"action":"closed","issue":{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/86","labels_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/86/comments","events_url":"https://api.github.com/repos/Cardshifter/Cardshifter/issues/86/events","html_url":"https://github.com/Cardshifter/Cardshifter/issues/86","id":45664805,"number":86,"title":"Create example server settings to use for sandboxed mods","user":{"login":"skiwi2","id":2961606,"avatar_url":"https://avatars.githubusercontent.com/u/2961606?v=3","gravatar_id":"","url":"https://api.github.com/users/skiwi2","html_url":"https://github.com/skiwi2","followers_url":"https://api.github.com/users/skiwi2/followers","following_url":"https://api.github.com/users/skiwi2/following{/other_user}","gists_url":"https://api.github.com/users/skiwi2/gists{/gist_id}","starred_url":"https://api.github.com/users/skiwi2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skiwi2/subscriptions","organizations_url":"https://api.github.com/users/skiwi2/orgs","repos_url":"https://api.github.com/users/skiwi2/repos","events_url":"https://api.github.com/users/skiwi2/events{/privacy}","received_events_url":"https://api.github.com/users/skiwi2/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/labels/documentation","name":"documentation","color":"000000"},{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/labels/security","name":"security","color":"f7c6c7"},{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/labels/server","name":"server","color":"eb6420"}],"state":"closed","locked":false,"assignee":{"login":"skiwi2","id":2961606,"avatar_url":"https://avatars.githubusercontent.com/u/2961606?v=3","gravatar_id":"","url":"https://api.github.com/users/skiwi2","html_url":"https://github.com/skiwi2","followers_url":"https://api.github.com/users/skiwi2/followers","following_url":"https://api.github.com/users/skiwi2/following{/other_user}","gists_url":"https://api.github.com/users/skiwi2/gists{/gist_id}","starred_url":"https://api.github.com/users/skiwi2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skiwi2/subscriptions","organizations_url":"https://api.github.com/users/skiwi2/orgs","repos_url":"https://api.github.com/users/skiwi2/repos","events_url":"https://api.github.com/users/skiwi2/events{/privacy}","received_events_url":"https://api.github.com/users/skiwi2/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Cardshifter/Cardshifter/milestones/3","labels_url":"https://api.github.com/repos/Cardshifter/Cardshifter/milestones/3/labels","id":821776,"number":3,"title":"0.5","description":"","creator":{"login":"Zomis","id":1405379,"avatar_url":"https://avatars.githubusercontent.com/u/1405379?v=3","gravatar_id":"","url":"https://api.github.com/users/Zomis","html_url":"https://github.com/Zomis","followers_url":"https://api.github.com/users/Zomis/followers","following_url":"https://api.github.com/users/Zomis/following{/other_user}","gists_url":"https://api.github.com/users/Zomis/gists{/gist_id}","starred_url":"https://api.github.com/users/Zomis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zomis/subscriptions","organizations_url":"https://api.github.com/users/Zomis/orgs","repos_url":"https://api.github.com/users/Zomis/repos","events_url":"https://api.github.com/users/Zomis/events{/privacy}","received_events_url":"https://api.github.com/users/Zomis/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":15,"state":"open","created_at":"2014-10-10T23:19:10Z","updated_at":"2015-02-12T12:31:59Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2014-10-13T17:10:27Z","updated_at":"2015-02-12T12:31:59Z","closed_at":"2015-02-12T12:31:59Z","body":"With the sandboxed mods implemented in the unit tests, we now need to get them working on the server.\r\n\r\nThis has to be done by running the server with the JVM arguments ```-Djava.security.manager -Djava.security.policy==path/to/java.policy```, the exact syntax used here needs to be preserved, so exactly with the double equal sign.\r\n\r\nFor the java.policy file we need to give the executing code the permissions it needs, this is the example from the unit tests:\r\n\r\n```\r\ngrant codeBase \"file:./-\" {\r\n\tpermission java.security.AllPermission;\r\n};\r\n\r\ngrant codeBase \"file:../cardshifter-modapi/target/-\" {\r\n\tpermission java.security.AllPermission;\r\n};\r\n\r\ngrant codeBase \"file:${user.home}/.m2/repository/org/apache/maven/surefire/-\" {\r\n\tpermission java.security.AllPermission;\r\n};\r\n\r\ngrant codeBase \"file:${user.home}/.m2/repository/junit/-\" {\r\n\tpermission java.security.AllPermission;\r\n};\r\n\r\n//when ${java.home} is set to point to the JDK\r\ngrant codeBase \"file:${java.home}/../lib/tools.jar\" {\r\n\tpermission java.security.AllPermission;\r\n};\r\n\r\n//when ${java.home} is set to point to the JRE\r\ngrant codeBase \"file:${java.home}/lib/tools.jar\" {\r\n\tpermission java.security.AllPermission;\r\n};\r\n\r\ngrant {\r\n\t//mod permissions\r\n};\r\n```\r\n\r\nPlease note that the permissions in .m2 are for the unit tets, and the permissions on tools.jar are for the JavaCompiler used in the unit tests."}}