Browse Source

Merge pull request #1 from coturn/master

coturn
Erdem Duman 7 years ago
parent
commit
8f43b63c3f
3 changed files with 33 additions and 9 deletions
  1. 3 0
      ChangeLog
  2. 19 2
      examples/etc/turnserver.conf
  3. 11 7
      src/apps/relay/mainrelay.c

+ 3 - 0
ChangeLog

@@ -18,6 +18,9 @@ Version 4.5.0.8 'dan Eider':
 	- fix total and user quota mix-up
 	- Fixed typos in postinstall.txt (by Prashanth Rajaram)
 	- MySQL password encryption (by Mustafa Bingül & Erdem Duman)
+	- Do not write to log before logging configuration is read from a config file (by eiver)
+	- Add more explanation on use-auth-secret / REST in example config (by Krithin Sitaram)
+	- Add a Warning if lines in config file ends with semicolon (by heyheyjc)n
 
 12/10/2017 Oleg Moskalenko <[email protected]>
 Version 4.5.0.7 'dan Eider':

+ 19 - 2
examples/etc/turnserver.conf

@@ -179,9 +179,10 @@
 #no-auth
 
 # TURN REST API flag.
+# (Time Limited Long Term Credential)
 # Flag that sets a special authorization option that is based upon authentication secret.
-# This feature can be used with the long-term authentication mechanism, only.
-# This feature purpose is to support "TURN Server REST API", see
+#
+# This feature's purpose is to support "TURN Server REST API", see
 # "TURN REST API" link in the project's page 
 # https://github.com/coturn/coturn/
 #
@@ -197,6 +198,22 @@
 # The actual value of the secret is defined either by option static-auth-secret,
 # or can be found in the turn_secret table in the database (see below).
 # 
+# Read more about it:
+#  - https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00
+#  - https://www.ietf.org/proceedings/87/slides/slides-87-behave-10.pdf
+#
+# Be aware that use-auth-secret overrides some part of lt-cred-mech.
+# Notice that this feature depends internally on lt-cred-mech, so if you set
+# use-auth-secret then it enables internally automatically lt-cred-mech option
+# like if you enable both.
+#
+# You can use only one of the to auth mechanisms in the same time because,
+# both mechanism use the username and password validation in different way.
+#
+# This way be aware that you can't use both auth mechnaism in the same time!
+# Use in config either the lt-cred-mech or the use-auth-secret
+# to avoid any confusion.
+#
 #use-auth-secret
 
 # 'Static' authentication secret value (a string) for TURN REST API only. 

+ 11 - 7
src/apps/relay/mainrelay.c

@@ -1598,7 +1598,7 @@ static void read_config_file(int argc, char **argv, int pass)
 		FILE *f = NULL;
 		char *full_path_to_config_file = NULL;
 
-		full_path_to_config_file = find_config_file(config_file, 1);
+		full_path_to_config_file = find_config_file(config_file, pass);
 		if (full_path_to_config_file)
 			f = fopen(full_path_to_config_file, "r");
 
@@ -1639,6 +1639,10 @@ static void read_config_file(int argc, char **argv, int pass)
 					} else if((pass > 0) && (c == 'u')) {
 					  set_option(c, value);
 					}
+					if (s[slen - 1] == 59) {
+						TURN_LOG_FUNC(TURN_LOG_LEVEL_WARNING, "Check config! The following line ends with semicolon: \"%s\" \n",s);
+					}
+
 				}
 			}
 
@@ -2119,12 +2123,6 @@ int main(int argc, char **argv)
 	if(strstr(argv[0],"turnadmin"))
 		return adminmain(argc,argv);
 
-	{
-		unsigned long mfn = set_system_parameters(1);
-
-		print_features(mfn);
-	}
-
 	read_config_file(argc,argv,0);
 
 	struct uoptions uo;
@@ -2137,6 +2135,12 @@ int main(int argc, char **argv)
 
 	read_config_file(argc,argv,1);
 
+	{
+		unsigned long mfn = set_system_parameters(1);
+
+		print_features(mfn);
+	}
+
 	if(!get_realm(NULL)->options.name[0]) {
 		STRCPY(get_realm(NULL)->options.name,turn_params.domain);
 	}