Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 21 15:17

    jcubic on master

    Slight rewording, and fix some … Merge pull request #13 from mar… (compare)

  • Apr 21 15:17
    jcubic closed #13
  • Apr 21 15:17
    jcubic commented #13
  • Apr 21 14:41
    marclaporte opened #13
  • Apr 21 14:36
  • Apr 14 02:41
  • Nov 23 2019 09:52
    jcubic commented #12
  • Nov 23 2019 02:18
    tommyjcode closed #12
  • Nov 23 2019 02:18
    tommyjcode commented #12
  • Nov 22 2019 22:16
    jcubic commented #12
  • Nov 22 2019 22:14
    jcubic closed #11
  • Nov 22 2019 21:40
    tommyjcode opened #12
  • Sep 28 2019 14:09
    jcubic commented #11
  • Sep 28 2019 10:25
    ZerooCool opened #11
  • Apr 08 2019 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)

Jakub T. Jankiewicz
@jcubic
Ask questions about leash shell
coreygoettsch
@coreygoettsch
Hi, Jakub. How are you? I am very excited to try out Leash. I uploaded all of the files from the github repo into the /var/www/html folder of a virtual private server, and I'm stuck at the opening page. It just keeps loading forever. I apologize if you get this question a lot. If you have a minute, would you please help me? Have you ever heard of this, and do you know how to fix it? Thank you very much for your help, and thank you for such a clever project.
Jakub T. Jankiewicz
@jcubic
hi @coreygoettsch maybe you're missing some library or get error in javascript, try checking dev tools console if there are errors or maybe some ajax return error, if so you can check error logs in /var/log/httpd/ or /var/log/apache2/ directory there should be error.log file
coreygoettsch
@coreygoettsch
I checked error.log already, and I didn't see anything.
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