Skip to content

Commit 19897f0

Browse files
authored
Merge v4.3.3 FSC v2, NTP for time
2 parents 7ddc200 + 2bdc68a commit 19897f0

File tree

22 files changed

+427
-299
lines changed

22 files changed

+427
-299
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ env:
1111
PRJ_NAME: LiveTraffic # The plugin's name, expected to be the .xpl file's name and used as the plugin folder name
1212
# On master branches or when explicitely tagged we build prod versions, otherwise BETA
1313
version_beta: ${{ (github.ref != 'refs/heads/master' && github.ref_type != 'tag') && '1' || '0' }}
14+
FSC_PROD_CLIENT_SECRET: ${{ secrets.FSC_PROD_CLIENT_SECRET }}
15+
FSC_PROD_CLIENT_ID: ${{ secrets.FSC_PROD_CLIENT_ID }}
16+
FSC_STAGING_CLIENT_SECRET: ${{ secrets.FSC_STAGING_CLIENT_SECRET }}
17+
FSC_STAGING_CLIENT_ID: ${{ secrets.FSC_STAGING_CLIENT_ID }}
1418

1519
jobs:
1620
#####################################

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
.vs/
55
.vscode/
66

7+
# Environment variables (secrets)
8+
.env
9+
710
# Build directories
811
build*/*
912

@@ -19,4 +22,4 @@ xcuserdata/
1922
*.pbxuser
2023

2124
# MS Office Temporary Files
22-
~$*
25+
~$*

CMakeLists.txt

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# LiveTraffic - Set up to be used in the provided docker environment to build lin, mac, and win
22

3-
cmake_minimum_required(VERSION 3.16)
3+
cmake_minimum_required(VERSION 3.18)
44

55
# Mac: Need to tell early on that we want a cross platform build
66
if(DEFINED ENV{platform})
@@ -23,7 +23,7 @@ endif()
2323
set(CMAKE_BUILD_TYPE RelWithDebInfo)
2424

2525
project(LiveTraffic
26-
VERSION 4.3.2
26+
VERSION 4.3.3
2727
DESCRIPTION "LiveTraffic X-Plane plugin")
2828
set(VERSION_BETA 0)
2929

@@ -47,6 +47,46 @@ if (VERSION_BETA)
4747
message(" BETA Version")
4848
endif()
4949

50+
#
51+
# MARK: Build Configuration from Environment Variables
52+
#
53+
54+
# FSCharter OAuth Configuration
55+
# These can be set via environment variables or CMake cache variables
56+
# For GitHub Actions, set these as repository secrets
57+
# For local builds, set environment variables before running cmake
58+
59+
# Production environment
60+
if(DEFINED ENV{FSC_PROD_CLIENT_ID})
61+
set(FSC_PROD_CLIENT_ID "$ENV{FSC_PROD_CLIENT_ID}" CACHE STRING "FSCharter production client ID")
62+
else()
63+
set(FSC_PROD_CLIENT_ID "3" CACHE STRING "FSCharter production client ID")
64+
endif()
65+
if(DEFINED ENV{FSC_PROD_CLIENT_SECRET})
66+
set(FSC_PROD_CLIENT_SECRET "$ENV{FSC_PROD_CLIENT_SECRET}" CACHE STRING "FSCharter production client secret (base64)")
67+
else()
68+
# Default fallback value, is handled specifically by LiveTraffic code
69+
set(FSC_PROD_CLIENT_SECRET "INOP" CACHE STRING "FSCharter production client secret (base64)")
70+
endif()
71+
72+
# Staging environment
73+
if(DEFINED ENV{FSC_STAGING_CLIENT_ID})
74+
set(FSC_STAGING_CLIENT_ID "$ENV{FSC_STAGING_CLIENT_ID}" CACHE STRING "FSCharter staging client ID")
75+
else()
76+
set(FSC_STAGING_CLIENT_ID "3" CACHE STRING "FSCharter staging client ID")
77+
endif()
78+
if(DEFINED ENV{FSC_STAGING_CLIENT_SECRET})
79+
set(FSC_STAGING_CLIENT_SECRET "$ENV{FSC_STAGING_CLIENT_SECRET}" CACHE STRING "FSCharter staging client secret (base64)")
80+
else()
81+
# Default fallback value, is handled specifically by LiveTraffic code
82+
set(FSC_STAGING_CLIENT_SECRET "INOP" CACHE STRING "FSCharter staging client secret (base64)")
83+
endif()
84+
85+
string(SUBSTRING "${FSC_PROD_CLIENT_SECRET}" 0 10 _short_secret)
86+
message("FSCharter Production = Client ID: ${FSC_PROD_CLIENT_ID}, Client Secret: ${_short_secret}")
87+
string(SUBSTRING "${FSC_STAGING_CLIENT_SECRET}" 0 10 _short_secret)
88+
message("FSCharter Staging = Client ID: ${FSC_STAGING_CLIENT_ID}, Client Secret: ${_short_secret}")
89+
5090
# By default we build Release with Debug Info (and strip the debug info in post-processing)
5191
if ((NOT DEFINED CMAKE_BUILD_TYPE) OR (CMAKE_BUILD_TYPE STREQUAL ""))
5292
set(CMAKE_BUILD_TYPE RelWithDebInfo)
@@ -271,6 +311,18 @@ if (APPLE)
271311
COMPILE_OPTIONS "-Wno-deprecated-declarations")
272312
endif()
273313

314+
# FSCharter OAuth Configuration
315+
# We keep them restricted to the one file for which they are relevat to reduce log output clutter.
316+
set_property(
317+
SOURCE
318+
Src/LTFSCharter.cpp
319+
PROPERTY COMPILE_DEFINITIONS
320+
FSC_PROD_CLIENT_ID=${FSC_PROD_CLIENT_ID}
321+
FSC_PROD_CLIENT_SECRET="${FSC_PROD_CLIENT_SECRET}"
322+
FSC_STAGING_CLIENT_ID=${FSC_STAGING_CLIENT_ID}
323+
FSC_STAGING_CLIENT_SECRET="${FSC_STAGING_CLIENT_SECRET}"
324+
)
325+
274326
################################################################################
275327
# Define pre-compiled header
276328
################################################################################

Data/FSCharter/.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# LiveTraffic Build Environment Variables for FSCharter secrets
2+
# Copy this file to .env and fill in your values for local development
3+
# For GitHub Actions, configure these as repository secrets
4+
5+
# ============================================================================
6+
# FSCharter OAuth Configuration
7+
# ============================================================================
8+
# These values are used to authenticate with FSCharter's API
9+
# The client secrets should be Base64 encoded
10+
11+
# Production Environment
12+
# Server: v2.fscharter.net (not configurable via env var)
13+
export FSC_PROD_CLIENT_ID=3
14+
export FSC_PROD_CLIENT_SECRET=<BASE64_ENCODED_SECRET>
15+
16+
# Staging Environment
17+
# Server: staging.fscharter.net (not configurable via env var)
18+
export FSC_STAGING_CLIENT_ID=3
19+
export FSC_STAGING_CLIENT_SECRET=<BASE64_ENCODED_SECRET>

Data/FSCharter/FSC_FLO41-17.png

-96.5 KB
Binary file not shown.
774 Bytes
Binary file not shown.
282 Bytes
Binary file not shown.
783 Bytes
Binary file not shown.
229 Bytes
Binary file not shown.
297 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)