From 1d90e5086fb64835f6cabc72a3a37fc6151e7244 Mon Sep 17 00:00:00 2001 From: Alex Godbehere <114239316+AlexGodbehere@users.noreply.github.com> Date: Fri, 26 Jan 2024 14:43:39 +0000 Subject: [PATCH] Refactor ccache file storage paths for better organization (#95) --- .docker/Dockerfiles/Dockerfile.backend-build | 1 + app/Domain/Auth/Actions/AuthenticateUserAction.php | 2 +- app/Support/Providers/AppServiceProvider.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.docker/Dockerfiles/Dockerfile.backend-build b/.docker/Dockerfiles/Dockerfile.backend-build index d5b92dc..ac49d9e 100644 --- a/.docker/Dockerfiles/Dockerfile.backend-build +++ b/.docker/Dockerfiles/Dockerfile.backend-build @@ -17,4 +17,5 @@ RUN mkdir -p /app/storage/logs RUN mkdir -p /app/storage/app/purify RUN mkdir -p /app/storage/app/purify/HTML RUN mkdir -p /app/storage/app/purify/JSON +RUN mkdir -p /app/storage/ccache RUN chmod -R 775 /app/storage diff --git a/app/Domain/Auth/Actions/AuthenticateUserAction.php b/app/Domain/Auth/Actions/AuthenticateUserAction.php index 995718b..e71b26f 100644 --- a/app/Domain/Auth/Actions/AuthenticateUserAction.php +++ b/app/Domain/Auth/Actions/AuthenticateUserAction.php @@ -85,7 +85,7 @@ public function execute(string $username, string $password) // At this point we have a valid ccache for the user. Store // the cache to disk using the user's full principal as the // filename, replacing the @ with a - to avoid issues with - $ccache->save("FILE:/app/storage/" . $user->username . '.ccache'); + $ccache->save("FILE:/app/storage/ccache/" . $user->username . '.ccache'); // Log the user in return action_success($user); diff --git a/app/Support/Providers/AppServiceProvider.php b/app/Support/Providers/AppServiceProvider.php index 5d255e2..18b77d0 100644 --- a/app/Support/Providers/AppServiceProvider.php +++ b/app/Support/Providers/AppServiceProvider.php @@ -28,7 +28,7 @@ public function register() try { // If the user is logged in then get their ccache // and use that for all future requests - $ccache->open("FILE:/app/storage/" . auth()->user()->username . '.ccache'); + $ccache->open("FILE:/app/storage/ccache/" . auth()->user()->username . '.ccache'); $ccache->isValid(); } catch (\Exception $e) {