Skip to content

Commit 607677c

Browse files
committed
change readme
1 parent 7040e05 commit 607677c

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

README.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,22 @@ cee
6363

6464
IMPORTANT: There are no security modules available for windows!
6565

66-
**The useLXC Option is currently under maintenance! Don't execute untrusted code with this package.**
67-
6866
```javascript
6967
const cee = require("code-execution-engine");
7068

71-
const options = {
72-
security: {
73-
useLXC: true, // defaults to false
74-
timeout: 10, // 10 seconds timeout
75-
},
76-
};
69+
const executor = cee.LXC("[NAME OF YOUR LXC-CONTAINER]");
70+
71+
// Run this line after the installation of the container
72+
executor.init();
7773

78-
cee.execute("print('Hi!')", cee.languages.PYTHON3, options);
74+
executor
75+
.execute("echo 'Im in a secure environment!'", cee.languages.BASH)
76+
.then((result) => {
77+
console.log(result);
78+
})
79+
.catch((error) => {
80+
console.error(error);
81+
});
7982
```
8083

8184
In order to use useLXC, follow the instructions below to setup LXC.
@@ -86,23 +89,9 @@ In order to use useLXC, follow the instructions below to setup LXC.
8689

8790
LXC are Linux containers, that run the code in a different and secure environment. To use them, you need to install them first. LXC are only available on Linux-Systems.
8891

89-
### Installation
92+
In order to use this package with LXC, you need to install an unprivileged container.
9093

91-
```sh
92-
$ sudo apt-get install lxc
93-
```
94-
95-
Create the Linux-Container
96-
97-
```sh
98-
$ lxc-create -t download -n cee
99-
```
100-
101-
Start the created container
102-
103-
```sh
104-
$ lxc-start -n cee -d
105-
```
94+
**Follow these instructions: [linuxcontainers.org](https://linuxcontainers.org/lxc/getting-started/#creating-unprivileged-containers-as-a-user)**
10695

10796
<a name="contributing"/>
10897

0 commit comments

Comments
 (0)