split plc.d/ and db-config.d between myplc and plcapi modules as a first step
[plcapi.git] / db-config.d / 060-messages
1 # -*-python-*-
2 # $Id$
3 # $URL$
4 #################### body for messages
5
6 installfailed = """Once the node meets these requirements, please reinitiate the install
7 by visiting:
8
9 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/nodes/?id=%(node_id)d
10
11 Update the BootState to 'Reinstall', then reboot the node.
12
13 If you have already performed this step and are still receiving this
14 message, please reply so that we may investigate the problem.
15 """
16
17 # Load default message templates
18 message_templates = [
19     {'message_id': 'Verify account',
20      'subject': "Verify account registration",
21      'template': """
22 Please verify that you registered for a %(PLC_NAME)s account with the
23 username %(email)s by visiting:
24
25 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/persons/register.php?id=%(person_id)d&key=%(verification_key)s
26
27 You must wait for this account to be approved before you can begin using it, please be patient.
28
29 If you did not register for a %(PLC_NAME)s account, please ignore this
30 message, or contact %(PLC_NAME)s Support <%(PLC_MAIL_SUPPORT_ADDRESS)s>.
31 """
32      },
33
34     {'message_id': 'New PI account',
35      'subject': "New PI account registration from %(first_name)s %(last_name)s <%(email)s> at %(site_name)s",
36      'template': """
37 %(first_name)s %(last_name)s <%(email)s> has signed up for a new
38 %(PLC_NAME)s account at %(site_name)s and has requested a PI role. PIs
39 are responsible for enabling user accounts, creating slices, and
40 ensuring that all users abide by the %(PLC_NAME)s Acceptable Use
41 Policy.
42
43 Only %(PLC_NAME)s administrators may enable new PI accounts. If you
44 are a PI at %(site_name)s, please respond and indicate whether this
45 registration is acceptable.
46
47 To view the request, visit:
48
49 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/persons/index.php?id=%(person_id)d
50 """
51      },
52
53     {'message_id': 'New account',
54      'subject': "New account registration from %(first_name)s %(last_name)s <%(email)s> at %(site_name)s",
55      'template': """
56 %(first_name)s %(last_name)s <%(email)s> has signed up for a new
57 %(PLC_NAME)s account at %(site_name)s and has requested the following
58 roles: %(roles)s.
59
60 To deny the request or enable the account, visit:
61
62 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/persons/index.php?id=%(person_id)d
63 """
64      },
65
66     {'message_id': 'Password reset requested',
67      'subject': "Password reset requested",
68      'template': """
69 Someone has requested that the password of your %(PLC_NAME)s account
70 %(email)s be reset. If this person was you, you may continue with the
71 reset by visiting:
72
73 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/persons/reset_password.php?id=%(person_id)d&key=%(verification_key)s
74
75 If you did not request that your password be reset, please contact
76 %(PLC_NAME)s Support <%(PLC_MAIL_SUPPORT_ADDRESS)s>. Do not quote or
77 otherwise include any of this text in any correspondence.
78 """
79      },
80
81     {'message_id': 'Password reset',
82      'subject': "Password reset",
83      'template': """
84 The password of your %(PLC_NAME)s account %(email)s has been
85 temporarily reset to:
86
87 %(password)s
88
89 Please change it at as soon as possible by visiting:
90
91 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/persons/index.php?id=%(person_id)d
92
93 If you did not request that your password be reset, please contact
94 %(PLC_NAME)s Support <%(PLC_MAIL_SUPPORT_ADDRESS)s>. Do not quote or
95 otherwise include any of this text in any correspondence.
96 """
97      },
98
99     # Boot Manager messages
100     {'message_id': "installfinished",
101      'subject': "%(hostname)s completed installation",
102      'template': """
103 %(hostname)s just completed installation.
104
105 The node should be usable in a couple of minutes if installation was
106 successful.
107 """
108      },
109
110     {'message_id': "insufficientdisk",
111      'subject': "%(hostname)s does not have sufficient disk space",
112      'template': """
113 %(hostname)s failed to boot because it does not have sufficent disk
114 space, or because its disk controller was not recognized.
115
116 Please replace the current disk or disk controller or install
117 additional disks to meet the current hardware requirements.
118 """ + installfailed
119      },
120
121     {'message_id': "insufficientmemory",
122      'subject': "%(hostname)s does not have sufficient memory",
123      'template': """
124 %(hostname)s failed to boot because it does not have sufficent
125 memory.
126
127 Please install additional memory to meet the current hardware
128 requirements.
129 """ + installfailed
130      },
131
132     {'message_id': "authfail",
133      'subject': "%(hostname)s failed to authenticate",
134      'template':
135 """
136 %(hostname)s failed to authenticate for the following reason:
137
138 %(fault)s
139
140 The most common reason for authentication failure is that the
141 authentication key stored in the node configuration file, does not
142 match the key on record. 
143
144 There are two possible steps to resolve the problem.
145
146 1. If you have used an All-in-one BootCD that includes the plnode.txt file,
147     then please check your machine for any old boot media, either in the
148     floppy drive, or on a USB stick.  It is likely that an old configuration
149     is being used instead of the new configuration stored on the BootCD.
150 Or, 
151 2. If you are using Generic BootCD image, then regenerate the node 
152     configuration file by visiting:
153
154     https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/nodes/?id=%(node_id)d
155
156     Under 'Download', follow the 'Download plnode.txt file for %(hostname)s'
157     option, and save the downloaded file as plnode.txt on either a floppy 
158     disk or a USB flash drive.  Be sure the 'Boot State' is set to 'Boot', 
159     and, then reboot the node.
160
161 If you have already performed this step and are still receiving this
162 message, please reply so that we can help investigate the problem.
163 """
164      },
165
166     {'message_id': "notinstalled",
167      'subject': "%(hostname)s is not installed",
168      'template':
169 """
170 %(hostname)s failed to boot because it has either never been
171 installed, or the installation is corrupt.
172
173 Please check if the hard drive has failed, and replace it if so. After
174 doing so, visit:
175
176 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/nodes/?id=%(node_id)d
177
178 Change the 'Boot State' to 'Reinstall', and then reboot the node.
179
180 If you have already performed this step and are still receiving this
181 message, please reply so that we may investigate the problem.
182 """
183      },
184
185     {'message_id': "missingkernel",
186      'subject': "%(hostname)s is missing its production kernel",
187      'template':
188 """
189 %(hostname)s failed to boot because the filesystem is missing its production
190 kernel.
191
192 No action is needed from you at this time; this message is merely
193 informational.
194
195 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/nodes/?id=%(node_id)d
196
197 We will investigate the problem shortly.
198 """
199      },
200
201     {'message_id': "filesystemcorrupted",
202      'subject': "%(hostname)s may have corrupt filesystem",
203      'template':
204 """
205 %(hostname)s failed to boot because the filesystem appears to be corrupted. 
206
207 No action is needed from you at this time; this message is merely
208 informational.
209
210 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/nodes/?id=%(node_id)d
211
212 We will investigate the problem shortly.
213 """
214      },
215
216     {'message_id': "mountfailed",
217      'subject': "%(hostname)s could not mount filesystem",
218      'template':
219 """
220 %(hostname)s failed to boot because the boot scripts could not mount the 
221 filesystem.
222
223 This could be for a number of reasons.  No action is needed from you at this
224 time; this message is merely informational.  
225
226 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/nodes/?id=%(node_id)d
227
228 We will investigate the problem shortly.
229 """
230      },
231
232     {'message_id': "hostnamenotresolve",
233      'subject': "%(hostname)s does not resolve",
234      'template':
235 """
236 %(hostname)s failed to boot because its hostname does not resolve, or
237 does resolve but does not match its configured IP address.
238
239 Please check the network settings for the node, especially its
240 hostname, IP address, and DNS servers, by visiting:
241
242 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/nodes/?id=%(node_id)d
243
244 Correct any errors, and change the 'Boot State' to 'Reinstall', and then
245 reboot the node.
246
247 If you have already performed this step and are still receiving this
248 message, please reply so that we may investigate the problem.
249 """
250      },
251
252     # XXX N.B. I don't think these are necessary, since there's no
253     # way that the Boot Manager would even be able to contact the
254     # API to send these messages.
255
256     {'message_id': "noconfig",
257      'subject': "%(hostname)s does not have a configuration file",
258      'template': """
259 %(hostname)s failed to boot because it could not find a PlanetLab
260 configuration file. To create this file, visit:
261
262 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/nodes/?id=%(node_id)d
263
264 Click the Configuration File link, and save the downloaded file as
265 plnode.txt on either a floppy disk or a USB flash drive.  Change the 
266 'Boot State' to 'Reinstall', and then reboot the node.
267
268 If you have already performed this step and are still receiving this
269 message, please reply so that we may investigate the problem.
270 """
271      },
272
273     {'message_id': "nodetectednetwork",
274      'subject': "%(hostname)s has unsupported network hardware",
275      'template':
276 """
277
278 %(hostname)s failed to boot because it has network hardware that is
279 unsupported by the current production kernel. If it has booted
280 successfully in the past, please try re-installing it by visiting:
281
282 https://%(PLC_WWW_HOST)s:%(PLC_WWW_SSL_PORT)d/db/nodes/?id=%(node_id)d
283
284 Change the 'Boot State' to 'Reinstall', and then reboot the node.
285
286 If you have already performed this step and are still receiving this
287 message, please reply so that we may investigate the problem.
288 """
289      },
290 ]
291
292 for message in message_templates:
293     SetMessage(message)