You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-30Lines changed: 34 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Inspired by [NW.js] (http://nwjs.io/) and [Electron] (http://electron.atom.io/),
30
30
* Basic security restrictions are imposed on every Perl script.
31
31
* PEB can be started from any folder.
32
32
* PEB is usefull for both single-page or multi-page applications.
33
-
* Single file or multiple files, new filename, existing or new directory can be selected by user.
33
+
* Single file or multiple files, new filename, existing or new directory can be selected by user.
34
34
Their full paths are displayed in the calling local page and they can be supplied to local Perl scripts.
35
35
* Browser functions are accessible from special URLs.
36
36
* Any icon can be displayed on windows and message boxes.
@@ -65,7 +65,9 @@ Compiled and tested successfully using:
65
65
66
66
* Qt 5 libraries,
67
67
* Perl 5 distribution - any Linux, Mac or Windows Perl distribution.
68
-
[Strawberry Perl] (http://strawberryperl.com/) PortableZIP edition is successfully used with all Windows builds of PEB.
68
+
[Strawberry Perl] (http://strawberryperl.com/) PortableZIP edition is successfully used with all Windows builds of PEB.
69
+
[Perlbrew] (https://perlbrew.pl/) Perl distributions (5.18.4, 5.23.7) are successfully used with many Linux builds of PEB.
70
+
Being unable to start with administrative privileges PEB can use, but not abuse, any system Perl on PATH.
69
71
70
72
## How to Call Local Perl Scripts from a Local Page?
71
73
PEB recognizes two types of local Perl scripts: non-AJAX scripts and AJAX scripts.
@@ -216,6 +218,21 @@ JavaScript-based settings are created to facilitate the development of fully tra
216
218
```
217
219
218
220
221
+
## Security
222
+
223
+
**Security features based on C++ code:**
224
+
* PEB can not and does not download remote files on hard disk and can not execute any Perl scripts from remote locations.
225
+
* Users have no dialog to select arbitrary local scripts for execution by PEB. Only scripts within the ```{PEB_binary_directory}/resources/app``` directory can be executed if they are invoked from the PEB pseudo-domain: ```http://perl-executing-browser-pseudodomain/```.
226
+
* Starting PEB with administrative privileges is not allowed - it exits with a warning message.
227
+
* Perl 5 scripts are executed in a clean environment and only ```REQUEST_METHOD```, ```QUERY_STRING``` and ```CONTENT_LENGTH``` environment variables (borrowed from the CGI protocol) are used for communication between local HTML forms and local Perl scripts.
228
+
229
+
**Security features based on Perl code:**
230
+
* Perl scripts are executed in an ```eval``` function after banning potentially unsafe core functions. This feature is implemented in a special script named ```censor.pl```, which is compiled into the resources of the browser binary and is executed from memory when Perl script is started. All core functions from the :dangerous group - ```syscall```, ```dump``` and ```chroot```, as well as ```fork``` are banned. ```fork``` is banned to avoid any orphan processes, which may be created if this function is carelessly used.
231
+
* The environment of all Perl scripts is once again filtered in the ```BEGIN``` block of ```censor.pl``` to ensure no unwanted environment variables are inserted by the operating system.
232
+
233
+
**Perl Debugger Interaction:**
234
+
* Any Perl script can be selected for debugging, which is also a security risk. So if Perl debugger interaction is not needed, it can be turned off by a compile-time variable. Just change ```PERL_DEBUGGER_INTERACTION = 1``` to ```PERL_DEBUGGER_INTERACTION = 0``` in the project file of the browser (peb.pro) and compile the binary.
235
+
219
236
## Special URLs for Users and Interaction with Files and Folders
@@ -258,7 +275,7 @@ JavaScript-based settings are created to facilitate the development of fully tra
258
275
```inodeselection``` HTML event is emitted when the paths of the selected files are inserted into the calling local page.
259
276
Different file names are separated by a semicolon - ```;```
260
277
261
-
***Select new file name:**```http://perl-executing-browser-pseudodomain/new-file.function?target=DOM_element```
278
+
***Select new file name:**```http://perl-executing-browser-pseudodomain/new-file-name.function?target=DOM_element```
262
279
The full path of the new file name will be inserted in the target DOM element of the calling local page.
263
280
Having a target DOM element is mandatory when using this special URL.
264
281
```inodeselection``` HTML event is emitted when the new file name is inserted into the calling local page.
@@ -272,13 +289,14 @@ JavaScript-based settings are created to facilitate the development of fully tra
272
289
273
290
Please note that if you choose to create a new directory, it will be created immediately by PEB and it will be already existing when it will be passed to a local Perl script.
Any Perl script can be selected for debugging in an embedded HTML user interface. The debugger output is displayed together with the syntax highlighted source code of the debugged script and it's modules. Syntax highlighting is achieved using [Syntax::Highlight::Engine::Kate] (https://metacpan.org/release/Syntax-Highlight-Engine-Kate) CPAN module by Hans Jeuken and Gábor Szabó. Interaction with the built-in Perl debugger is an idea proposed by Valcho Nedelchev and provoked by the scarcity of graphical frontends for the Perl debugger.
@@ -317,36 +335,22 @@ JavaScript-based settings are created to facilitate the development of fully tra
317
335
*```Ctrl+P``` - Print
318
336
*```Ctrl+I``` - debug current page using ```QWebInspector```
319
337
320
-
## Security
321
-
322
-
**Security features based on C++ code:**
323
-
* PEB can not and does not download remote files on hard disk and can not execute any Perl scripts from remote locations.
324
-
* Users have no dialog to select arbitrary local scripts for execution by PEB. Only scripts within the ```{PEB_binary_directory}/resources/app``` directory can be executed if they are invoked from the PEB pseudo-domain: ```http://perl-executing-browser-pseudodomain/```.
325
-
* Starting PEB with administrative privileges is not allowed - it exits with a warning message.
326
-
* Perl 5 scripts are executed in a clean environment and only ```REQUEST_METHOD```, ```QUERY_STRING``` and ```CONTENT_LENGTH``` environment variables (borrowed from the CGI protocol) are used for communication between local HTML forms and local Perl scripts.
327
-
328
-
**Security features based on Perl code:**
329
-
* Perl scripts are executed in an ```eval``` function after banning potentially unsafe core functions. This feature is implemented in a special script named ```censor.pl```, which is compiled into the resources of the browser binary and is executed from memory when Perl script is started. All core functions from the :dangerous group - ```syscall```, ```dump``` and ```chroot```, as well as ```fork``` are banned.
330
-
* The environment of all Perl scripts is once again filtered in the ```BEGIN``` block of ```censor.pl``` to ensure no unwanted environment variables are inserted by the operating system.
331
-
332
-
**Perl Debugger Interaction:**
333
-
* Any Perl script can be selected for debugging, which is also a security risk. So if Perl debugger interaction is not needed, it can be turned off by a compile-time variable. Just change ```PERL_DEBUGGER_INTERACTION = 1``` to ```PERL_DEBUGGER_INTERACTION = 0``` in the project file of the browser (peb.pro) and compile the binary.
334
-
335
-
## Limitations
336
-
337
-
* No history and cache. JavaScript functions ```window.history.back()```, ```window.history.forward()``` and ```window.history.go()``` are disabled.
338
-
* No reloading from JavaScript of a page that is produced by local script, but local static pages, as well as web pages, can be reloaded from JavaScript using ```location.reload()```.
339
-
* No file can be downloaded on hard disk.
340
-
* No support for plugins and HTML 5 video.
341
-
342
338
## What Perl Executing Browser Is Not
343
339
344
340
* PEB is not a general purpose web browser and does not have all traditional features of general purpose web browsers.
345
-
* Unlike JavaScript in general purpose web browsers, Perl scripts executed by PEB have no access to the HTML DOM tree of any page.
341
+
* Unlike JavaScript in general purpose web browsers, Perl scripts executed by PEB have no direct access to the HTML DOM tree of any page.
346
342
* PEB is not an implementation of the CGI protocol. It uses only three environment variables together with the GET and POST methods from the CGI protocol in a purely local context without any attempt to communicate with the outside world.
347
343
* PEB does not embed any Perl interpreter in itself and rellies on an external Perl distribution, which could be easily changed or upgraded independently.
348
344
* PEB has no sandbox for Perl scripts - they are treated like and executed as ordinary desktop applications with normal user privileges.
349
345
346
+
## Limitations
347
+
348
+
* No history and cache.
349
+
JavaScript functions ```window.history.back()```, ```window.history.forward()``` and ```window.history.go()``` are disabled.
350
+
* No reloading from JavaScript of a page that is produced by a local Perl script, but local static pages, as well as web pages, can be reloaded using JavaScript ```location.reload()```.
0 commit comments