2024-01-03 17:59:04 +00:00
|
|
|
package stirling.software.SPDF.config;
|
|
|
|
|
2024-01-09 21:13:35 -05:00
|
|
|
import java.io.IOException;
|
2024-01-09 22:39:21 +00:00
|
|
|
import java.nio.file.Files;
|
2024-05-25 00:22:01 +08:00
|
|
|
import java.nio.file.Path;
|
2024-01-09 22:39:21 +00:00
|
|
|
import java.nio.file.Paths;
|
2025-02-03 11:52:34 +01:00
|
|
|
import java.util.List;
|
2025-05-09 16:42:20 +01:00
|
|
|
import java.util.Locale;
|
2024-01-09 21:13:35 -05:00
|
|
|
import java.util.Properties;
|
2024-05-25 00:22:01 +08:00
|
|
|
import java.util.function.Predicate;
|
2024-01-09 21:13:35 -05:00
|
|
|
|
2025-03-20 08:53:29 +01:00
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
2024-04-21 22:16:39 +02:00
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
2024-04-27 11:03:57 +01:00
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
2024-01-03 17:59:04 +00:00
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
2024-04-27 11:03:57 +01:00
|
|
|
import org.springframework.context.annotation.Lazy;
|
2024-10-22 11:10:09 +01:00
|
|
|
import org.springframework.context.annotation.Scope;
|
2025-05-09 16:42:20 +01:00
|
|
|
import org.springframework.core.env.Environment;
|
2024-01-09 21:13:35 -05:00
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
import org.springframework.core.io.Resource;
|
2024-04-27 11:03:57 +01:00
|
|
|
import org.springframework.core.io.ResourceLoader;
|
|
|
|
import org.thymeleaf.spring6.SpringTemplateEngine;
|
2024-01-03 17:59:04 +00:00
|
|
|
|
2025-04-25 15:35:12 +02:00
|
|
|
import lombok.RequiredArgsConstructor;
|
2024-12-17 10:26:18 +01:00
|
|
|
import lombok.extern.slf4j.Slf4j;
|
2025-02-23 13:36:21 +00:00
|
|
|
|
2024-01-03 17:59:04 +00:00
|
|
|
import stirling.software.SPDF.model.ApplicationProperties;
|
|
|
|
|
|
|
|
@Configuration
|
2024-04-27 11:03:57 +01:00
|
|
|
@Lazy
|
2024-12-17 10:26:18 +01:00
|
|
|
@Slf4j
|
2025-04-25 15:35:12 +02:00
|
|
|
@RequiredArgsConstructor
|
2024-01-03 17:59:04 +00:00
|
|
|
public class AppConfig {
|
|
|
|
|
2024-12-24 09:52:53 +00:00
|
|
|
private final ApplicationProperties applicationProperties;
|
|
|
|
|
2025-05-09 16:42:20 +01:00
|
|
|
private final Environment env;
|
2025-05-12 09:01:28 +01:00
|
|
|
|
2024-04-27 11:03:57 +01:00
|
|
|
@Bean
|
2025-02-24 22:18:34 +00:00
|
|
|
@ConditionalOnProperty(name = "system.customHTMLFiles", havingValue = "true")
|
2024-04-27 11:03:57 +01:00
|
|
|
public SpringTemplateEngine templateEngine(ResourceLoader resourceLoader) {
|
|
|
|
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
|
|
|
|
templateEngine.addTemplateResolver(new FileFallbackTemplateResolver(resourceLoader));
|
|
|
|
return templateEngine;
|
|
|
|
}
|
|
|
|
|
2024-01-03 17:59:04 +00:00
|
|
|
@Bean(name = "loginEnabled")
|
|
|
|
public boolean loginEnabled() {
|
|
|
|
return applicationProperties.getSecurity().getEnableLogin();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "appName")
|
|
|
|
public String appName() {
|
|
|
|
String homeTitle = applicationProperties.getUi().getAppName();
|
|
|
|
return (homeTitle != null) ? homeTitle : "Stirling PDF";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "appVersion")
|
|
|
|
public String appVersion() {
|
2024-01-09 21:13:35 -05:00
|
|
|
Resource resource = new ClassPathResource("version.properties");
|
|
|
|
Properties props = new Properties();
|
|
|
|
try {
|
|
|
|
props.load(resource.getInputStream());
|
|
|
|
return props.getProperty("version");
|
|
|
|
} catch (IOException e) {
|
2024-12-17 10:26:18 +01:00
|
|
|
log.error("exception", e);
|
2024-01-09 21:13:35 -05:00
|
|
|
}
|
|
|
|
return "0.0.0";
|
2024-01-03 17:59:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "homeText")
|
|
|
|
public String homeText() {
|
|
|
|
return (applicationProperties.getUi().getHomeDescription() != null)
|
|
|
|
? applicationProperties.getUi().getHomeDescription()
|
|
|
|
: "null";
|
|
|
|
}
|
|
|
|
|
2025-02-03 11:52:34 +01:00
|
|
|
@Bean(name = "languages")
|
|
|
|
public List<String> languages() {
|
|
|
|
return applicationProperties.getUi().getLanguages();
|
|
|
|
}
|
|
|
|
|
2025-03-20 08:53:29 +01:00
|
|
|
@Bean
|
|
|
|
public String contextPath(@Value("${server.servlet.context-path}") String contextPath) {
|
|
|
|
return contextPath;
|
|
|
|
}
|
|
|
|
|
2024-01-03 17:59:04 +00:00
|
|
|
@Bean(name = "navBarText")
|
|
|
|
public String navBarText() {
|
|
|
|
String defaultNavBar =
|
|
|
|
applicationProperties.getUi().getAppNameNavbar() != null
|
|
|
|
? applicationProperties.getUi().getAppNameNavbar()
|
|
|
|
: applicationProperties.getUi().getAppName();
|
|
|
|
return (defaultNavBar != null) ? defaultNavBar : "Stirling PDF";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "enableAlphaFunctionality")
|
|
|
|
public boolean enableAlphaFunctionality() {
|
|
|
|
return applicationProperties.getSystem().getEnableAlphaFunctionality() != null
|
|
|
|
? applicationProperties.getSystem().getEnableAlphaFunctionality()
|
|
|
|
: false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "rateLimit")
|
|
|
|
public boolean rateLimit() {
|
Improved Configuration and YAML Management (#2966)
# Description of Changes
**What was changed:**
- **Configuration Updates:**
Replaced all calls to `GeneralUtils.saveKeyToConfig` with the new
`GeneralUtils.saveKeyToSettings` method across multiple classes (e.g.,
`LicenseKeyChecker`, `InitialSetup`, `SettingsController`, etc.). This
update ensures consistent management of configuration settings.
- **File Path and Exception Handling:**
Updated file path handling in `SPDFApplication` by creating `Path`
objects from string paths and logging these paths for clarity. Also
refined exception handling by catching more specific exceptions (e.g.,
using `IOException` instead of a generic `Exception`).
- **Analytics Flag and Rate Limiting:**
Changed the analytics flag in the application properties from a `String`
to a `Boolean`, and updated related logic in `AppConfig` and
`PostHogService`. The rate-limiting property retrieval in `AppConfig`
was also refined for clarity.
- **YAML Configuration Management:**
Replaced the previous manual, line-based YAML merging logic in
`ConfigInitializer` with a new `YamlHelper` class. This helper leverages
the SnakeYAML engine to load, update, and save YAML configurations more
robustly while preserving comments and formatting.
**Why the change was made:**
- **Improved Maintainability:**
Consolidating configuration update logic into a single utility method
(`saveKeyToSettings`) reduces code duplication and simplifies future
maintenance.
- **Enhanced Robustness:**
The new `YamlHelper` class ensures that configuration files are merged
accurately and safely, minimizing risks of data loss or format
corruption.
- **Better Type Safety and Exception Handling:**
Switching the analytics flag to a Boolean and refining exception
handling improves code robustness and debugging efficiency.
- **Clarity and Consistency:**
Standardizing file path handling and logging practices enhances code
readability across the project.
**Challenges encountered:**
- **YAML Merging Complexity:**
Integrating the new `YamlHelper` required careful handling to preserve
existing settings, comments, and formatting during merges.
- **Type Conversion and Backward Compatibility:**
Updating the analytics flag from a string to a Boolean required
extensive testing to ensure backward compatibility and proper
functionality.
- **Exception Granularity:**
Refactoring exception handling from a generic to a more specific
approach involved a detailed review to cover all edge cases.
Closes #<issue_number>
---
## Checklist
- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [x] I have performed a self-review of my own code
- [x] My changes generate no new warnings
### Documentation
- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)
### UI Changes (if applicable)
- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)
### Testing (if applicable)
- [x] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
---------
Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
2025-02-25 22:52:59 +01:00
|
|
|
String rateLimit = System.getProperty("rateLimit");
|
|
|
|
if (rateLimit == null) rateLimit = System.getenv("rateLimit");
|
|
|
|
return (rateLimit != null) ? Boolean.valueOf(rateLimit) : false;
|
2024-01-03 17:59:04 +00:00
|
|
|
}
|
2024-01-09 22:39:21 +00:00
|
|
|
|
|
|
|
@Bean(name = "RunningInDocker")
|
|
|
|
public boolean runningInDocker() {
|
|
|
|
return Files.exists(Paths.get("/.dockerenv"));
|
|
|
|
}
|
|
|
|
|
2024-12-18 18:04:10 +00:00
|
|
|
@Bean(name = "configDirMounted")
|
|
|
|
public boolean isRunningInDockerWithConfig() {
|
|
|
|
Path dockerEnv = Paths.get("/.dockerenv");
|
|
|
|
// default to true if not docker
|
|
|
|
if (!Files.exists(dockerEnv)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
Path mountInfo = Paths.get("/proc/1/mountinfo");
|
|
|
|
// this should always exist, if not some unknown usecase
|
|
|
|
if (!Files.exists(mountInfo)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
return Files.lines(mountInfo).anyMatch(line -> line.contains(" /configs "));
|
|
|
|
} catch (IOException e) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-04-21 22:16:39 +02:00
|
|
|
@ConditionalOnMissingClass("stirling.software.SPDF.config.security.SecurityConfiguration")
|
2025-02-24 22:18:34 +00:00
|
|
|
@Bean(name = "activeSecurity")
|
|
|
|
public boolean missingActiveSecurity() {
|
2024-04-21 22:16:39 +02:00
|
|
|
return false;
|
|
|
|
}
|
2024-05-25 00:22:01 +08:00
|
|
|
|
|
|
|
@Bean(name = "directoryFilter")
|
2024-08-24 18:08:51 +02:00
|
|
|
public Predicate<Path> processOnlyFiles() {
|
2024-05-25 00:22:01 +08:00
|
|
|
return path -> {
|
|
|
|
if (Files.isDirectory(path)) {
|
2024-06-01 13:55:28 +01:00
|
|
|
return !path.toString().contains("processing");
|
2024-05-25 00:22:01 +08:00
|
|
|
} else {
|
2024-08-24 18:08:51 +02:00
|
|
|
return true;
|
2024-05-25 00:22:01 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2024-09-13 16:42:38 +01:00
|
|
|
|
|
|
|
@Bean(name = "termsAndConditions")
|
|
|
|
public String termsAndConditions() {
|
|
|
|
return applicationProperties.getLegal().getTermsAndConditions();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "privacyPolicy")
|
|
|
|
public String privacyPolicy() {
|
|
|
|
return applicationProperties.getLegal().getPrivacyPolicy();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "cookiePolicy")
|
|
|
|
public String cookiePolicy() {
|
|
|
|
return applicationProperties.getLegal().getCookiePolicy();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "impressum")
|
|
|
|
public String impressum() {
|
|
|
|
return applicationProperties.getLegal().getImpressum();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "accessibilityStatement")
|
|
|
|
public String accessibilityStatement() {
|
|
|
|
return applicationProperties.getLegal().getAccessibilityStatement();
|
|
|
|
}
|
2024-10-14 22:34:41 +01:00
|
|
|
|
|
|
|
@Bean(name = "analyticsPrompt")
|
2024-10-22 11:10:09 +01:00
|
|
|
@Scope("request")
|
2024-10-14 22:34:41 +01:00
|
|
|
public boolean analyticsPrompt() {
|
Improved Configuration and YAML Management (#2966)
# Description of Changes
**What was changed:**
- **Configuration Updates:**
Replaced all calls to `GeneralUtils.saveKeyToConfig` with the new
`GeneralUtils.saveKeyToSettings` method across multiple classes (e.g.,
`LicenseKeyChecker`, `InitialSetup`, `SettingsController`, etc.). This
update ensures consistent management of configuration settings.
- **File Path and Exception Handling:**
Updated file path handling in `SPDFApplication` by creating `Path`
objects from string paths and logging these paths for clarity. Also
refined exception handling by catching more specific exceptions (e.g.,
using `IOException` instead of a generic `Exception`).
- **Analytics Flag and Rate Limiting:**
Changed the analytics flag in the application properties from a `String`
to a `Boolean`, and updated related logic in `AppConfig` and
`PostHogService`. The rate-limiting property retrieval in `AppConfig`
was also refined for clarity.
- **YAML Configuration Management:**
Replaced the previous manual, line-based YAML merging logic in
`ConfigInitializer` with a new `YamlHelper` class. This helper leverages
the SnakeYAML engine to load, update, and save YAML configurations more
robustly while preserving comments and formatting.
**Why the change was made:**
- **Improved Maintainability:**
Consolidating configuration update logic into a single utility method
(`saveKeyToSettings`) reduces code duplication and simplifies future
maintenance.
- **Enhanced Robustness:**
The new `YamlHelper` class ensures that configuration files are merged
accurately and safely, minimizing risks of data loss or format
corruption.
- **Better Type Safety and Exception Handling:**
Switching the analytics flag to a Boolean and refining exception
handling improves code robustness and debugging efficiency.
- **Clarity and Consistency:**
Standardizing file path handling and logging practices enhances code
readability across the project.
**Challenges encountered:**
- **YAML Merging Complexity:**
Integrating the new `YamlHelper` required careful handling to preserve
existing settings, comments, and formatting during merges.
- **Type Conversion and Backward Compatibility:**
Updating the analytics flag from a string to a Boolean required
extensive testing to ensure backward compatibility and proper
functionality.
- **Exception Granularity:**
Refactoring exception handling from a generic to a more specific
approach involved a detailed review to cover all edge cases.
Closes #<issue_number>
---
## Checklist
- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [x] I have performed a self-review of my own code
- [x] My changes generate no new warnings
### Documentation
- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)
### UI Changes (if applicable)
- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)
### Testing (if applicable)
- [x] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
---------
Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
2025-02-25 22:52:59 +01:00
|
|
|
return applicationProperties.getSystem().getEnableAnalytics() == null;
|
2024-10-14 22:34:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "analyticsEnabled")
|
2024-10-22 11:10:09 +01:00
|
|
|
@Scope("request")
|
2024-10-14 22:34:41 +01:00
|
|
|
public boolean analyticsEnabled() {
|
2025-03-25 17:57:17 +00:00
|
|
|
if (applicationProperties.getPremium().isEnabled()) return true;
|
Improved Configuration and YAML Management (#2966)
# Description of Changes
**What was changed:**
- **Configuration Updates:**
Replaced all calls to `GeneralUtils.saveKeyToConfig` with the new
`GeneralUtils.saveKeyToSettings` method across multiple classes (e.g.,
`LicenseKeyChecker`, `InitialSetup`, `SettingsController`, etc.). This
update ensures consistent management of configuration settings.
- **File Path and Exception Handling:**
Updated file path handling in `SPDFApplication` by creating `Path`
objects from string paths and logging these paths for clarity. Also
refined exception handling by catching more specific exceptions (e.g.,
using `IOException` instead of a generic `Exception`).
- **Analytics Flag and Rate Limiting:**
Changed the analytics flag in the application properties from a `String`
to a `Boolean`, and updated related logic in `AppConfig` and
`PostHogService`. The rate-limiting property retrieval in `AppConfig`
was also refined for clarity.
- **YAML Configuration Management:**
Replaced the previous manual, line-based YAML merging logic in
`ConfigInitializer` with a new `YamlHelper` class. This helper leverages
the SnakeYAML engine to load, update, and save YAML configurations more
robustly while preserving comments and formatting.
**Why the change was made:**
- **Improved Maintainability:**
Consolidating configuration update logic into a single utility method
(`saveKeyToSettings`) reduces code duplication and simplifies future
maintenance.
- **Enhanced Robustness:**
The new `YamlHelper` class ensures that configuration files are merged
accurately and safely, minimizing risks of data loss or format
corruption.
- **Better Type Safety and Exception Handling:**
Switching the analytics flag to a Boolean and refining exception
handling improves code robustness and debugging efficiency.
- **Clarity and Consistency:**
Standardizing file path handling and logging practices enhances code
readability across the project.
**Challenges encountered:**
- **YAML Merging Complexity:**
Integrating the new `YamlHelper` required careful handling to preserve
existing settings, comments, and formatting during merges.
- **Type Conversion and Backward Compatibility:**
Updating the analytics flag from a string to a Boolean required
extensive testing to ensure backward compatibility and proper
functionality.
- **Exception Granularity:**
Refactoring exception handling from a generic to a more specific
approach involved a detailed review to cover all edge cases.
Closes #<issue_number>
---
## Checklist
- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [x] I have performed a self-review of my own code
- [x] My changes generate no new warnings
### Documentation
- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)
### UI Changes (if applicable)
- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)
### Testing (if applicable)
- [x] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
---------
Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
2025-02-25 22:52:59 +01:00
|
|
|
return applicationProperties.getSystem().isAnalyticsEnabled();
|
2024-10-14 22:34:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "StirlingPDFLabel")
|
|
|
|
public String stirlingPDFLabel() {
|
|
|
|
return "Stirling-PDF" + " v" + appVersion();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Bean(name = "UUID")
|
|
|
|
public String uuid() {
|
|
|
|
return applicationProperties.getAutomaticallyGenerated().getUUID();
|
|
|
|
}
|
2025-05-12 09:01:28 +01:00
|
|
|
|
2025-05-09 16:42:20 +01:00
|
|
|
@Bean(name = "disablePixel")
|
|
|
|
public boolean disablePixel() {
|
|
|
|
return Boolean.getBoolean(env.getProperty("DISABLE_PIXEL"));
|
|
|
|
}
|
2025-05-12 09:01:28 +01:00
|
|
|
|
2025-05-09 16:42:20 +01:00
|
|
|
@Bean(name = "machineType")
|
|
|
|
public String determineMachineType() {
|
|
|
|
try {
|
|
|
|
boolean isDocker = runningInDocker();
|
|
|
|
boolean isKubernetes = System.getenv("KUBERNETES_SERVICE_HOST") != null;
|
|
|
|
boolean isBrowserOpen = "true".equalsIgnoreCase(env.getProperty("BROWSER_OPEN"));
|
|
|
|
|
|
|
|
if (isKubernetes) {
|
|
|
|
return "Kubernetes";
|
|
|
|
} else if (isDocker) {
|
|
|
|
return "Docker";
|
|
|
|
} else if (isBrowserOpen) {
|
|
|
|
String os = System.getProperty("os.name").toLowerCase(Locale.ROOT);
|
|
|
|
if (os.contains("win")) {
|
|
|
|
return "Client-windows";
|
|
|
|
} else if (os.contains("mac")) {
|
|
|
|
return "Client-mac";
|
|
|
|
} else {
|
|
|
|
return "Client-unix";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return "Server-jar";
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
return "Unknown";
|
|
|
|
}
|
|
|
|
}
|
2024-01-03 17:59:04 +00:00
|
|
|
}
|