From 87e3f98e179558a119f9e349150db1f292d3f09e Mon Sep 17 00:00:00 2001 From: Brian O'Reilly Date: Tue, 11 Nov 2025 11:06:29 -0500 Subject: [PATCH] fixup routes. turn down compression on executable. --- auth-routes.lisp | 4 ++-- build-asteroid.lisp | 45 +++++++++++++++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/auth-routes.lisp b/auth-routes.lisp index f8db8db..6aa5aec 100644 --- a/auth-routes.lisp +++ b/auth-routes.lisp @@ -22,9 +22,9 @@ (user-role (if (listp user-role-raw) (first user-role-raw) user-role-raw)) (redirect-path (cond ;; Admin users go to admin dashboard - ((string-equal user-role "admin") "/asteroid/admin") + ((string-equal user-role "admin") "/admin") ;; All other users go to their profile - (t "/asteroid/profile")))) + (t "/profile")))) (format t "User ID from DB: ~a~%" user-id) (format t "User role: ~a, redirecting to: ~a~%" user-role redirect-path) (setf (session:field "user-id") (if (listp user-id) (first user-id) user-id)) diff --git a/build-asteroid.lisp b/build-asteroid.lisp index 1d45b31..13b794f 100755 --- a/build-asteroid.lisp +++ b/build-asteroid.lisp @@ -1,35 +1,60 @@ ;; -*-lisp-*- -(unless *load-pathname* - (error "Please LOAD this file.")) - -(when (find-package :quicklisp) - (error "Please run this file as a script or from the Makefile.")) - (defpackage #:asteroid-bootstrap + (:nicknames #:ab) (:use #:cl) (:export #:*root* #:path)) +(in-package #:asteroid-bootstrap) + +(defvar *root* (make-pathname :name NIL :type NIL :defaults *load-pathname*)) + +(defun path (pathname) + (merge-pathnames pathname *root*)) + ;; we require quicklisp to load our transitive dependencies. (load "~/quicklisp/setup.lisp") + ;; Build script for creating asteroid executable using save-lisp-and-die ;; ASDF will automatically find the project via source-registry.conf ;; Load RADIANCE first, then handle environment (ql:quickload :radiance) +(defmethod radiance:environment-directory (environment (kind (eql :configuration))) + (ab:path (make-pathname :directory `(:relative "config" ,environment)))) + +(defmethod radiance:environment-directory (environment (kind (eql :cache))) + (ab:path (make-pathname :directory `(:relative "cache" ,environment)))) + +(defmethod radiance:environment-directory (environment (kind (eql :data))) + (ab:path (make-pathname :directory `(:relative "data" ,environment)))) + +(defmethod radiance:environment-directory (environment (kind (eql :template))) + (ab:path (make-pathname :directory `(:relative "override" ,environment "template")))) + +(defmethod radiance:environment-directory (environment (kind (eql :static))) + (ab:path (make-pathname :directory `(:relative "override" ,environment "static")))) + ;; Ensure RADIANCE environment is set before loading (unless (radiance:environment) - (setf (radiance:environment) "default")) + (setf (radiance:environment) "asteroid")) ;; Load the system with RADIANCE environment handling (handler-bind ((radiance-core:environment-not-set - (lambda (c) - (declare (ignore c)) - (invoke-restart 'continue)))) + (lambda (c) + (declare (ignore c)) + (invoke-restart 'continue)))) (ql:quickload :asteroid)) +(log:info "~2&:configuration - ~A~%:cache - ~A~%:data - ~A~%:template - ~A~%:static - ~A~2%" + (radiance:environment-directory (radiance-core:environment) :configuration) + (radiance:environment-directory (radiance-core:environment) :cache) + (radiance:environment-directory (radiance-core:environment) :data) + (radiance:environment-directory (radiance-core:environment) :template) + (radiance:environment-directory (radiance-core:environment) :static)) + ;; Define the main function for the executable (defun main () (asteroid:-main))