I've changed the approach to how users deal with downloading Snapshots. Instead
of re-implementing the functionality for downloading files in the /storage
section of the site, the user now prep's the Snapshots (zips them up) and moves
them to the /storage/media directory. From there, users can download the zipped
file and I haven't had to re-implement or write additional code.
This differs from the other file/directory checks because it doesn't create a
directory when it can't find one (usual Common Lisp predicate behaviour with
files/directories).
This is the second part of porting string-is-nil-or-empty? from the utils
package to the validation package. The code between the validation and utils
package was already sorted in a previous commit. This commit to updates where
the web.lisp package calls it.
This is a port I've been meaning to do for a while now; I just haven't got
around to it until now. This commit doesn't refactor the code in web.lisp to
call the ported code from validation -- it's just the first step in the port.
This commit looks like it has more going on that is acutally does. The biggest
mis-directed blobs are the docstring comments I added to get-files-in-directory
and get-file-names. I just never got around to adding them until now.
I remove the format call in make-raw-path because I forgot to do so in another
commit. The code works with or without it which is why I missed it
previously. I'm removing here to clean the code up and before I get distracted
and forget.
The actual code which this commit is mostly for are the get-raw-directories and
get-directory-names. You shouldn't need to use these functions in the normal
operations of the site. They are mostly intended to be used for dealing with the
site's snapshots -- or any other directories outside of the /storage
directory. The snapshot management section of the site is part of the 'danger
zon' features -- hence the need to break-out of the usual '/storage directory'
features.
This package grabs disk information from the OS -- and can display it in human
readable form. Looking to create a 'Disk Info.' section on the dashboard page to
help users decide when they need to start deleting snapshot data or move to a
machine with a bigger disk.
At the time of this commit, no features have been implemented yet.
This directory is created during the site's first run. This addition to
.gitignore stops the commit history from getting clogged up with irrelevant data
during development.
The most notable ones are the 'copy' functions. The main intention here is to
provide the functionality needed by the snapshot package to help it take
programmatic snapshots of the website's data and database. At the time of
writing the 'restore from snapshot' functionality has not been implemented but
that is something these 'copy' functions will look to help with.
This is a variation on the create-timestamp-id used for generating a
timestamp-id for the Meilisearch database. This text-based timestamp takes the
form of YYYY-MM-DD_HH-MM-SS. The main intention of this function is to use is as
part of a directory name when generating a snapshot (of the website's data/DB).
This is part of the 'danger zone' section in the site-settings.html
template. The back-end for this feature is not implemented at the time of this
commit.
I will add to this as I add more snapshot features into the main website
code (I.E. HTML templates and routes in web.lisp). At the moment, this package
is a little island right now and doesn't integrate into the rest of the website
at all.
copy-directory is a package on quicklisp to copy files using the OS's native cp
command (useful for taking snapshots/back-ups of directories). The snapshot
package is for copying directories (I.E. taking snapshots) in /storage and the
site's DB.
It's never been and won't be used. It came as part of the 'make project' process
when generating a Caveman2 website -- just never got around to deleting until now.
This feature copies the selected file in /storage/media and builds it full
URL. The intention is to make it easier for users to copy the URL when the need
to paster it into one of the 'edit' pages (I.E. Pages and Archive sections) text
areas.
At the minute the code assumes its only copying and building URL for the files
listed on the 'Storage Index' page (/storage/manage defroute). If the website's
features expand in the future in this area, this function/feature will need to
be refactored.
The file-type contains 'image' so the filter assumed it was a .png or .jpg and
the image wouldn't render when it was a .svg file. This additional check to the
filter makes sure the svg.png (stock image file) is used when a thumbnail is
used in a HTML template.
I was going to start on making this function more robust and remove the
hard-coded nature of it but cleary I got distracted and never actually started
it. I know it will need to include the 'build-url' functions in the utils
package but until I get around to actually refactoring this function, I'm going
to leave the code commented out.
This includes the HTTP GET and HTTP POST requests (defroutes in web.lisp). This
is part of the 'danger zone' features because it can leave the website in an
un-recoverable state.
This template has the CSS and HTML already included with this commit. It's
usable but I'm guessing it will need tweaking when the site gets closer to going
into production.
Links point to sections for manaully deleting files in the /storage
directory (without database interaction) and deleting database entries (without
storage file interaction). These sections are marked as 'danger zone' because
they should be used carefully and only if the site's storage files and database
have become out-of-sync. with each other.
The back-end functionality has not been implemented yet.
This feature deletes all the user created content stored in the /storage
directory, the website's database (so User Accounts) and wipes the
Meilisearch database clear of the Archive Entries stored in it.
This is part of the 'danger zone' features and intension is to allow the site's
Admin. to clear out the website and start with a fresh clean install.
This function is part of the 'reset website' feature implemention. You should
only need to call this when you want to delete something outsite of the /storage
directory (I.E. the website's database).
This feature is part of the 'danger zone' section in the site's settings. This
feature clears the Meilisearch database (with this site's Archive Entries) and
re-populates it with the data from this website's (nera) database.
This commit establishes the 'danger zone' in the site's settings page. This will
need to be added to over time. This commit set-ups the 're-populate search DB'
feature but the back-end is not yet implemented.
The main feature is the repopulate-database function which clears out the
Meilisearch DB index containing this site's searchable information and
repopulates it with the site's nera.db information.
I, also, added a delete-index function (also in search package) but that is
mostly a convenience feature. It allows me to quickly delete any index in the
Meilisearch DB which I made by mistake (E.G. wrong name, change of plan) and
remove old indexes from other projects which are no longer in use (on local
dev. machine mostly).