Commit Graph

713 Commits (577d982b51670f7f68d6dad9d0bf08f8a01879ba)

Author SHA1 Message Date
Selva Nair a9898d3819 Add a registry key for choosing config menu view
Add a new registry key (DWORD): config_menu_vew
   possible values:  0 (auto), 1 (flat), 2 (nested).

Default value is 0 which renders nested menu if the number of
configs is > 50, else displays the current flat view. To force
the flat menu view set it to 1. A value of 2 forces the nested
view even if there are only a few configs.

A new command line option "--config_menu_view n" does the same.
Command line options take precedence over any value set in the
registry.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2019-02-11 11:51:23 -05:00
Selva Nair 2d64cb5603 Provide support for a hierarchical config menu listing
- Shows all configs in a subdirectory grouped into a
  submenu entry. This hopefully provided a better UX when
  there are more than a few 10's of config files.

- Enabled only if number of configs is > 50 or if the
  option config_menu_view is set to 2.
  To force the current flat listing, set config_menu_view = 1.

TODO: Make config_menu_view user configurable.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2019-02-11 11:51:23 -05:00
Selva Nair 567efd1f45 In config menu squash directories containing a single config
- Single configs all by itself in a directory are shown as a
  member of the parent directory. This allows keeping every
  config in its own directory without causing an additional
  level of nesting. Eg., import always put each config in
  its own directory.

  Improves the menu navigation.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2019-02-11 11:51:23 -05:00
Selva Nair 398a771840 Group configs based on the directory structure to support a nested view
- Group all configs in a subdirectory with directory name
  as the label.

- If any connection is active, newly found configs are
  added to the root group to keep the logic simple.

- Directory hierarchy is scanned up to a depth of 4: i.e.,
  config_dir and global_config_dir and its subdirectories
  up to 3 levels down.

Only support for scanning configs and attaching group labels
is added here. Rendering the nested menu is the subject of
a later commit.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2019-02-11 11:51:23 -05:00
Selva Nair 0702acf70c Remove the limit on number of config subdirectories
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2019-02-11 11:51:23 -05:00
JoungKyun Kim e5855f9eaa synchronized the korean resource files with the english version 2019-02-12 00:08:21 +09:00
Selva Nair 4cb55f1e58 Ignore pushed --route-method when interactive service is in use
When using interactive service, route addition should use the
service. The user may not have privileges to set routes
otherwise.  We already override any --route-method set in the
config file as openvpn.exe is started with --msg-channel as the
last option which sets route-method to ROUTE_METHOD_SERVICE.

This patch extends that to pushed --route-method

Also change _T("") to L"" in the edited lines to be explicit about
wide and narrow strings. We no longer support non-unicode builds.

No change when interactive service is not used.

Ref: issue #281

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-11-22 12:56:54 -05:00
Selva Nair 89509747f1 Remove service-only checkbox from settings menu
- This checkbox is inactive and does nothing.

  The service-only  usage can be still activated using the command
  line option --service_only  or by editing the registry, but its
  not a recommended use case for GUI version 11.0 and above.

See also issue: #264

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-06-16 16:32:27 -04:00
Selva Nair b53c8a758e Fix display of assigned IPs when IPv4 address is absent
- In tray info do not skip the address when v4 ip is absent

- When combining two strings do not add the separator (comma)
  if either is empty.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-06-16 16:29:52 -04:00
Selva Nair 3ba0615140 Clear c->ip and c->ipv6 buffers before reset
Trac: #1064
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-06-16 16:29:52 -04:00
speadup 0f3ed6c653 add Chinese (Simplified) localization 2018-05-25 21:51:52 -04:00
Andres Ofner 30097d43cb Add shortcuts (mnemonics) to GUI elements 2018-05-02 02:06:39 -04:00
Selva Nair 343643657f Log --command option errors to the event log
This supplements the non-zero exit-code.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-04-24 09:03:16 +03:00
Selva Nair 1cb07f92f3 Fix detection of running instance
When openvpn is run with --help option it pops up a help
message and exits when that window is closed. Such instances
cannot accept any commands and should not be treated as a
running instance.

Fix by
(i) When run with --help, promptly release the semaphore used
to restrict to a single running instance.

(ii) Wait for a short interval (200 msec) before timing out of
locking the semaphore. This helps avoid race conditions.

While at it also make sure the semaphore is released and closed
on exit.

Fixes issue: #237

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-04-24 09:03:16 +03:00
Selva Nair c51fd4450d Support for 'setenv name var' using echo
- Implement connection specific env variables. These are merged
  with the process environment strings and passed to scripts.

- To set an env variable, use 'echo setenv name value' in the config
  or push from the server. This will set "OPENVPN_name=value" in
  the connections's env set. Note that "name" is mangled as
  "OPENVPN_name" to avoid servers overwriting sensitive variables
  such as PATH. Names are set in the order received and same name
  overwrites any previously set value.

