Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 08 00:58
  • Nov 22 2018 04:45
  • Aug 23 2018 06:06
  • Apr 17 2018 13:48
  • Apr 01 2018 10:28

    jcubic on devel

    update scripts + more restricti… (compare)

  • Apr 01 2018 08:21

    jcubic on devel

    remove cat for guest users so s… (compare)

  • Mar 30 2018 19:22

    jcubic on devel

    fix unicode issue #10 (compare)

  • Mar 30 2018 19:22
    jcubic opened #10
  • Mar 30 2018 18:50

    jcubic on devel

    fix perl cgi script (compare)

  • Mar 30 2018 17:54

    jcubic on devel

    add hataccess to exec cgi files (compare)

  • Mar 29 2018 20:38

    jcubic on devel

    fix logger, upload and download (compare)

  • Mar 29 2018 18:40

    jcubic on devel

    restrict dir and write by guest… (compare)

  • Mar 29 2018 17:34
  • Mar 25 2018 14:47

    jcubic on devel

    use delay queue for calling API… (compare)

  • Mar 25 2018 14:15

    jcubic on devel

    Call onDirectoryChange when cha… (compare)

  • Mar 25 2018 14:06

    jcubic on devel

    add change_directory api method (compare)

  • Mar 25 2018 12:02

    jcubic on devel

    don't allow to view config.json… (compare)

  • Mar 25 2018 11:58

    jcubic on devel

    more hash functions to Service.… (compare)

  • Mar 24 2018 20:13

    jcubic on devel

    add path to install deps (compare)

  • Mar 24 2018 19:53

    jcubic on devel

    replace private methods to prot… (compare)

coreygoettsch
@coreygoettsch
I do get this error message from the web interface:

AJAX Error: "*

  • Released under the MIT license
    /
    error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
    ini_set('display_errors', 'On');

require('lib/Service.php');
$service = new Service('config.json', getcwd());
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
$_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
require_once('lib/json-rpc.php');
if ($service->debug()) {
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', 'On');
}
echo handle_json_rpc($service);
exit;
}

?>

Leash






debug()) { ?>
    " rel="stylesheet"/>





 /* some styles before I move them to style.css */

/ / / / _ | / / // /
/ // _// |\ \/ /
/_/// |/__///_/

   [ LOADING ]

debug()) { ?>

debug()) { ?>
">

debug()) { ?>
">

keyboardeventKeyPolyfill.polyfill();
var d = $.Deferred();
$.leash = d.promise();
$(function() {
$('#shell').css({
overflow: 'auto'
}).leash().then(function(leash) {
$('#splash').hide();
d.resolve(leash);
// terminal is created after async call so we need to get terminal
// instance in a promise otherwise it will be created here.
var terminal = $('#shell').show().terminal();
var $win = $(window);
$win.resize(function() {
var height = $win.height();
terminal.innerHeight(height);
}).resize();
terminal.resize();
});
});

';
}
}
closedir($dh);
}
}
?>"

Jakub T. Jankiewicz
@jcubic
it seems that you don't have php enabled, does it work? can you create page <?php echo "hello"; ?>?
coreygoettsch
@coreygoettsch
I think php's on--at least that's what systemd is telling me.
systemctl list-unit-files | grep php
php7.0-fpm.service enabled
Jakub T. Jankiewicz
@jcubic
I don't know if you need php service, from what I know you need httpd server and php for the server but I never seen php service
coreygoettsch
@coreygoettsch
Hmm, maybe you're right. When I copied your code into a page and tried to access it, it was a blank screen.
Jakub T. Jankiewicz
@jcubic
Can you install things on this server? if so you need to install and enable php
coreygoettsch
@coreygoettsch
I did forget to install libapache2-mod-php, and now the test page is showing "hello"
This is just a basic Ubuntu server.
It's still in a loading loop
I'm getting this ajax error now:

AJAX Error: "Fatal error: Uncaught Error: Call to undefined function mb_detect_encoding() in /var/www/html/lib/json-rpc.php:187
Stack trace:

#0 /var/www/html/lib/json-rpc.php(202): get_json_request()

#1 /var/www/html/index.php(21): handle_json_rpc(Object(Service))

#2 {main}

thrown in /var/www/html/lib/json-rpc.php on line 187"

Jakub T. Jankiewicz
@jcubic
you need mb_string for php
jcubic/leash#5
coreygoettsch
@coreygoettsch
Yup, that did it! Once I restarted mb_string and apache2, it works now. Thank you so much for your time--and putting up with my stupidity.
I'm very excited to try this out. Thanks for working on this project.
coreygoettsch
@coreygoettsch
Hey man, I'm sorry to bother you again. I did manage to get into a shall, but once I got a bit into the intial setup, I got another error.

