Skip to content

Commit

Permalink
Merge branch 'master' of github.com:SWI-Prolog/swish
Browse files Browse the repository at this point in the history
  • Loading branch information
friguzzi committed Jan 14, 2020
2 parents 23ecf72 + b4a1feb commit 8097cb7
Show file tree
Hide file tree
Showing 24 changed files with 375 additions and 139 deletions.
2 changes: 0 additions & 2 deletions .bowerrc

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules
bower_components
node_modules
swish-bower-components.zip
.bower-senitel
passwd
Expand Down
2 changes: 2 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# install modules here
--modules-folder web/node_modules
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright: VU University of Amsterdam, CWI Amsterdam
# License: Simplified BSD license

YARN_ARCHIVE=swish-js-components.zip
YARN_ARCHIVE=swish-node-modules.zip
YARN_URL=https://www.swi-prolog.org/download/swish/${YARN_ARCHIVE}
SWIPL=swipl

Expand Down Expand Up @@ -60,7 +60,7 @@ $(YARN_ARCHIVE)::

upload::
rm -f $(YARN_ARCHIVE)
zip -r $(YARN_ARCHIVE) web/bower_components
zip -r $(YARN_ARCHIVE) web/node_modules
rsync $(YARN_ARCHIVE) ops:/home/swipl/web/download/swish/$(YARN_ARCHIVE)


Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ get the dependencies:

As installing node and yarn is not a pleasure on all operating systems,
you can also download the dependencies as a single zip file from
http://www.swi-prolog.org/download/swish/swish-bower-components.zip.
http://www.swi-prolog.org/download/swish/swish-node-modules.zip.
Unpack the zip file, maintaining the directory structure, from the swish
root directory to create the directory web/bower_components. If you have
root directory to create the directory web/node_modules. If you have
`make` installed you can install the above `.zip` file using

make yarn-zip

Last updated: Feb 18, 2018, 2017: upgraded to current dependencies.
Last updated: Dec 16, 2019: upgraded dependencies, new archive name

#### Get the latest SWI-Prolog

Expand Down
61 changes: 61 additions & 0 deletions config-available/sshd.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/* Part of SWISH
Author: Jan Wielemaker
E-mail: [email protected]
WWW: http://www.swi-prolog.org
Copyright (C): 2019, VU University Amsterdam
CWI Amsterdam
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/

:- module(swish_config_sshd, []).

/** <module> Provide admin access through SSH
Provide an administrative channel to access the SWISH server. This can
be used on anonymous installations to apply hot fixes, load additional
libraries, etc.
Requires the pack `libssh` to be installed.
*/

:- use_module(library(ssh_server)).
:- use_module(library(broadcast)).

% If library(http/http_unix_daemon) is used we are loaded before the
% fork, but we cannot start threads before forking. This ensures we
% are started later.

:- listen(http(pre_server_start),
start_sshd).

start_sshd :-
ssh_server([ port(3250),
bind_address(*),
authorized_keys_file('etc/ssh/authorized_keys')
]).
14 changes: 9 additions & 5 deletions examples/stats.swinb
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ chart(PeriodS, Keys, Chart) :-

period_format(minute, '%M:%S').
period_format(hour, '%H:%M').
period_format(day, '%m-%d %H:00').
period_format(week, '%Y-%m-%d').
period_format(day, '%m-%d %H:%M').
period_format(week, '%Y-%m-%d %H:00').
period_format(year, '%Y-%m-%d').

add_heap_mb(Stat0, Stat) :-
Expand Down Expand Up @@ -174,11 +174,15 @@ chart(Period, [pengines,threads,visitors], Chart).
</div>
<p><b>rss</b> is the total (resident) memory usage as reported by Linux. <b>stack</b> is the memory
occupied by all Prolog stacks. <b>heap</b> is an approximation of the memory used for the
Prolog program space, computed as <i>rss - stack - free<i>. This is incorrect for two reasons.
Prolog program space, computed as <i>rss - stack - free</i>. This is incorrect for two reasons.
It ignores the C-stacks and the not-yet-committed memory of the Prolog stacks
is not part of rss. free is memory that is freed but not yet reused as reported
by GNU <a href="https://www.gnu.org/software/libc/manual/html_node/Statistics-of-Malloc.html">malinfo()</a> as <code>fordblks</code>.
</i></i></p><div class="panel-body"><i><i>
by GNU <a href="https://www.gnu.org/software/libc/manual/html_node/Statistics-of-Malloc.html">malinfo()</a>
as <code>fordblks</code>. Note that <code>fordblks</code> is a 32-bit value. The implementation heuristically
guesses how many times the value wrapped around and corrects for this.
</p>

<div class="panel-body"><i><i>
<div class="form-group row" style="margin-bottom:0px">
<label class="col-sm-2">Period:</label>
<div class="col-sm-10">
Expand Down
4 changes: 2 additions & 2 deletions lib/page.pl
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
resource_prefix('form/').
resource_prefix('icons/').
resource_prefix('js/').
resource_prefix('bower_components/').
resource_prefix('node_modules/').

%% swish_page(+Options)//
%
Expand Down Expand Up @@ -819,7 +819,7 @@
alt(css, 'swish.css', swish_web('css/swish.css')).
alt(rjs, 'js/require.js', swish_web('js/require.js')) :-
\+ debugging(nominified).
alt(rjs, 'bower_components/requirejs/require.js', -).
alt(rjs, 'node_modules/requirejs/require.js', -).


/*******************************
Expand Down
14 changes: 13 additions & 1 deletion lib/replay.pl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
replay/1, % +Pengine
replay/2, % +Pengine, +ServerURL
concurrent_replay/1, % +Count
skip_pengine/1 % +Pengine
skip_pengine/1, % +Pengine

pengine_source/2 % ?Pengine, ?Source
]).
:- use_module(library(debug)).
:- use_module(library(pengines)).
Expand Down Expand Up @@ -318,6 +320,16 @@
skip_pengine(Pengine) :-
assertz(skip_pengine_store(Pengine)).

/*******************************
* QUERY *
*******************************/

pengine_source(Pengine, Src) :-
pengine(_Time, create(Pengine, _App, Options)),
memberchk(src_text(_Hash-Src), Options).



/*******************************
* MESSAGES *
*******************************/
Expand Down
Loading

0 comments on commit 8097cb7

Please sign in to comment.