Class MyBBApplicationSpec
- All Implemented Interfaces:
ApplicationSpec, CmsSpec, DatabaseSpec
MyBB is a free, open-source forum software with a focus on user-friendliness and extensibility. It has a loyal community and extensive plugin system.
Key Features:
- PHP 7.3+ support (8.x recommended)
- MySQL/MariaDB/PostgreSQL/SQLite database
- Plugin and theme system
- Database failover support
- Task scheduler
- Since:
- 3.1.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ApplicationSpec
ApplicationSpec.OptionalPort, ApplicationSpec.SidecarContainerNested classes/interfaces inherited from interface DatabaseSpec
DatabaseSpec.DatabaseConnection, DatabaseSpec.DatabaseRequirement -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final intprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a unique identifier for this application.intReturns the primary application port.intDatabase backup retention requirements.Returns default protected paths for MyBB when using ALB-level OIDC.Returns static asset paths cached at the edge in CloudFront.cliTool()Returns the CLI tool for this CMS, if available.Returns commands to install the CLI tool.Returns the CMS category.voidconfigureUserData(UserDataBuilder builder, Ec2Context context) Configure EC2 UserData script for application installation and setup.Returns the container path where application data is stored.containerEnvironmentVariables(String fqdn, boolean sslEnabled, String authMode) Configures application-specific environment variables for the container.Returns the container user (UID:GID) to run as.cronCommands(String siteUrl) Returns scheduled task commands for system cron.Database requirement for this application.Returns the default container image for this application.intGet the recommended health check grace period for this application.Returns the document root path within the container.Returns the EBS device name for EC2 instances when not using EFS.Returns the EC2 data path where application stores persistent data.Returns CloudWatch log file paths for EC2 monitoring.Returns the EFS path for this application's data.Returns the EFS permissions for the access point.Returns the OIDC integration handler for this application.Returns the list of supported authentication modes for this application.booleanReturns whether the CMS has scheduled tasks (cron jobs).Returns the health check path for ALB/ELB health checks.Returns the local media upload path within the container.Returns the multi-site configuration mode.Returns the object cache plugin/module identifier.Returns OPcache configuration for PHP bytecode caching.Returns PHP-FPM pool configuration overrides.intReturns PHP max execution time in seconds.intReturns PHP memory limit in megabytes.intReturns PHP post max size in megabytes.intReturns PHP upload max filesize in megabytes.Returns the required PHP version for this CMS.Returns the preferred caching backend.Returns the preferred web server.Returns required PHP extensions for this CMS.Returns the plugin/module identifier for S3 media integration.booleanReturns whether CDN integration is supported.booleanReturns whether multi-site/multi-store is supported.booleanReturns whether Redis/Memcached object caching is supported.booleanReturns whether S3 media offloading is supported.booleanReturns whether to use system cron instead of internal scheduler.Returns the volume name for this application.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ApplicationSpec
albSignerArnEnvVar, autoAdminPasswordEnvVar, cipherKeySecretEnvVar, cpuArchitecture, databasePasswordEnvVar, defaultOidcGroupNames, deploymentTargetEnvVar, getRecommendedAuthMode, getRecommendedAuthMode, getSupportedAuthModes, licenseKeySecretEnvVar, oidcClientSecretEnvVar, optionalPorts, publicPaths, publicTlsTrustedEnvVar, requiresCognitoGroupManagementIam, requiresSequentialDeploymentWithoutDatabase, requiresSessionStore, sessionStoreEnvVars, sidecarContainersMethods inherited from interface CmsSpec
category, cdnAssetPaths, cdnMediaPaths, containerCommand, databaseEnvVars, defaultCpu, defaultInstanceType, defaultMemory, description, displayName, isEcommerce, protectedPaths, redisEnvVars, requiresDatabase, supportsEc2, supportsFargate, supportsOidcIntegrationMethods inherited from interface DatabaseSpec
databaseInitScripts, databaseParameters, readReplicaCount, requiresReadReplicas
-
Field Details
-
APPLICATION_ID
- See Also:
-
DEFAULT_IMAGE
- See Also:
-
APPLICATION_PORT
protected static final int APPLICATION_PORT- See Also:
-
CONTAINER_DATA_PATH
- See Also:
-
EFS_DATA_PATH
- See Also:
-
VOLUME_NAME
- See Also:
-
CONTAINER_USER
- See Also:
-
EFS_PERMISSIONS
- See Also:
-
PHP_VERSION
- See Also:
-
PHP_EXTENSIONS
-
-
Constructor Details
-
MyBBApplicationSpec
public MyBBApplicationSpec()
-
-
Method Details
-
applicationId
Description copied from interface:ApplicationSpecReturns a unique identifier for this application. Used for logging, metrics, and resource naming.- Specified by:
applicationIdin interfaceApplicationSpec- Returns:
- application identifier (e.g., "jenkins", "gitlab", "vault")
-
defaultContainerImage
Description copied from interface:ApplicationSpecReturns the default container image for this application. Can be overridden by deployment context configuration.- Specified by:
defaultContainerImagein interfaceApplicationSpec- Returns:
- container image string (e.g., "jenkins/jenkins:lts")
-
applicationPort
public int applicationPort()Description copied from interface:ApplicationSpecReturns the primary application port. This is the port the application listens on inside the container.- Specified by:
applicationPortin interfaceApplicationSpec- Returns:
- application port (e.g., 8080 for Jenkins)
-
containerDataPath
Description copied from interface:ApplicationSpecReturns the container path where application data is stored. This is where the volume will be mounted inside the container.- Specified by:
containerDataPathin interfaceApplicationSpec- Returns:
- container mount path (e.g., "/var/jenkins_home")
-
efsDataPath
Description copied from interface:ApplicationSpecReturns the EFS path for this application's data. This is the path within the EFS filesystem.- Specified by:
efsDataPathin interfaceApplicationSpec- Returns:
- EFS path (e.g., "/jenkins")
-
volumeName
Description copied from interface:ApplicationSpecReturns the volume name for this application. Used to reference the volume in task definitions.- Specified by:
volumeNamein interfaceApplicationSpec- Returns:
- volume name (e.g., "jenkinsHome")
-
containerUser
Description copied from interface:ApplicationSpecReturns the container user (UID:GID) to run as. Important for file permissions when using EFS.- Specified by:
containerUserin interfaceApplicationSpec- Returns:
- user in format "UID:GID" (e.g., "1000:1000")
-
efsPermissions
Description copied from interface:ApplicationSpecReturns the EFS permissions for the access point.- Specified by:
efsPermissionsin interfaceApplicationSpec- Returns:
- permissions string (e.g., "750")
-
healthCheckPath
Description copied from interface:ApplicationSpecReturns the health check path for ALB/ELB health checks.Different applications expose health endpoints at different paths:
- Jenkins: /login
- GitLab: /users/sign_in
- Grafana: /api/health
- Metabase: /api/health
- Specified by:
healthCheckPathin interfaceApplicationSpec- Returns:
- health check path (e.g., "/login", "/api/health")
-
defaultHealthCheckGracePeriod
public int defaultHealthCheckGracePeriod()Description copied from interface:ApplicationSpecGet the recommended health check grace period for this application.The grace period is how long ECS/ALB waits before starting health checks after a container starts. Applications with longer initialization times (like GitLab) need longer grace periods.
Default values:
- Most applications: 300 seconds (5 minutes)
- GitLab: 600 seconds (10 minutes) - due to database migrations and initialization
- Other database-heavy apps may also need longer periods
- Specified by:
defaultHealthCheckGracePeriodin interfaceApplicationSpec- Returns:
- recommended health check grace period in seconds
-
phpVersion
Description copied from interface:CmsSpecReturns the required PHP version for this CMS.Common versions:
- 8.2 - WordPress, Magento 2.4.6+, Drupal 10
- 8.1 - PrestaShop 8.x, Joomla 5
- 7.4 - Legacy support (not recommended)
- Specified by:
phpVersionin interfaceCmsSpec- Returns:
- PHP version string (e.g., "8.2", "8.1")
-
requiredPhpExtensions
Description copied from interface:CmsSpecReturns required PHP extensions for this CMS.Common extensions include:
- mysqli, pdo_mysql - MySQL database connectivity
- gd, imagick - Image processing
- curl - HTTP client
- mbstring - Multibyte string handling
- xml, dom - XML processing
- zip - Archive handling
- intl - Internationalization
- opcache - Bytecode caching
- redis - Redis client
- Specified by:
requiredPhpExtensionsin interfaceCmsSpec- Returns:
- List of PHP extension names
-
phpFpmConfig
Description copied from interface:CmsSpecReturns PHP-FPM pool configuration overrides.Common settings:
- pm - Process manager (static, dynamic, ondemand)
- pm.max_children - Maximum worker processes
- pm.start_servers - Initial workers (dynamic mode)
- pm.min_spare_servers - Minimum idle workers
- pm.max_spare_servers - Maximum idle workers
- pm.max_requests - Requests before worker recycle
- Specified by:
phpFpmConfigin interfaceCmsSpec- Returns:
- Map of PHP-FPM configuration key-value pairs
-
opcacheConfig
Description copied from interface:CmsSpecReturns OPcache configuration for PHP bytecode caching.Recommended production settings:
- opcache.enable=1 - Enable OPcache
- opcache.memory_consumption=128 - Cache memory (MB)
- opcache.max_accelerated_files=10000 - Cached file limit
- opcache.revalidate_freq=60 - File check interval (seconds)
- opcache.validate_timestamps=0 - Disable for production
- Specified by:
opcacheConfigin interfaceCmsSpec- Returns:
- Map of OPcache configuration key-value pairs
-
phpMemoryLimit
public int phpMemoryLimit()Description copied from interface:CmsSpecReturns PHP memory limit in megabytes.Recommended values:
- WordPress: 256MB
- WooCommerce: 512MB
- Magento: 756MB-2GB
- Drupal: 256MB
- Specified by:
phpMemoryLimitin interfaceCmsSpec- Returns:
- Memory limit in MB
-
phpMaxExecutionTime
public int phpMaxExecutionTime()Description copied from interface:CmsSpecReturns PHP max execution time in seconds.- Specified by:
phpMaxExecutionTimein interfaceCmsSpec- Returns:
- Max execution time (default: 300 seconds)
-
phpUploadMaxFilesize
public int phpUploadMaxFilesize()Description copied from interface:CmsSpecReturns PHP upload max filesize in megabytes.- Specified by:
phpUploadMaxFilesizein interfaceCmsSpec- Returns:
- Upload max filesize in MB (default: 64MB)
-
phpPostMaxSize
public int phpPostMaxSize()Description copied from interface:CmsSpecReturns PHP post max size in megabytes.- Specified by:
phpPostMaxSizein interfaceCmsSpec- Returns:
- Post max size in MB (default: 64MB)
-
supportsS3MediaStorage
public boolean supportsS3MediaStorage()Description copied from interface:CmsSpecReturns whether S3 media offloading is supported.When enabled, media uploads are stored in S3 instead of local filesystem, enabling horizontal scaling and CDN integration.
- Specified by:
supportsS3MediaStoragein interfaceCmsSpec- Returns:
- true if S3 media storage is supported
-
s3MediaPlugin
Description copied from interface:CmsSpecReturns the plugin/module identifier for S3 media integration.Examples:
- WordPress: "wp-offload-media" or "amazon-s3-and-cloudfront"
- Magento: "magento/module-aws-s3"
- Drupal: "s3fs"
- Specified by:
s3MediaPluginin interfaceCmsSpec- Returns:
- Plugin identifier, or null if native S3 support
-
mediaUploadPath
Description copied from interface:CmsSpecReturns the local media upload path within the container.Examples:
- WordPress: "/var/www/html/wp-content/uploads"
- Magento: "/var/www/html/pub/media"
- Drupal: "/var/www/html/sites/default/files"
- Specified by:
mediaUploadPathin interfaceCmsSpec- Returns:
- Absolute path to media upload directory
-
supportsCdnIntegration
public boolean supportsCdnIntegration()Description copied from interface:CmsSpecReturns whether CDN integration is supported.CDN integration via CloudFront enables:
- Edge caching for static assets
- Global content delivery
- SSL termination at edge
- DDoS protection
- Specified by:
supportsCdnIntegrationin interfaceCmsSpec- Returns:
- true if CDN integration is supported (default: true)
-
cdnStaticPaths
Description copied from interface:CmsSpecReturns static asset paths cached at the edge in CloudFront.These paths (CSS, JS, fonts, theme assets) are served from the ALB origin with a long-TTL static cache policy. They do not include user-uploaded media; see
CmsSpec.cdnMediaPaths()for that.Examples:
- WordPress:
["/wp-content/themes/*", "/wp-content/plugins/*", "/wp-includes/*"] - Magento:
["/static/*"] - Drupal:
["/core/*", "/modules/*", "/themes/*"]
- Specified by:
cdnStaticPathsin interfaceCmsSpec- Returns:
- List of URL path patterns for edge-cached static assets (default: empty)
- WordPress:
-
supportsObjectCache
public boolean supportsObjectCache()Description copied from interface:CmsSpecReturns whether Redis/Memcached object caching is supported.Object caching stores database query results and computed values in memory for faster retrieval.
- Specified by:
supportsObjectCachein interfaceCmsSpec- Returns:
- true if object caching is supported
-
preferredCacheBackend
Description copied from interface:CmsSpecReturns the preferred caching backend.- Specified by:
preferredCacheBackendin interfaceCmsSpec- Returns:
- "redis", "memcached", or "none"
-
objectCachePlugin
Description copied from interface:CmsSpecReturns the object cache plugin/module identifier.Examples:
- WordPress: "redis-cache" (Redis Object Cache plugin)
- Magento: Built-in Redis support
- Drupal: "redis" module
- Specified by:
objectCachePluginin interfaceCmsSpec- Returns:
- Plugin identifier for object caching
-
hasScheduledTasks
public boolean hasScheduledTasks()Description copied from interface:CmsSpecReturns whether the CMS has scheduled tasks (cron jobs).Most CMS platforms have internal task schedulers:
- WordPress: WP-Cron
- Magento: Cron groups (index, default, consumers)
- Drupal: Cron module
- Specified by:
hasScheduledTasksin interfaceCmsSpec- Returns:
- true if scheduled tasks exist
-
useSystemCron
public boolean useSystemCron()Description copied from interface:CmsSpecReturns whether to use system cron instead of internal scheduler.System cron is recommended for production because:
- More reliable execution timing
- Reduced page load overhead
- Better control over resource usage
- Specified by:
useSystemCronin interfaceCmsSpec- Returns:
- true to disable internal cron and use system cron
-
cronCommands
Description copied from interface:CmsSpecReturns scheduled task commands for system cron.Map keys are cron schedule expressions, values are commands.
Example for WordPress:
"* /15 * * * *" -> "curl -s https://example.com/wp-cron.php"
- Specified by:
cronCommandsin interfaceCmsSpec- Parameters:
siteUrl- The site URL for cron execution- Returns:
- Map of cron schedule to command
-
supportsMultisite
public boolean supportsMultisite()Description copied from interface:CmsSpecReturns whether multi-site/multi-store is supported.Multi-site capabilities:
- WordPress: Multisite network
- Magento: Multi-store views
- Drupal: Multi-site configuration
- PrestaShop: Multi-shop
- Specified by:
supportsMultisitein interfaceCmsSpec- Returns:
- true if multi-site is available
-
multisiteMode
Description copied from interface:CmsSpecReturns the multi-site configuration mode.Modes:
- "subdomain" - sites.example.com
- "subdirectory" - example.com/sites/
- "domain" - separate domains per site
- "none" - multi-site not enabled
- Specified by:
multisiteModein interfaceCmsSpec- Returns:
- Multi-site mode string
-
cmsCategory
Description copied from interface:CmsSpecReturns the CMS category.Categories:
- "cms" - Content management (WordPress, Joomla, Drupal)
- "ecommerce" - E-commerce (WooCommerce, Magento, PrestaShop)
- Specified by:
cmsCategoryin interfaceCmsSpec- Returns:
- "cms" or "ecommerce"
-
preferredWebServer
Description copied from interface:CmsSpecReturns the preferred web server.- Specified by:
preferredWebServerin interfaceCmsSpec- Returns:
- "nginx", "apache", or "caddy"
-
documentRoot
Description copied from interface:CmsSpecReturns the document root path within the container.This is where the web server serves files from.
- Specified by:
documentRootin interfaceCmsSpec- Returns:
- Document root path (e.g., "/var/www/html")
-
cliTool
Description copied from interface:CmsSpecReturns the CLI tool for this CMS, if available.Examples:
- WordPress: "wp" (WP-CLI)
- Magento: "bin/magento"
- Drupal: "drush"
- Joomla: "cli/joomla.php"
-
cliToolInstallCommands
Description copied from interface:CmsSpecReturns commands to install the CLI tool.- Specified by:
cliToolInstallCommandsin interfaceCmsSpec- Returns:
- List of shell commands to install CLI tool
-
databaseRequirement
Description copied from interface:DatabaseSpecDatabase requirement for this application.- Specified by:
databaseRequirementin interfaceDatabaseSpec- Returns:
- database requirement (required, optional, or none)
-
backupRetentionDays
public int backupRetentionDays()Description copied from interface:DatabaseSpecDatabase backup retention requirements.- Specified by:
backupRetentionDaysin interfaceDatabaseSpec- Returns:
- backup retention days (1-35), default 7
-
ebsDeviceName
Description copied from interface:ApplicationSpecReturns the EBS device name for EC2 instances when not using EFS. This is the device that will be formatted and mounted for application data.- Specified by:
ebsDeviceNamein interfaceApplicationSpec- Returns:
- EBS device path (e.g., "/dev/xvdh")
-
ec2DataPath
Description copied from interface:ApplicationSpecReturns the EC2 data path where application stores persistent data. This may differ from containerDataPath depending on application packaging.- Specified by:
ec2DataPathin interfaceApplicationSpec- Returns:
- EC2 mount path (e.g., "/var/lib/jenkins")
-
ec2LogPaths
Description copied from interface:ApplicationSpecReturns CloudWatch log file paths for EC2 monitoring. These files will be streamed to CloudWatch Logs for centralized logging.- Specified by:
ec2LogPathsin interfaceApplicationSpec- Returns:
- list of absolute log file paths (e.g., ["/var/log/jenkins/jenkins.log"])
-
configureUserData
Description copied from interface:ApplicationSpecConfigure EC2 UserData script for application installation and setup.The implementation should use the UserDataBuilder to add application-specific installation commands while leveraging infrastructure helpers for storage mounting and CloudWatch configuration.
The infrastructure handles:
- System updates
- EFS vs EBS storage mounting (based on availability)
- CloudWatch Agent installation and configuration
- File permissions and ownership
The application provides:
- Application installation commands (yum/dnf install, etc.)
- Application configuration
- Service startup commands
- Specified by:
configureUserDatain interfaceApplicationSpec- Parameters:
builder- The UserDataBuilder providing infrastructure helperscontext- The Ec2Context providing runtime information
-
containerEnvironmentVariables
public Map<String,String> containerEnvironmentVariables(String fqdn, boolean sslEnabled, String authMode) Description copied from interface:ApplicationSpecConfigures application-specific environment variables for the container.Applications can override this to provide custom environment variables based on deployment configuration (FQDN, SSL, authMode, etc.). The infrastructure passes the FQDN, SSL settings, and authentication mode for applications that need reverse proxy configuration or authentication-specific setup.
Example use cases:
- Jenkins: JAVA_OPTS, JENKINS_OPTS for reverse proxy configuration, skip setup wizard for application-oidc
- GitLab: GITLAB_OMNIBUS_CONFIG for external URL configuration and OIDC setup
- Vault: VAULT_ADDR for API endpoint configuration
- Specified by:
containerEnvironmentVariablesin interfaceApplicationSpec- Parameters:
fqdn- The fully qualified domain name (may be null)sslEnabled- Whether SSL is enabledauthMode- The authentication mode (may be null, e.g., "none", "alb-oidc", "application-oidc")- Returns:
- Map of environment variable key-value pairs (never null, may be empty)
-
getOidcIntegration
Description copied from interface:ApplicationSpecReturns the OIDC integration handler for this application.This provides application-specific configuration for integrating with Cognito or IAM Identity Center OIDC.
- Specified by:
getOidcIntegrationin interfaceApplicationSpec- Returns:
- OIDC integration handler, or null if not supported
-
getSupportedAuthModes
Description copied from interface:ApplicationSpecReturns the list of supported authentication modes for this application.CloudForge supports three authentication modes:
- application-oidc: OIDC authentication integrated within the application (requires getOidcIntegration() != null)
- alb-oidc: OIDC authentication at ALB level (works for all applications)
- none: No authentication (public access or manually configured)
The list is ordered by preference. The first mode is the recommended default.
Default behavior:
- If application has OIDC integration → ["application-oidc", "alb-oidc", "none"]
- If application claims OIDC support but lacks integration → ["alb-oidc", "none"]
- If application doesn't support OIDC → ["none"]
- Specified by:
getSupportedAuthModesin interfaceApplicationSpec- Returns:
- List of supported auth modes in order of preference (never null, never empty)
-
cdnAdminPaths
Returns default protected paths for MyBB when using ALB-level OIDC.MyBB administrative areas:
- /admin - Admin Control Panel
- /install - Installation directory
- Specified by:
cdnAdminPathsin interfaceCmsSpec- Returns:
- list of MyBB administrative paths requiring authentication
-