<% @header [("title", ["IP address requests"])]; val admin = Group.inGroupName "server"; val nodeNum = case $"node" of "" => 4 | node => Web.stoi node; if $"new" <> "" then val port = Web.stoi ($"port"); val msg = $"msg"; %>Are you sure you want to ask for an IP address with port <% port %> free on machine <% Init.nodeName nodeNum %>?

Yes, I want to request that. <% elseif $"req" <> "" then val id = Ip.add {usr = Init.getUserId (), node = nodeNum, data = $"req", msg = $"msg"}; if not (Ip.notifyNew id) then %>

Error sending e-mail notification

<% end %>

Request added

<% elseif $"cmd" = "open" then %>

Open requests

List all requests<% foreach (name, req) in Ip.listOpen () do %>


By: <% name %>
Time: <% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)
Node: <% Web.html (Init.nodeName (#node req)) %>
Port: <% #data req %>
Reason: <% Web.html (#msg req) %>
<% if admin then %>
[Modify] [Delete]
To install:
  1. Choose a new IP address 69.90.123.NNN from those available.
  2. Add new entry to /etc/network/interfaces on mire, where N is some incremented number.
    auto eth0:N
    iface eth0:N inet static
            address 69.90.123.NNN
            netmask 255.255.255.224
            network 69.90.123.64
    
  3. Edit /etc/apache2/ports.conf and add the following lines:
    Listen 69.90.123.NNN:80
    Listen 69.90.123.NNN:443
  4. Run ifup eth0:N.
  5. Restart Apache with /etc/init.d/apache2 restart.
  6. Run domtool-admin grant <% name %> ip 69.90.123.NNN
<% end %> <% end elseif $"cmd" = "list" then %>

All requests

<% foreach (name, req) in Ip.list () do %>


By: <% name %>
Time: <% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)
Node: <% Web.html (Init.nodeName (#node req)) %>
Port: <% #data req %>
Reason: <% Web.html (#msg req) %>
<% if admin then %>
[Modify] [Delete] <% end %> <% end elseif $"mod" <> "" then Group.requireGroupName "server"; val id = Web.stoi ($"mod"); val req = Ip.lookup id; val user = Init.lookupUser (#usr req) %>

Handle request

Requestor: <% #name user %>
Time: <% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)
Node:
Status:
Port:
Message:
<% elseif $"save" <> "" then Group.requireGroupName "server"; val id = Web.stoi ($"save"); val node = Web.stoi ($"node"); val req = Ip.lookup id; val oldStatus = #status req; val newStatus = Ip.statusFromInt (Web.stoi ($"status")); Ip.modify {req with node = node, data = $"port", msg = $"msg", status = newStatus}; if not (Ip.notifyMod {old = oldStatus, new = newStatus, changer = Init.getUserName(), req = id}) then %>

Error sending e-mail notification

<% end %>

Request modified

Back to: open requests, all requests <% elseif $"del" <> "" then Group.requireGroupName "server"; val id = Web.stoi ($"del"); val req = Ip.lookup id; val user = Init.lookupUser (#usr req) %>

Are you sure you want to delete request by <% #name user %> for <% #data req %>?

Yes, I'm sure! <% elseif $"del2" <> "" then Group.requireGroupName "server"; val id = Web.stoi ($"del2"); Ip.delete id %>

Request deleted

Back to: open requests, all requests <% else %>

Request an IP address

Use this form to request use of a particular port. If your request is granted, you will be assigned rights to your port on a particular IP address. The most common use of this form is to ask for an IP address to use with an SSL virtual web host. We will grant requests in very few other cases. Try to use free ports on the base IP address of one of the machines on which we grant member log-in.

Machine:
Port#:
Reason:
<% end %> <% @footer[] %>