- Environment variable names are allowed to contain only alpha numeric
  characters and underscore as in openvpn.exe. But, unlike openvpn.exe,
  invalid names are ignored, not sanitized.

v2 changes (Dec 16, 2017):

- If value is missing, the directive is interpreted as a delete command
  and the env var with matching name in the connection's env set is removed.

- Windows needs env block to be ordered:
  While merging connection specific env vars with process env block, order
  the entries 'alphabetically' (locale independent, case insensitive
  unicode ordinal order). In case of duplicates, the value in connection
  env set replaces the one in process env.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-04-23 22:05:05 +03:00
Ilya Shipitsin 9ceb2d25e5 travis-ci: switch to openssl-1.1.0 by default 2018-04-23 22:03:31 +03:00
Selva Nair 2f5084d47e Set a fall back for editor if file association fails
- When registry keys were simplified, the log viewer and editor
  entries were removed in favour of file associations that the
  user can independently control.

  Yet, there are times when an associated application fails to start
  or no associations are present etc., and its useful to have a fall
  back editor setting to open config and log files.
  This patch sets that default as "notepad.exe"

- Also remove the unused profile_dir[] in registry.c
  and have add a default for Windows directory

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-04-23 15:49:10 +03:00
Erwin Bronkhorst 52b1647a57 Add Dutch translations for recently added resources 2018-04-23 15:46:26 +03:00
Selva Nair 14615356e5 Do not clear saved passwords on verification failure
After a failure the auth-pass dialog is shown with the password
field prefilled but highlighted. This allows the user to easily
overwrite the password or resubmit the old password if the
failure was temporary.

After a private key passphrase failure, the dialog is not
prefilled with saved password as this failure happens locally
and in such cases the password is very likely wrong.

If the user aborts the dialog by pressing cancel, the saved
password will get used during the next connection attempt.

Wrong username or password warning text is changed to: "Wrong
credentials".

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-04-23 15:41:03 +03:00
Ilya Shipitsin 4a4a6ab52f remove unused resource
after https://github.com/OpenVPN/openvpn-gui/pull/188 that string
is not used anymore
2018-04-23 15:39:47 +03:00
Selva Nair b23c4c2736 Update year in the "About" tab
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-04-02 20:59:25 -04:00
Selva Nair 6107c38692 Do not allow echo save-passwords to override disable_save_passwords
- As disable_save_passwords may be enforced system-wide by an Administrator,
  "echo save-passwords" should not be allowed to over-ride it. This was
  overlooked in commit d4090a8842.
  Fix it by ignoring this echo directive if disable_save_passwords is in
  effect. Also write a log message to the status window.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-03-10 13:40:28 -05:00
Ilya Shipitsin 1c020eee60 add EXSTYLE WS_EX_TOPMOST to login/auth window
(same way it is already done for key password dialog)
2018-03-10 11:00:02 -05:00
Samuli Seppänen 81b4031285 Bump version to 11.10.0.0
The v11.10.0.0 tag was pointed at the previous commit by mistake

Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
2018-03-02 19:44:26 +02:00
Samuli Seppänen 961d1b37c2 Get rid of TODO
It is obsolete and the tasks in there are best tracked locally or in GitHub
issues.

URL: https://github.com/OpenVPN/openvpn-gui/pull/225
Signed-off-by: Samuli Seppänen <samuli@openvpn.net>
2018-02-27 10:05:07 -05:00
Ilya Shipitsin e7fd11812f simplify caption on user/password auth window
also add openvpn ico to auth window
2018-01-30 10:29:00 +02:00
Selva Nair ecb8e50c0f Display assigned IPs and connection stats on status window
- Show the assigned IP numbers, traffic stats (bytes in/out), and
  the GUI and OpenVPN core versions on the status window.

Note: IDS_TXT_BYTECOUNT = "Bytes in: %s out %s" needs translation.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-30 10:20:58 +02:00
Selva Nair 105e022f7b Subscribe to bytecount message from management interface
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-30 10:20:58 +02:00
Selva Nair dd8c4dfdab Show assigned ipv6 address in balloon and tray popup
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-29 09:40:36 +02:00
Selva Nair b18d1a9245
Merge pull request #208 from selvanair/readme
Update README.rst
2018-01-24 10:45:44 -05:00
Selva Nair 844de0c75f Update README
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-24 10:13:11 -05:00
Selva Nair c87c7387b3
Merge pull request #188 from selvanair/already-running-v2
Support sending commands to a running instance of the GUI
2018-01-24 07:38:07 -05:00
Selva Nair 92570bce1e
Merge pull request #207 from MaxXor/res-de
Update german translation

