Skip to content

Commit

Permalink
wininstaller: Make webui login configurable via cmdline settings
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Sep 14, 2016
1 parent f74b1aa commit ee95636
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions platforms/win32/winbareos.nsi
Expand Up @@ -89,6 +89,8 @@ Var InstallStorage
Var InstallWebUI
Var WebUIListenAddress
Var WebUIListenPort
Var WebUILogin
Var WebUIPassword

# Generated configuration snippet for bareos director config (client ressource)
Var ConfigSnippet
Expand Down Expand Up @@ -482,6 +484,15 @@ Section -SetPasswords
FileWrite $R1 "s#user1#bareos#g$\r$\n"
FileWrite $R1 "s#CHANGEME#bareos#g$\r$\n"

# configure webui login
# Name = admin
# Password = "admin"
#
FileWrite $R1 "s#Name = admin#Name = $WebUILogin#g$\r$\n"
FileWrite $R1 "s#Password = $\"admin$\"#Password = $WebUIPassword#g$\r$\n"



FileClose $R1


Expand Down Expand Up @@ -1187,6 +1198,7 @@ Section -ConfigureConfiguration
# FileWrite $R1 "s#@smtp_host@#localhost#g$\r$\n"
FileWrite $R1 "s#@working_dir@#$BareosAppdata/working#g$\r$\n"


FileClose $R1

nsExec::ExecToLog '"$INSTDIR\bareos-config-deploy.bat" "$INSTDIR\defaultconfigs" "$APPDATA\${PRODUCT_NAME}"'
Expand Down Expand Up @@ -1333,6 +1345,8 @@ Function .onInit
[/INSTALLWEBUI Installs Bareos WebUI Components, REQUIRES Visual C++ Redistributable for Visual Studio 2012 x86, implicitly sets /INSTALLDIRECTOR $\r$\n\
[/WEBUILISTENADDRESS=webui listen address, default 127.0.0.1] $\r$\n\
[/WEBUILISTENPORT=webui listen port, default 9100 ] $\r$\n\
[/WEBUILOGIN=Login Name for WebUI, default admin ] $\r$\n\
[/WEBUIPASSWORD=Password for WebUI, default admin ] $\r$\n\
[/DBDRIVER=Database Driver <postgresql|sqlite3>, postgresql is default if not specified] $\r$\n\
[/DBADMINUSER=Database Admin User (not needed for sqlite3)] $\r$\n\
[/DBADMINPASSWORD=Database Admin Password (not needed for sqlite3)] $\r$\n\
Expand Down Expand Up @@ -1485,6 +1499,13 @@ done:
${GetOptions} $cmdLineParams "/WEBUILISTENPORT=" $WebUIListenPort
ClearErrors

${GetOptions} $cmdLineParams "/WEBUILOGIN=" $WebUILogin
ClearErrors

${GetOptions} $cmdLineParams "/WEBUIPASSWORD=" $WebUIPassword
ClearErrors


${GetOptions} $cmdLineParams "/DBDRIVER=" $DbDriver
ClearErrors

Expand Down Expand Up @@ -1755,6 +1776,12 @@ ${EndIf}
strcmp $WebUIListenPort "" +1 +2
StrCpy $WebUIListenPort "9100"

strcmp $WebUILogin "" +1 +2
StrCpy $WebUILogin "admin"

strcmp $WebUIPassword "" +1 +2
StrCpy $WebUIPassword "$\"admin$\""

strcmp $DbEncoding "" +1 +2
StrCpy $DbEncoding "ENCODING 'SQL_ASCII' LC_COLLATE 'C' LC_CTYPE 'C'"

Expand Down

0 comments on commit ee95636

Please sign in to comment.