1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

remove iiab-admin from iiab

This commit is contained in:
Tim Moody 2017-05-31 12:08:09 -04:00
parent 39632ce8ab
commit 2a137e83d1
52 changed files with 5 additions and 6650 deletions

View file

@ -19,64 +19,7 @@ Add Packages for Remote Access
* screen
* lynx
Add Command Server
------------------
Admin Console
-------------
* Command Server escalates privileges to root for web user
Add Admin Console and Dependencies
----------------------------------
* Gui configuration tool
XSCE-CMDSRV
===========
The purpose of xsce-cmdsrv application is to run various administrative tasks
initiated by the Admin Console with privilege escalated to the root level.
Security
--------
xsce-cmdsrv listens on an ipc socket readable and writeable only by root and
members of the xsce-admin group. It accepts commands on this channel which must
be in a list of acceptable commands and which it then translates into actual
actions to take on the server
Commands and Jobs
-----------------
Commands are received from the front end and turned into actions by xsce-cmsrv.
Some actions take little time and are executed immediately and the result returned
to the front end. Others may be long running and are tracked as jobs. On startup
xsce-cmdsrv checks to see if there jobs that did not complete and tries to restart
them. The frontend can query the output and status of these jobs and can cancel jobs.
Command Data Structure
----------------------
* rowid - used as cmd_id key
* cmd_msg text - text of command received from the front end
* create_datetime text - datetime of insertion
Job Data Structure
------------------
* rowid -used as job_id key
* cmd_rowid integer - foreign key to command table
* cmd_step_no integer - the number of the step in multi-step commands
* depend_on_job_id integer - the job_id of the job that must complete before this starts
* has_dependent text - Y/N does this job have a dependent job
* job_command text - the job string that will be passed to the subprocess module
* job_pid integer - pid of a running job
* job_output text - any output from the job executable
* job_status text - one of SCEDULED, STARTED, RESTARTED, SUCCEEDED, FAILED, or CANCELLED
* create_datetime text - datetime of insertion
* last_update_datetime text - datetime of last update
Storage
-------
The persistent storage for this application is essentially single user so
sqlite has been used for speed and simplicity.
Has been moved to a separate git repo

View file

@ -2,10 +2,4 @@
# must keep roles/0-once/defaults/main.yml sync'd
# The values here are defaults.
admin_console_path: "{{ xsce_base }}/admin_console"
cmdsrv_path: "{{ xsce_base }}/xsce_cmdsrv"
xsce_cmdsrv_dbname : "xsce_cmdsrv.0.2.db"
gui_version: 4
novnc_version: noVNC-0.6.1
novnc_install: True
novnc_enabled: False
xsce_admin_user: xsce-admin

File diff suppressed because one or more lines are too long

View file

@ -1,14 +0,0 @@
#!/bin/bash
# start the vnc server and websockify server
/etc/init.d/vnc start
# if a parameter was passed it is the remote addr
if [ $# -eq 1 ]; then
iptables -I INPUT -p tcp -s $1 --dport 6080 -j ACCEPT
else
# open the new port for direct access to the websocket
iptables -I INPUT -p tcp --dport 6080 -j ACCEPT
fi
# launch the websocket server
systemctl start websockify.service

View file

@ -1,6 +0,0 @@
#!/bin/bash
parted -m <<EOF
print all free
quit
EOF

View file

@ -1,17 +0,0 @@
#!/usr/bin/python
import time
import subprocess
t1 = time.time()
rc = subprocess.call(["wget", "http://cachefly.cachefly.net/10mb.test", "-q", "-O", "/dev/null"])
t2 = time.time()
if rc == 0:
t3 = t2 - t1
speed = 10/t3
print "Time for 10MB was %f; Speed was %f MB/s" % (t3, speed)
else:
print "Speed Test Failed."

View file

@ -1,105 +0,0 @@
#!/usr/bin/python
import xml.etree.ElementTree as ET
import json
import csv
import operator
import base64
import os.path
import sys
import urllib2
import time
XSCE_PATH='/etc/xsce'
if not XSCE_PATH in sys.path:
sys.path.append(XSCE_PATH)
from xsce_env import get_xsce_env
zimCat = {}
zims = {}
zimCount = 0
# as of Apr 13, 2015
problemUrlMap = {"http://download.kiwix.org/zim/0.9/wikipedia_en_ray_charles_03_2013.zim.meta4":"http://download.kiwix.org/portable/wikipedia/kiwix-0.9+wikipedia_en_ray_charles_03_2013.zip", \
"http://download.kiwix.org/zim/0.9/wikipedia_en_wp1_0.8_45000+_12_2010.zim.meta4":"http://download.kiwix.org/portable/wikipedia/kiwix-0.9+wikipedia_en_wp1_0.8_45000+_12_2010.zip", \
"http://download.kiwix.org/zim/0.9/wikipedia_es_venezuela_11_2012.zim.meta4":"http://download.kiwix.org/portable/wikipedia/kiwix-0.9+wikipedia_es_venezuela_11_2012.zip", \
"http://download.kiwix.org/zim/wikispecies/wikispecies_en_all_nopic_2015-03.zim.meta4":"http://download.kiwix.org/portable/wikispecies/kiwix-+wikispecies_en_all_nopic_2015-03.zip", \
"http://download.kiwix.org/zim/wikispecies/wikispecies_en_all_2015-03.zim.meta4":"http://download.kiwix.org/portable/wikispecies/kiwix-+wikispecies_en_all_2015-03.zip"}
# get the document root
WWWROOT=get_xsce_env('WWWROOT')
consolePath = WWWROOT + "/devel/"
assetsPath = consolePath + "assets/"
imgPath = consolePath + "images/"
jsonPath = "/etc/xsce/"
# input file
kiwixLibUrl = 'http://download.kiwix.org/library/library.xml'
zimKiwixUrl = "http://download.kiwix.org/portable/"
zimKiwixPrefix = "kiwix-0.9+"
# output files
kiwix_catalog = jsonPath + "kiwix_catalog.json"
try:
xmlsrc = urllib2.urlopen(kiwixLibUrl)
tree = ET.parse(xmlsrc)
xmlsrc.close()
except (urllib2.URLError) as exc:
sys.stdout.write("GET-KIWIX-CAT ERROR - " + str(exc.reason))
sys.stdout.flush()
sys.exit(0)
#tree = ET.parse("assets/test.xml")
root = tree.getroot()
for child in root:
attributes = {}
zimAttr = {}
attributes = child.attrib
if 'id' in attributes and 'language' in attributes and 'creator' in attributes:
id = attributes['id']
lang = attributes['language']
category = attributes['creator']
url = attributes['url']
urlSlash = url.split('/')
urlEnd = urlSlash[-1] # last element
if url in problemUrlMap:
downloadUrl = problemUrlMap[url]
else:
downloadUrl = url.replace("/zim/", "/portable/")
downloadUrl = downloadUrl.replace(urlEnd, zimKiwixPrefix + urlEnd)
downloadUrl = downloadUrl.replace(".zim.meta4", ".zip")
fileRef = urlEnd.split('.')
fileRef = fileRef[0]
permaRefParts = urlEnd.split('_')
permaRefParts = permaRefParts[0:len(permaRefParts) - 1]
permaRef = permaRefParts[0]
for part in permaRefParts[1:]:
if not part.isdigit():
permaRef += "_" + part
zimCount += 1
# print zimCount, attributes['language'], attributes['title'], attributes['description']
for key in attributes:
if key != 'favicon' and key != 'faviconMimeType':
zimAttr[key] = attributes[key]
zimAttr['download_url'] = downloadUrl
zimAttr['file_ref'] = fileRef
zimAttr['perma_ref'] = permaRef
zims[id] = zimAttr
zimCat['download_date'] = time.strftime("%Y-%m-%d.%H:%M:%S")
zimCat['zims'] = zims
with open(kiwix_catalog, 'w') as fp:
json.dump(zimCat, fp)
sys.stdout.write("SUCCESS")
sys.stdout.flush()
sys.exit(0)

View file

@ -1,138 +0,0 @@
#!/usr/bin/python
# Not currently used
import xml.etree.ElementTree as ET
import json
import csv
import operator
import base64
import os.path
import sys
import urllib2
XSCE_PATH='/etc/xsce'
if not XSCE_PATH in sys.path:
sys.path.append(XSCE_PATH)
from xsce_env import get_xsce_env
zimLangCodes = []
zimGroups = {}
zimUrls = {}
zims = {}
zimUrls = {}
zimGroups = {}
zimLangCodes = []
zimCount = 0
langGroups = {"en":"eng"}
# as of Mar 21, 2015
problemUrlMap = {"http://download.kiwix.org/zim/0.9/wikipedia_en_ray_charles_03_2013.zim.meta4":"http://download.kiwix.org/portable/wikipedia/kiwix-0.9+wikipedia_en_ray_charles_03_2013.zip", \
"http://download.kiwix.org/zim/0.9/wikipedia_en_wp1_0.8_45000+_12_2010.zim.meta4":"http://download.kiwix.org/portable/wikipedia/kiwix-0.9+wikipedia_en_wp1_0.8_45000+_12_2010.zip", \
"http://download.kiwix.org/zim/0.9/wikipedia_es_venezuela_11_2012.zim.meta4":"http://download.kiwix.org/portable/wikipedia/kiwix-0.9+wikipedia_es_venezuela_11_2012.zip", \
"http://download.kiwix.org/zim/wikispecies/wikispecies_en_all_nopic_2015-03.zim.meta4":"http://download.kiwix.org/portable/wikispecies/kiwix-+wikispecies_en_all_nopic_2015-03.zip", \
"http://download.kiwix.org/zim/wikispecies/wikispecies_en_all_2015-03.zim.meta4":"http://download.kiwix.org/portable/wikispecies/kiwix-+wikispecies_en_all_2015-03.zip"}
WWWROOT = get_xsce_env('WWWROOT')
consolePath = WWWROOT + "/devel/"
assetsPath = consolePath + "assets/"
imgPath = consolePath + "images/"
jsonPath = "/etc/xsce/"
# input file
#xmlfile = assetsPath + "library.xml"
kiwixLibUrl = 'http://www.kiwix.org/library.xml'
zimKiwixUrl = "http://download.kiwix.org/portable/"
zimKiwixPrefix = "kiwix-0.9+"
# output files
zim_langs = jsonPath + "zim_langs.json"
zim_groups = jsonPath + "zim_groups.json"
zim_catalog = jsonPath + "zim_catalog.json"
zim_urls = jsonPath + "zim_urls.json"
try:
xmlsrc = urllib2.urlopen(kiwixLibUrl)
tree = ET.parse(xmlsrc)
xmlsrc.close()
except (urllib2.URLError) as exc:
sys.stdout.write("GET-ZIM-LIB ERROR - " + str(exc.reason))
sys.stdout.flush()
sys.exit(0)
#tree = ET.parse("assets/test.xml")
root = tree.getroot()
for child in root:
attributes = {}
listAttr = {}
attributes = child.attrib
if 'id' in attributes and 'language' in attributes and 'creator' in attributes:
id = attributes['id']
lang = attributes['language']
category = attributes['creator']
url = attributes['url']
if lang in langGroups: # allow for grouping of language codes
lang = langGroups[lang]
if lang not in zimLangCodes:
zimLangCodes.append(lang)
if lang not in zimGroups:
zimGroups[lang] = {}
if category not in zimGroups[lang]:
zimGroups[lang][category] = []
zimGroups[lang][category].append(id)
urlSlash = url.split('/')
urlEnd = urlSlash[-1] # last element
if url in problemUrlMap:
downloadUrl = problemUrlMap[url]
else:
downloadUrl = url.replace("/zim/", "/portable/")
downloadUrl = downloadUrl.replace(urlEnd, zimKiwixPrefix + urlEnd)
downloadUrl = downloadUrl.replace(".zim.meta4", ".zip")
fileRef = urlEnd.split('.')
fileRef = fileRef[0]
permaRefParts = urlEnd.split('_')
permaRefParts = permaRefParts[0:len(permaRefParts) - 1]
permaRef = permaRefParts[0]
for part in permaRefParts[1:]:
if not part.isdigit():
permaRef += "_" + part
attributes['perma_ref'] = permaRef
#if 'favicon' in attributes:
# filename = imgPath + id + '.png' # we should possibly use permaRef
# if os.path.exists(filename):
# imgdata = base64.b64decode(attributes['favicon'])
# with open(filename, 'wb') as f:
# f.write(imgdata)
# attributes['favicon'] = filename
zims[id] = attributes
zimCount += 1
# print zimCount, attributes['language'], attributes['title'], attributes['description']
listAttr['download_url'] = downloadUrl
listAttr['file_ref'] = fileRef
listAttr['perma_ref'] = permaRef
listAttr['size'] = attributes['size']
zimUrls[id] = listAttr
zimLangCodes.sort()
with open(zim_groups, 'w') as fp:
json.dump(zimGroups, fp)
with open(zim_langs, 'w') as fp:
json.dump(zimLangCodes, fp)
with open(zim_catalog, 'w') as fp:
json.dump(zims, fp)
with open(zim_urls, 'w') as fp:
json.dump(zimUrls, fp)
sys.stdout.write("SUCCESS")
sys.stdout.flush()
sys.exit(0)

View file

@ -1,6 +0,0 @@
#!/bin/bash -x
# this will break on machines with LVM, but other things will too
FIRSTDEV=`ls -lav /dev |grep brw| grep 'sd\|mmc' | awk 'NR==1' |awk --field-separator=' ' '{ print $10 }'`
parted /dev/$FIRSTDEV -ms print devices

View file

@ -1,3 +0,0 @@
#!/bin/bash
du -ah /library/$1

View file

@ -1,5 +0,0 @@
#!/bin/bash
scripts/poweroffX.sh > /dev/null 2>&1 &
exit 0

View file

@ -1,13 +0,0 @@
#!/bin/bash
. /etc/xsce/xsce.env
if [ "$OS" = "Debian" ] || [ "$OS" = "raspbian" ]; then
/bin/sleep 3
/sbin/shutdown -P now
else
/usr/bin/sleep 3
/usr/sbin/shutdown -P now
fi
exit 0

View file

@ -1,38 +0,0 @@
#!/bin/bash
VERSION=$1
SOURCEDIR=/library/downloads/rachel/$VERSION.zip
WORKINGDIR=/library/working/rachel/$VERSION
if [[ "$VERSION" == "rachelusb_32EN_3.1.5" ]]; then
echo "Unzipping Version $VERSION."
/usr/bin/unzip -quo $SOURCEDIR rachelusb_32EN_3.1.4/RACHEL/bin/bin/* rachelusb_32EN_3.1.4/RACHEL/bin/www/* -d $WORKINGDIR
rc=$?
case $rc in
0)
echo "RACHEL Unzip Successful."
EXITCODE=0
;;
1)
echo "RACHEL Unzip Completed with Warnings."
EXITCODE=0
;;
11)
echo "RACHEL Unzip Completed with Warnings that some files had already been extracted."
EXITCODE=0
;;
*)
echo "RACHEL Unzip Failed."
EXITCODE=1
;;
esac
else
echo "Unsupported Version $VERSION."
EXITCODE=1
fi
exit $EXITCODE

View file

@ -1,28 +0,0 @@
#!/bin/bash
VERSION=$1
WORKINGDIR=/library/working/rachel/$VERSION
DESTDIR=/library/rachel
if [[ -d "$DESTDIR/www" ]]; then
echo "Rachel content already there."
if [[ -d "$WORKINGDIR" ]]; then
rm -Rf $WORKINGDIR
fi
exit 2
fi
RACHELWORKING=$WORKINGDIR/rachelusb_32EN_3.1.4/RACHEL/bin
echo "Moving www directory"
mv $RACHELWORKING/www $DESTDIR/
mkdir -p $DESTDIR/www/modules.out
echo "Moving bin directory"
mv $RACHELWORKING/bin $DESTDIR/
echo "Removing $WORKINGDIR"
rm -Rf $WORKINGDIR
echo $VERSION > $DESTDIR/version
exit 0

View file

@ -1,5 +0,0 @@
#!/bin/bash
scripts/rebootX.sh > /dev/null 2>&1 &
exit 0

View file

@ -1,12 +0,0 @@
#!/bin/bash
. /etc/xsce/xsce.env
if [ "$OS" = "Debian" ] || [ "$OS" = "raspbian" ]; then
/bin/sleep 3
/sbin/reboot
else
/usr/bin/sleep 3
/usr/sbin/reboot
fi
exit 0

View file

@ -1,13 +0,0 @@
#!/bin/bash
# close down the vnc remote desktop
# delete any rules permitting 6080
iptables -L INPUT |grep 6080
while [ $? -eq 0 ];do
iptables -D INPUT 1
iptables -L INPUT |grep 6080
done
/etc/init.d/vnc stop
systemctl stop websockify.service
iptables -D INPUT -p tcp --dport 6080 -j ACCEPT

View file

@ -1,3 +0,0 @@
#!/bin/bash
# just return a success
echo "outcome" : "success"

View file

@ -1,67 +0,0 @@
#!/bin/bash
WORKINGDIR=/library/working/zims/$1
SRCDIR=$WORKINGDIR/data
DESTDIR=/library/zims
ZIMIDXPATH=`find $SRCDIR/index/ -name *.idx`
ZIMIDXNAME=`basename $ZIMIDXPATH`
ZIMIDX=/index/$ZIMIDXNAME
EXITCODE=0
rc=0
# ZIM File(s)
for zimpath in $SRCDIR/content/*.zim*
do
zimfile=$(basename $zimpath)
if [[ -f $DESTDIR/content/$zimfile ]]; then
echo "Removing existing $DESTDIR/content/$zimfile."
rm $DESTDIR/content/$zimfile
fi
echo "Moving $zimpath"
mv $zimpath $DESTDIR/content/$zimfile; rc1=$?
rc=$((rc + rc1))
done
if [[ $rc > 0 ]]; then
EXITCODE=1
fi
# ZIM IDX Directory
if [[ -d $DESTDIR$ZIMIDX ]]; then
echo "$DESTDIR$ZIMIDX already exists - nothing to do"
if [[ -d $SRCDIR$ZIMIDX ]]; then
echo "Removing $SRCDIR$ZIMIDX"
rm -Rf $SRCDIR$ZIMIDX
fi
else
if [[ -d $SRCDIR$ZIMIDX ]]; then
echo "Moving $SRCDIR$ZIMIDX "
mv $SRCDIR$ZIMIDX $DESTDIR$ZIMIDX; rc1=$?
else
echo "Can not find $SRCDIR$ZIMIDX"
echo "Unable to move it"
rc2=1
fi
fi
if [[ $rc1 > 0 || $rc2 > 0 ]]; then
EXITCODE=1
fi
if [[ $EXITCODE > 0 ]]; then
exit 1
fi
echo "Removing $WORKINGDIR"
rm -Rf $WORKINGDIR
echo "Re-indexing Kiwix Library"
/usr/bin/xsce-make-kiwix-lib
exit 0

View file

@ -1,5 +0,0 @@
#!/bin/bash
rsync -a /library/working/zims/$1/data/content/ /library/zims/content
rsync -a /library/working/zims/$1/data/index/ /library/zims/index
/usr/bin/xsce-make-kiwix-lib
# rm -Rf /library/working/zims/$1

File diff suppressed because it is too large Load diff

View file

@ -1,136 +0,0 @@
@charset "UTF-8";
.xsce-top-nav {
background: #E5CF87;
}
.xsce-left-nav {
background: #CFE8BE;
}
.nav>li>a {
font-size: medium;
}
.action-buttons {
/* width: 70%; */
margin-bottom: 1.5em;
margin-top: 1em;
}
.action-buttons button {
width: 14.5em;
text-align: left;
margin-bottom: 1em;
}
.pane-buttons {
width: 50%;
margin-bottom: 1.5em;
margin-top: 1em;
}
.nav-tabs>li.active>a,
.nav-tabs>li.active>a:hover,
.nav-tabs>li.active>a:focus {
color: #555;
cursor: default;
background-color: #F0B343;
border: 1px solid #ddd;
border-bottom-color: transparent;
}
.nav-tabs>li>a {
margin-right: 2px;
line-height: 1.42857143;
border: 1px solid transparent;
border-radius: 8px 8px 0 0;
}
/* Install Content styles */
.modal.modal-wide .modal-dialog {
width: 90%;
}
.modal-wide .modal-body {
overflow-y: auto;
}
#ZimDownload h2 {
font-size: 18px;
font-weight: 700;
margin-left: 5px;
}
#ZimDownload h3 {
font-size: 16px;
font-weight: 700;
margin-left: 5px;
}
#ZimDownload label {
font-weight: 600;
margin-left: 10px;
}
.lang-list {
margin-top: 10px;
margin-bottom: 10px;
}
.lang-codes {
display:inline-block;
width:20em;
}
#ZimLanguages2 {
display: none;
}
.installed {
color:green;
font-weight: 700;
}
.scheduled {
color:blue;
font-weight: 700;
}
.zim-desc {
display: inline-block;
width: 50%;
text-overflow: ellipsis;
overflow: hidden;
vertical-align: text-bottom;
white-space: nowrap;
margin-right: 8px;
}
/* Util styles */
#jobStatTable {
margin-top: 20px;
}
.jobTable {
width:100%;
padding: 4px;
vertical-align: top;
}
.jobTable tr, td{
padding: 4px;
vertical-align: top;
}
.statusJobResult {
/* width:100%; */
max-height:8em;
overflow-y:auto;
overflow-x:hidden;
}
#statusJobsRefreshTime {
padding-left:20px;
}