Acked-by: Gert Doering <gert@greenie.muc.de>
2018-01-23 22:53:07 -05:00
MaxXor eabd26fc18 Update german translation 2018-01-23 19:08:37 +01:00
Samuli Seppänen 64b0ae83c8
Merge pull request #192 from MaxXor/res-de
Update german translation
2018-01-23 14:04:16 +02:00
Samuli Seppänen b54365788e
Merge pull request #205 from chipitsine/openssl_1.1.0
travis-ci: add openssl-1.1.0 support
2018-01-23 13:58:09 +02:00
Selva Nair 874d0890dd Document sending commands to a running instance
Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-22 00:31:11 -05:00
Selva Nair 688f41878f More helpful message if already running
Why: The current message assumes the balloon to appear attached
to the icon which is not the case in Windows 10.

Based on feedback from larson0815 and Deantwo here:
https://github.com/selvanair/openvpn-gui/issues/5

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-20 11:43:02 -05:00
Selva Nair 10f34584ea In '--connect profile-name' make the extension (.ovpn) optional
Treat '--connect foo.ovpn' and '--connect foo' as the same. This matches
with the behaviour of '--command connect foo'.

Note: the argument is first compared against config file names and then
against config names.

Based on comment by larson0815 here:
https://github.com/selvanair/openvpn-gui/issues/5

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-20 11:42:24 -05:00
Selva Nair eb52950f7a Treat --connect as --command connect in case GUI is already running
- This makes the behaviour more intuitive for those used to the
  auto connect option (--connect xxx). Note: this will work only for
  the first occurrence of --connect as --command allows only one profile
  to be speciifed.
- Also make '--command connect' behave as '--connect' if the GUI is not
  already running.

Based on comment by larson0815 here:
https://github.com/selvanair/openvpn-gui/issues/5

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-20 11:42:23 -05:00
Selva Nair 0f21030774 Support sending commands to running instance
- New option --command <action> <params> to send commands to
  a running instance of openvpn-gui.exe
  Supported actions are
      connect, disconnect, reconnect
  each of which takes the name of the config (with or without the
  extension .ovpn) as a parameter;
      disconnect_all, exit
  which take no parameter and
      silent_connection
  which takes an optional parameter = 0 or 1 (1 is the default)

  Examples: with the gui running, start a new instance as

  openvpn-gui.exe --command disconnect myvpn : ask running instance
                        to disconnect myvpn if connected
  openvpn-gui.exe --command status myvpn     : ask running instance
                        to show the status window for myvpn if available
  openvpn-gui.exe --command disconnect_all   : ask running instance
                        to disconnect all active connections

- The second instance exits after issuing a SendMessage to the
  already running instance. If no action is specified, the running
  instance is notified to show a balloon to alert the user

- These messages may also be sent from scripts as COPYDATA messages
  with the wData element specifying the action to execute and lpData
  a pointer to the parameter. The dwData param must be one of
  WM_OVPN_xxx with xxx = START, STOP, RESTART, STOPALL, EXIT or
  SILENT. See main.h for their values.

v2: Bug fixes based on test reports from larson0815
here: https://github.com/selvanair/openvpn-gui/issues/5
and cron410 here: https://github.com/OpenVPN/openvpn-gui/issues/104

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-20 11:42:23 -05:00
Selva Nair 31896ce33b Add restart button to connection menus
- This works the same way as restart button in the status window
  but is more conveniently accessible from the tray menu.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-20 11:41:19 -05:00
Ilya Shipitsin 8418bc7f45 travis-ci: add openssl-1.1.0 support 2018-01-18 18:00:10 +05:00
Samuli Seppänen 4055f86206
Merge pull request #202 from selvanair/auto-submit-fix
Do not auto submit username/password after an auth failure
2018-01-11 20:49:28 +02:00
Samuli Seppänen 5233f81fdc
Merge pull request #204 from chipitsine/better_align
better alignment of warning message
2018-01-11 20:47:37 +02:00
Ilya Shipitsin 0642cb8fe5 better alignment of warning message 2018-01-06 21:14:11 +05:00
Samuli Seppänen 1c1bf2045b
Merge pull request #201 from chipitsine/russian
russian localization for "no-auth-prompt" branch
2018-01-06 16:51:15 +02:00
Selva Nair 185b571d6e Do not auto submit username/password after an auth failure
- This case was missed by commit 5fb23f6ad9 that introduced
  automatic username/password submission.
- Also avoid auto submit if the recalled password is an empty
  string.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
2018-01-03 21:38:40 -05:00
Ilya Shipitsin 52219fcebf russian localization for "no-auth-prompt" branch 2017-12-29 01:27:52 +05:00
Selva Nair 702251327c
Merge pull request #186 from selvanair/no-auth-prompt
Use saved password with no prompt if silent_connection is on

Acked by: Илья Шипицин <chipitsine@gmail.com>
2017-12-26 14:41:17 -05:00