<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>DaemonAdmin/Portal</title><revhistory><revision><revnumber>26</revnumber><date>2018-12-01 22:19:39</date><authorinitials>ClintonEbadi</authorinitials><revremark>LD_LIBRARY_PATH gunk is no longer needed, multiarch works fine nowadays</revremark></revision><revision><revnumber>25</revnumber><date>2018-03-04 20:39:55</date><authorinitials>ClintonEbadi</authorinitials><revremark>note which server to publish on</revremark></revision><revision><revnumber>24</revnumber><date>2018-03-04 20:38:26</date><authorinitials>ClintonEbadi</authorinitials><revremark>typo</revremark></revision><revision><revnumber>23</revnumber><date>2018-03-04 20:34:35</date><authorinitials>ClintonEbadi</authorinitials><revremark>update commands for portal3</revremark></revision><revision><revnumber>22</revnumber><date>2015-05-24 22:16:44</date><authorinitials>ClintonEbadi</authorinitials><revremark>the portal crons are in a crontab file now and should be installed with the user instead of scattered around /etc/</revremark></revision><revision><revnumber>21</revnumber><date>2015-05-24 22:12:36</date><authorinitials>ClintonEbadi</authorinitials><revremark>update a bit, we're using portal3 in production now</revremark></revision><revision><revnumber>20</revnumber><date>2014-04-29 05:21:04</date><authorinitials>ClintonEbadi</authorinitials><revremark>mention activewebnodes</revremark></revision><revision><revnumber>19</revnumber><date>2014-02-25 06:09:01</date><authorinitials>ClintonEbadi</authorinitials><revremark>so that</revremark></revision><revision><revnumber>18</revnumber><date>2014-02-25 01:01:31</date><authorinitials>ClintonEbadi</authorinitials><revremark>apg is required too!</revremark></revision><revision><revnumber>17</revnumber><date>2014-02-24 21:42:29</date><authorinitials>ClintonEbadi</authorinitials><revremark>note the LD_LIBRARY_PATH</revremark></revision><revision><revnumber>16</revnumber><date>2014-02-21 20:17:25</date><authorinitials>ClintonEbadi</authorinitials><revremark>probably should rename portal-tools to portal-support</revremark></revision><revision><revnumber>15</revnumber><date>2014-02-21 19:09:19</date><authorinitials>ClintonEbadi</authorinitials><revremark>Updating for navajos installation of the portal</revremark></revision><revision><revnumber>14</revnumber><date>2012-12-30 23:02:22</date><authorinitials>ClintonEbadi</authorinitials><revremark>add webnode</revremark></revision><revision><revnumber>13</revnumber><date>2012-03-30 05:48:31</date><authorinitials>ClintonEbadi</authorinitials></revision><revision><revnumber>12</revnumber><date>2010-12-09 00:06:01</date><authorinitials>ClintonEbadi</authorinitials></revision><revision><revnumber>11</revnumber><date>2010-12-09 00:01:43</date><authorinitials>ClintonEbadi</authorinitials><revremark>Information on sub apps</revremark></revision><revision><revnumber>10</revnumber><date>2010-12-08 23:48:42</date><authorinitials>ClintonEbadi</authorinitials><revremark>rebuilding the join script</revremark></revision><revision><revnumber>9</revnumber><date>2010-03-13 13:10:47</date><authorinitials>AdamChlipala</authorinitials><revremark>Mention that wrappers are built automatically</revremark></revision><revision><revnumber>8</revnumber><date>2010-03-12 23:22:18</date><authorinitials>RichardDarst</authorinitials><revremark>adjust header/footer file stuff</revremark></revision><revision><revnumber>7</revnumber><date>2010-03-12 23:16:10</date><authorinitials>RichardDarst</authorinitials><revremark>update with more building instructions</revremark></revision><revision><revnumber>6</revnumber><date>2008-07-07 04:28:14</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>5</revnumber><date>2007-12-08 16:02:03</date><authorinitials>AdamChlipala</authorinitials><revremark>Subdirectories</revremark></revision><revision><revnumber>4</revnumber><date>2007-12-05 01:38:08</date><authorinitials>AdamChlipala</authorinitials><revremark>Mention building header and footer</revremark></revision><revision><revnumber>3</revnumber><date>2007-12-05 01:29:14</date><authorinitials>AdamChlipala</authorinitials><revremark>No other portal pages around</revremark></revision><revision><revnumber>2</revnumber><date>2007-12-05 01:26:37</date><authorinitials>AdamChlipala</authorinitials><revremark>Add real content</revremark></revision><revision><revnumber>1</revnumber><date>2007-12-04 22:48:21</date><authorinitials>MichaelOlson</authorinitials><revremark>Initial contents, copied from DomTool/Building</revremark></revision></revhistory></articleinfo><para>The HCoop portal runs <ulink url="https://members.hcoop.net"/> and <ulink url="https://join.hcoop.net"/>, generates the <ulink url="http://hcoop.net/who">member directory</ulink>, and manages the vmail user database. </para><section><title>Build Requirements</title><para>The portal requires <ulink url="http://git.hcoop.net/?p=hcoop/mlt.git;a=summary">mlt</ulink> (an html templating system for smlnj) and <ulink url="http://git.hcoop.net/?p=hcoop/smlsql.git;a=summary">smlsql</ulink> (postgresql bindings for smlnj). They are managed in the standard hcoop git repositories. The password generating tool also relies upon <ulink url="https://packages.debian.org/search?keywords=apg">apg</ulink> (automatic password generator). </para><para>The portal build utilities stored in and installed to <code>~hcoop/portal-tools/...</code> </para><itemizedlist><listitem><para><code>.../src</code>: checkouts of mlt and smlsql (portal build file references smlsql from here) </para></listitem><listitem><para><code>.../etc</code>: location of default <code>mlt.conf</code>, <code>hcoop.header</code>, <code>hcoop.footer</code> </para></listitem><listitem><para><code>.../bin</code>: <code>mlt</code> and <code>hcoop_header</code> binaries </para></listitem><listitem><para><code>.../lib32</code>: 32-bit libraries needed by the smlsql </para></listitem><listitem><para><code>.../cgi</code>: portal cgi binaries </para></listitem></itemizedlist><para>mlt and smlsql licensed under the LGPL version 2.1 or any later version. </para></section><section><title>Source</title><para>The portal source lives in module <code>portal</code> of <ulink url="http://git.hcoop.net/?p=hcoop/portal.git;a=summary">our git server</ulink>.  The main check-out is in <code>/afs/hcoop.net/user/h/hc/hcoop/portal3</code>. </para><para>The portal source is available under the GPLv3 or any later version. </para></section><section><title>Building</title><para>Run <code>/afs/hcoop.net/common/etc/scripts/become-hcoop</code> before modifying files in the main check-out or running any git commands that would modify it. </para><para>There are small CGI wrappers which just run compiled binaries in <code>~hcoop/portal-tools/cgi/</code>. The file <code>mlt.conf</code> contains the CGI installation path (modify this to suit your system if building locally).  These wrappers are generated automatically by <code>mlt</code>. </para><section><title>Publishing</title><para>To recompile and publish, login to the webserver hosting the portal (<code>navajos</code> as of 2018-03, but verify in the <code>hcoop.net</code> domtool configuration), enter the portal source directory, and run <code>~hcoop/portal-tools/bin/mlt</code>: </para><screen><![CDATA[/afs/hcoop.net/common/etc/scripts/become-hcoop
cd ~/portal3
~/portal-tools/bin/mlt]]></screen></section><section><title>Regenerating Page Header</title><para><code>header.mlt</code> and <code>footer.mlt</code> are built from assorted other files.  Running <code>make</code> in a check-out directory should build them.  See the Makefile for how they're built.  Note that <code>make</code> <emphasis role="strong">won't</emphasis> publish changes that you make onto the real web sites; you must use <code>mlt</code> for that. </para><para>Needed files for building: </para><itemizedlist><listitem><para>hcoop_header is the one line script <code>cat $prefix/etc/hcoop.header | sed &quot;s/TITLE/$1/g&quot;</code> </para></listitem><listitem><para>hcoop_footer is the one line script <code>cat $prefix/etc/hcoop.footer</code> </para></listitem><listitem><para>You need <code>~hcoop/portal-tools/etc/hcoop.{header,footer}</code> (currently not tracked in git) </para></listitem></itemizedlist></section><section><title>Other Applications Within the Portal</title><para>There are some subdirectories of <code>portal</code> that contain different web apps, like <code>app</code> (the source for join.hcoop.net).  <emphasis role="strong">You must run <code>mlt</code> separately in any of these directories to publish changes in it</emphasis>. These include: </para><itemizedlist><listitem><para><code>app/</code> The Join script </para></listitem><listitem><para><code>contact/</code> Emergency contact directory for admins </para></listitem><listitem><para><code>listaddrs/</code> Lists all hcoop member email addresses </para></listitem><listitem><para><code>mailman/</code> portal subscription helper program </para></listitem><listitem><para><code>passgen/</code> Password reset tool </para></listitem><listitem><para><code>remind/</code> Low balance reminder </para></listitem><listitem><para><code>static/</code> Public member directory generator </para></listitem><listitem><para><code>vmailpasswd</code> Vmail password changing </para></listitem></itemizedlist></section></section><section><title>Maintenance</title><section><title>Cron Jobs</title><para>The portal source contains a crontab which should be installed and run under the <code>hcoop</code> user. This sends out monthly dues reminders and periodically generates semi-static pages. </para></section><section><title>Adding Machine</title><para>To support user requests for a machine, insert a <code>WebNode</code> into the database. The Debian version should be the release name (e.g. &quot;squeeze&quot;). </para><screen><![CDATA[INSERT INTO WebNode (id, name, descr, debian)
        VALUES ((select max(id)+1 from WebNode), $HOST, $DESCRIPTION, $DEBIANVERSION);]]></screen><para>If the machine should show up in the portal for members to request permissions or packages on, add it to <code>ActiveWebNodes</code>. </para><screen><![CDATA[insert into ActiveWebNode VALUES ((select id from WebNode where name = '$HOST'));]]></screen><!--rule (<hr>) is not applicable to DocBook--><para> <ulink url="https://wiki.hcoop.net/DaemonAdmin/Portal/CategorySystemAdministration#">CategorySystemAdministration</ulink> </para></section></section></article>