View file

@ -1,196 +0,0 @@
XSCE Admin Console - Configure
==============================
When you installed the XSCE School Server, a great deal of software was included, but much of it was not turned on.
These configuration options allow you to turn various features on or off to suit the needs of your school.
Configuration is divided into the following sections:
Network Parameters
------------------
You will not usually need to touch these, but they are here in case you do and also for reference.
### Hostname and Domain Name
Both hostname and domain name can be changed, but you would normally only do this to fit into a larger networking environment.
**Warning:** If you change the Host Name or Domain Name, you will need to refresh the browser after clicking Install Configured Options.
The most important parameter is the **Role of the Server** in your network. The server can play one of three roles
### Gateway
This means that the server has two connections, ethernet and/or wifi, and that it filters traffic from
client machines to the internet.
### Appliance
This means that the School Server is just another machine on the network and usually that its content can be reached by a browser with the URL http://schoolserver or http://schoolserver.lan.
### Lan Controller
This is similar to an Appliance except that the server is playing a network role for other machines on the network, such as supplying IP Addresses and Name Resolution. An Appliance is a member of the network. The Lan Controller is in charge of it.
### Override IP Addresses
There may be times when in order to fit into an existing network you need to change the IP Address of the adapter connected to that network. Again this is something you would seldom do. There are four fields that must be entered:
**Please Note**: None of the values entered have any effect unless you **Check the Box** titled 'Check to use a static WAN IP Address instead of DHCP'.
**Static Wan IP Address** - Must be a valid IP Address. The default is the current dynamic address if known, otherwise 127.0.0.1.
**Static Wan Mask** - Must be a valid Network Mask. The default is the current maks if known, otherwise 255.255.255.0.
**Static Wan Gateway** - Must be a valid IP Address. The default is the current gateway if known, otherwise 127.0.0.1.
**Static Wan Name Server** - Must be a valid IP Address. The default is the current gateway address if known, otherwise 127.0.0.1.
### Internet Access for Installations
During the installation of the School Server all of the software packages were stored for future use when you might not have an Internet connection. But as long as you do have an Internet connection any future installations or updates still cause packages to download from the Internet. If you want to use the stored packages even when you have an Internet connection you can check this box.
**Please Note:** This parameter will only be rarely changed.
### Admin Console Security
The Admin Console, this program, is password protected. You can further protect it by requiring an encrypted connection to the School Server. This less convenient because of the questions it will cause the browser to ask, but may be necessary if you think someone might spy on traffic on the network.
Internet Caching/Filtering
--------------------------
**Please Note**: These parameters only take effect when you have selected the Gateway Role on the previous screen and have the necessary Network Adapters.
* Enable local Web Page storage for later fast Access (squid cache)
* Restrict Web Page Access to a Specific List of Sites (Permitted URLs)
* Block all HTTPS Access to Web Page
* Restrict Web Page Access according to Words in the Content (dansguardian)
When the School Server acts as a **Gateway** between school users and the internet it can provide two main types of services. The first is that it can make the connection to the Internet more efficient by caching or storing responses on the server so that the next request does not need to go to the Internet. You will usually want this.
In addition, it can filter the sites that students are permitted to access in three ways. The first is to only allow pages in the **Permitted URLs** list to be accessed; see below. The second is that all sites accessed with https security can be blocked to prevent users from by-passing the previous filter.
The last filter is based not on URLs, but on **Words in the Content**.
Use your local policy to decide which of these filters to enable.
Server Portal
-------------
The School Server portal or home page is the main menu for accessing the various content modules on the server.
This is an aspect of the server that many wish to customize based on content choices, so we have included several alternative home pages.
* The default is simply called Home and has an icon look and feel with submenus.
* An earlier home page called xs-portal remains with multilingual capabilites and php scripts to detect the presence of content.
* For those who want to take customization further, both WordPress and Dokuwiki are installed and may be made the home page.
**Please Note**: Selecting WordPress or Dokuwiki will only take effect if you **Check its Box** titled 'Check to Enable'.
Services Enabled
----------------
The School Server has many individual pieces of software that incorporated into it when it is set up so that they do not have to be installed later when you might have a slow internet connection. Many of these are not turned on initially, but may be turned on or enabled by checking the box beside the name. Applications that are not used may also be turned off.
You should **note** that a number of items below require content to be useful. Enabling them turns them on, but you must also optain content using the **Install Content** menu or from a portable hard disk.
Note some services listed below may not be installed and will not have a checkbox.
### For Students
* **Services for XO Laptops** such as Registration, Backup, and the Activity Server
* **Chat and Collaboration Server** for XO Laptops and Others
If your school has OLPC XO laptops you should probably check these two. Otherwise you do not normally need them.
* **Moodle** - a Courseware Manager and E-Learning Platform
Moodle is one of the most widely used Learning Management Systems. There is a great deal of course materials available for it, and it can be used to set up classes and curriculum.
* **Kiwix** - serves Wikipediae and other content from sources below. You must also install content.
If you want any Wiki content you problably want this. Kiwix provides a server allows you to view and search a broad range of Wiki type material independent of the Internet. This material is selected in **Install Content** - **Get Zim Files from Kiwix**
The main reason you would not want this is if the server has very limited disk space.
* **Khan Academy Lite** - serves Khan Academy videos and Exercises. You must also install content.
* **Khan Academy Downloader** - This is onlyt the downloader portion of the appplication which may be turned off if you don't plan to download videos.
Khan Academy is a famous source of instructional videos originally on math topics, but now spanning numerous subjects. KA Lite is an offline version of these videos and accompanying exercises.
* **Open Street Maps** - from the original Internet in a Box, this is a world map to 13 or 16 levels of zoom depending on the tiles you install. You must also install content.
* **RACHEL** - another collection of popular content from World Possible. You must also install content.
* **Calibre** - an E-Book Platform. You must also install content.
* **Pathagar** - another E-Book Platform. You must also install content.
### Media Sharing and Printing
* **ELGG** - a Social Networking Platform for Student Blogging, File Sharing, and Collaboration
* **OwnCloud** - a local server-based facility for sharing files, photos, contacts, calendars, etc.
* **SAMBA** provides Network File Sharing
There is some overlap between these three. **ELGG** allows blogging and other forms of social media. Students and Teachers can use it to collaborate on projects or for journalling. **OwnCloud** is great for sharing media. It has apps for phones and tablets that make it easy to drop photos and other materials onto the server for sharing. **SAMBA** gives you the ability to share directories on the server that can be accessed by Teachers and Students as if they were local to their laptops.
* **CUPS** provides support for **Printers** either directly attached to the server or on the network.
### For Monitoring and Administration
The options below are intended for administrators and people who may help with or support the installatiion of this School Server. It is best to consult with someone who set up the server to decide which of these to turn on.
* **SchoolTool** - a School Administration System.
* **XO Visualization** - Graphs of Student Usage Statistics.
* Title to Appear on XO Visualization Charts
* **Collect Statistics** on the use of Sugar Activities.
* **Monit** watches critical applications and restarts them if they fail.
* **Munin** collects and graphs system-level statistics.
* **VnStat** gathers and displays networking statistics.
* **AWStats** graphs statistics on web server usage.
* **PhpMyadmin** allows maintenance of mysql databases.
* **Open VPN** allows a secure connection between servers over the Internet for remote maintenance. You can access via a terminal or a web browser.
* **Team Viewer** TeamViewer provides a secure connection for Remote Support and Online Meetings. You can access the server with a graphical user interface and do file transfers.
Edit Permitted URLs
-------------------
Under **Configure** - **Internet Caching/Filtering** you can turn on Internet filtering to only permit access to URLs or web sites that are in this list. Here you can modify the list to add or remove sites. To remove a site delete the line that has its URL. To add a site add a line with the site's URL. The dot at the beginning of the line means to match anything up to that point, so .unleashkids.org is the same as www.unleashkids.org and download.unleashkids.org.
Actions
-------
### Update Permitted URLs List
Saves the list of permitted URLs edited above and makes them active.
### Save Configuration
Saves all configuration variables so that they will be used when the follwing button is clicked.
### Install Configured Server Options
**Warning:** This option will **Reconfigure your Server**. It runs the Ansible configuration software using all configuration variables that have been saved with the above button.
### Reset Network Configuration
**Warning:** This option will **Reconfigure your Server's Networking Setup**. It clears the current network parameters and re-applies network configuration variables that have been saved with the Save Configuration button.
**Note:** The last two Actions may not be run at the same time. You should also refresh your browser after running either of them.

