Skip to content

Commit

Permalink
Merge branch 'main' into unsaved-changes-warn
Browse files Browse the repository at this point in the history
  • Loading branch information
jvogt23 authored Dec 15, 2024
2 parents 23ab97d + b5b2c55 commit 0dd6294
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 86 deletions.
95 changes: 95 additions & 0 deletions .nomad/apiary.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ job "apiary" {
type = "service"

group "apiary" {
network {
port "resp" {}
}

volume "run" {
type = "host"
source = "run"
Expand Down Expand Up @@ -378,6 +382,97 @@ EOF
}
}
}

dynamic "task" {
for_each = var.run_background_containers ? ["redis"] : []

labels = [task.value]

content {
driver = "docker"

lifecycle {
hook = "prestart"
sidecar = true
}

config {
image = "redis"

args = [
"/usr/local/etc/redis/redis.conf"
]

force_pull = true

network_mode = "host"

mount {
type = "bind"
source = "secrets/"
target = "/usr/local/etc/redis/"
}
}

resources {
cpu = 100
memory = 256
memory_max = 2048
}

template {
data = <<EOH
bind 127.0.0.1
port {{ env "NOMAD_PORT_resp" }}
unixsocket /alloc/tmp/redis.sock
unixsocketperm 777
requirepass {{ env "NOMAD_ALLOC_ID" }}
maxmemory {{ env "NOMAD_MEMORY_MAX_LIMIT" }}mb
maxmemory-policy allkeys-lru
EOH

destination = "secrets/redis.conf"
}

service {
name = "${NOMAD_JOB_NAME}-redis"

port = "resp"

address = "127.0.0.1"

tags = [
"resp"
]

check {
success_before_passing = 3
failures_before_critical = 2

interval = "5s"

name = "TCP"
port = "resp"
timeout = "1s"
type = "tcp"
}

check_restart {
limit = 5
grace = "20s"
}
}

restart {
attempts = 5
delay = "10s"
interval = "1m"
mode = "fail"
}

shutdown_delay = "60s"
}
}
}

reschedule {
Expand Down
14 changes: 7 additions & 7 deletions .nomad/conf/.env.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ CAS_ENABLE_SAML="false"
{{- range service "mysql" }}
DB_SOCKET="{{- index .ServiceMeta "socket" | trimSpace -}}"
{{ end }}
REDIS_CLIENT="phpredis"
REDIS_SCHEME="null"
REDIS_PORT="-1"
{{- range service "redis" }}
REDIS_HOST="{{- index .ServiceMeta "socket" | trimSpace -}}"
{{ end }}
REDIS_PASSWORD="{{- key "redis/password" | trimSpace -}}"
{{- range service "meilisearch-v1-10" }}
MEILISEARCH_HOST="http://127.0.0.1:{{- .Port -}}"
{{ end }}
Expand All @@ -36,3 +29,10 @@ HOME="/secrets/"
RESPONSE_CACHE_HEADER_NAME="x-cache-time"
RESPONSE_CACHE_AGE_HEADER_NAME="x-cache-age"
RESPONSE_CACHE_AGE_HEADER=true
REDIS_CLIENT="phpredis"
REDIS_SCHEME="null"
REDIS_PORT="-1"
REDIS_HOST="/alloc/tmp/redis.sock"
REDIS_PASSWORD="{{ env "NOMAD_ALLOC_ID" }}"
REDIS_DB=0
REDIS_CACHE_DB=1
4 changes: 1 addition & 3 deletions .nomad/conf/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ catch_workers_output = yes
php_admin_value[date.timezone] = America/New_York
{{ if ne (env "NOMAD_JOB_NAME") "apiary-sandbox" }}
php_admin_value[session.save_handler] = redis
{{- range service "redis" }}
php_admin_value[session.save_path] = "unix://{{- index .ServiceMeta "socket" | trimSpace -}}?persistent=1&database={{- with (key "redis/session_database" | parseJSON) -}}{{- index . (env "NOMAD_JOB_NAME") -}}{{- end -}}&timeout=1&auth={{- key "redis/password" | trimSpace -}}"
{{ end }}
php_admin_value[session.save_path] = "unix:///alloc/tmp/redis.sock?persistent=1&database=2&timeout=1&auth={{ env "NOMAD_ALLOC_ID" }}"
{{ end }}
access.log = /proc/self/fd/2
access.format = "%t %m %{REQUEST_URI}e %s %f %{mili}d %{kilo}M %C \"%{HTTP_USER_AGENT}e\"%"
Expand Down
7 changes: 7 additions & 0 deletions app/Nova/Actions/MatrixAirfareSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@

class MatrixAirfareSearch extends Action
{
/**
* Disables action log events for this action.
*
* @var bool
*/
public $withoutActionEvents = true;

/**
* The text to be used for the action's confirm button.
*
Expand Down
3 changes: 2 additions & 1 deletion app/Nova/TravelAssignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public function fields(NovaRequest $request): array
->withoutTrashed()
->searchable()
->rules('required', 'unique:travel_assignments,user_id,NULL,id,travel_id,'.$request->travel)
->readonly(static fn (NovaRequest $request): bool => $request->editMode === 'update'),
->readonly(static fn (NovaRequest $request): bool => $request->editMode === 'update')
->help(view('nova.help.travel.assignment.member')->render()),

BelongsTo::make('Trip', 'travel', Travel::class)
->withoutTrashed()
Expand Down
4 changes: 2 additions & 2 deletions app/Nova/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,8 @@ public function subtitle(): ?string
$lastPaidTransact = $paidTransactions->last();

if ($firstPaidTransact !== null && $lastPaidTransact !== null) {
$firstYear = (new Carbon($firstPaidTransact->effective_start, 'America/New_York'))->year;
$lastYear = (new Carbon($lastPaidTransact->effective_end, 'America/New_York'))->year;
$firstYear = (new Carbon($firstPaidTransact->effective_start, 'America/New_York'))->addMonth()->year;
$lastYear = (new Carbon($lastPaidTransact->effective_end, 'America/New_York'))->subMonth()->year;

return $firstYear === $lastYear ? 'Member '.$firstYear : 'Member '.$firstYear.'-'.$lastYear;
}
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"htmlmin/htmlmin": "dev-master",
"http-interop/http-factory-guzzle": "1.2.0",
"kiritokatklian/nova-permission": "4.0.10",
"laravel/framework": "11.35.0",
"laravel/horizon": "5.29.4",
"laravel/framework": "11.35.1",
"laravel/horizon": "5.30.0",
"laravel/nova": "4.35.5",
"laravel/passport": "12.3.1",
"laravel/scout": "10.11.9",
Expand All @@ -59,7 +59,7 @@
"spatie/laravel-csp": "2.10.1",
"spatie/laravel-failed-job-monitor": "4.3.2",
"spatie/laravel-permission": "6.10.1",
"spatie/laravel-responsecache": "7.6.2",
"spatie/laravel-responsecache": "7.6.3",
"spatie/laravel-webhook-client": "3.4.2",
"square/square": "38.2.0.20241017",
"subfission/cas": "5.1.0",
Expand Down
Loading

0 comments on commit 0dd6294

Please sign in to comment.