fix: added support for docker environment variables
This commit is contained in:
@@ -12,7 +12,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- 5198:80
|
- 5198:80
|
||||||
volumes:
|
volumes:
|
||||||
- /Users/michaelgreen/.gaseous-server:/root/.gaseous-server
|
- gs:/root/.gaseous-server
|
||||||
environment:
|
environment:
|
||||||
- dbhost=gsdb
|
- dbhost=gsdb
|
||||||
- dbuser=root
|
- dbuser=root
|
||||||
|
@@ -244,9 +244,53 @@ namespace gaseous_tools
|
|||||||
|
|
||||||
public class Database
|
public class Database
|
||||||
{
|
{
|
||||||
public string HostName = "localhost";
|
private static string _DefaultHostName {
|
||||||
public string UserName = "gaseous";
|
get
|
||||||
public string Password = "gaseous";
|
{
|
||||||
|
if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("dbhost")))
|
||||||
|
{
|
||||||
|
return Environment.GetEnvironmentVariable("dbhost");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "localhost";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string _DefaultUserName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("dbuser")))
|
||||||
|
{
|
||||||
|
return Environment.GetEnvironmentVariable("dbuser");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "gaseous";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string _DefaultPassword
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("dbpass")))
|
||||||
|
{
|
||||||
|
return Environment.GetEnvironmentVariable("dbpass");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "gaseous";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string HostName = _DefaultHostName;
|
||||||
|
public string UserName = _DefaultUserName;
|
||||||
|
public string Password = _DefaultPassword;
|
||||||
public string DatabaseName = "gaseous";
|
public string DatabaseName = "gaseous";
|
||||||
public int Port = 3306;
|
public int Port = 3306;
|
||||||
|
|
||||||
@@ -349,8 +393,38 @@ namespace gaseous_tools
|
|||||||
|
|
||||||
public class IGDB
|
public class IGDB
|
||||||
{
|
{
|
||||||
public string ClientId = "";
|
private static string _DefaultIGDBClientId
|
||||||
public string Secret = "";
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("igdbclientid")))
|
||||||
|
{
|
||||||
|
return Environment.GetEnvironmentVariable("igdbclientid");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string _DefaultIGDBSecret
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("igdbclientsecret")))
|
||||||
|
{
|
||||||
|
return Environment.GetEnvironmentVariable("igdbclientsecret");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ClientId = _DefaultIGDBClientId;
|
||||||
|
public string Secret = _DefaultIGDBSecret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Logging
|
public class Logging
|
||||||
|
Reference in New Issue
Block a user