-
Notifications
You must be signed in to change notification settings - Fork 0
Add multi-server support #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 22 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
defcd6e
Added provider config and variable
DCCoder90 6c20698
Formatting
DCCoder90 ef9506b
Added host config and formatting
DCCoder90 eb4ef54
Added host to stack
DCCoder90 34b0b46
Added host to each service from the stack.
DCCoder90 1cd2cf9
Removed copy/paste error
DCCoder90 3b4d967
Update modules to use relative paths
DCCoder90 7ca79ac
Add workflow
DCCoder90 7c4e884
Added ignore directories
DCCoder90 e10b293
Forgot to tell it to actually ignore them...
DCCoder90 f9db425
Test
DCCoder90 a7dddfa
Test
DCCoder90 af27652
Test
DCCoder90 4aec8e4
Test
DCCoder90 1a3f772
Test
DCCoder90 8ee5165
Test
DCCoder90 f29da5f
Test
DCCoder90 be201a4
Test
DCCoder90 20c474f
Test
DCCoder90 16b81ad
Maybe AI can help?
DCCoder90 87102a7
AI was useless, just going to make it stupid simple....
DCCoder90 00342e3
oops
DCCoder90 9e4ef28
Update uri path in auth module
DCCoder90 cd5476b
Moved provider configuration out of modules. This will require calle…
DCCoder90 c35849f
Forgot to include host_connection in docker-stack module
DCCoder90 1063abf
Remove all provider configuration for docker provider from module.
DCCoder90 055753a
.
DCCoder90 ba85c7d
.
DCCoder90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Terraform Module Validation | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| validate_each_module: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| module_dir: | ||
| - "./authentik" | ||
| - "./dns" | ||
| - "./docker" | ||
| - "./docker-network" | ||
| - "./docker-service" | ||
| - "./docker-stack" | ||
| - "./nginx_config" | ||
| - "./oauth_auth" | ||
| - "./proxy_auth" | ||
|
|
||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Terraform | ||
| uses: hashicorp/setup-terraform@v3 | ||
| with: | ||
| terraform_version: "latest" | ||
|
|
||
| - name: Validate Module ${{ matrix.module_dir }} | ||
| shell: bash | ||
| run: | | ||
| module_dir="${{ matrix.module_dir }}" | ||
| echo "--- Validating module: $module_dir ---" | ||
|
|
||
| pushd "$module_dir" > /dev/null || { echo "Failed to change directory to $module_dir"; exit 1; } | ||
|
|
||
| echo "Running terraform init in $module_dir..." | ||
| if ! terraform init -backend=false -input=false -upgrade; then | ||
| echo "::error file=$module_dir::Terraform init failed for module: $module_dir" | ||
| exit 1 | ||
| else | ||
| echo "Running terraform validate in $module_dir..." | ||
| if ! terraform validate; then | ||
| echo "::error file=$module_dir::Terraform validate failed for module: $module_dir" | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| popd > /dev/null || { echo "Failed to return from directory"; exit 1; } | ||
| echo "Module $module_dir validated successfully!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| module "proxy_authentication" { | ||
| source = "[email protected]:DCCoder90/home-tf-modules.git//proxy_auth?ref=1.0.0" | ||
| source = "../proxy_auth" | ||
|
|
||
| count = var.service.auth.enabled && var.service.auth.proxy.enabled ? 1 : 0 | ||
|
|
||
|
|
@@ -24,16 +24,16 @@ module "proxy_authentication" { | |
| } | ||
|
|
||
| module "oauth_authentication" { | ||
| source = "[email protected]:DCCoder90/home-tf-modules.git//oauth_auth?ref=1.0.0" | ||
| source = "../oauth_auth" | ||
|
|
||
| count = var.service.auth.enabled && var.service.auth.oauth.enabled ? 1 : 0 | ||
|
|
||
| group = var.service.auth.group | ||
| description = var.service.description | ||
| name = var.service.service_name | ||
| create_access_group = true | ||
| access_group_name = "tf_${var.service.service_name}" | ||
| user_to_add_to_access_group = var.system.network_admin_username | ||
| access_group_name = "tf_${var.service.service_name}" | ||
| user_to_add_to_access_group = var.system.network_admin_username | ||
| allowed_redirect_uris = concat( | ||
| [ | ||
| { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| data "nginxproxymanager_access_lists" "access_lists" {} | ||
|
|
||
| module "service_dns" { | ||
| source = "[email protected]:DCCoder90/home-tf-modules.git//dns?ref=1.0.0" | ||
| source = "../dns" | ||
|
|
||
| count = var.service.dns.enabled ? 1 : 0 | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| module "service_container" { | ||
| source = "[email protected]:DCCoder90/home-tf-modules.git//docker?ref=1.0.0" | ||
| source = "../docker" | ||
|
|
||
| icon = var.service.icon | ||
| web_ui = try(var.service.network.service_port, null) != null && local.service_ip_address != null ? "http://${local.service_ip_address}:${var.service.network.service_port}" : null | ||
|
|
@@ -11,6 +11,7 @@ module "service_container" { | |
| mounts = var.service.mounts | ||
| container_capabilities = var.service.capabilities | ||
| commands = var.service.commands | ||
| host_connection = data.infisical_secrets.host_connections.secrets[var.service.host].value | ||
|
|
||
| # Attach the container to custom networks defined in the stack, but only if the service | ||
| # explicitly lists that network in its own configuration. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,37 +5,20 @@ data "infisical_projects" "home-net" { | |
| } | ||
|
|
||
| module "custom_network" { | ||
| count = length(local.creatable_networks) > 0 ? 1 : 0 | ||
| source = "[email protected]:DCCoder90/home-tf-modules.git//docker-network?ref=1.0.0" | ||
| count = length(local.creatable_networks) > 0 ? 1 : 0 | ||
| source = "../docker-network" | ||
|
|
||
| networks = local.creatable_networks | ||
| } | ||
|
|
||
| module "service_container" { | ||
| for_each = var.stack.services | ||
| source = "[email protected]:DCCoder90/home-tf-modules.git//docker-service?ref=1.0.0" | ||
| source = "../docker-service" | ||
|
|
||
| service = each.value | ||
| system = var.system | ||
| service = merge(each.value, { host = var.stack.host }) | ||
| system = var.system | ||
|
|
||
| /* | ||
| /* | ||
| Still need to combine environment, mounts, and networks! | ||
|
|
||
|
|
||
| icon = each.value.icon | ||
| web_ui = try(each.value.network.service_port, null) != null && local.service_ip_addresses[each.key] != null ? "http://${local.service_ip_addresses[each.key]}:${each.value.network.service_port}" : null | ||
| container_name = each.value.service_name | ||
| container_image = each.value.image_name | ||
| container_network_mode = each.value.network_mode | ||
| enable_gpu = each.value.enable_gpu | ||
| environment_vars = toset(concat(coalesce(var.stack.env, []), local.processed_envs[each.key], coalesce(var.stack.env, []), coalesce(local.oauth_envs[each.key], []))) | ||
| mounts = concat(coalesce(var.stack.mounts, []), coalesce(each.value.mounts, [])) | ||
| container_capabilities = each.value.capabilities | ||
| commands = each.value.commands | ||
|
|
||
| # Attach the container to custom networks defined in the stack, but only if the service | ||
| # explicitly lists that network in its own configuration. | ||
| # The docker module expects a list of objects with `name` and `ipv4_address`. | ||
| networks = coalesce(each.value.network.networks, []) | ||
| */ | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.