From 32310d910b8721f46c96cfb3709ca2d13da7b066 Mon Sep 17 00:00:00 2001 From: colin Date: Sun, 1 Jan 2023 09:01:10 -0800 Subject: Docs: Changed Hacking and Install docs --- HACKING | 30 --------------- HACKING.md | 30 +++++++++++++++ INSTALL | 105 --------------------------------------------------- INSTALL.md | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 156 insertions(+), 135 deletions(-) delete mode 100644 HACKING create mode 100644 HACKING.md delete mode 100644 INSTALL create mode 100644 INSTALL.md diff --git a/HACKING b/HACKING deleted file mode 100644 index cf244f3..0000000 --- a/HACKING +++ /dev/null @@ -1,30 +0,0 @@ - -To hack on Vampire locally, here's what I'd do. - -1. copy the vampire static directory to your home dir, calling it vampire-static: - - cp -r /path/to/vampire.git/static ~/vampire-static - -2. Fire up SLIME and ensure that you can load vampire in quicklisp - - > (pushnew #P"/path/to/vampire.git/" ql:*local-project-directories*) - > (pushnew #P"/path/to/derrida.git/" ql:*local-project-directories*) - > (ql:quickload :vampire) - -3. Run (vampire::hacking-start), which will - - create a bknr.datastore in ~/vampire-store - - start the service - - open a browser tab and give it focus - -The first time you start up vampire, or anytime after deleting -~/vampire-store/, you'll need to make a new invite so you can make an -account for your local use: - -4. Make an invite to use: - - > (in-package :vampire) - > (with-transaction () - > (key (make-invite nil 1))) ;; one time anonymous invite. - -That should print an invite code into the REPL. Use that code in the -web interface for making a new account. diff --git a/HACKING.md b/HACKING.md new file mode 100644 index 0000000..423ae5d --- /dev/null +++ b/HACKING.md @@ -0,0 +1,30 @@ + +To hack on Vampire locally, here's what I'd do. + +1. copy the vampire static directory to your home dir, calling it vampire-static: + + cp -r /path/to/vampire.git/static ~/vampire-static + +2. Fire up SLIME and ensure that you can load vampire in quicklisp + + (pushnew #P"/path/to/vampire.git/" ql:*local-project-directories*) + (pushnew #P"/path/to/derrida.git/" ql:*local-project-directories*) + (ql:quickload :vampire) + +3. Run (vampire::hacking-start), which will + +- create a bknr.datastore in ~/vampire-store +- start the service +- open a browser tab and give it focus + +The first time you start up vampire, or anytime after deleting +~/vampire-store/, you'll need to make a new invite so you can make an +account for your local use: + +4. Make an invite to use: + + (in-package :vampire) + (key (make-invite nil 1)) ;; one time anonymous invite. + +That should print an invite code into the REPL. Use that code in the +web interface for making a new account. diff --git a/INSTALL b/INSTALL deleted file mode 100644 index dcee8d2..0000000 --- a/INSTALL +++ /dev/null @@ -1,105 +0,0 @@ - -+--------------------------------------------+ -| YOUTUBE-DL | -+--------------------------------------------+ - -vampire relies on youtube-dl to fetch media and meta information. -Ensure that it is propery linstalled. - -e.g. - - pip3 install youtube-dl - -+----------------------------------------------+ -| BUILDING | -+----------------------------------------------+ - -I have only tested vampire using SBCL on Linux. - -First install the dependencies that are not in quicklisp: - - git clone https://cicadas.surf/cgit/colin/derrida.git ~/quicklisp/local-projects/ - git clone https://cicadas.surf/cgit/colin/vampire.git ~/quicklisp/local-projects/ - -Then cd into the vampire repo's directory and run the build script. - - cd ~/quicklisp/local-projects/vampire - sbcl --load build.lisp - -If it worked, you should be able to find the file bin/vampire. - -+------------------------------------------------------+ -| CONFIGURATION FILE | -+------------------------------------------------------+ - -The configuration file is called config.lisp. Here is an example. - - (:datastore-directory "/home/vampire/store/" - :static-directory "/home/vampire/static/" - :swank-port 5011 - :port 8081 - :downloader-threads 8) - - -The :datastore-directory and :static-directory fields are REQUIRED and -must be writable by the vampire process. In particular, a subdirectory -of the static-directory, called media, is where media files will be -stored. - -Hence, if you want to store media elsewhere, you can mount or symlink -at the ./media subdirectory to the real location. - -The :swank-port field is optional. It is the localhost port where you -can connect via SLIME to debug the live application. - -+------------------------------------------------------+ -| REVERSE PROXY | -+------------------------------------------------------+ - -I am using apache to set up a reverse proxy. If I'm running vampire on -host at 10.0.0.6, and serving over HTTPS using the domain name -vampire.yourhost.moo, then here's how I'd configure the proxy: - - - ServerName vampire.yourhost.moo - Redirect / "https://vampire.yourhost.moo/" - - - - ServerName vampire.yourhost.moo - SSLEngine on - SSLCertificateFile "/etc/letsencrypt/live/vampire.yourhost.moo/fullchain.pem" - SSLCertificateKeyFile "/etc/letsencrypt/live/vampire.yourhost.moo/privkey.pem" - - ProxyPass /clog ws://10.0.0.6:8081/clog - ProxyPass / http://10.0.0.6:8081/ - ProxyPassReverse / http://10.0.0.6:8081/ - - - - -+------------------------------------------------------+ -| SYSTEM SERVICE | -+------------------------------------------------------+ - -Use a systemd service to run vampire, ensuring that it restarts on -reboot. - - - [Unit] - Description=Vampire Service - - [Service] - Type=simple - ExecStart=/home/vampire/vampire/config --config /home/vampire/config.lisp - Restart=always - User=vampire - Group=vampire - - - [Install] - WantedBy=multi-user.target - -Put that into /etc/systemd/system/ - -and start it like any other systemd service. diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..2ff46a4 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,126 @@ + +# INSTALL DEPENDENCIES + +Vampire requires the following software to operate properly. + +- youtube-dl +- ffmpeg (used by youtube-dl) + +Install youtube-dl: + + pip3 install youtube-dl + +Install ffmpeg + + sudo apt-get install ffmpeg + + + +# BUILDING + +I have only tested vampire using SBCL on Linux. + +First install the dependencies that are not in quicklisp: + + git clone https://cicadas.surf/cgit/colin/derrida.git ~/quicklisp/local-projects/ + git clone https://cicadas.surf/cgit/colin/vampire.git ~/quicklisp/local-projects/ + +Then cd into the vampire repo's directory and run the build script. + + cd ~/quicklisp/local-projects/vampire + sbcl --load build.lisp + +If it worked, you should be able to find the file bin/vampire. + +# SETUP AND CONFIGURATION + +## Choose an installation directory + +Choose a directory into which vampire files will be placed. For +example, if you make a user called `vampire`, you can use +`/home/vampire` for the vampire directory. + +For the rest of this document, I will refer to whatever directory you +have chosen as $VAMPIRE_HOME. + +## CREATE A CONFIGURATION FILE + +The configuration file is called config.lisp. Here is an example. + + (:datastore-directory "$VAMPIRE_HOME/store/" + :static-directory "$VAMPIRE_HOME/static/" + :swank-port 5011 + :port 8081 + :downloader-threads 8) + +Put the above into a file called "$VAMPIRE_HOME/config.lisp". + +The :datastore-directory and :static-directory fields are REQUIRED and +must be writable by the vampire process. In particular, a subdirectory +of the static-directory, called media, is where media files will be +stored. + +The :port optionis the where the http server will listen for incoming +connections on localhost. Vampire assumes you are using a reverse +proxy. + +The :swank-port field is optional. It is the localhost port where you +can connect via SLIME to debug the live application. + +## COPY CSS & CLOG FILES + +The application css and necessary clog files are stored in the git +repository within the subdirectory called `static`. Copy this whole +directory to the location you specified for the `:static-directory` +option in your `config.lisp`: + + cp -r /path/to/vampire.git/static $VAMPIRE_HOME/static + + +## SET UP A REVERSE PROXY + +I am using apache to set up a reverse proxy. If I'm running vampire on +host at 10.0.0.6, and serving over HTTPS using the domain name +vampire.yourhost.moo, then here's how I'd configure the proxy: + + + ServerName vampire.yourhost.moo + Redirect / "https://vampire.yourhost.moo/" + + + + ServerName vampire.yourhost.moo + SSLEngine on + SSLCertificateFile "/etc/letsencrypt/live/vampire.yourhost.moo/fullchain.pem" + SSLCertificateKeyFile "/etc/letsencrypt/live/vampire.yourhost.moo/privkey.pem" + + ProxyPass /clog ws://10.0.0.6:8081/clog + ProxyPass / http://10.0.0.6:8081/ + ProxyPassReverse / http://10.0.0.6:8081/ + + + + +## SYSTEMD SYSTEM SERVICE + +Use a systemd service to run vampire, ensuring that it restarts on +reboot. + + + [Unit] + Description=Vampire Service + + [Service] + Type=simple + ExecStart=/home/vampire/vampire/config --config /home/vampire/config.lisp + Restart=always + User=vampire + Group=vampire + + + [Install] + WantedBy=multi-user.target + +Put that into /etc/systemd/system/ + +and start it like any other systemd service. -- cgit v1.2.3