View file

@ -1,23 +0,0 @@
XSCE Admin Console - Control
============================
The options in this menu are for immediate control of the School Server.
**Note:** You can reboot or power off the server before the start up finishes, as soon as the buttons become solid red.
Reboot Server
-------------
Clicking this button will reboot the server. You should **Click the Refresh Button** on your browser after a minute or so to verify that the server has restarted and to reload any configuration data that might have changed.
Power Off Server
----------------
Clicking this button will cause the server to shutdown. The server will wait 5 seconds before initiating the shutdown and the entire process can take up to a minute to complete.
Starting Application
--------------------
Displays a log of the commands used to start up the Admin Console and whether they succeeded or not.
Errors are displayed if the server is not available or the command server is not running or not ready.

View file

@ -1,111 +0,0 @@
XSCE Admin Console - Install Content
====================================
The options on this menu allow you to download and install content onto the School Server. As of this release all of this content comes from the internet, but in the future there will be menu options to copy from a portable hard disk drive.
These options are aimed at people who plan to set up the server in a location where there is a relatively high bandwidth connection and then deploy it where there is little or no connectivity.
Get Zim Files from Kiwix
------------------------
### Overview
The words Zim and Kiwix are probably unfamiliar, but the content is very familiar and highly desirable, including all or some of the following for more than 100 languages:
* Wikipedia
* Wiktionary
* TED Talks
* Project Gutenberg Books
* Wikibooks
* Wikiquote
* Wikinews
* Wikivoyage
* Others
Kiwix.org supplies a server that is installed on the School Server and also hosts all of this content.
### Do this First
Click on the button labelled **Refresh Kiwix Catalog** if you have not done so before or if it has been a month or more since you last did so. This will retrieve the latest list of content hosted at Kiwix.org.
### How it works
When you Click on this menu option you will see a list of any content already installed, any in the process of being installed, and all content available in the languages selected.
To select more languages Click on the button labelled **Select Languages**. You will see the six languages with the most speakers in the world. Click **More Languages** for others. Check the language you want and then click **Show Content** or the **x** in the top right of the screen.
Next **Check the Titles** you want to download. You will see the total space available and the amount required for your selections. Be aware that the download process can require approximately double this amount.
When you have made your selections click **Install Selected Zims**. Jobs will be created on the server to download, unzip, and install the selected content. These are large files and the download can take a long time. Visit **Display Job Status** on the **Utilities** menu to see when they have completed or any problems encountered. It is not necessary to keep the browser open during the download.
### Don't Forget
When all of the Zim files have been downloaded and installed the Kiwix server needs to be restarted, which can be done by clicking **Restart the Kiwix Zim Server**.
Make sure that the **Kiwix** service is enabled under **Configure** - **Services Enabled**.
Download Khan Academy Videos
----------------------------
### How it works
KA Lite from the Learning Equality Foundation is installed on the School Server for offline viewing of Khan Academy videos and exercises. It has its own options to select language and download videos. To access this functionality simply click **Launch KA Lite** and another tab will open where you can login and manage content.
### Don't Forget
Make sure that the **Khan Academy Lite** and **Khan Academy Downloader** services are enabled under **Configure** - **Services Enabled**.
Get RACHEL
----------
RACHEL from worldpossible.org is another collection of content which includes as of the rachelusb_32EN_3.1.5 release:
* Khan Academy - Math and Science (without exercises)
* Medline Plus Medical Encyclopedia
* Hesperian Health Guides
* Khan Academy - Health & Medicine
* Infonet-Biovision
* Practical Action
* Project Gutenberg, 400 Selected Titles
* CK-12 Textbooks
* OLPC Educational Packages
* UNESCO's IICBA Electronic Library
* Math Expression
* Powertyping
* MIT Scratch
* Understanding Algebra
### How it works
The screen displays whether RACHEL is installed, enabled, and whether the content has been installed.
To download, unzip, and install the above content click **Download RACHEL Content**. This is a single, large file and the whole process can take a long time. Visit **Display Job Status** on the **Utilities** menu to see when they have completed or any problems encountered. It is not necessary to keep the browser open during the download.
Particular content items can be removed from the RACHEL menu (but not from the server), by moving them from the rachel/www/modules directory to rachel/www/modules.out. In the future it will be possible to do this using this menu option.
### Please Note
With the current version of RACHEL there are errors in several files that may cause this download to fail part way through the first time. However, it will succeed on a subsequent try. If you see that it has failed when visting the **Display Job Status** screen, please return to this screen and click **Download RACHEL Content**. The download and unzip will resume from the point at which it failed.
### Don't Forget
Make sure that the **RACHEL** service is enabled under **Configure** - **Services Enabled**. The content can be downloaded if it is not enabled, but will only be visible to students after RACHEL has been enabled.
Remove Downloaded Files
-----------------------
By installing Zim files or RACHEL you are downloading large files from the internet. These are not removed in case there is a problem and the installed needs to be rerun.
After you are sure that everything has been installed successfully you can remove some or all of these files to free up space on the disk.
Here is how to verify that an item has been installed:
* Look at the installation page and ensure that the item is marked as installed.
* Look at the School Server menu to see it the item is accessible and brings up content.
Actions
-------
**Restart the Kiwix Zim Server** and **Refresh Kiwix Catalog** are covered above.
**Refresh Zims Installed** recalculates the amount of space used on the disk.

View file

@ -1,53 +0,0 @@
XSCE Admin Console - Overview
=============================
The purpose of this Admin Console is to assist an administrator in configuring, adding content to, and generally managing
the School Server.
### Caution
The Admin Console you are using can make changes to the server. These changes can take varying amounts of time to complete
and the Console will often not be aware of exactly when they finish. To see the results of these changes in the Admin Console
panels you will need to refresh your browser.
The Admin Console is also not aware of hardware changes you make, like plugging in an ethernet cable, until you reboot, so you
should reboot when you make such changes.
The following menu options are available. Please see the help for each individually.
Control
-------
* Reboot Server
* Power Off Server
Configuration
-------------
* Network Parameters
* Internet Caching/Filtering
* Server Portal
* Services Enabled
* Edit Permitted URLs
Install Content
---------------
* Get Started
* Get Zim Files from Kiwix
* Download Khan Academy Videos
* Get RACHEL
* Remove Downloaded Files
Utilities
---------
* Change Password
* Display Job Status
* Display Commands Log
* Display Ansible Facts
* Display XSCE.INI File
* Display System Memory
* Display System Storage
* Perform Internet Speed Test

View file

@ -1,47 +0,0 @@
XSCE Admin Console - Utilities
==============================
The options on this menu serve to monitor and diagnose problems on the School Server and to maintain some core data.
### Change Password
Use this menu option to change the XSCE Admin Password.
The password should be at least 8 characters in length and include a mix of Upper Case, Lower Case, Numbers, and Symbols. The server will also impose restrictions based the use of simple patterns like 123 and some words.
Please note that there is no way to recover this password without logging directly into the server and changing it as root.
### Display Job Status
Actions that will require more than a few seconds to complete are handled as long-running Jobs. In fact, some tasks create multiple jobs. The progress and success or failure of these jobs may be monitored by visiting this menu option. Click **Refresh Status** to update the display.
Jobs that are no longer desired may be cancelled and doing so will cancel any jobs that were created as part of the same task. To cancel a job check the box beside it and click **Cancel Checked Jobs**
### Display Commands Log
Shows the commands sent from the browser application to the command server, any errors generated, and the response time if succeeded.
### Admin Tools
Use these tools to administer, monitor, and evaluate server usage.
### Display Ansible Facts
All software on the server has been installed using a product called ansible. This option will tell you more than you probably wanted to know about its variables.
### Display XSCE.INI File
The xsce.ini file is where the School Server stores information about what is installed and enabled. You can view it here.
### Display System Memory
Just what it says.
### Display System Storage
Just what it says, the amount of storage, allocated and unallocated in internal and external drives and cards.
### Perform Internet Speed Test
There are two tests that can be performed. One downloads a 10M file and the other downloads 100M and does a smaller upload. Even the 10M can take a long time on a **slow internet connection** to the point that it never returns a result to the console.
**WARNING:** On mobile connections you should be careful not to consume excessive bandwidth as this **could lead to additional costs** from your network supplier.

View file

@ -1,34 +0,0 @@
<!-- Start ControlServer Top Level Pane -->
<div class="row-fluid"> <!-- ControlServer Top Level Header -->
<div class="col-md-9 col-md-offset-3">
<h1>Control School Server</h1>
</div>
</div> <!-- row-fluid -->
<div class="tabbable"> <!-- Start ControlServer Sublevel Menu Items and Options -->
<div class="row-fluid"> <!-- Start containing row -->
<div class="col-md-3 xsce-left-nav"> <!-- Start left column -->
<h2>Control Server</h2>
<ul class="nav nav-pills nav-stacked"> <!-- Start XXX Sub Level Menu -->
<li class="active"><a href="#controlWarning">Warning</a></li>
<!-- <li><a href="#">Services Enabled</a></li> -->
</ul> <!-- End XXX Sub Level Menu -->
<h2>Actions</h2>
<div class="action-buttons">
<button id="REBOOT" type="button" class="btn btn-lg btn-danger">REBOOT Server</button>
<button id="POWEROFF" type="button" class="btn btn-lg btn-danger">POWER OFF Server</button>
</div>
</div> <!-- left column -->
<div class="col-md-9"> <!-- Start right column -->
<div class="tab-content"> <!-- Start Container for Sub Menu Options Panes -->
<div class="tab-pane active" id="controlWarning"> <!-- Start instConStart Submenu Option Pane -->
<h2>WARNING</h2>
<p>Please use caution in rebooting or powering off the server.</p>
<p>Please make sure that no one is using it.</p>
<h2>PLEASE NOTE</h2>
<p>After you have made <b>Changes to Hardware</b> you should probably <b>Reboot</b>.</p>
<p>After you have <b>Installed New Content or Features</b> please <b>Refresh your Browser</b>.</p>
</div> <!-- End controlWarning Submenu Option Pane -->
</div> <!-- End Container for Sub Menu Options Panes -->
</div> <!-- right column -->
</div> <!-- End containing row -->
</div> <!-- End ControlServer Sublevel Menu Items and Options -->

View file

@ -1,300 +0,0 @@
<!-- Start Configure Pane -->
<div class="row-fluid"> <!-- Configure Header -->
<div class="col-md-9 col-md-offset-3">
<h1>Configure the School Server</h1>
</div>
</div> <!-- row -->
<div class="tabbable"> <!-- Configure Menu Options -->
<div class="row-fluid">
<div class="col-md-3 xsce-left-nav">
<h2>Configuration</h2>
<ul class="nav nav-pills nav-stacked">
<li class="active"><a href="#confNetwork">Network Parameters</a></li>
<li><a href="#confNetFilter">Internet Caching/Filtering</a></li>
<li><a href="#confHostapd">Internal Wifi AP</a></li>
<li><a href="#confPortal">Server Portal</a></li>
<li><a href="#confServices">Services Enabled</a></li>
<li><a href="#confWhitelist">Edit Permitted URLs</a></li>
</ul>
<h2>Actions</h2>
<div class="action-buttons">
<button id="SAVE-WHITELIST" type="button" class="btn btn-lg btn-success">Update Permitted URLs List</button>
<button id="SET-CONF-CMD" type="button" class="btn btn-lg btn-success">Save Configuration</button>
<button id="RUN-ANSIBLE" type="button" class="btn btn-lg btn-danger">Install Configured Options</button>
</div>
</div> <!-- left column -->
<div class="col-md-9"> <!-- right column -->
<div class="tab-content">
<div class="tab-pane active" id="confNetwork"> <!-- Start Configure Network Pane -->
<h2>Network Parameters</h2>
<p><b>WARNING:</b> If you change the Host Name or Domain Name, you will need to refresh the browser after clicking Install Configured Options.</p>
<form role="form" class="form-horizontal" id="confNetworkForm">
<div class="form-group">
<div class="col-sm-4"><label>Host Name</label><input type="text" class="form-control" name="xsce_hostname" id="xsce_hostname" onblur="return xsce_hostnameVal()"></div>
<div class="col-sm-4"><label>Domain Name (no inital dot)</label><input type="text" class="form-control" name="xsce_domain" id="xsce_domain" onblur="return xsce_domainVal()"></div>
</div>
<h3>Server's Role in the Network</h3>
<div class="radio">
<label><input type="radio" name="gui_desired_network_role" id="gui_desired_network_role-Gateway" value="Gateway">Gateway - You need two or more network adapters, one of which must be connected to the Internet or a larger Network (WAN).</label>
</div>
<div class="radio">
<label><input type="radio" name="gui_desired_network_role" id="gui_desired_network_role-Appliance" value="Appliance">Appliance - You only need one network adapter, which must be connected to the Internet or a larger Network (WAN).</label>
</div>
<div class="radio">
<label><input type="radio" name="gui_desired_network_role" id="gui_desired_network_role-LanController" value="LanController">Lan Controller - You only need one network adapter. It is probably part of a standalone Network (LAN).</label>
</div>
<h2>Advanced Network Parameters</h2>
<h3>Network Discovered at Last Boot</h3>
<div id="discoveredNetwork">
Gateway Found<BR>
WAN Device p2p1<BR>
LAN Device p7p1<BR>
**** HARD CODED FOR TESTING ***
</div>
<h3>Override IP Addresses</h3>
<div class="checkbox">
<label><input type="checkbox" name="gui_static_wan" id="gui_static_wan" >Check to use a static WAN IP Address instead of DHCP</label>
</div>
<p><b>Please Note:</b> These parameters only take effect when you have checked the box above and have the necessary Network Adapters.</p>
<div class="row"><label class="col-md-3">Static Wan IP Address</label><div class="col-md-3"><input type="text" class="form-control" name="gui_static_wan_ip" id="gui_static_wan_ip"></div></div>
<div class="row"><label class="col-md-3">Static Wan Mask</label><div class="col-md-3"><input type="text" class="form-control" name="gui_static_wan_netmask" id="gui_static_wan_netmask"></div></div>
<div class="row"><label class="col-md-3">Static Wan Gateway</label><div class="col-md-3"><input type="text" class="form-control" name="gui_static_wan_gateway" id="gui_static_wan_gateway"></div></div>
<div class="row"><label class="col-md-3">Static Wan Name Server</label><div class="col-md-3"><input type="text" class="form-control" name="gui_static_wan_nameserver" id="gui_static_wan_nameserver"></div></div>
<h3>Internet Access for Installations</h3>
<p><b>Please Note:</b> This parameter will only be rarely changed.</p>
<div class="checkbox">
<label><input type="checkbox" name="use_cache" id="use_cache" >Check to force cache use even when online</label>
</div>
<h3>Admin Console Security</h3>
<p><b>Please Note:</b> This program is password protected, so this only needs to be changed if you are worried that there could be people listening on your network.</p>
<div class="checkbox">
<label><input type="checkbox" name="adm_cons_force_ssl" id="adm_cons_force_ssl" >Check to force https (ssl) access to this program.</label>
</div>
</form>
</div> <!-- network pane -->
<div class="tab-pane" id="confNetFilter"> <!-- Start Configure Network Filter Pane -->
<h2>Internet Caching/Filtering</h2>
<p><b>Please Note:</b> These parameters only take effect when you have selected the Gateway Role on the previous screen and have the necessary Network Adapters.</p>
<form role="form" id="confNetFilterForm">
<div class="checkbox">
<label>
<input type="checkbox" name="squid_enabled" id="squid_enabled">Check to Enable local Web Page storage for later fast Access (squid cache)
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="gw_squid_whitelist" id="xo-gw_squid_whitelist">Check to Restrict Web Page Access to a Specific List of Sites (Permitted URLs)
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="gw_block_https" id="xo-gw_block_https">Check to Block all HTTPS Access to Web Page
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="dansguardian_enabled" id="dansguardian_enabled">Check to Restrict Web Page Access according to Words in the Content (dansguardian)
</label>
</div>
</form>
</div> <!-- network Filter pane -->
<div class="tab-pane" id="confHostapd"> <!-- Start Configure Hostapd Pane -->
<h2>Internal Wifi Access Point</h2>
<p><b>Please Note:</b> These parameters only take effect if there is an internal wifi adapter and hostapd is enabled.</p>
<form role="form" id="confHostapdForm">
<div class="checkbox">
<label>
<input type="checkbox" name="hostapd_enabled" id="hostapd_enabled">Check to Enable the internal wifi adapter as an Access Point.
</label>
</div>
<div class="row"><label class="col-md-3">Internal Wifi Access Point Name</label><div class="col-md-3"><input type="text" class="form-control" name="host_ssid" id="host_ssid"></div></div>
<div class="row"><label class="col-md-3">Internal Wifi Access Point Mode</label><div class="col-md-3"><input type="text" class="form-control" name="host_wifi_mode" id="host_wifi_mode"></div></div>
<div class="row"><label class="col-md-3">Internal Wifi Access Point Channel</label><div class="col-md-3"><input type="text" class="form-control" name="host_channel" id="host_channel"></div></div>
</form>
</div> <!-- Configure Hostapd pane -->
<div class="tab-pane" id="confPortal"> <!-- Start Configure Server Portal Pane -->
<h2>Server Portal</h2>
<p><b>Please Note:</b> The selected Portal Page will only work if the corresponding software is Enabled.</p>
<form role="form" id="confPortalForm">
<div class="checkbox">
<label>
<input type="checkbox" name="wordpress_enabled" id="wordpress_enabled">Check to Enable WordPress.
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="dokuwiki_enabled" id="dokuwiki_enabled">Check to Enable Dokuwiki.
</label>
</div>
<h3>Select Server Home Page</h3>
<div class="radio">
<label><input type="radio" name="gui_desired_home_url" id="gui_desired_home_url-home" value="home">/home</label>
</div>
<div class="radio">
<label><input type="radio" name="gui_desired_home_url" id="gui_desired_home_url-xs-portal" value="xs-portal">/xs-portal</label>
</div>
<div class="radio">
<label><input type="radio" name="gui_desired_home_url" id="gui_desired_home_url-wordpress" value="wordpress">/wordpress</label>
</div>
<div class="radio">
<label><input type="radio" name="gui_desired_home_url" id="gui_desired_home_url-wiki" value="wiki">/wiki</label>
</div>
</form>
</div> <!-- Configure Server Portal pane -->
<div class="tab-pane" id="confServices"> <!-- Start Configure Services Pane -->
<h2>Check Each Service to Enable</h2>
<form role="form" id="confServicesForm">
<h3>For Students</h3>
<div class="checkbox xo-services_service">
<label>
<input type="checkbox" name="xo-services_enabled" id="xo-services_enabled">Services for XO Laptops such as Registration, Backup, and the Activity Server
</label>
</div>
<div class="checkbox ejabberd_service">
<label>
<input type="checkbox" name="ejabberd_enabled" id="ejabberd_enabled">Chat and Collaboration Server for XO Laptops and Others
</label>
</div>
<div class="checkbox moodle_service">
<label>
<input type="checkbox" name="moodle_enabled" id="moodle_enabled">Moodle, a Courseware Manager and E-Learning Platform
</label>
</div>
<div class="checkbox kiwix_serve_service">
<label>
<input type="checkbox" name="kiwix_serve_enabled" id="kiwix_serve_enabled">Kiwix, serves Wikipediae and other content from sources below. You must also install content.
</label>
</div>
<div class="checkbox kalite_service">
<label>
<input type="checkbox" name="kalite_enabled" id="kalite_enabled">Khan Academy Lite, serves Khan Academy videos and Exercises. You must also install content.
</label>
</div>
<div class="checkbox kalite_cron_service">
<label>
<input type="checkbox" name="kalite_cron_enabled" id="kalite_cron_enabled">The Khan Academy Downloader. You can turn this off if you don't plan to download videos.
</label>
</div>
<div class="checkbox iiab_service">
<label>
<input type="checkbox" name="iiab_enabled" id="iiab_enabled">Open Street Maps from the original Internet-in-a-Box. You must also install content.
</label>
</div>
<div class="checkbox rachel_service">
<label>
<input type="checkbox" name="rachel_enabled" id="rachel_enabled">RACHEL, another collection of popular content from World Possible. You must also install content.
</label>
</div>
<div class="checkbox calibre_service">
<label>
<input type="checkbox" name="calibre_enabled" id="calibre_enabled">Calibre, an E-Book Platform. You must also install content.
</label>
</div>
<div class="checkbox pathagar_service">
<label>
<input type="checkbox" name="pathagar_enabled" id="pathagar_enabled">Pathagar, another E-Book Platform. You must also install content.
</label>
</div>
<div class="checkbox sugarizer_service">
<label>
<input type="checkbox" name="sugarizer_enabled" id="sugarizer_enabled">Sugarizer provides SugarLabs activities directly on the server.
</label>
</div>
<h3>Media Sharing and Printing</h3>
<div class="checkbox elgg_service">
<label>
<input type="checkbox" name="elgg_enabled" id="elgg_enabled">ELGG, a Social Networking Platform for Student Blogging, File Sharing, and Collaboration
</label>
</div>
<div class="checkbox owncloud_service">
<label>
<input type="checkbox" name="owncloud_enabled" id="owncloud_enabled">OwnCloud is a local server-based facility for sharing files, photos, contacts, calendars, etc.
</label>
</div>
<div class="checkbox samba_service">
<label>
<input type="checkbox" name="samba_enabled" id="samba_enabled">SAMBA provides Network File Sharing
</label>
</div>
<div class="checkbox cups_service">
<label>
<input type="checkbox" name="cups_enabled" id="cups_enabled">CUPS provides support for printers.
</label>
</div>
<h3>For Monitoring and Administration</h3>
<div class="checkbox schooltool_service">
<label>
<input type="checkbox" name="schooltool_enabled" id="schooltool_enabled">SchoolTool is a School Administration System.
</label>
</div>
<div class="checkbox xovis_service">
<label>
<input type="checkbox" name="xovis_enabled" id="xovis_enabled">XO Visualization&mdash;Graphs of Student Usage Statistics.
</label>
</div>
<div class="form-group xovis_service">
<label for="xovis_chart_heading">Title to Appear on XO Visualization Charts</label>
<input type="text" name="xovis_chart_heading" class="form-control" id="xovis_chart_heading" placeholder="Enter chart heading.">
</div>
<div class="checkbox sugar-stats_service">
<label>
<input type="checkbox" name="sugar-stats_enabled" id="sugar-stats_enabled">Collect statistics on the use of Sugar Activities.
</label>
</div>
<!-- removed ajenti -->
<div class="checkbox monit_service">
<label>
<input type="checkbox" name="monit_enabled" id="monit_enabled">Monit watches critical applications and restarts them if they fail.
</label>
</div>
<div class="checkbox munin_service">
<label>
<input type="checkbox" name="munin_enabled" id="munin_enabled">Munin collects and graphs system-level statistics.
</label>
</div>
<div class="checkbox vnstat_service">
<label>
<input type="checkbox" name="vnstat_enabled" id="vnstat_enabled">VnStat gathers and displays networking statistics.
</label>
</div>
<div class="checkbox awstats_service">
<label>
<input type="checkbox" name="awstats_enabled" id="awstats_enabled">AWStats graphs statistics on web server usage.
</label>
</div>
<div class="checkbox phpmyadmin_service">
<label>
<input type="checkbox" name="phpmyadmin_enabled" id="phpmyadmin_enabled">PhpMyadmin allows maintenance of mysql databases.
</label>
</div>
<div class="checkbox openvpn_service">
<label>
<input type="checkbox" name="openvpn_enabled" id="openvpn_enabled">Open VPN allows a secure connection between servers over the Internet for remote maintenance.
</label>
</div>
<div class="checkbox teamviewer_service">
<label>
<input type="checkbox" name="teamviewer_enabled" id="teamviewer_enabled">TeamViewer provides a secure connection for Remote Support and Online Meetings.
</label>
</div>
</form>
</div> <!-- services pane -->
<div class="tab-pane" id="confWhitelist"> <!-- Start Configure Whitelist Pane -->
<h2>Edit Permitted URLs</h2>
<p><b>Please Note:</b> These parameters only take effect when you have Checked Server should act as a Gateway to the Internet the previous screen.</p>
<form role="form" id="confNetFilterForm">
<div class="form-group">
<label for="xsce_whitelist">Permitted URLs</label>
<textarea rows="20" name="xsce_whitelist" class="form-control" id="xsce_whitelist" placeholder="Enter a list of permitted URLs."></textarea>
</div>
</form>
</div> <!-- End Whitelist pane -->
</div> <!-- tab-content -->
</div> <!-- right column -->
</div> <!-- row -->
</div> <!-- tabbable -->
<!-- Configure -->

