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