summaryrefslogtreecommitdiff
path: root/README.md
AgeCommit message (Collapse)AuthorFilesLines
2024-03-30JS: Rewrite TraitEdit formYorhel1-2/+2
Pretty much a copy of TagEdit with some minor differences. Might make sense to merge these into a single file.
2024-03-28Multi: run in foreground and use lock file for single-instance checkYorhel1-4/+1
This is a lot more robust than that silly pid file.
2024-03-28+docsYorhel1-0/+4
2024-03-28!BREAKING! Restructure directory layout for generated & runtime filesYorhel1-60/+134
My testing, deployment and backup scripts were getting more complicated with files from various stages being lumped into a single directory structure, so all generated files (= anything touched by 'make') and runtime files (= anything touched by the web backend or multi) have now been moved into separate directories. These directories are also configurable with $VNDB_GEN and $VNDB_VAR, making it possible to manage multiple instances from a single source checkout. I also got rid of *data/* and *dl/* while I was at it, and moved *static/st/* (that is, the screenshot thumbnails) to */sf.t/*, to be consistent with the newer and more flexible image directory naming scheme. This commit breaks all existing installations and upgrading requires manual action. General upgrade instructions: # BEFORE doing a checkout of this commit make clean # AFTER make mkdir -p var/static var/log mv static/st var/static/sf.t mv static/{sf,ch,cv}{,.orig} var/static/ mv data/conf.pl var/ mv data/log var/ mv data/hibp var/ mv dl var/ util/setup-var.sh Use `git status` find leftover files to clean up or move. Don't forget to update conf.pl and web server configuration to make sure they access the new paths.
2024-03-10Use vips for pngsprite.pl; drop ImageMagick dependencyYorhel1-1/+0
Not particularly useful, but I always enjoy removing dependencies.
2024-03-10Unbreak DockerYorhel1-1/+1
Wanted to upgrade to Alpine 3.19 while I was at it, but getting postgresql15-dev and libpq-dev installed at the same time didn't go well. Upgrading to Postgres 16 also didn't go well, I'll probably need to fix vndbfuncs for that. Later.
2024-03-10Improve processing of uploaded imagesYorhel1-0/+1
My goals, in particular, were to: - Make use of a more efficient jpeg encoder; jpegli in this case. - Sandbox the image handling process to protect against codec vulnerabilities; implemented with seccomp. This isn't easy to do with software packaged in typical Linux repos, so I had to improvise a bit. I switched to libvips as that is easier to sandbox than ImageMagick and provided a Makefile to fetch and build a custom libvips that uses jpegli. None of this is very portable, so to simplify testing setups a simpler "imgproc-portable" binary is built instead. Also experimented with different resizing and encoding options, but the defaults were mostly okay. See https://vndb.org/t21692 (This breaks the Docker setup, I'll fix that later. I'll also see if I can drop the ImageMagick dependency that's still used for pngsprite.pl, as it seems a little redundant)
2023-11-15README: clarify licenseYorhel1-1/+1
2023-07-12README: More flexible nginx asset rewrite configYorhel1-5/+4
2023-06-04Misc fixesYorhel1-0/+1
2023-04-12Add brotli compression for css and js filesYorhel1-1/+3
2023-04-08JS: Reorganization to prepare for an Elm->Preact migrationYorhel1-2/+2
This change also increases browser version requirements by quite a bit, though it should still be fair. Pale Moon is an easy "old enough" target to test. This new organization is, in a way, pretty similar to what we had before the switch to Elm, except with more experience I might be able to do this in a more manageable way. I have to admit, I like arrow functions more than I had expected.
2023-04-01README: Some guidance on a production deploymentYorhel1-0/+49
2023-01-04Update Docker imageYorhel1-4/+0
Had a little fight with ConnMan and network setup stuff on my laptop, but eventually managed to get docker to run over there. What a mess.
2022-12-18SQL: Experiment with MERGE to perform in-place updates for tags_vn_calc()Yorhel1-1/+5
The previous TRUNCATE + INSERT approach is still faster, but has the major downside that it acquires an exclusive lock on the cache tables and hence brings down the site for 10 seconds. This MERGE approach is a bit slower, but avoids unnecessary writes and the site should hopefully remain responsive. Both implementations perform equally well for single-VN updates. If this approach turns out to work, I'll also fix traits_chars_calc(), which is responsible for taking down the site for 20 seconds every day. If this doesn't work, new table + rename is prolly also a viable option.
2021-02-24SQL/vndbid: Add HASHES & MERGES options to eq operator + equalimage btree ↵Yorhel1-1/+1
function The HASHES and MERGES options enable some pretty important join strategies, amazing how I haven't stumbled upon major performance issues before without them. The equalimage function enables btree key deduplication in Postgres 13+. Won't have a major impact on performance, but still a nice to have. I don't have a migration script for these changes, it'll involve updating all existing columns and indices that use the vndbid type. I'll instead work on a script to dump all data and use the sql/ files to re-import everything. Been wanting such a script for a while, anyway.
2021-02-21README: "How to contribute" sectionYorhel1-0/+19
Been meaning to add a section like this for a while. This section totally isn't complete, but at least it sets the right expectations.
2021-01-20v2rw: Rewrite done, time to clean up old v2 codeYorhel1-39/+0
Yay! There are no more request handlers in the VNDB::* namespace and no more Javascript in data/js/. This cleans up a lot of old legacy code that wasn't fun to maintain.
2021-01-17Use SASS for CSS + static asset reoganizationYorhel1-0/+1
Had been planning to use a more powerful preprocessor for CSS for a while, so that I can also reorganize and clean up the CSS a bit. The cleanup will come later, this is the first step to reorganize the build system a bit and remove skingen.pl. I moved all generated static assets to static/g/ (for _g_enerated), including icons.png and js files. This simplifies management of static/f/ and static/s/, which are fully in git. Skins are now defined as sass files in css/skins/ with their images in static/s/ using plain directory structure.
2020-12-31spritegen.pl: Remove Image::Magick dependency + use new indentation styleYorhel1-1/+0
Just pointless cleanup because I'm not in the mood to do meaningful work...
2020-12-24Convert images by running convert instead of loading Image::MagickYorhel1-1/+2
This has three potential advantages: - Memory used for image processing is released immediately, thus resulting in lower average memory usage. I've yet to test how significant this is in practice... I'm not entirely sure how VNDB's memory use is distributed (not that it's really a problem, but if I see something that could be optimized I try to optimize it. First world engineering problems) - The 'convert' command can be better sandboxed for increased security. - Removes a dependency on a Perl module... except spritegen.pl still uses it, but that can be rewritten as well if necessary. In the process I found out that the old code's attempt to sharpen the image after resizing was buggy and the sharpening was never applied. This new code *does* apply the sharpen filter, so newly uploaded images will be visually different (if resized). I also found that imagemagick's built-in ratio-preserving resize sometimes ends up with different image dimensions than my imgsize(). I think that's a bug in my imgsize function, but it does result in a discrepancy that should prolly be resolved as it may result in screenshot thumbnails being displayed incorrectly.
2020-04-06Delete old relation graph generating and caching machineryYorhel1-1/+0
2020-04-05SQL: Add C-based "vndbid" type and use it for image IDsYorhel1-1/+12
I had already rambled on the current composite type solution in 583ae868dfd3c882a8d2dd40b5d5ed099170c1c2 and I had already explored a few alternatives. This was the one alternative I hadn't yet explored because I wasn't sure the operational complexity was going to be worth it, but after seeing how bad PostgreSQL was at optimizing queries with composite types, I figured I might as well just go with this approach. It improves performance of some queries by a *lot* (especially the image selection query) and it's pretty elegant and convenient to work with. Only downside is the complexity of compiling, installing and maintaining a vndbid.so library for PostgreSQL.
2020-04-04SQL reorg: Move util/sql/ to sql/ as a top-level dirYorhel1-2/+2
Been wanting to do this for a while... I've kept util/sql as a symlink for compatibility with the devdump, old update scripts and other code I may have forgotten. I'll remove it later.
2020-03-30Producers::Graph: Experiment with dynamically generating relation graphsYorhel1-2/+2
The producers.rgraph column still exists and the old graphs are still being generated - that will be removed if this new approach works out.
2020-01-12Docker: Add image version check to docker-init.shYorhel1-1/+2
This adds a method to signal that the docker image should be rebuilt after a change or update to the dependencies - which is much better than getting weird hard-to-debug errors because an older version of TUWF happens to be missing a function or something.
2019-12-30Actually, let's get rid of v3 now that it doesn't work anymore anywayYorhel1-20/+4
2019-12-30ulist: Remove remnants of old votes/vnlists/wlists tablesYorhel1-1/+3
2019-10-23Also update README with the new Elm version requirementYorhel1-1/+1
2019-09-25v2rw: Add Elm & db_edit framework + Convert doc page editingYorhel1-7/+8
Most of this is copied from v3. I did improve on a few aspects: - db_edit() and db_entry() use VNDB::Schema rather than dynamically querying the DB. This has the minor advantage of a faster startup. - The Elm code generator now writes to multiple files, this avoids the namespace pollution seen in v3's Lib.Gen and makes the dependency graph a bit more lean (i.e. faster incremental builds). - The Elm code generator doesn't update the timestamp of files that haven't been modified. This also speeds up incremental builds, the elm compiler can now skip rebuilding unmodified files. - The Elm API response generator code now uses plain functions rather than code references and all possible responses are now defined in Elm.pm. Turns out most API responses were used from more than a single place, so it makes sense to have them centrally defined. The doc page preview function is also much nicer; I'd like to apply this to all BBCode textareas as well. (Elm.pm itself is ugly as hell though. And we will prolly need some HTML form generation functions in Elm to make that part less verbose)
2019-09-23Minor administrative fixesYorhel1-1/+2
The FCGI module is only required when running in FastCGI mode, which isn't how the container is configured. The AnyEvent::HTTP module, on the other hand, is required for many of the new Multi::* modules. They're not enabled by default but are still a significant part of Multi, so it's good to have the dependencies available.
2019-09-23v2rw: Convert doc pages + add framework for item fetching & display & revisionsYorhel1-1/+1
This bumps the minimum Perl version to 5.26 in order to make use of lexical subroutines - a feature I've been wanting for a while. This should be the last version bump, 5.26 is the highest version in Ubuntu LTS at the moment. Not that I use Ubuntu, but it's used by the Docker container and it's a sensible reference. I merged the 'maintabs' and 'hiddenmsg' features into the primary framework_ function; It fits quite well there, removes a little bit of boilerplate from the DB entry page code and reduces the reliance on common "dbSomethingGet()" methods. I was hoping I'd be able to reduce the boilerplate required for defining revisions, but I don't think that's going to happen. What I did do was reimplement the diffing to handle item and text diffs separately, with sensible defaults for the old split/join/diff options. Diffing is now performed on the raw structured data rather than on formatted HTML, which, combined with the db_entry() functions, ought to be less brittle.
2019-09-17v2rw: Initial start on an incremental rewrite; Layout HTML firstYorhel1-8/+39
I copied and modified VN3::DB to VNWeb::DB, but it isn't used yet. Now that I think about it, that module isn't "web" specific at all and should perhaps be in the VNDB:: namespace. Oh well.
2019-09-17Make hashes in VNDB::Types immutable + get rid of Tie::IxHash depYorhel1-2/+1
I love it when I can get rid of a dependency! I realized in the process that I had already made Perl 2.24+ a requirement a bit earlier on by using postfix deref. It's a useful feature and 2.24 isn't *that* new, so let's make that official.
2019-09-12Add VNDB::Config module and unified conf.pl config fileYorhel1-3/+2
This gets rid of global.pl, config.pl and config3.pl and uses the cleaner config3.pl format for the config file. The config is easily accessible from anywhere by importing the new VNDB::Config module; The global $VNDB::S,O,M,ROOT variables have been removed. Sorry for all the churn...
2019-09-11Cleanup + simplify setup instructions in READMEYorhel1-21/+10
2019-08-06Hide Novelnews/Encubed links, site seems deadYorhel1-1/+1
2019-07-25Merge the v3 branch into separate namespace + fix Docker stuff (again)Yorhel1-4/+30
I was getting tired of having to keep two branches up-to-date with the latest developments, so decided to throw v3 into the same branch - just different files (...which will get mostly rewritten again soon). The two versions aren't very different in terms of dependencies, build system and support code, so they can now properly share files. Added a section to the README to avoid confusion. This merge also makes it easier to quickly switch between the different versions, which is handy for development. It's even possible to run both at the same time, but my scripts use the same port so that needs a workaround. And it's amazing how often I break the Docker scripts.
2019-07-17Docker: Store Postgres DB in data/ + simplify the setup a bitYorhel1-12/+20
I initially wanted to move the static/.. files onto the Docker volume, so that all dynamic site data is stored in a single place. But that turned out to be impossible to do without some really ugly hacks. So instead I went with the opposite approach: get rid of the 'vndb-data' volume and instead store everything in the source directory. This also requires running PostgreSQL as the 'devuser', but that's fine for a development setup. All of this makes it more obvious what is going on and simplifies the init script.
2018-11-02Change Multi to use separate setting for db_login and to use UNIX socket for ↵alto1-0/+14
Postgres Update README with basic information on Multi (cherry picked from commit 01188a82ab736a8975c73ac5ec12621426bf6bf2)
2018-09-29Add default spoiler level to traits and use it on character editYorhel1-1/+1
https://vndb.org/t11296
2018-06-03Add development DB dump, remove old devdb, convert README to markdownYorhel1-0/+112