View file

@ -1,136 +0,0 @@
<!-- Start InstallContent Top Level Pane -->
<div class="row-fluid"> <!-- InstallContent Top Level Header -->
<div class="col-md-9 col-md-offset-3">
<h1>Install School Server Content</h1>
</div>
</div> <!-- row-fluid -->
<div class="tabbable"> <!-- Start InstallContent Sublevel Menu Items and Options -->
<div class="row-fluid"> <!-- Start containing row -->
<div class="col-md-3 xsce-left-nav"> <!-- Start left column -->
<h2>Installation Tasks</h2>
<ul class="nav nav-pills nav-stacked"> <!-- Start XXX Sub Level Menu -->
<li class="active"><a href="#instConStart">Get Started</a></li>
<li><a href="#instConZims" call-after="checkKiwixCatalogDate">Get Zim Files from Kiwix</a></li>
<li><a href="#instConKAlite">Download Khan Academy Videos</a></li>
<!-- <li><a href="#instConRachel" call-after="getRachelStat">Get RACHEL</a></li> -->
<li><a href="#instDelDownloads" call-after="getDownloadList">Remove Downloaded Files</a></li>
<!-- <li><a href="#">Services Enabled</a></li> -->
</ul> <!-- End XXX Sub Level Menu -->
<h2>Actions</h2>
<div class="action-buttons">
<!-- <button id="ZIM-STATUS-REFRESH" type="button" class="btn btn-lg btn-success">Refresh Zims Installed List </button> -->
<button id="RESTART-KIWIX" type="button" class="btn btn-lg btn-success">Restart Kiwix Server</button>
<button id="KIWIX-LIB-REFRESH" type="button" class="btn btn-lg btn-success">Refresh Kiwix Catalog</button>
</div>
</div> <!-- left column -->
<div class="col-md-9"> <!-- Start right column -->
<div class="tab-content"> <!-- Start Container for Sub Menu Options Panes -->
<div class="tab-pane active" id="instConStart"> <!-- Start instConStart Submenu Option Pane -->
<h2>Get Started</h2>
<p>The options on this menu allow you to download and install content onto the School Server. As of this release all of this content comes from the internet, but in the future there will be menu options to copy from a portable hard disk drive.</p>
<p>These options are aimed at people who plan to set up the server in a location where there is a relatively high bandwidth connection and then deploy it where there is little or no connectivity.</p>
<p>Options planned but not yet implemented</p>
<ul>
<li>Search for media-based content such as RACHEL or IIAB on removable media to permit installation.</li>
<li>Ability to set removable storage as working disk for downloads.</li>
<li>Flag to allow downloads of content to be valid only for each session.</li>
</ul>
</div> <!-- End instConStart Submenu Option Pane -->
<div class="tab-pane" id="instConZims"> <!-- Start instConZims Submenu Option Pane -->
<h2>Install Kiwix Zim Files</h2>
<p>Kiwix has a large number of files containing compressed content which you can select by language.</p>
<div class="row">
<div class="col-sm-3"><button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#selectLangCodes">Select Languages</button></div>
<div class="col-sm-4"><span id="zimDiskSpace" >Disk Space: </span></div>
<div class="col-sm-2"><button id="INST-ZIMS" type="button" class="btn btn-lg btn-primary">Install Selected Zims</button></div>
</div>
<div id="ZimDownload" > </div>
</div> <!-- End instConZims Submenu Option Pane -->
<div class="tab-pane" id="instConRachel"> <!-- Start instConRachel Submenu Option Pane -->
<h2>Install Rachel</h2>
<p>RACHEL is a collection of a variety of educational content currated by World Possible. This menu option allows you to download and install it.</p>
<h3>PLEASE NOTE</h3>
<p>There is an error in one or two files of the current version of RACHEL in use here, so it may be necessary to <b>run this command a second time</b> if the job fails.</p>
<div class="row">
<div class="col-sm-4">
<h3>Rachel Status: </h3>
<table>
<tr><td>Installed:&nbsp;</td><td id="rachelInstalled"></td></tr>
<tr><td>Enabled:&nbsp;</td><td id="rachelEnabled"></td></tr>
<tr><td>Content Found:&nbsp;</td><td id="rachelContentFound"></td></tr>
</table>
</div>
<div class="col-sm-4">
<h3>Disk Space:</h3>
<span id="rachelDiskSpace" >Disk Space: </span><BR><BR>
<button id="DOWNLOAD-RACHEL" type="button" class="btn btn-lg btn-primary">Download RACHEL Content</button></div>
</div>
<div id=rachelModules class="row">
<div class="col-sm-4">
<h3>Rachel Modules: </h3>
<div> <!-- Start rachelModules Table -->
<table class="rachelModules">
<thead>
<tr>
<th style="width:40%">Title</th>
<th style="width:10%">Enabled</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div> <!-- End rachelModules Table -->
</div>
<div class="col-sm-4"><BR><BR><BR>
<!-- <button id="ENABLE-RACHEL" type="button" class="btn btn-lg btn-primary">Enable RACHEL Content</button>-->
</div>
</div>
<div id="RachelDownload" > </div>
</div> <!-- End instConRachel Submenu Option Pane -->
<div class="tab-pane" id="instDelDownloads"> <!-- Start instDelDownloads Submenu Option Pane -->
<h2>Remove Downloaded Files</h2>
<p>In the process of installing ZIM files and RACHEL a number of downloads are performed and accumulated. Use this option to remove any of them.<BR>
Please <b>make sure</b> the content contained in the downloads has been <b>installed</b> prior to deleting these files.
</p>
<div class="row">
<div class="col-sm-4">
<h3>Disk Space:</h3>
<span id="dnldDiskSpace" >Disk Space: </span><BR><BR>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<h3>Downloaded Files: </h3>
<div> <!-- Start downloadedFiles Table -->
<table>
<thead>
<tr>
<th style="width:40%">File Name</th>
<th style="width:10%">Size</th>
<th style="width:10%">Delete</th>
</tr>
</thead>
<tbody id="downloadedFilesRachel"></tbody>
<tbody id="downloadedFilesZims"></tbody>
</table>
</div> <!-- End downloadedFiles Table -->
</div>
</div>
<div class="row">
<div class="col-sm-4">
<button id="DEL-DOWNLOADS" type="button" class="btn btn-lg btn-primary">Delete Checked Files</button>
</div>
</div>
</div> <!-- End instDelDownloads Submenu Option Pane -->
<div class="tab-pane" id="instConKAlite"> <!-- Start instConStart Submenu Option Pane -->
<h2>Download Khan Academy Videos</h2>
<p>Khan Academ Lite has the ability to download selected portions of the available videos in several different languages.</p>
<p>Click the Button below to launch it.</p>
<button id="launchKaliteButton" type="button" class="btn btn-lg btn-success">Launch KA Lite</button>
</div> <!-- End instConKAlite Submenu Option Pane -->
</div> <!-- End Container for Sub Menu Options Panes -->
</div> <!-- right column -->
</div> <!-- End containing row -->
</div> <!-- End XXX Sublevel Menu Items and Options -->
</div> <!-- End InstallContent Top Level Pane -->

View file

