XS Community Edition/0.3/Hacking: Difference between revisions
No edit summary |
|||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
==Summary== |
|||
This is the developer documentation for initial version of the School Server - Community Edition, Version 0.3. |
|||
The target audience will be experienced Linux users and admin with a strong interest in the School Server. |
|||
Based on practical experience and this document a hacker should be able to download the XS code, modify the code, build an rpm, and install an RPM on either XO-1.75 or commodity x86 hardware. Secondary goals will be to download a RPM and install a fully functioning School Server. |
|||
==Purpose== |
|||
The purpose of this documentation will be to provide a stable enough starting point from which hackers can view, modify, and install the server code it for their individual needs. |
|||
==Design and architecture== |
==Design and architecture== |
||
The school server is a collection of common network related services which can be installed and configured as necessary. The School Server provides a core base of services on which extended service can be installed and modified and modified as modules. |
|||
==Core Services== |
==Core Services== |
||
====Dynamic Host Configuration Protocol (dhcpd)==== |
|||
<ul> |
|||
Dynamic Host Configuration Protocol is a network protocol used to configure devices so that they can connect and communicate over an IP network. DHCP allows the school server to assign IP addresses to connected XOs. |
|||
====Internet Domain Name Server (named)==== |
|||
<li>Dynamic Host Configuration Protocol (dhcpd) |
|||
The Domain Name System converts the name of a Web site (www.google.com) to an IP address (65.115.71.34). Named is a daemon within BIND that responds to DNS queries from remote machines. |
|||
====Network Address Translation (NAT), Gateway, IP Masquerading, Firewall (iptables)==== |
|||
DHCP (Dynamic Host Configuration Protocol) allows the school server to assign IP addresses to connected XOs. DHCP is a network protocol used to configure network devices so that they can connect and communicate over an IP network. |
|||
The School Server used Network Address Translation to provide security, privacy, and scalability. NAT enhances scalability as an entire school only needs a single IP address. This can be further augmented by additional filtering. Privacy in enhance because students machines are not directly accessible from the public internet. |
|||
<li>Internet Domain Name Server (named) |
|||
The Domain Name System (DNS) converts the name of a Web site (www.google.com) to an IP address (65.115.71.34). Named is a daemon within BIND that responds to DNS queries from remote machines. |
|||
<li>Network Address Translation/NAT, Gateway, IP Masquerading, Firewall (iptables) |
|||
NAT. The School Server used Network Address Translation to provide security, privacy, and scalability. NAT enables all of the XOs within a school to appear to the world as a single machine. As a security measure all packets pass through the server. This can be further augmented by additional filtering. Privacy in enhance because students machines are not directly accessible from the public internet. Finally NAT enhances scalability as an entire school only needs a single IP address. |
|||
<li>XMPP server (ejabberd) |
|||
====XMPP server (ejabberd)==== |
|||
Extensible Messaging and Presence Protocol (XMPP)is a communications protocol for near real-time, instant messaging (IM), presence information, and contact list maintenance. In the classroom environment it's used to give support to XO Collaboration features through Gabble. |
Extensible Messaging and Presence Protocol (XMPP)is a communications protocol for near real-time, instant messaging (IM), presence information, and contact list maintenance. In the classroom environment it's used to give support to XO Collaboration features through Gabble. |
||
====IDMGR==== |
|||
<li>IDMGR : TODO fix The Identity Manager is a service which accepts requests for registration from laptops [[School_Identity_Manager]] |
|||
Identity Manager is a service which accepts requests for registration from laptops [[School_Identity_Manager]] |
|||
</ul> |
|||
==Extended Services== |
==Extended Services== |
||
====Web server (apache)==== |
|||
<ul> |
|||
<li>Web server (apache) |
|||
A web server enables the school server to generate and deliver web pages at the request of client Laptop. The web server is a building block for many other extended services. |
A web server enables the school server to generate and deliver web pages at the request of client Laptop. The web server is a building block for many other extended services. |
||
====Proxy server and web cache (squid)==== |
|||
A proxy server and web cache reduces the overall bandwidth needs of the school. All Laptops requests pass through the proxy and are temporarily stored. If more than one student requests the same file, the proxy only has to go out to the public internet once. |
A proxy server and web cache reduces the overall bandwidth needs of the school. All Laptops requests pass through the proxy and are temporarily stored. If more than one student requests the same file, the proxy only has to go out to the public internet once. |
||
====OLPC-update (rsync)==== |
|||
OLPC-update is necessary to update the kernel of XO due to modifications that have been made to the kernel which prevent standard package management systems from working correctly. |
OLPC-update is necessary to update the kernel of XO due to modifications that have been made to the kernel which prevent standard package management systems from working correctly. |
||
====Activity update (activity updater)==== |
|||
The activity updater enables teachers to easily distribute new or updated activities to their students |
The activity updater enables teachers to easily distribute new or updated activities to their students. |
||
====Virtual Private Network (open vpn)==== |
|||
The Virtual private Network is useful for creating secure point-to-point connections in routed or bridged configurations which makes is possible for remote access facilities |
|||
The Virtual private Network is useful for creating secure point-to-point connections in routed or bridged configurations which makes is possible for remote access facilities. |
|||
</ul> |
|||
==The Code== |
==The Code== |
||
Line 79: | Line 54: | ||
===Code layout=== |
===Code layout=== |
||
The 0.3 revision of XSCE software has been made more modular. |
|||
TODO new code layout. |
|||
Configuration consists of a series of scripts in the plugins.d tree. Major services are separated under plugins.d. The layout of each plugin is described in http://schoolserver.wordpress.com/xs-installation/add-a-service-to-school-server-by-creating-a-plugin/. |
|||
Currently the code lives in the xs-config/ dir. Consider these 3 subdirectories of xs-config: |
|||
In the 0.2 release, the code lived in the xs-config/ dir. Consider these 3 subdirectories of xs-config: |
|||
<ol> |
<ol> |
||
Line 101: | Line 79: | ||
===Building=== |
===Building=== |
||
'''$ make rpm''' |
'''$ make rpm''' |
||
==Installing== |
|||
XS-CE 0.2 will run on XO 1.75. |
|||
TODO commodity x86. |
|||
===XO 1.75 Install=== |
|||
====Prereqs==== |
|||
This recipe installs XS Community Edition on XO-1.75 (ARM) running OLPC OS 12.1.0 (http://wiki.laptop.org/go/Release_notes/12.1.0) with power management turned off within My Settings | Power. |
|||
During the install process, your XS server must be connected to the Internet, via its built-in Wifi adapter/ears (it may NOT connect to the Internet thru a USB Ethernet Adapter during your install). After the install process, your XS server may connect to the Internet using others mean. |
|||
Also required is a [[USB ethernet adaptors|USB Ethernet Adapter]] connected to a separate Wifi access point (call it AP-LAN) so kids' XOs can later connect their XOs to the server. |
|||
Repeat any of the download steps below if they fail due to Internet/DNS glitches. |
|||
====Installing==== |
|||
<ol> |
|||
<li>Ensure USB Ethernet Adapters are connected. |
|||
<li>Launch Terminal Activity (unhide Terminal if necessary, clicking List View in the top right of Home View). |
|||
<Li>Change to user root by typing "su". |
|||
<li>Make sure the date and time are set correctly. If not set it manually using "date mmddhhmmyyyy" where mm=month, dd=day, hh=hour, mm=minute, yyyy=year. This is required for yum to work correctly. |
|||
<li>Change directory by typing "cd /etc/yum.repos.d" |
|||
<li>Download the needed yum repo by typing "wget http://build.activitycentral.com/xsce.repo". |
|||
<li>Install xs-config-xo by typing "yum -y install xs-config-xo" (downloads 17+ MB). |
|||
<li>Type "bootstrap-xo" (downloads 34+ MB). |
|||
<li>Press [Enter] to reboot. |
|||
<li>Launch Terminal Activity. |
|||
<li>Change to user root by typing "su". |
|||
<li>Type the command "xs-setup" . This generates a long list of "yum" install requests, similar to the normal adding of functions that you would do if you loaded a minimal "network" install CD from Fedora, and then added additional functions one at a time. (downloads 200+ MB) |
|||
<li>"INSERT USB ETHERNET ADAPTER NOW" warning will appear. Insert it as instructed.<br>Type "y" to continue. 40+ minutes later, your XS should return to a root prompt with the message "XS configured; services are ready to use." (downloads about 200 MB !) |
|||
<li>Remove any USB Ethernet Adapter |
|||
<li>Reboot. |
|||
<li>Re-insert USB Ethernet Adapter. |
|||
</ol> |
|||
====setup==== |
|||
<ol> |
|||
<li>Use "ifconfig" to determine the ip address of the XS.<br>Take note of its eth0-ip-address = WAN-ip.<br>If you've inserted the USB Ethernet Adapter above (serving the LAN/Intranet) also take note of the school server's eth1-ip-address = LAN-ip = 172.18.96.1 |
|||
<li>If you inserted the USB Ethernet Adapter above, configure its own Wifi Access Point (AP) to properly serve other LAN/Intranet client XOs. (If the Wifi AP is a router, DO NOT plug into its "WAN" port -- instead use any of its LAN/normal ports. And be sure to enable the AP's "bridge mode" or similar, to disable the AP's own DHCP) |
|||
</ol> |
|||
==Hacking== |
==Hacking== |
||
Line 206: | Line 139: | ||
Project Link http://openvpn.net/ |
Project Link http://openvpn.net/ |
||
===OOB=== |
|||
Build system |
|||
===Offline Yum=== |
|||
Offline set up |
Latest revision as of 23:49, 8 August 2013
Design and architecture
The school server is a collection of common network related services which can be installed and configured as necessary. The School Server provides a core base of services on which extended service can be installed and modified and modified as modules.
Core Services
Dynamic Host Configuration Protocol (dhcpd)
Dynamic Host Configuration Protocol is a network protocol used to configure devices so that they can connect and communicate over an IP network. DHCP allows the school server to assign IP addresses to connected XOs.
Internet Domain Name Server (named)
The Domain Name System converts the name of a Web site (www.google.com) to an IP address (65.115.71.34). Named is a daemon within BIND that responds to DNS queries from remote machines.
Network Address Translation (NAT), Gateway, IP Masquerading, Firewall (iptables)
The School Server used Network Address Translation to provide security, privacy, and scalability. NAT enhances scalability as an entire school only needs a single IP address. This can be further augmented by additional filtering. Privacy in enhance because students machines are not directly accessible from the public internet.
XMPP server (ejabberd)
Extensible Messaging and Presence Protocol (XMPP)is a communications protocol for near real-time, instant messaging (IM), presence information, and contact list maintenance. In the classroom environment it's used to give support to XO Collaboration features through Gabble.
IDMGR
Identity Manager is a service which accepts requests for registration from laptops School_Identity_Manager
Extended Services
Web server (apache)
A web server enables the school server to generate and deliver web pages at the request of client Laptop. The web server is a building block for many other extended services.
Proxy server and web cache (squid)
A proxy server and web cache reduces the overall bandwidth needs of the school. All Laptops requests pass through the proxy and are temporarily stored. If more than one student requests the same file, the proxy only has to go out to the public internet once.
OLPC-update (rsync)
OLPC-update is necessary to update the kernel of XO due to modifications that have been made to the kernel which prevent standard package management systems from working correctly.
Activity update (activity updater)
The activity updater enables teachers to easily distribute new or updated activities to their students.
Virtual Private Network (open vpn)
The Virtual private Network is useful for creating secure point-to-point connections in routed or bridged configurations which makes is possible for remote access facilities.
The Code
Downloading code
$ git clone http://dev.sugardextrose.org/xs-config
$ git clone git://dev.sugardextrose.org/xs-config <-- (Shows progress through git:// protocol)
or for commit access (requires login and password)
$ git clone http://dev.sugardextrose.org/git/xs-config
Code layout
The 0.3 revision of XSCE software has been made more modular.
Configuration consists of a series of scripts in the plugins.d tree. Major services are separated under plugins.d. The layout of each plugin is described in http://schoolserver.wordpress.com/xs-installation/add-a-service-to-school-server-by-creating-a-plugin/.
In the 0.2 release, the code lived in the xs-config/ dir. Consider these 3 subdirectories of xs-config:
scripts/
Configuration consists of a series of scripts which live in the scripts/ dir. The process is kicked off by running xs-setup. xs-setup calls a series of scripts with the naming convention the xs-[ServiceName] each of which set up an individual service.cfg/etc/
When necessary, the xs-[ServiceName] scripts installs files from under cfg/etc as necessary.cfg/html/top/
The web based GUI is located under cfg/html/top/
Building
$ make rpm
Hacking
Dynamic Host Configuration Protocol (dhcpd)
DHCP (Dynamic Host Configuration Protocol) allows the school server to assign IP addresses to connected XOs. DHCP is a network protocol used to configure network devices so that they can connect and communicate over an IP network.
Project Link http://www.isc.org/software/dhcp
Internet Domain Name Server (named)
The Domain Name System (DNS) converts the name of a Web site (www.google.com) to an IP address (65.115.71.34). Named is a daemon within BIND that responds to DNS queries from remote machines.
Project Link https://www.isc.org/software/bind
Network Address Translation/NAT, Gateway, IP Masquerading, Firewall (iptables)
NAT. The School Server used Network Address Translation to provide security, privacy, and scalability. NAT enables all of the XOs within a school to appear to the world as a single machine. As a security measure all packets pass through the server. This can be further augmented by additional filtering. Privacy in enhance because students machines are not directly accessible from the public internet. Finally NAT enhances scalability as an entire school only needs a single IP address.
Project Link http://www.netfilter.org/projects/iptables/
XMPP server (ejabberd)
Extensible Messaging and Presence Protocol (XMPP)is a communications protocol for near real-time, instant messaging (IM), presence information, and contact list maintenance. In the classroom environment it's used to give support to XO Collaboration features through Gabble.
Project Link http://www.ejabberd.im/
IDMGR The Identity Manager is a service which accepts requests for registration from laptops School_Identity_Manager
Project Link http://wiki.laptop.org/go/School_Identity_Manager
Web server (apache)
A web server enables the school server to generate and deliver web pages at the request of client Laptop. The web server is a building block for many other extended services.
Project Link http://www.apache.org/
Proxy server and web cache (squid)
A proxy server and web cache reduces the overall bandwidth needs of the school. All Laptops requests pass through the proxy and are temporarily stored. If more than one student requests the same file, the proxy only has to go out to the public internet once.
Project Link http://www.squid-cache.org/
OLPC-update (rsync)
OLPC-update is necessary to update the kernel of XO due to modifications that have been made to the kernel which prevent standard package management systems from working correctly.
Project Link http://wiki.laptop.org/go/Olpc-update
Activity update (activity updater)
The activity updater enables teachers to easily distribute new or updated activities to their students
Project Link ???
Virtual Private Network (open vpn)
The Virtual private Network is useful for creating secure point-to-point connections in routed or bridged configurations which makes is possible for remote access facilities
Project Link http://openvpn.net/