Skip to content

Commit

Permalink
Configuration: use correct case for filesystem section in config yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
stephendade committed Sep 11, 2024
1 parent 2b7915f commit 8bf93fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion FreeTAKServer/core/configuration/MainConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ def validate_and_sanitize_path(self, path):
sanitized_path = ROOTPATH + os.path.relpath(os.path.normpath(os.path.join(os.sep, path)), os.sep)

if not os.access(sanitized_path, os.F_OK) or not os.access(sanitized_path, os.W_OK):
raise ValueError
print(f"Cannot access configuration path: {sanitized_path}")
sys.exit(1)

return sanitized_path

Expand Down
14 changes: 7 additions & 7 deletions FreeTAKServer/core/configuration/configuration_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,22 @@ def ask_user_for_config():
else:
print('invalid database type')
config.DBFilePath = database_path
add_to_config(data=database_path, path=["FileSystem", "FTS_DB_PATH"], source=yaml_config)
add_to_config(data=database_path, path=["Filesystem", "FTS_DB_PATH"], source=yaml_config)

main_path = get_user_input(question="enter the preferred main path", default=config.MainPath)
while not valid_and_safe_path(main_path):
print("Invalid path. Path does not exist or insufficient permissions exist.")
main_path = get_user_input(question="enter the preferred main path", default=config.MainPath)

config.MainPath = main_path
add_to_config(path=["FileSystem", "FTS_MAINPATH"], data= main_path, source= yaml_config)
add_to_config(path=["Filesystem", "FTS_MAINPATH"], data= main_path, source= yaml_config)

log_path = get_user_input(question="enter the preferred log file path", default=config.LogFilePath)
while not valid_and_safe_path(log_path):
print("Invalid path. Path does not exist or insufficient permissions exist.")
log_path = get_user_input(question="enter the preferred log file path", default=config.LogFilePath)

add_to_config(path=["FileSystem", "FTS_LOGFILE_PATH"], data=log_path, source=yaml_config)
add_to_config(path=["Filesystem", "FTS_LOGFILE_PATH"], data=log_path, source=yaml_config)

add_to_config(path=["System", "FTS_NODE_ID"], data=config.nodeID, source=yaml_config)

Expand Down Expand Up @@ -156,9 +156,9 @@ def autogenerate_config():

add_to_config(data=config.UserConnectionIP, path=["Addresses", "FTS_DP_ADDRESS"], source=yaml_config)
add_to_config(data=config.UserConnectionIP, path=["Addresses", "FTS_USER_ADDRESS"], source=yaml_config)
add_to_config(data=config.DBFilePath, path=["FileSystem", "FTS_DB_PATH"], source=yaml_config)
add_to_config(path=["FileSystem", "FTS_MAINPATH"], data=config.MainPath, source=yaml_config)
add_to_config(path=["FileSystem", "FTS_LOGFILE_PATH"], data=config.LogFilePath, source=yaml_config)
add_to_config(data=config.DBFilePath, path=["Filesystem", "FTS_DB_PATH"], source=yaml_config)
add_to_config(path=["Filesystem", "FTS_MAINPATH"], data=config.MainPath, source=yaml_config)
add_to_config(path=["Filesystem", "FTS_LOGFILE_PATH"], data=config.LogFilePath, source=yaml_config)
add_to_config(path=["System", "FTS_NODE_ID"], data=config.nodeID, source=yaml_config)

file = open(config.yaml_path, mode="w+")
Expand All @@ -185,7 +185,7 @@ def autogenerate_config():
#FTS_API_PORT: 19023
#FTS_FED_PORT: 9000
#FTS_API_ADDRESS: 0.0.0.0
FileSystem:
Filesystem:
FTS_DB_PATH: /opt/fts/FreeTAKServer.db
#FTS_COT_TO_DB: True
FTS_PERSISTENCE_PATH: /opt/fts/
Expand Down

0 comments on commit 8bf93fa

Please sign in to comment.