@ -1,145 +0,0 @@
<!-- Start Utilites Top Level Pane -->
<div class="row-fluid"> <!-- Status Top Level Header -->
<div class="col-md-9 col-md-offset-3">
<h1>School Server Utilities</h1>
</div>
</div> <!-- row-fluid -->
<div class="tabbable"> <!-- Start Status Sublevel Menu Items and Options -->
<div class="row-fluid"> <!-- Start containing row -->
<div class="col-md-3 xsce-left-nav"> <!-- Start left column -->
<h2>Menu Options</h2>
<ul class="nav nav-pills nav-stacked"> <!-- Start Status Sub Level Menu -->
<li class="active"><a href="#utilChgPW">Change Password</a></li>
<li><a href="#utilJobs" call-after="getJobStat">Display Job Status</a></li>
<li><a href="#utilLog">Display Commands Log</a></li>
<li><a href="#utilsTools">Admin Tools</a></li>
<li><a href="#utilsAnsible">Display Ansible Facts</a></li>
<li><a href="#utilsXsceIni" call-after="getXsceIni">Display XSCE.INI File</a></li>
<li><a href="#utilsMemory" call-after="getSysMem">Display System Memory</a></li>
<li><a href="#utilsStorage" call-after="getSysStorage">Display System Storage</a></li>
<li><a href="#utilsSpeedTest">Perform Internet Speed Test</a></li>
<!-- <li><a href="#utilsAnsTags">Run Ansible by Tag</a></li> -->
<!-- <li><a href="#utilsResetNetwork">Troubleshoot Networking</a></li> -->
</ul> <!-- End Status Sub Level Menu -->
<!--
<h2>Actions</h2>
<div class="action-buttons">
<button id="REBOOT" type="button" class="btn btn-lg btn-danger">REBOOT Server</button>
<button id="POWEROFF" type="button" class="btn btn-lg btn-danger">POWER OFF Server</button>
</div>
-->
</div> <!-- left column -->
<div class="col-md-9"> <!-- Start right column -->
<div class="tab-content"> <!-- Start Container for Sub Menu Options Panes -->
<div class="tab-pane active" id="utilChgPW"> <!-- Start Change Password Pane -->
<h2>Change Password</h2>
<h3>XSCE Admin User</h3>
<!-- <p></p> -->
<form role="form" class="form-horizontal" id="utilChgPWForm">
<p><b>Please Note:</b> You should chose a password that is a mix of Upper Case, Lower Case, Numbers, and Symbols and is at least 8 Characters long.</p>
<div class="row"><label class="col-md-3">XSCE Admin User</label><div class="col-md-3"><input type="text" class="form-control" name="xsce_admin_user" id="xsce_admin_user" readonly></div></div>
<div class="row"><label class="col-md-3">Old Password</label><div class="col-md-3"><input type="text" class="form-control" name="xsce_admin_old_password" id="xsce_admin_old_password"></div></div>
<div class="row"><label class="col-md-3">New Password</label><div class="col-md-3"><input type="text" class="form-control" name="xsce_admin_new_password" id="xsce_admin_new_password"></div></div>
<div class="row"><label class="col-md-3">Repeat New Password</label><div class="col-md-3"><input type="text" class="form-control" name="xsce_admin_new_password2" id="xsce_admin_new_password2"></div></div>
</form>
<button id="CHGPW" type="button" class="btn btn-lg btn-primary">Change Password</button>
</div> <!-- End Change Password Pane -->
<div class="tab-pane" id="utilJobs"> <!-- Start Status statusJobs Submenu Option Pane -->
<h2>Job Status</h2><br>
<div class="row">
<div class="col-sm-3"><button id="CANCEL-JOBS" type="button" class="btn btn-lg btn-primary">Cancel Checked Jobs</button></div>
<div class="col-sm-5"><span id="statusJobsRefreshTime" >Last Refreshed: </span></div>
<div class="col-sm-2"><button id="JOB-STATUS-REFRESH" type="button" class="btn btn-lg btn-primary">Refresh Status</button></div>
</div>
<div id=jobStatTable> <!-- Start jobStatTable -->
<table class="jobTable table-striped table-bordered">
<thead>
<tr>
<th style="width:10%">#</th>
<th style="width:30%">Command</th>
<th style="width:40%">Result</th>
<th style="width:10%">Status</th>
<th style="width:10%">As Of</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div> <!-- End jobStatTable -->
</div> <!-- End Status statusJobs Submenu Option Pane -->
<div class="tab-pane" id="utilLog"> <!-- Start utilLogs Pane -->
<h2>Command Log</h2>
<div id="serverCmdLog"></div>
</div> <!-- End utilLogs pane -->
<div class="tab-pane" id="utilsTools"> <!-- Start utilsTools Pane -->
<h2>Administration Tools</h2>
<ul >
<!-- <li><a href="http://schoolserver:5984/xovis/_design/xovis-couchapp/index.html" target="_blank">XOvis - Graphs statistics on XO use of Activities.</a></li> -->
<li><a href="/munin" target="_blank">Munin - Drill down to monitor server performance.</a></li>
<li><a href="/awstats/awstats.pl?config=schoolserver" target="_blank">AWStats - Statistics on web server usage.</a></li>
<li><a href="/info" target="_blank">Online IIAB Information copied for Offline Use</a></li>
<li><a href="http://github.com/XSCE/xsce/wiki" target="_blank">Link to the same Online IIAB Information</a></li>
</ul>
</div> <!-- End utilsTools pane -->
<div class="tab-pane" id="utilsAnsible"> <!-- Start statusAnsible Pane -->
<h2>Ansible Facts</h2>
<div id=ansibleFacts>
</div>
</div> <!-- End statusAnsible pane -->
<div class="tab-pane" id="utilsXsceIni"> <!-- Start statusAnsible Pane -->
<h2>XSCE.INI file</h2>
<div id=xsceIni>
</div>
</div> <!-- End statusAnsible pane -->
<div class="tab-pane" id="utilsMemory"> <!-- Start statusAnsible Pane -->
<h2>System Memory</h2>
<pre><div id="sysMemory">
</div></pre>
</div> <!-- End utilsMemory pane -->
<div class="tab-pane" id="utilsStorage"> <!-- Start statusAnsible Pane -->
<h2>System Storage</h2>
<pre><div id=sysStorage>
</div></pre>
</div> <!-- End utilsStorage pane -->
<div class="tab-pane" id="utilsSpeedTest"> <!-- Start utilsSpeedTest Pane -->
<h2>Internet Speed Test</h2>
<!-- <p><b>WARNING:</b> The first test retrieves a 10M data file. The second is more than 100M. If you have a mobile internet connection this could be costly.</p>
<p>If you have a mobile internet connection this could be <b>costly</b>.</p> -->
<div class="row">
<div class="col-sm-6">
<button id="GET-INET-SPEED" type="button" class="btn btn-lg btn-primary pane-buttons">Run 10M Speed Test</button>
<div id="intSpeed1">
No Test Results<BR>
</div>
</div>
<!-- <div class="col-sm-6">
<button id="GET-INET-SPEED2" type="button" class="btn btn-lg btn-primary pane-buttons">Run 100M Speed Test</button>
<div id="intSpeed2">
No Test Results<BR>
</div>
</div> -->
</div> <!-- End row -->
</div> <!-- End utilsSpeedTest pane -->
<div class="tab-pane" id="utilsAnsTags"> <!-- Start utilsAnsTags Pane -->
<h2>Ansible Tags</h2>
<p><b>WARNING:</b> This option should only be used by EXPERTS. Not all combinations of tags will work.</p>
<form role="form" id="ansibleTagsForm">
<div id="ansibleTags">
</div>
</form>
<button id="RUN-TAGS" type="button" class="btn btn-lg btn-danger">Run Ansible with Checked Tags</button>
</div> <!-- End utilsAnsTags pane -->
<div class="tab-pane" id="utilsResetNetwork"> <!-- Start utilsResetNetwork Pane -->
<h2>Troubleshoot Networking</h2>
<p><b>WARNING:</b> This option should only be used by EXPERTS. It is possible to leave the server without a usable connection.</p>
<button id="RESET-NETWORK" type="button" class="btn btn-lg btn-danger">Reset Network Configuration</button>
</div> <!-- End utilsResetNetwork pane -->
</div> <!-- End Container for Status Sub Menu Options Panes -->
</div> <!-- right column -->
</div> <!-- End containing row -->
</div> <!-- End Status Sublevel Menu Items and Options -->

View file

@ -1,246 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>School Server Admin Console</title>
<!-- Bootstrap -->
<link href="/common/css/bootstrap.min.css" rel="stylesheet">
<!-- <link href="css/xsce.css" rel="stylesheet"> -->
<link href="css/xsce.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container-fluid"> <!-- Start Outermost Container -->
<div class="page-header">
<center><h1>School Server Admin Console</h1></center>
</div>
<div class="tabbable boxed parentTabs"> <!-- Start Top Level tabbable boxed parentTabs -->
<div class="xsce-top-nav"> <!-- Top Level Nav-->
<ul class="nav nav-tabs">
<li class="active"><a href="#ControlServer">Control</a></li>
<li><a href="#Configure">Configure</a></li>
<li><a href="#InstallContent">Install Content</a></li>
<!-- <li><a href="#Future">Assemble Content</a></li> -->
<li><a href="#Util">Utilities</a></li>
<li><a href="#Help">Help</a></li>
<li><a href="#About" call-after="showAboutSummary">About</a></li>
<!-- <li><a href="#Test">Tests</a></li> -->
</ul>
</div>
<div class="tab-content"> <!-- Start Top Level Content-->
<!-- Start ControlServer Top Level Pane -->
<!-- This is inline so can reboot or poweroff without waiting for rest of app -->
<div class="tab-pane active" id="ControlServer">
<div class="row-fluid"> <!-- ControlServer Top Level Header -->
<div class="col-md-9 col-md-offset-3">
<h1>Control School Server</h1>
</div>
</div> <!-- row-fluid -->
<div class="tabbable"> <!-- Start ControlServer Sublevel Menu Items and Options -->
<div class="row-fluid"> <!-- Start containing row -->
<div class="col-md-3 xsce-left-nav"> <!-- Start left column -->
<h2>Control Server</h2>
<ul class="nav nav-pills nav-stacked"> <!-- Start XXX Sub Level Menu -->
<li class="active"><a href="#controlWarning">Warning</a></li>
<!-- <li><a href="#">Services Enabled</a></li> -->
</ul> <!-- End XXX Sub Level Menu -->
<h2>Actions</h2>
<div class="action-buttons">
<button id="REBOOT" type="button" class="btn btn-lg btn-danger" style="opacity:0.5" disabled>REBOOT Server</button>
<button id="POWEROFF" type="button" class="btn btn-lg btn-danger" style="opacity:0.5" disabled>POWER OFF Server</button>
</div>
</div> <!-- left column -->
<div class="col-md-9"> <!-- Start right column -->
<div class="tab-content"> <!-- Start Container for Sub Menu Options Panes -->
<div class="tab-pane active" id="controlWarning"> <!-- Start instConStart Submenu Option Pane -->
<h2>WARNING</h2>
<p>Please use caution in rebooting or powering off the server.</p>
<p>Please make sure that no one is using it.</p>
<h2>PLEASE NOTE</h2>
<p>After you have made <b>Changes to Hardware</b> you should probably <b>Reboot</b>.</p>
<p>After you have <b>Installed New Content or Features</b> please <b>Refresh your Browser</b>.</p>
<h2>Starting Application</h2>
<div id="initLog"></div>
</div> <!-- End controlWarning Submenu Option Pane -->
</div> <!-- End Container for Sub Menu Options Panes -->
</div> <!-- right column -->
</div> <!-- End containing row -->
</div> <!-- End XXX Sublevel Menu Items and Options -->
</div> <!-- End ControlServer Top Level Pane -->
<!-- These Menu Panes are dynamically loaded -->
<!-- Configure Pane -->
<div class="tab-pane" id="Configure"></div>
<!-- InstallContent Pane -->
<div class="tab-pane" id="InstallContent"></div>
<!-- Utilities Pane -->
<div class="tab-pane" id="Util"></div>
<div class="tab-pane" id="Help"> <!-- Start Help Top Level Pane -->
<div class="row-fluid"> <!-- Help Top Level Header -->
<div class="col-md-9 col-md-offset-3">
<h1>Help</h1>
</div>
</div> <!-- row-fluid -->
<div class="tabbable"> <!-- Start XXX Sublevel Menu Items and Options -->
<div class="row-fluid"> <!-- Start containing row -->
<div class="col-md-3 xsce-left-nav"> <!-- Start left column -->
<h2>Help Sections</h2>
<ul class="nav nav-pills nav-stacked"> <!-- Start XXX Sub Level Menu -->
<li class="active"><a href="#helpText" call-after="getHelp" call-after-arg="Overview.rst">Overview</a></li>
<li><a href="#helpText" call-after="getHelp" call-after-arg="Control.rst">Control</a></li>
<li><a href="#helpText" call-after="getHelp" call-after-arg="Config.rst">Configure</a></li>
<li><a href="#helpText" call-after="getHelp" call-after-arg="InstContent.rst">Install Content</a></li>
<li><a href="#helpText" call-after="getHelp" call-after-arg="Utilities.rst">Utilities</a></li>
<!-- <li><a href="#">Internet Caching/Filtering</a></li>
<li><a href="#">Services Enabled</a></li> -->
</ul> <!-- End XXX Sub Level Menu -->
</div> <!-- left column -->
<div class="col-md-9"> <!-- Start right column -->
<div class="tab-content"> <!-- Start Container for Sub Menu Options Panes -->
<div class="tab-pane active" id="helpText"> <!-- Start XXX Submenu Option Pane -->
<div id="helpItem"></div>
</div> <!-- End XXX Submenu Option Pane -->
</div> <!-- End Container for Sub Menu Options Panes -->
</div> <!-- right column -->
</div> <!-- End containing row -->
</div> <!-- End XXX Sublevel Menu Items and Options -->
</div> <!-- End Help Top Level Pane -->
<div class="tab-pane" id="About"> <!-- Start About Top Level Pane -->
<div class="row-fluid"> <!-- About Top Level Header -->
<div class="col-md-9 col-md-offset-3">
<h1>About XSCE Server</h1>
</div>
</div> <!-- row-fluid -->
<div class="tabbable"> <!-- Start XXX Sublevel Menu Items and Options -->
<div class="row-fluid"> <!-- Start containing row -->
<div class="col-md-3 xsce-left-nav"> <!-- Start left column -->
<h2>About</h2>
<ul class="nav nav-pills nav-stacked"> <!-- Start XXX Sub Level Menu -->
<li class="active"><a href="#aboutSummary" call-after="showAboutSummary">About XSCE Server</a></li>
<li><a href="#"></a></li>
<!-- <li><a href="#">Internet Caching/Filtering</a></li>
<li><a href="#">Services Enabled</a></li> -->
</ul> <!-- End XXX Sub Level Menu -->
</div> <!-- left column -->
<div class="col-md-9"> <!-- Start right column -->
<div class="tab-content"> <!-- Start Container for Sub Menu Options Panes -->
<div class="tab-pane active" id="aboutSummary"> <!-- Start XXX Submenu Option Pane -->
<div id="aboutSummaryText"></div>
<div>
<h2>Internet-in-a-Box Credits</h2>
The XSCE School Server known as Internet-in-a-Box includes a variety of educational and other content and applications which are attributed as follows:<br><br>
All Wikipedia content is available for free at <a href="http://www.wikipedia.org/">www.wikipedia.org</a>.<br>
All other Wikimedia content is available for free via links at <a href="http://www.wikimedia.org/">www.wikimedia.org</a>.<br>
All Khan Academy content is available for free at <a href="http://www.khanacademy.org/">www.khanacademy.org</a>.<br>
All CK-12 content is available for free at <a href="http://www.ck-12.org/">www.ck-12.org</a>.<br>
All MedLine content is available for free at <a href="http://www.nlm.nih.gov/medlineplus/">www.nlm.nih.gov/medlineplus</a>.<br>
All Hesperian content is available for free at <a href="http://www.hesperian.org/">www.hesperian.org</a>.<br>
All Gutenberg content is available for free at <a href="http://www.gutenberg.org/">www.gutenberg.org</a>.<br>
All OLPC content is available for free at <a href="http://wiki.laptop.org/go/Library_grid">www.laptop.org</a>.<br>
All MIT Scratch content is available for free at <a href="http://scratch.mit.edu">scratch.mit.edu</a>.<br>
All UNESCO's IICBA content is available for free at <a href="http://www.eng.unesco-iicba.org/elibrary">www.eng.unesco-iicba.org</a>.<br>
All Math Expression content is available for free at <a href="http://www.mathexpression.com">www.mathexpression.com</a>.<br>
All Music Theory content is available for free at <a href="http://www.musictheory.net">www.musictheory.net</a>.<br><br>
Internet-in-a-Box also includes the work of content aggregators which we gratefully acknowledge:<br><br>
RACHEL is a curation of selected offline content at <a href="http://www.rachel.worldpossible.org/">www.rachel.worldpossible.org</a>.<br>
Kiwix is a Zim server and repository of Wikimedia and other content in a compressed Zim file format at <a href="http://www.kiwix.org/">www.kiwix.org</a>.<br>
KA Lite is a server and repository of Khan Academy content in various languages at <a href="http://learningequality.org/ka-lite/">learningequality.org/ka-lite</a>.<br><br>
Internet-in-a-Box also contains a number of applications each of which has its own attribution information which is included.<br><br>
This Internet-in-a-Box distribution resides at <a href="http://github.com/XSCE/xsce">github.com/XSCE/xsce</a>.<br><br>
It is licensed under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.<br><br>
Licensing information may be found at <a href="http://github.com/XSCE/xsce/blob/master/LICENSE">github.com/XSCE/xsce/blob/master/LICENSE</a>.<br>
</div>
</div> <!-- End XXX Submenu Option Pane -->
</div> <!-- End Container for Sub Menu Options Panes -->
</div> <!-- right column -->
</div> <!-- End containing row -->
</div> <!-- End XXX Sublevel Menu Items and Options -->
</div> <!-- End About Top Level Pane -->
</div> <!-- End Top Level Content -->
</div> <!-- End Top Level tabbable boxed parentTabs -->
<!-- Modal Pages go Here -->
<div id="initDataModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<!-- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> -->
<h4>Loading Data into Console</h4>
</div>
<div id="initDataModalResult" class="modal-body">
If this takes more than a couple of seconds there is likely a problem with the server.<BR><BR>
</div>
</div>
</div>
</div>
<!-- Select LangCodes Modal -->
<div class="modal fade modal-wide" id="selectLangCodes" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button id="selectLangButton2" type="button" class="close" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Select Languages</h4>
</div>
<div class="modal-body">
<div id="ZimLanguages" class="lang-list"> </div>
<button id="moreLangButton" type="button" class="btn btn-primary">More Languages</button>
<div id="ZimLanguages2" class="lang-list"> </div>
</div>
<div class="modal-footer">
<button id="selectLangButton" type="button" class="btn btn-primary">Show Content</button>
</div>
</div>
</div>
</div>
<!-- Select LangCodes Modal -->
</div> <!-- End Outermost Container -->
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/common/js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/common/js/bootstrap.min.js"></script>
<script src="/common/js/Markdown.Converter.js"></script>
<script src="/common/js/Markdown.Sanitizer.js"></script>
<script src="js/admin_console.js"></script>
<script>
controlButtonsEvents(); // make first page active before others in case want to reboot or shutdown
make_button_disabled("#REBOOT", false);
make_button_disabled("#POWEROFF", false);
console.log ("Starting dynamic pages");
// N.B we can preassemble the html fragments with ansible assemble module so browser caches a single file
// We can still set up Control panel before the others
$.when(
$.get('htmlf/20-configure.html', function(data) {
$('#Configure').html(data);
configButtonsEvents();
}),
$.get('htmlf/40-install_content.html', function(data) {
$('#InstallContent').html(data);
instContentButtonsEvents();
}),
$.get('htmlf/70-utilities.html', function(data) {
$('#Util').html(data);
utilButtonsEvents();
})
).done(function() {
main();
});
</script>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -1,231 +0,0 @@
- name: Install packages for cmdsrv
package: name={{ item }}
state=present
with_items:
- apache2
- php{{ php_version }}
- php{{ php_version }}-mysql
- php{{ php_version }}-dev
- build-essential
- php-pear
- python-dev
- python-pip
- libzmq3-dev
- python-cracklib
- pkg-config
tags:
- download
when: is_debuntu
- name: install ubuntu connector apache to php
package: name=libapache2-mod-php
state=present
tags:
- download
when: is_ubuntu
- name: Install packages for cmdsrv
package: name={{ item }}
state=present
with_items:
- httpd
- php
- mod_ssl
- mod_authnz_external
- pwauth
- gcc
- gcc-c++
- php-devel
- php-pear
- python-devel
- python-pip
- zeromq3-devel
- cracklib-python
tags:
- download
when: is_redhat
- name: check the config_vars.yml file
stat: path=/etc/xsce/config_vars.yml
register: config_vars
- name: Ensure config_vars.yml is not empty
shell: "cat /etc/xsce/config_vars.yml"
register: config_vars_check
when: config_vars.stat.exists == true
- name: Install default config_vars.yml
template: src=cmdsrv/config_vars.yml
dest=/etc/xsce/config_vars.yml
mode=0644
when: config_vars.stat.exists == false or config_vars_check.stdout == ""
- name: put a python interface to xsce.env
template: src=cmdsrv/xsce_env.py
dest=/etc/xsce
- name: Install packages for fedora 23+
package: name=redhat-rpm-config
state=installed
when: ansible_distribution == "Fedora" and ansible_distribution_version >= "22"
# - zeromq3
# pip install pyzmq - didn't use the installed zmq rpm and the target zmq 4, not 3, for which there is no rpm.
- name: Download zeromq and python binding
pip: name=pyzmq
extra_args="--download {{ pip_packages_dir }}"
when: not {{ use_cache }} and not {{ no_network }}
tags:
- download2
- name: Install zeromq and python binding
pip: name=pyzmq
extra_args="--no-index --find-links=file://{{ pip_packages_dir }}"
- name: Set the pear download_dir
shell: "pear config-set download_dir {{ xsce_dir }}"
tags:
- download2
- name: Download php binding for zeromq
shell: yes '' | pecl download zmq-beta
when: not {{ use_cache }} and not {{ no_network }}
tags:
- download2
- name: Install php binding for zeromq
shell: pecl install -f zmq*tgz
args:
creates: "{{ phplib_dir }}/modules/zmq.so"
- name: Download speedtest-cli
pip: name=speedtest-cli
extra_args="--download {{ pip_packages_dir }}"
when: not {{ use_cache }} and not {{ no_network }}
tags:
- download2
- name: Install speedtest-cli
pip: name=speedtest-cli
extra_args="--no-index --find-links=file://{{ pip_packages_dir }}"
- name: Create admin-console directory
file: path={{ item }}
mode=0700
owner=root
group=root
state=directory
with_items:
- "{{ cmdsrv_path }}"
- "{{ cmdsrv_path }}/scripts"
- name: Install Command Server Executable
copy: src=cmdsrv/xsce-cmdsrv
dest="{{ cmdsrv_path }}/xsce-cmdsrv"
mode=0700
owner=root
group=root
- name: create an empty database
file: path={{ cmdsrv_path }}/{{ xsce_cmdsrv_dbname }}
state=touch
- name: Copy scripts
copy: src={{ item }}
dest="{{ cmdsrv_path }}/scripts"
mode=0755
owner=root
group=root
with_fileglob:
- cmdsrv/scripts/*
- name: Copy json files
copy: src={{ item }}
dest="/etc/xsce"
mode=0644
owner=root
group=root
with_fileglob:
- cmdsrv/json/*
- name: Create symlink from /common/assets to kiwix_catalog.json
file: src=/etc/xsce/kiwix_catalog.json
dest={{ doc_root }}/common/assets/kiwix_catalog.json
owner=root
group=root
state=link
- name: Create cmdsrv.conf file
template: backup=yes
src=cmdsrv/cmdsrv.conf.j2.debian
dest=/etc/xsce/cmdsrv.conf
owner=root
group=root
mode=0644
when: is_debuntu
- name: Create cmdsrv.conf file
template: backup=yes
src=cmdsrv/cmdsrv.conf.j2.fedora
dest=/etc/xsce/cmdsrv.conf
owner=root
group=root
mode=0644
when: not is_debuntu
- name: Create a folder for xsce-cmdsrv executable not on path
file: path=/usr/lib/xsce
state=directory
# Create xsce-cmdsrv service
- name: Create xsce-cmdsrv service
template: backup=yes
src={{ item.src }}
dest={{ item.dest }}
owner=root
group=root
mode={{ item.mode }}
with_items:
- { src: 'cmdsrv/xsce-cmdsrv.service.j2', dest: '/etc/systemd/system/xsce-cmdsrv.service', mode: '0655'}
- { src: 'cmdsrv/xsce-cmdsrv-ctl', dest: '/usr/bin/xsce-cmdsrv-ctl', mode: '0755'}
- name: Create xsce-cmdsrv service
template: backup=yes
src={{ item.src }}
dest={{ item.dest }}
mode={{ item.mode }}
with_items:
- { src: 'cmdsrv/xsce-cmdsrv-init.j2', dest: '/etc/init.d/xsce-cmdsrv', mode: '0755'}
- { src: 'cmdsrv/zmq.ini', dest: '/etc/php5/apache2/conf.d/20-zmq.ini', mode: '0755'}
when: is_debian
- name: Create xsce-cmdsrv service
template: backup=yes
src={{ item.src }}
dest={{ item.dest }}
mode={{ item.mode }}
with_items:
- { src: 'cmdsrv/xsce-cmdsrv-init.j2', dest: '/etc/init.d/xsce-cmdsrv', mode: '0755'}
- { src: 'cmdsrv/zmq.ini', dest: '/etc/php/7.0/mods-available/20-zmq.ini', mode: '0755'}
when: is_ubuntu
- name: Enable the ubuntu php config file
command: phpenmod 20-zmq
when: is_ubuntu
- name: Create xsce-cmdsrv service
template: backup=yes
src={{ item.src }}
dest={{ item.dest }}
mode={{ item.mode }}
with_items:
- { src: 'cmdsrv/xsce-cmdsrv-init.j2', dest: '/usr/libexec/xsce-cmdsrv', mode: '0755'}
- { src: 'cmdsrv/zmq.ini', dest: '/etc/php.d/20-zmq.ini', mode: '0755'}
when: is_redhat
- name: Enable xsce-cmdsrv service
service: name=xsce-cmdsrv
enabled=yes
state=started

View file

@ -1,155 +0,0 @@
- name: Install packages for console
package: name={{ item }}
state=present
with_items:
- libapache2-mod-authnz-external
- pwauth
when: is_debuntu
tags:
- download
- name: Enable ssl
apache2_module: name=ssl
when: is_debuntu
- name: Create admin-console directory tree
file: path={{ item }}
mode=0755
owner=root
group=root
state=directory
with_items:
- "{{ admin_console_path }}"
- "{{ admin_console_path }}/css"
- "{{ admin_console_path }}/help"
- "{{ admin_console_path }}/js"
- "{{ admin_console_path }}/htmlf"
- name: Copy admin-console css files
copy: src={{ item }}
dest="{{ admin_console_path }}/css"
mode=0644
owner=root
group=root
with_fileglob:
- console/css/*.css
- name: Copy admin-console help files
copy: src={{ item }}
dest="{{ admin_console_path }}/help"
mode=0644
owner=root
group=root
with_fileglob:
- console/help/*
- name: Copy admin-console javascript files
copy: src={{ item }}
dest="{{ admin_console_path }}/js"
mode=0644
owner=root
group=root
with_fileglob:
- console/js/*
- name: Copy admin-console html fragment files
copy: src={{ item }}
dest="{{ admin_console_path }}/htmlf"
mode=0644
owner=root
group=root
with_fileglob:
- console/htmlf/*
- name: Install admin-console config file
template: src=console/xs-console.conf.j2
dest=/etc/{{ apache_config_dir }}/xs-console.conf
owner=root
group=root
mode=0644
when: not adm_cons_force_ssl
- name: Delete admin-console config file
file: dest=/etc/{{ apache_config_dir }}/xs-console.conf
state=absent
when: adm_cons_force_ssl
- name: Install admin-console ssl config file
template: src=console/xs-console-ssl.conf.j2
dest=/etc/{{ apache_config_dir }}/xs-console-ssl.conf
owner=root
group=root
mode=0644
when: adm_cons_force_ssl and is_fedora
- name: Remove admin-console ssl config file
file: path=/etc/{{ apache_config_dir }}/xs-console-ssl.conf
state=absent
when: not adm_cons_force_ssl and is_fedora
- name: Remove the debian default config which gets in the way
file: dest=/etc/apache2/sites-enabled/000-default.conf
state=absent
when: is_debuntu
# without ssl
- name: Make the xs-console enabled in apache2
file: state=link
dest=/etc/apache2/sites-enabled/xs-console.conf
src=/etc/{{ apache_config_dir }}/xs-console.conf
when: is_debuntu and not adm_cons_force_ssl
- name: Make the xs-console ssl version disabled in apache2
file: state=absent
dest=/etc/apache2/sites-enabled/xs-console-ssl.conf
src=/etc/{{ apache_config_dir }}/xs-console-ssl.conf
when: is_debuntu and not adm_cons_force_ssl
# with ssl
- name: add link for admin-console config file with ssl support
file: path=/etc/apache2/sites-enabled/xs-console-ssl.conf
src=/etc/{{ apache_config_dir }}/xs-console-ssl.conf
state=link
when: is_debuntu and adm_cons_force_ssl
- name: remove link for admin-console config file with ssl support
file: path=/etc/apache2/sites-enabled/xs-console.conf
src=/etc/{{ apache_config_dir }}/xs-console.conf
state=absent
when: adm_cons_force_ssl and is_debuntu
- name: Install admin-console service
template: src=console/cmd-service.php
dest="{{ admin_console_path }}/cmd-service.php"
owner=root
group=root
mode=0644
- name: Install admin-console server info service
template: src=console/server-info.php
dest="{{ admin_console_path }}/server-info.php"
owner=root
group=root
mode=0644
- name: Install admin-console app
copy: src=console/index.html
dest="{{ admin_console_path }}/index.html"
owner=root
group=root
mode=0644
- name: Install admin home page into apache2
template: src=console/xsce-home-page.conf
dest=/etc/{{ apache_config_dir }}/xsce-home-page.conf
- name: Enable the home page
file: src=/etc/{{ apache_config_dir }}/xsce-home-page.conf
dest=/etc/apache2/sites-enabled/xsce-home-page.conf
state=link
when: is_debuntu
- name: Create the home directory
file: dest={{ doc_root }}/home
state=directory

View file

@ -1,22 +1,11 @@
- include: admin-user.yml
tags:
- base
when: not no_admin is defined
- include: access.yml
tags:
- base
- include: cmdsrv.yml
tags:
- base
- console
- include: console.yml
tags:
- base
- console
- name: Add xsce-admin parameters to ini file
ini_file: dest='{{ service_filelist }}'
section=xsce-admin
@ -26,10 +15,6 @@
- option: name
value: xsce-admin
- option: description
value: '"GUI Admin Console and Command Server"'
value: '"Admin User"'
- option: xsce_admin_user
value: "{{ xsce_admin_user }}"
- option: admin_console_path
value: "{{ admin_console_path }}"
- option: cmdsrv_path
value: "{{ cmdsrv_path }}"

View file

@ -1,21 +0,0 @@
{
"_comments": "xsce-cmdsrv.conf - runtime parameters for the XSCE Command Server",
"xsce-cmdsrv_conf": {
"cmdsrv_no_workers" : 5,
"cmdsrv_job_poll_sleep_interval" : 1,
"cmdsrv_max_concurrent_jobs" : 7,
"xsce_cmdsrv_pid_file" : "/var/run/xsce-cmdsrv.pid",
"kiwix_catalog_file" : "/etc/xsce/kiwix_catalog.json",
"zim_downloads_dir" : "/library/downloads/zims/",
"zim_working_dir" : "/library/working/zims/",
"zim_download_prefix" : "kiwix-0.9+",
"rachel_downloads_dir" : "/library/downloads/rachel/",
"rachel_working_dir" : "/library/working/rachel/",
"xsce_cmdsrv_dbname" : "{{ xsce_cmdsrv_dbname }}",
"ansible_playbook_program" : "/usr/local/bin/ansible-playbook",
"ansible_program" : "/usr/local/bin/ansible",
"apache_data" : "www-data",
"squid_service" : "squid3",
"df_program" : "/bin/df"
}
}

View file

@ -1,21 +0,0 @@
{
"_comments": "xsce-cmdsrv.conf - runtime parameters for the XSCE Command Server",
"xsce-cmdsrv_conf": {
"cmdsrv_no_workers" : 5,
"cmdsrv_job_poll_sleep_interval" : 1,
"cmdsrv_max_concurrent_jobs" : 7,
"xsce_cmdsrv_pid_file" : "/var/run/xsce-cmdsrv.pid",
"kiwix_catalog_file" : "/etc/xsce/kiwix_catalog.json",
"zim_downloads_dir" : "/library/downloads/zims/",
"zim_working_dir" : "/library/working/zims/",
"zim_download_prefix" : "kiwix-0.9+",
"rachel_downloads_dir" : "/library/downloads/rachel/",
"rachel_working_dir" : "/library/working/rachel/",
"xsce_cmdsrv_dbname" : "{{ xsce_cmdsrv_dbname }}",
"ansible_playbook_program" : "/usr/bin/ansible-playbook",
"ansible_program" : "/usr/bin/ansible",
"apache_data" : "apache",
"squid_service" : "squid",
"df_program" : "/usr/bin/df"
}
}

View file

@ -1,45 +0,0 @@
#!/usr/bin/python
import zmq
import sys
REQUEST_TIMEOUT = 10000
if len(sys.argv) == 1 or len(sys.argv) > 3:
print 'usage: cmdsrv-ctl "<command>" "<optional json argument>"'
sys.exit(0)
cmd = sys.argv[1]
send_msg = cmd
if len(sys.argv) == 3:
cmd_args = sys.argv[2]
send_msg += ' ' + cmd_args
print "message to send: ", send_msg
ipc_sock = "/run/cmdsrv_sock"
context = zmq.Context()
print "Connecting to server..."
socket = context.socket(zmq.DEALER)
socket.connect ("ipc://%s" % ipc_sock)
poll = zmq.Poller()
poll.register(socket, zmq.POLLIN)
socket.send (send_msg)
socks = dict(poll.poll(REQUEST_TIMEOUT))
if socket in socks and socks[socket] == zmq.POLLIN:
#if socket_poll.get(socket) == zmq.POLLIN:
# Get the reply
reply_msg = socket.recv()
else:
reply_msg = '{"Error": "No Response from XSCE-CMDSRV"}'
socket.setsockopt(zmq.LINGER, 0)
socket.close()
poll.unregister(socket)
print "Received reply: ", reply_msg

View file

@ -1,91 +0,0 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: xsce-cmdsrv
# Required-Start: $local_fs $network $syslog $named
# Required-Stop: $local_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Administrative GUI for schoolserver
# Description: Start the daemon which filter GUI selectios and
# does the work, changing configuration, down loading content, etc
### END INIT INFO
# Copyright 2014, Tim Moody
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# xsce-cmdsrv This is the script that starts up the
# Command Server on the XSCE School server
#
# Source function library
{% if is_debuntu %}
. /lib/lsb/init-functions
{% else %}
. /etc/rc.d/init.d/functions
{% endif %}
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PID_FILE="/var/run/xsce-cmdsrv.pid"
#OPTS="$PID_FILE "
OPTS="--daemon "
prog=xsce-cmdsrv
SERVER={{ xsce_base }}/xsce_cmdsrv/xsce-cmdsrv
RETVAL=0
start() {
# Start daemons.
{% if is_debuntu %}
log_daemon_msg "Starting $prog: " "cmdsrv"
if start-stop-daemon --start --oknodo --quiet --exec $SERVER \
--pidfile $PID_FILE -- $OPTS; then
log_end_msg 0
else
log_end_msg 1
fi
RETVAL=$?
return $RETVAL
{% else %}
echo -n "Starting $prog: "
daemon --pidfile=${PID_FILE} $SERVER $OPTS
{% endif %}
}
stop() {
# Stop is handled by /usr/bin/xsce-cmdsrv-ctl STOP
/usr/bin/xscd-cmdsrv-ctl < STOP > /dev/null
RETVAL=$?
return $RETVAL
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status xsce-cmdsrv $PID_FILE
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|status}"
exit 1
esac
exit $RETVAL

View file

@ -1,16 +0,0 @@
[Unit]
Description=Provides the XSCE Command Server
After=syslog.target network.target local-fs.target
[Service]
Type=forking
PIDFile=/var/run/xsce-cmdsrv.pid
{% if is_debuntu %}
ExecStart=/etc/init.d/xsce-cmdsrv start
{% else %}
ExecStart=/usr/libexec/xsce-cmdsrv start
{% endif %}
ExecStop=/usr/bin/xsce-cmdsrv-ctl STOP
[Install]
WantedBy=multi-user.target

View file

@ -1,27 +0,0 @@
#!/usr/bin/python
# read xsce.env from python
def get_xsce_env(name):
""" read xsce.env file for a value, return "" if does not exist"""
try:
fd = open("/etc/xsce/xsce.env","r")
for line in fd:
line = line.lstrip()
line = line.rstrip('\n')
if len(line) == 0:
continue
if line[0] == "#":
continue
if line.find("=") == -1:
continue
chunks = line.split('=')
if chunks[0] == name:
return chunks[1]
return("")
except:
return("")
finally:
fd.close()
if __name__ == "__main__":
print(get_xsce_env("WWWROOT"))

View file

@ -1,2 +0,0 @@
; Enable zmq extension module
extension=zmq.so

View file

@ -1,64 +0,0 @@
<?php
/*
* xsce-cmdsrv service handler
* Connects DEALER socket to ipc:///run/cmdsrv_sock
* Sends command, expects response json back
*/
$time_start = microtime(true);
$request_timeout = 30000; // REQUEST_TIMEOUT in milliseconds
$command = $_POST['command'];
//$command = "TEST";
// echo "Command: $command <BR>";
$alert_param = ',"Alert": "True"';
$read = $write = array();
// See if XSCE-CMDSRV is running
if (file_exists("/var/run/xsce-cmdsrv.pid")) {
if (file_exists("/var/run/xsce-cmdsrv-ready")) {
try {
$context = new ZMQContext();
$requester = new ZMQSocket($context, ZMQ::SOCKET_DEALER);
// Socket to talk to server
$requester->connect("ipc:///run/cmdsrv_sock");
$requester->setSockOpt(ZMQ::SOCKOPT_LINGER, 0);
$requester->send($command);
$poll = new ZMQPoll();
$poll->add($requester, ZMQ::POLL_IN);
$events = $poll->poll($read, $write, $request_timeout);
if ($events > 0) {
$reply = $requester->recv();
if (strpos($reply, '"Error":') === false) {
$reply = '{"Data": ' . $reply;
}
} else {
$reply = '{"Error": "No Response from XSCE-CMDSRV in ' . $request_timeout . ' milliseconds"' . $alert_param;
}
} catch (Exception $e) {
$reply = '{"Error": "' . $e->getMessage() . '"' . $alert_param;
}
} else {
$reply = '{"Error": "XSCE-CMDSRV has started but is not ready."' . $alert_param;
}
} else {
$reply = '{"Error": "XSCE-CMDSRV is not running."' . $alert_param;
}
$time_end = microtime(true);
$time = $time_end - $time_start;
if (strpos($reply, '"Error":') === false) {
$reply = $reply . ',"Resp_time": "' . $time . '"}';
}
// $time = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"]; php 5.4 up
header('Content-type: application/json');
echo $reply;
?>

View file

@ -1,10 +0,0 @@
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/ca.crt
SSLCertificateKeyFile /etc/pki/tls/private/ca.key
<Directory /var/www/vhosts/yoursite.com/httpsdocs>
AllowOverride All
</Directory>
DocumentRoot /var/www/vhosts/yoursite.com/httpsdocs
ServerName yoursite.com
</VirtualHost>

View file

@ -1,16 +0,0 @@
<?php
/*
* server_info.php
* send server and client ip to client
*/
// phpinfo();
exec("pgrep xsce-cmdsrv", $pids);
if(empty($pids))
$cmdsrv_running = "FALSE";
else
$cmdsrv_running = "TRUE";
header('Content-type: application/json');
echo '{"xsce_server_ip":"'.$_SERVER['SERVER_ADDR'].'","xsce_client_ip":"'.$_SERVER['REMOTE_ADDR'].'","xsce_cmdsrv_running":"'.$cmdsrv_running.'"}';
?>

View file

@ -1,32 +0,0 @@
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^/admin(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Alias /admin "{{ admin_console_path }}"
<VirtualHost *:443>
ServerName "schoolserver.lan"
AddExternalAuth pwauth /usr/sbin/pwauth
SetExternalAuthMethod pwauth pipe
SSLEngine on
{% if is_debuntu %}
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
{% else %}
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
{% endif %}
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
<Directory "{{ admin_console_path }}">
AuthType Basic
AuthName "Admin Console"
AuthBasicProvider external
AuthExternal pwauth
require valid-user
</Directory>
</VirtualHost>

View file

@ -1,7 +0,0 @@
<VirtualHost *:12345>
<Directory /var/www/admin>
AllowOverride All
</Directory>
DocumentRoot /var/www/admin
ServerName Console
</VirtualHost>

View file

@ -1,16 +0,0 @@
Alias /admin "{{ admin_console_path }}"
<Directory "{{ admin_console_path }}">
AuthType Basic
AuthName "Admin Console"
AuthBasicProvider external
AuthExternal pwauth
require valid-user
</Directory>
{% if is_debuntu %}
<IfModule mod_authnz_external.c>
AddExternalAuth pwauth /usr/sbin/pwauth
SetExternalAuthMethod pwauth pipe
</IfModule>
{% endif %}

View file

@ -1 +0,0 @@
WSGIScriptAlias /cmdsrv {{ doc_root }}/test/client.wsgi

View file

@ -1,9 +0,0 @@
# XSCE Home Page
# Redirect to home page on School Server
# Default is xs-portal
# RedirectMatch of root to home page
# See the note in default_vars.yml
RedirectMatch ^/$ {{ xsce_home_url }}