Update the Enterprise submodule and make use of the newly added secrets configuration mechanism
This commit is contained in:
committed by
Stefan Ceriu
parent
3dd98adeeb
commit
f20629b1dc
@@ -74,7 +74,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
|||||||
|
|
||||||
Target.mainApp.configure(logLevel: appSettings.logLevel,
|
Target.mainApp.configure(logLevel: appSettings.logLevel,
|
||||||
traceLogPacks: appSettings.traceLogPacks,
|
traceLogPacks: appSettings.traceLogPacks,
|
||||||
sentryURL: appSettings.bugReportSDKSentryURL)
|
sentryURL: appSettings.bugReportSentryRustURL)
|
||||||
|
|
||||||
let appName = InfoPlistReader.main.bundleDisplayName
|
let appName = InfoPlistReader.main.bundleDisplayName
|
||||||
let appVersion = InfoPlistReader.main.bundleShortVersionString
|
let appVersion = InfoPlistReader.main.bundleShortVersionString
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ final class AppSettings {
|
|||||||
|
|
||||||
let bugReportServiceBaseURL: URL? = Secrets.rageshakeServerURL.map { URL(string: $0)! } // swiftlint:disable:this force_unwrapping
|
let bugReportServiceBaseURL: URL? = Secrets.rageshakeServerURL.map { URL(string: $0)! } // swiftlint:disable:this force_unwrapping
|
||||||
let bugReportSentryURL: URL? = Secrets.sentryDSN.map { URL(string: $0)! } // swiftlint:disable:this force_unwrapping
|
let bugReportSentryURL: URL? = Secrets.sentryDSN.map { URL(string: $0)! } // swiftlint:disable:this force_unwrapping
|
||||||
let bugReportSDKSentryURL: URL? = Secrets.sentrySDKDSN.map { URL(string: $0)! } // swiftlint:disable:this force_unwrapping
|
let bugReportSentryRustURL: URL? = Secrets.sentryRustDSN.map { URL(string: $0)! } // swiftlint:disable:this force_unwrapping
|
||||||
/// The name allocated by the bug report server
|
/// The name allocated by the bug report server
|
||||||
private(set) var bugReportApplicationID = "element-x-ios"
|
private(set) var bugReportApplicationID = "element-x-ios"
|
||||||
/// The maximum size of the upload request. Default value is just below CloudFlare's max request size.
|
/// The maximum size of the upload request. Default value is just below CloudFlare's max request size.
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
import "package://pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.0.1#/StaticCode.pkl"
|
import "package://pkg.pkl-lang.org/github.com/element-hq/pkl-tools/staticcode@1.0.1#/StaticCode.pkl"
|
||||||
|
|
||||||
sentryDSN: String? = read?("env:SENTRY_DSN")
|
sentryDSN: String? = read?("env:SENTRY_DSN")
|
||||||
|
sentryRustDSN: String? = read?("env:SENTRY_RUST_DSN")
|
||||||
postHogHost: String? = read?("env:POSTHOG_HOST")
|
postHogHost: String? = read?("env:POSTHOG_HOST")
|
||||||
postHogAPIKey: String? = read?("env:POSTHOG_API_KEY")
|
postHogAPIKey: String? = read?("env:POSTHOG_API_KEY")
|
||||||
rageshakeServerURL: String? = read?("env:RAGESHAKE_SERVER_URL")
|
rageshakeServerURL: String? = read?("env:RAGESHAKE_SERVER_URL")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
enum Secrets {
|
enum Secrets {
|
||||||
static let sentryDSN: String? = "https://username@sentry.localhost/project_id"
|
static let sentryDSN: String? = "https://username@sentry.localhost/project_id"
|
||||||
static let sentrySDKDSN: String? = "https://username@sentry.localhost/project_id"
|
static let sentryRustDSN: String? = "https://username@sentry.localhost/project_id"
|
||||||
static let postHogHost: String? = "https://posthog.localhost"
|
static let postHogHost: String? = "https://posthog.localhost"
|
||||||
static let postHogAPIKey: String? = "your_key"
|
static let postHogAPIKey: String? = "your_key"
|
||||||
static let rageshakeServerURL: String? = "https://rageshake.localhost"
|
static let rageshakeServerURL: String? = "https://rageshake.localhost"
|
||||||
|
|||||||
@@ -29,14 +29,12 @@ The location sharing feature on Element X is currently integrated with [MapLibre
|
|||||||
|
|
||||||
The MapLibre SDK requires an API key to work, so you need to get one for yourself.
|
The MapLibre SDK requires an API key to work, so you need to get one for yourself.
|
||||||
|
|
||||||
After you get an API key, you need to configure the project by exporting it and regenerating the `Secrets.swift` file:
|
After you get an API key, you need to configure the project by updating the `Secrets.swift`.
|
||||||
|
|
||||||
```
|
It’s not recommended to push your API key in your repository since other people may get it so the mechanism for updating this file is left up to the reader.
|
||||||
export MAPLIBRE_API_KEY=your_map_libre_key
|
|
||||||
bundle exec fastlane config_secrets
|
|
||||||
```
|
|
||||||
|
|
||||||
It’s not recommended to push your API key in your repository since other people may get it.
|
An option would be to export it to your environment and use the existing `Secrets.pkl` file to update them like so:
|
||||||
|
`pkl eval -o Secrets.swift Secrets.pkl`
|
||||||
|
|
||||||
One way to avoid pushing the API key by mistake is running on your machine the command:
|
One way to avoid pushing the API key by mistake is running on your machine the command:
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ lane :integration_tests do
|
|||||||
end
|
end
|
||||||
|
|
||||||
lane :config_production do
|
lane :config_production do
|
||||||
config_secrets()
|
update_foss_secrets()
|
||||||
xcodegen(spec: "project.yml")
|
xcodegen(spec: "project.yml")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ lane :config_nightly do |options|
|
|||||||
data["include"].append({ "path" => "Variants/Nightly/nightly.yml" })
|
data["include"].append({ "path" => "Variants/Nightly/nightly.yml" })
|
||||||
end
|
end
|
||||||
|
|
||||||
config_secrets()
|
update_foss_secrets()
|
||||||
|
|
||||||
File.open(target_file_path, 'w') { |f| YAML.dump(data, f) }
|
File.open(target_file_path, 'w') { |f| YAML.dump(data, f) }
|
||||||
|
|
||||||
@@ -313,9 +313,3 @@ private_lane :create_simulator_if_necessary do |options|
|
|||||||
sh("xcrun simctl create '#{simulator_name}' #{simulator_type} #{simulator_runtime}")
|
sh("xcrun simctl create '#{simulator_name}' #{simulator_type} #{simulator_runtime}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
lane :config_secrets do
|
|
||||||
Dir.chdir "../Secrets" do
|
|
||||||
sh("pkl eval --cache-dir vendor -o Secrets.swift Secrets.pkl")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|||||||
Reference in New Issue
Block a user