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