Question: Notification E-mail Content Change

26 views
Skip to first unread message

Akio Yamada

unread,
Aug 6, 2018, 6:44:35 PM8/6/18
to WISE-dev
Hi team:

I recently installed WISE on AWS, and while doing QA, I noticed in an e-mail on a Password Change Request that URL link to choose a new password is not pointing correctly.

http://localhost:8080/webapp/forgotaccount/resetpassword.html?k=character_string


I know that in the wise.properties file, I have set a proper AWS wiseBaseURL. I also noticed that the e-mail copy is located in the i18n.properties file (see below)


forgotaccount.teacher.index.passwordChangeRequestEmailBody=Hi,\n\nYou have requested to have your password changed for your account with username: {0}. Please visit the link below to choose a new password.\n\n{1}\n\n-Team at {2}


The problem is, I don't know where/what the {1} is referencing. Can you please let me know where I can make the content change and point to the appropriate URL? Thank you!

Sincerely,
Akio Yamada

Geoffrey Kwan

unread,
Aug 7, 2018, 12:39:19 PM8/7/18
to WISE-dev
Did you use our WISE AMI on AWS or did you install everything yourself?

I tried launching a new WISE instance using our WISE-5.7.7 AMI. Then I filled out the mail properties in wise.properties. Then I tried requesting a password change and I get an email that looks like this.

Hi,

You have requested to have your password changed for your account with username: geoffreykwan. Please visit the link below to choose a new password.

http://34.209.12.248/forgotaccount/resetpassword.html?k=9Qv9TK1FMNR6HB2Wy60yLCHnEo9CsCVXxyw5pzL0YvAyb1En4Mf0iThnJzywTqDR

-Team at WISE EC2 Instance (Change Me)

If you used the WISE AMI, you shouldn't need to change the wiseBaseURL. In wise.properties what did you set your wiseBaseURL to?

{1} is dynamically generated by the server side code. It tries to retrieve the context path and uses it in the password reset url. This is what the code looks like in case you're curious.

      String contextPath = request.getContextPath();
      String portalContextURL = "";
      if (contextPath.startsWith("http")) {
        // in case contextPath is absolute, in the form "http://xyz:8080/wise"
        portalContextURL = contextPath;
      } else {
        // in case contextPath is relative, in the form "/wise"
        portalContextURL = ControllerUtil.getPortalUrlString(request);
      }
      String passwordResetLink = portalContextURL + "/forgotaccount/resetpassword.html?k=" + randomAlphanumeric;

If you are not using our WISE AMI, I would suggest trying that out since it's quicker and easier to set up. Here are the instructions

Geoff

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Akio Yamada

unread,
Aug 7, 2018, 1:58:54 PM8/7/18
to wise...@googlegroups.com
Hi Geoff:

Appreciate your response!

With the help of my system admin, I installed a previous version of WISE (5.7.6) on AWS, so this was before the AMI!

I set my wiseBaseURL in wise.properties to http://ec2-xyz-xyz-xyz-xyz.us-west-1.compute.amazonaws.com/webapp, with the wiseBaseDir being /opt/tomcat8/webapps/webapp. The request from our client was to rename the "wise" root directory to "webapp". Our system admin also made changes to not use the default WISE port 8080.

The contextPath should be absolute, so I am not sure as to why the portalContextURL appears to be set to localhost:8080.

Akio

To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

Geoffrey Kwan

unread,
Aug 7, 2018, 4:09:59 PM8/7/18
to wise...@googlegroups.com
Have you been using your WISE (5.7.6) instance to actually use with teachers and students? Have you performed a lot of customization on your WISE instance? If you haven't actually used the server with real users, it may be worthwhile to try the AMI that we created because setup will be much easier. You can find the WISE 5.7.7 AMI in the "Community AMIs" section of AWS EC2.

If you need to keep using your existing 5.7.6 instance we can continue to try to figure out what's wrong. Perhaps send me your wise.properties file so we can take a look at it? Make sure to take out any passwords and personal information you don't want to share.

To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

Akio Yamada

unread,
Aug 7, 2018, 4:18:14 PM8/7/18
to wise...@googlegroups.com
The client requested numerous customizations to the WISE instance, so that is the reason why I stuck with the older version. The next time around, I will definitely try the AMI!