You are running Leash for the first time. You need to configure it
root password: *
Type your server name
server: nicholas-server
Your normal username
username: nicholas
Home directory
home: /home/nicholas
Allow guest sessions (Y)es/(N)o
guest: Y
Execute sudo for user accounts (Y)es/(N)o
sudo: Y
password: **
Detect Shell
Test Shell 'exec' [PASS]
Using shell exec
AJAX Error: "Fatal error: Uncaught Error: Call to undefined function curl_init() in /var/www/html/lib/Service.php:1110
Stack trace:

#0 /var/www/html/lib/Service.php(944): Service->curl('https://github....')

#1 /var/www/html/lib/Service.php(983): Service->unzip_url(NULL, 'https://github....', 'jsvi-app-master', '/var/www/html/l...')

#2 /var/www/html/lib/Service.php(504): Service->get_repo(NULL, 'jcubic', 'jsvi-app', '/var/www/html/l...')

#3 /var/www/html/lib/json-rpc.php(262): Service->configure(Array)

#4 /var/www/html/index.php(21): handle_json_rpc(Object(Service))

#5 {main}

thrown in /var/www/html/lib/Service.php on line 1110"

coreygoettsch
@coreygoettsch
I should add that I get this from /var/log/apache2/error.log:
[Mon Sep 18 19:56:13.211377 2017] [:error] [pid 15545] [client 196.52.2.15:48834] PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /var/www/html/lib/Service.php:1110\nStack trace:\n#0 /var/www/html/lib/Service.php(944): Service->curl('https://github....')\n#1 /var/www/html/lib/Service.php(983): Service->unzip_url(NULL, 'https://github....', 'jsvi-app-master', '/var/www/html/l...')\n#2 /var/www/html/lib/Service.php(504): Service->get_repo(NULL, 'jcubic', 'jsvi-app', '/var/www/html/l...')\n#3 /var/www/html/lib/json-rpc.php(262): Service->configure(Array)\n#4 /var/www/html/index.php(21): handle_json_rpc(Object(Service))\n#5 {main}\n thrown in /var/www/html/lib/Service.php on line 1110, referer: http://159.203.189.218/
Jakub T. Jankiewicz
@jcubic
you need to install curl and zip, did you look at that issue I've linked?
coreygoettsch
@coreygoettsch
curl and zip are both installed.
Jakub T. Jankiewicz
@jcubic
curl and zip for php?
coreygoettsch
@coreygoettsch
no wait, not for php
just realized that right when you said it, haha
I'm sorry.
Okay, I'm fully logged in and ready to go now. Again, thanks for your help--and patience. I missed that part about having to install curl and zip for php.
Jakub T. Jankiewicz
@jcubic
I need to add snippet with apt-get for ubuntu to Readme
and maybe for Fedora that I'm currently using
coreygoettsch
@coreygoettsch
That'd definitely be helpful. And maybe include one for CentOS or RHEL. I don't know how different Fedora is from CentOS or RHEL. Have a good day, man. Thanks again!
Mordillo98
@Mordillo98
Hello
Not sure what i'm doing wrong. I get a blank screen when loading the page, and made sure all 4 php modules are installed. I have no error messages in error_log besides my timezone isn't in sync.
using centos 7, selinux and firewall disabled
Mordillo98
@Mordillo98
no functions disabled in my php.ini
Mordillo98
@Mordillo98
finally forced to get an error message. Woo hooo !
E_COMPILE_ERROR Error in file �Service.php� at line 367: Can't use function return value in write context
investigating
that's the line
return !empty(preg_replace("/\s$/", "", $response['output']));
Mordillo98
@Mordillo98
i'm using PHP Version 5.4.16
Mordillo98
@Mordillo98
Upgraded to PHP Version 5.5.21. that error msg is gone. :)
Now getting a permission error
failed to open stream: Permission denied","file":"\/var\/www\/html\/lib\/Service.php","at":251,"line":" $file = fopen($filename, 'w+');"},"name":"JSONRPCError"}}
Mordillo98
@Mordillo98
tons of permissions error. did a chmod -R 777 html/ - now working
chow !
Rohit N. Bhadani
@hashtagrb
Hello guys i ma getting error
You can't execute sudo if sudo option is on
Please help
Jakub T. Jankiewicz
@jcubic
@hashtagrb this is error if you have in config that it should use sudo for diiferent users, so if you login to leash using rohid username it will use sudo -u rohid I thougth that it make no sens to run sudo -u rohid sudo command not sure if that command would work in bash.