Alignak-monitoring-contrib / alignak-app

Desktop application in system tray for Alignak users.
GNU Affero General Public License v3.0
6 stars 2 forks source link

User does not have permission to create "log" or edit "settings.cfg" in "%ProgramFiles%" #196

Closed spea1 closed 7 years ago

spea1 commented 7 years ago

Please use "%USERPROFILE%\.alignak-app-develop" directory for:

Start app as usere from "C:\Program Files\Alignak-app\alignak-app.exe"

app-user-start-error

algorys commented 7 years ago

Normally installer give rights to all users for C:\Program Files\Alignak-app so this should not be a problem.

You can also define log folder in settings.cfg.

How do you install application ?

FYW, installation folders was discussed on #186.

spea1 commented 7 years ago

Password security: If the app is running on a Windows terminal server, then "settings.cfg" and "alignakapp.log" must be moved to the "% USERPROFILE%\. alignak-app" directory.

algorys commented 7 years ago

Normally, it is not recommended to store your password in your settings.cfg file, you should leave empty username and password or generate a token and set it in username option.

For teminal server connexion, I've not manage this case yet... Maybe I can define a variable to define "ROOT" app folder... (ex: %ALIGNAKAPP_ROOT%)

Like that I check at start if this var exist, if not I set default (C:\Program Files for Windows, etc...)

@spea1 If you are agree, rename your issue or close this one and open a new one ?

spea1 commented 7 years ago

For example, more users on a workstation with different settings in the "settings.cfg" how should that work?

algorys commented 7 years ago

I do not know for the moment, but I have to look at how to do this kind of thing.

spea1 commented 7 years ago

I think this is very simple:

  1. Check when launching the app if the "%USERPROFILE%\Alignak-app" directory exists if not created it
  2. Check when launching the app if the "%USERPROFILE%\Alignak-app\settings.cfg" file exists, if not "copy "%ProgramFiles%\Alignak-app\settings_example.cfg" %USERPROFILE%\Alignak-app\settings.cfg""
  3. Use "%USERPROFILE%\Alignak-app" directory for log file.
algorys commented 7 years ago

In case of multi user (with a terminal server) it would be very practical indeed.

I am not against giving back %USERAPPDATA%\Alignak-app as other python Libs.

@mohierf your advice ?

mohierf commented 7 years ago

IMHO, we should have two installation mode:

The installer may propose to choose the installation scheme?

algorys commented 7 years ago

The installer may propose to choose the installation scheme?

I can do this kind of things... The problem is to tell to App after where this files are stored...

spea1 commented 7 years ago

Create in "%ProgramFiles%\Alignak-app\app_work_dir.cfg" with the content app_work_dir=%ProgramFiles%\Alignak-app or app_work_dir=%USERPROFILE%\.alignak-app

algorys commented 7 years ago

Ok. I'll try to resume:

Like that user can define directory with needed rights more easily.

algorys commented 7 years ago

You can now define folder where App write logs and search his settings.cfg.