I will send the wise.properties file in a separate e-mail to you shortly. Thank you in advance for your help!

Akio

To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

Geoffrey Kwan

unread,
Aug 8, 2018, 3:53:36 PM8/8/18
to wise...@googlegroups.com
Are you guys using any kind of proxy on the server? On our production server and WISE AMI servers, we use Nginx. Perhaps the problem is caused by a proxy or lack of a proxy?

I've come up with 3 different solutions.

Solution #1
The first solution is a simple file replacement. This solution may not be the best in the long run but it may get the job done. I've modified two of the server files and attached them to this email. You will need to copy the files to your EC2 instance. Make sure you make a backup copy of the ControllerUtil.class and ForgotAccountTeacherIndexController.class files before you copy over them in case you need to rollback. You can find their locations on the server by looking at the examples below.

How to copy ControllerUtil.class to your EC2 instance using scp
scp -i <path_to_ec2_key> <path_to_ControllerUtil.class_downloaded_from_my_email> <root_or_ubuntu>@<aws_public_dns>:<path_to_controllers_folder_on_server>

Example
scp -i ~/Downloads/wise-ec2-key-pair.pem ~/Downloads/ControllerUtil.class ubu...@ec2-54-201-251-154.us-west-2.compute.amazonaws.com:/opt/tomcat/webapps/webapp/WEB-INF/classes/org/wise/portal/presentation/web/controllers

How to copy ForgotAccountTeacherIndexController.class to your EC2 instance using scp
scp -i <path_to_ec2_key> <path_to_ForgotAccountTeacherIndexController.class_downloaded_from_my_email> <root_or_ubuntu>@<aws_public_dns>:<path_to_teacher_folder_on_server>

Example
scp -i ~/Downloads/wise-ec2-key-pair.pem ~/Downloads/ForgotAccountTeacherIndexController.class ubu...@ec2-54-201-251-154.us-west-2.compute.amazonaws.com:/opt/tomcat/webapps/webapp/WEB-INF/classes/org/wise/portal/presentation/web/controllers/forgotaccount/teacher

After you've copied these files to your EC2 instance, you'll need to restart your WISE server.

How to shut down WISE
/opt/tomcat/bin/shutdown.sh

(wait a couple seconds before starting WISE back up)

How to start up WISE
/opt/tomcat/bin/startup.sh

Now you can try to generate the forgot password email by going to the forgot password page and entering a username.

I've added some code to output various values for troubleshooting purposes. After you've generated a forgot password email, can you send me your /opt/tomcat/logs/catalina.out file so I can see some of the values that I've output to the console? If the file is really big you can just send me the exact lines I'm looking for.

The lines I'm looking for in catalina.out should look something like this
X-Forwarded-For=150.108.240.126
Proxy-Client-IP=null
WL-Proxy-Client-IP=null
HTTP_CLIENT_IP=null
HTTP_X_FORWARDED_FOR=null
getRemoteAddr=127.0.0.1
host=34.217.113.232
contextPath=
portalContextURL=http://34.217.113.232
wiseBaseURL=null

Here's how to easily see the last 500 lines in catalina.out
tail -500 /opt/tomcat/logs/catalina.out

If you need help performing any of this, we can video chat over Google Hangouts or Skype.

Solution #2
The second solution is to update your WISE version. This may be a better solution in the long run but I'm not sure if it will fix the problem.

Solution #3
The third solution is to launch a new WISE instance using our WISE AMI. The WISE AMI already has Nginx installed on it. This would probably be the best solution in the long run. The drawback of this would be that you would need to re-apply your customizations.

To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.
ForgotAccountTeacherIndexController.class
ControllerUtil.class

Akio Yamada

unread,
Aug 8, 2018, 5:40:53 PM8/8/18
to wise...@googlegroups.com
Hi Geoff:

Thank you for your assistance! The replacement class files have appeared to fix the problem. I will send you the catalina output lines separately.

Akio

To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+unsubscribe@googlegroups.com.

Geoffrey Kwan

unread,
Aug 8, 2018, 7:05:34 PM8/8/18
to wise...@googlegroups.com
Ok great, if you have any more problems in the future let me know.

To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "WISE-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wise-dev+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages