#1 2021-02-17 19:01:30

telpochyaotl
Member
Registered: 2021-02-17

initial user password

Hello all! I'm new to the forum. First of all thank you so much for such an amazing product, this ReportServer is awesome.

I'm writing some scripts to deploy it to AWS via CDK and everything is going great. The one thing I'd like to do, if possible, at my setup, before even RS is launched on a browser, replace the ROOT's password with one I'm generating in AWS using secrets manager.

Is it possible, can someone point me in the right direction, to figure out how to encrypt my password and update the RS_USER table with it in such a way that RS can actually use it for the ROOT user that is being automatically created?

If I can piggy back the question: If we get the enterprise version, can I use scripting to do this and also deploy data sources and some reports even before using the RS UI or even if I need to use the UI but in some sort of pre-packaged script that I can make?

Thanks a lot!

Offline

#2 2021-02-18 13:44:46

eduardo
Administrator
Registered: 2016-11-01
Website

Re: initial user password

Hi telpochyaotl,

you can use scripting for this, e.g. using the method net.datenwerke.security.service.usermanager.UserManagerService.setPassword(User, String) for setting the user's password.

Since you are setting the user username and password at first run, you can use the same file our bitnami package uses for this: rsinit.properties.
Here is an example rsinit.properties file used in our bitnami package:

usermanager.root.username=user
usermanager.root.firstname=FirstName
usermanager.root.lastname=LastName
usermanager.root.email=user@example.com
usermanager.root.password=bitnami

cfg.main.localization_cf.localization.default=en
rsinit.keepfile=true

cfg.mail.mail_cf.smtp.host=smtp.gmail.com
cfg.mail.mail_cf.smtp.port=465
cfg.mail.mail_cf.smtp.username=user@gmail.com
cfg.mail.mail_cf.smtp.password=password
cfg.mail.mail_cf.smtp.ssl=true
cfg.mail.mail_cf.smtp.tls.enable=false
cfg.mail.mail_cf.smtp.tls.require=false

democontent.install=true

Note that you should set rsinit.keepfile=false for deleting the file after initial installation.

If you create such a file and put it in your classpath e.g. WEB-INF/classes, the settings here used.

You can of course run scripts without using the GUI by calling a URL: https://reportserver.net/en/guides/scri … rs/Basics/
3.2. Executing Scripts via URL
so if you write a script you can execute it by just calling the URL. Note that you can also schedule script: https://reportserver.net/en/guides/scri … g-Scripts/

Regards,
Eduardo

Offline

#3 2021-02-18 20:41:54

telpochyaotl
Member
Registered: 2021-02-17

Re: initial user password

Eduardo,

First thank you so much for your response. It is truly valuable information! I searched the RS site and forum and found no mention of the rsinit, so I would not have found it easy. Grepping the code I see a few appearances of course but would not have been easy to guess...

You are very kind.  I am about to give it a try.

Not having found docs about it, I'm very curious to know what all I can do with the init script. What would be the best way to find out all i can do with it?

As far as the scripts, that's also great news. I assume this is only possible in the enterprise version, correct?

Thank you again! Given your name, may I say Mil Gracias!

Offline

#4 2021-02-19 03:11:26

telpochyaotl
Member
Registered: 2021-02-17

Re: initial user password

Hello again!

I've placed the rsinit.properties both in the WEB-INF/classes and just in case also in the /opt/reportserver i made during installation where the persistance.properties also resides, but no luck with the file being acted upon at least for what I can see... Nothing in tomcat logs about it either... Do i have to enable something in config? or any other pointers as to why it's not being used?

Thank you again and sorry for the trouble.

Offline

#5 2021-02-19 04:13:14

telpochyaotl
Member
Registered: 2021-02-17

Re: initial user password

Ok, i think it worked, i deleted the database and placed the file in several places, I think the one in /opt/reportserver/config is the one worked, it looked like that was the right place after looking at the code... Will clean up and try it all again tomorrow and post here the final way so that others can use this info as well... Thanks again!

Offline

#6 2021-02-19 17:01:51

telpochyaotl
Member
Registered: 2021-02-17

Re: initial user password

Ok, here just confirming, I had to place the file in the /opt/reportserver folder I created when I followed the manual installation instructions. Also, the database had to be clean, it seems it only runs on the first startup on a clean DB, but i could be wrong about a few details. The script was only ran (the root user was added to RS_USER table) when I first accessed the portal and tried to login, before that there was no root user....

Don't have better details for others but that worked for me.

Thanks Eduardo for sharing this!

Take care.

Offline

#7 2021-02-22 14:25:42

eduardo
Administrator
Registered: 2016-11-01
Website

Re: initial user password

Hi telpochyaotl,

thanks for letting us know, I am glad this worked!
Yes, this script only runs the very first startup on a clean DB.

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB