Commit c96c0840 authored by Dave Cooper's avatar Dave Cooper
Browse files

merged and fixed conflict

parents e4f7955e 98bbccf1
Pipeline #7579 passed with stages
in 5 minutes and 34 seconds
This diff is collapsed.
......@@ -469,12 +469,34 @@
:load-toplevel
:execute)
(defclass gendl:gendl-development-system
(ccl::lisp-development-system) ())
(defclass gendl:gendl-runtime-system
(ccl::lisp-development-system) ()))
;;
;; These seem to work only if you don't override
;; ccl:toplevel-function. so for now, there is a need to replicate
;; what these are doing in said toplevel-function.
;;
#+ccl
(defmethod ccl:toplevel-function :before ((a gendl:gendl-development-system) init-file)
(declare (ignore init-file))
(gendl::initialize)(gwl::renew-wserver)(gendl::startup-banner))
(gendl::initialize :startup-banner? t)
(when (fboundp 'gdl::*restart-init-function*)
(funcall #'gdl::*restart-init-function*)))
#+ccl
(defmethod ccl:toplevel-function :before ((a gendl:gendl-runtime-system) init-file)
(declare (ignore init-file))
(gendl::initialize :startup-banner? t)
(when (fboundp 'gdl::*restart-init-function*)
(funcall #'gdl::*restart-init-function*)))
......@@ -182,6 +182,7 @@ If you are interested in this effort we would love to hear from you at open-sour
#:gdl-skin-class
#:get-version
#:gendl-development-system
#:gendl-runtime-system
#:half
#:ignore-errors-with-backtrace
#:index-filter
......
......@@ -28,11 +28,11 @@
:yadd :robot :cl-lite :geysr))
(defun start-gendl! (&key (features *features-to-initialize*)
(banner? nil) (init-files? t)
(banner? nil)
(http-port gwl:*http-port*)(https-port gwl:*https-port*)(https? gwl:*https?*))
(glisp::set-gendl-source-home-if-known)
(glisp::set-genworks-source-home-if-known)
;;(glisp::set-gendl-source-home-if-known)
;;(glisp::set-genworks-source-home-if-known)
(let ((gwl:*http-port* http-port)
......@@ -63,17 +63,6 @@
(when banner? (startup-banner))
(when init-files? (load-gdl-init-files) )
(when (find-package :uiop)
(funcall (read-from-string "uiop:setup-temporary-directory")))
(in-package :gdl-user)
(when (and (find-package :net.aserve)
(boundp (read-from-string "net.aserve:*wserver*")))
(gwl:announce-server-port))
(values))
;;
......@@ -81,20 +70,31 @@
;;
(defun start-gdl! (&rest args) (apply #'start-gendl! args))
(defun load-gdl-init-files ()
(let* ((user-homedir (user-homedir-pathname))
(current-directory (glisp:current-directory))
(homedir-init-file (or (probe-file (merge-pathnames ".gdlinit.cl" user-homedir))
(probe-file (merge-pathnames "gdlinit.cl" user-homedir))))
(current-init-file (when (not (equalp user-homedir current-directory))
(or (probe-file (merge-pathnames ".gdlinit.cl" current-directory))
(probe-file (merge-pathnames "gdlinit.cl" current-directory))))))
(let* ((command-args (glisp:basic-command-line-arguments))
(homedir-init? (and (not (member "-q" command-args :test #'string-equal))
(not (member "-qq" command-args :test #'string-equal))))
(current-dir-init? (not (member "-qq" command-args :test #'string-equal))))
(when (and current-dir-init? current-init-file) (load current-init-file))
(when (and homedir-init? homedir-init-file) (load homedir-init-file)))))
(let (loaded?)
(defun reset-gdl-init-files-flag! () (setf loaded? nil))
(defun set-gdl-init-files-flag! () (setf loaded? t))
(defun load-gdl-init-files (&key force?)
(unless (or (not loaded?) force?)
(let* ((user-homedir (user-homedir-pathname))
(current-directory (glisp:current-directory))
(homedir-init-file (or (probe-file (merge-pathnames ".gdlinit.cl" user-homedir))
(probe-file (merge-pathnames "gdlinit.cl" user-homedir))))
(current-init-file (when (not (equalp user-homedir current-directory))
(or (probe-file (merge-pathnames ".gdlinit.cl" current-directory))
(probe-file (merge-pathnames "gdlinit.cl" current-directory))))))
(format t "About to load homedir-init-file: ~a and current-init-file: ~a~%"
homedir-init-file current-init-file)
(let* ((command-args (glisp:basic-command-line-arguments))
(homedir-init? (and (not (member "-q" command-args :test #'string-equal))
(not (member "-qq" command-args :test #'string-equal))))
(current-dir-init? (not (member "-qq" command-args :test #'string-equal))))
(when (and current-dir-init? current-init-file) (load current-init-file))
(when (and homedir-init? homedir-init-file) (load homedir-init-file))))
(set-gdl-init-files-flag!))))
(defun quicklisp-copyright-string ()
......@@ -132,7 +132,7 @@ Within ~a ~a
~a
Welcome to Gendl®
Copyright© 2021, Genworks® International, Birmingham MI, USA.
Copyright© 2022, Genworks® International, Birmingham MI, USA.
All Rights Reserved.
This program contains free software: you can redistribute it and/or
......
......@@ -22,13 +22,18 @@
(in-package :gdl)
(defun initialize ()
(defun initialize (&key startup-banner?)
(setq glisp:*gdl-program-home* (probe-file (glisp:executable-homedir-pathname)))
(setq glisp:*gdl-home* (make-pathname :name nil
:type nil
:directory (butlast (pathname-directory glisp:*gdl-program-home*))
:defaults glisp:*gdl-program-home*))
(setq glisp:*gdl-home*
(make-pathname
:name nil
:type nil
:directory (let ((lastcar (lastcar (pathname-directory glisp:*gdl-program-home*))))
(if (string-equal lastcar "program")
(butlast (pathname-directory glisp:*gdl-program-home*))
(pathname-directory glisp:*gdl-program-home*)))
:defaults glisp:*gdl-program-home*))
(setq glisp:*gendl-home* glisp:*gdl-home*)
(when (find-package :asdf) (funcall (read-from-string "asdf:initialize-output-translations")))
......@@ -56,7 +61,36 @@
(glisp:set-default-float-format)
(glisp:set-defpackage-behavior)
(glisp:set-default-package)
(glisp:set-window-titles))
(glisp:set-window-titles)
(uiop:setup-temporary-directory)
(when (find-package :gwl) (funcall (read-from-string "gwl:renew-wserver")))
(when (find-package :pdf)
(setf (symbol-value (read-from-string "pdf::*cl-pdf-base-directory*")) glisp:*gdl-home*)
(setf (symbol-value (read-from-string "pdf::*afm-files-directories*"))
(list (merge-pathnames "afm/"
(symbol-value
(read-from-string "pdf::*cl-pdf-base-directory*"))))))
(when (find-package :cl-typesetting-hyphen)
(setf (symbol-value (read-from-string "cl-typesetting-hyphen::*cl-typesetting-base-directory*")) glisp:*gdl-home*)
(setf (symbol-value (read-from-string "cl-typesetting-hyphen::*hyphen-patterns-directory*"))
(merge-pathnames "hyphen-patterns/"
(symbol-value (read-from-string "cl-typesetting-hyphen::*cl-typesetting-base-directory*"))))
(funcall (read-from-string "cl-typesetting::initialize!")
:afm-files-directories
(symbol-value (read-from-string "pdf::*afm-files-directories*"))
:hyphen-patterns-directory
(symbol-value (read-from-string
"cl-typesetting-hyphen::*hyphen-patterns-directory*"))))
(load-gdl-init-files)
(when startup-banner? (gendl::startup-banner))
)
(defun deinitialize ()
......@@ -66,12 +100,16 @@
*quicklisp-home* nil
;; FLAG deal with ql:*quicklisp-home*
*genworks-source-home* nil
*gendl-source-home* nil
glisp:*genworks-source-home* nil
glisp:*gendl-source-home* nil
gwl::*fullchain-pem-path* nil
gwl::*privkey-pem-path* nil)
(when (and (find-package :zacl) (find-package :net.aserve))
(funcall (read-from-string "net.aserve:shutdown"))
(makunbound (read-from-string "net.aserve:*wserver*"))
(makunbound (read-from-string "excl:*initial-terminal-io*")))
;;
;; FLAG -- cffi prolly has one function to call to do all this & more.
;;
......
......@@ -9,13 +9,20 @@ ENV gwl_port=9080
EXPOSE $swank_port
EXPOSE $gwl_port
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install openssl libssl-dev iputils-ping telnet git git-flow ghostscript && \
rm -rf /var/cache/apk/* && apt-get clean && groupadd -g 1000 gendl-user && \
useradd -rm -s /bin/bash -u 1000 -g root -G sudo gendl-user && ln -s /home /Users
RUN apt-get -y update && apt-get -y upgrade
RUN apt -y install pip
RUN pip install indic_transliteration -U && \
pip install git+https://github.com/indic-transliteration/indic_transliteration_py/@master -U
RUN mkdir -p /opt
COPY --chown=gendl-user:gendl-user gendl-build/ /opt/gendl/
......
......@@ -23,6 +23,8 @@ export HTTP_PORT=${HTTP_PORT:=9080}
export HTTPS_PORT=${HTTPS_PORT:=9443}
export SWANK_PORT=${SWANK_PORT:=4200}
USER_SRC=${USER_SRC:="`cd "${CURRDIR}/../"; pwd`/"}
cd ${CURRDIR}
......@@ -33,6 +35,11 @@ cd ${CURRDIR}
SRC_BASENAME="$(basename $USER_SRC)"
if ! [ -z ${USER_ALT} ]; then
ALT_BASENAME="$(basename $USER_ALT)"
fi
HOST_USER_UID=$(id -u)
HOST_USER_NAME=${USER}
......@@ -81,17 +88,33 @@ echo "SRC_BASENAME=${SRC_BASENAME}"
echo "gendl_user=${gendl_user}"
if ! [ -z ${USER_ALT} ];
then
#
# FLAG -- duplicated code here, if you change one, change the other.
#
DOCKER_GENDL_CID=$(docker run -id --rm -h gendl --name gendl \
-p ${SWANK_HOST_PORT}:${SWANK_PORT} -p ${HTTP_HOST_PORT}:${HTTP_PORT} \
-p ${HTTPS_HOST_PORT}:${HTTPS_PORT} \
-e HTTP_PORT -e HTTPS_PORT -e HTTP_HOST_PORT -e HTTPS_HOST_PORT \
-e HOST_USER_UID -e SWANK_PORT -e SWANK_HOST_PORT \
--mount type=bind,src=${USER_SRC},dst=/home/${gendl_user}/${SRC_BASENAME}/ \
--mount type=bind,src=${USER_ALT},dst=/home/${gendl_user}/${ALT_BASENAME}/ \
--add-host host.docker.internal:172.17.0.1 \
dcooper8/gendl:${branch})
else
DOCKER_GENDL_CID=$(docker run -id --rm -h gendl --name gendl \
-p ${SWANK_HOST_PORT}:${SWANK_PORT} -p ${HTTP_HOST_PORT}:${HTTP_PORT} \
-p ${HTTPS_HOST_PORT}:${HTTPS_PORT} \
-e HTTP_PORT -e HTTPS_PORT -e HTTP_HOST_PORT -e HTTPS_HOST_PORT \
-e HOST_USER_UID -e SWANK_PORT -e SWANK_HOST_PORT \
--mount type=bind,src=${USER_SRC},dst=/home/${gendl_user}/${SRC_BASENAME}/ \
--add-host host.docker.internal:172.17.0.1 \
dcooper8/gendl:${branch})
fi
CID=$(docker run -id --rm -h gendl --name gendl \
-p ${SWANK_HOST_PORT}:${SWANK_PORT} -p ${HTTP_HOST_PORT}:${HTTP_PORT} \
-p ${HTTPS_HOST_PORT}:${HTTPS_PORT} \
-e HTTP_PORT -e HTTPS_PORT -e HTTP_HOST_PORT -e HTTPS_HOST_PORT \
-e HOST_USER_UID -e SWANK_PORT -e SWANK_HOST_PORT \
--mount type=bind,src=${USER_SRC},dst=/home/${gendl_user}/${SRC_BASENAME}/ \
--add-host host.docker.internal:172.17.0.1 \
dcooper8/gendl:${branch})
if [ -z "$CID" ]
if [ -z "$DOCKER_GENDL_CID" ]
then
echo ""
echo "Container did not start sucessfully, perhaps a name conflict with a running container?"
......@@ -106,8 +129,8 @@ else
# if [ -e ~/.ssh/ ];
# then
# echo "Copying your ~/.ssh/ directory into the container as /home/${gendl_user}/.ssh/"
# docker cp ~/.ssh ${CID}:/home/${gendl_user}/.ssh
# docker exec -it --user root ${CID} chown -R ${gendl_user}:${gendl_user} /home/${gendl_user}/.ssh
# docker cp ~/.ssh ${DOCKER_GENDL_CID}:/home/${gendl_user}/.ssh
# docker exec -it --user root ${DOCKER_GENDL_CID} chown -R ${gendl_user}:${gendl_user} /home/${gendl_user}/.ssh
# fi
# echo "Making a symbolic link from /home/${HOST_USER_NAME}/ to /home/${gendl_user}/ "
......@@ -115,7 +138,7 @@ else
# echo "mount when you access them on the host under /home/${HOST_USER_NAME}/..."
# if [ ${gendl_user} != ${HOST_USER_NAME} ];
# then
# docker exec -it --user root ${CID} ln -s /home/${gendl_user} /home/${HOST_USER_NAME}
# docker exec -it --user root ${DOCKER_GENDL_CID} ln -s /home/${gendl_user} /home/${HOST_USER_NAME}
# fi
......@@ -123,7 +146,7 @@ else
echo "New container has been started and ${USER_SRC} from this host has been mounted to:"
echo "/home/${gendl_user}/${SRC_BASENAME}/ in the container."
echo ""
echo "The new container ID is ${CID}."
echo "The new container ID is ${DOCKER_GENDL_CID}."
echo ""
echo "If you need slime loaded into your emacs, you can get it with:"
echo "M-x load-file RET ${GENDL_SRC}/docker/slime/slime.el RET"
......@@ -134,8 +157,6 @@ else
echo ""
echo "Container ID is:"
echo ""
echo ${CID}
echo ${DOCKER_GENDL_CID}
fi
......@@ -211,9 +211,9 @@ Default nil."
(include-default-favicon? t)
("String. The title of the web page. Defaults to \"Genworks GDL -\"
("String. The title of the web page. Defaults to \"GendL Application -\"
.followed by the strings-for-display."
title (format nil "Genworks GDL - ~a" (the strings-for-display)))
title (format nil "GendL Application - ~a" (the strings-for-display)))
("String of valid HTML. Additional tag content to go into the page header,
if you use the default main-sheet message and just fill in your own main-sheet-body, as
......
......@@ -184,6 +184,7 @@ other servers. Bailing.~&"))
:port port :listeners listeners
:external-format external-format
:server (or *https-server* :new)
:ssl fullchain-pem
:ssl-key privkey-pem
:ssl-args (list :method :tls
:key privkey-pem
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment