### Install Vagrant Plugin and Start VM Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Installs the necessary Vagrant plugin and starts the virtual machine for LANraragi. Ensure you are in the directory containing the Vagrantfile. ```bash vagrant plugin install vagrant-vbguest vagrant up ``` -------------------------------- ### Run LANraragi QuickStarter Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Execute this batch file to start the LANraragi application after extracting the QuickStarter. The first launch may take longer due to dependency downloads. ```batch start-lanraragi.bat ``` -------------------------------- ### Generate Installer Log for Troubleshooting Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/windows.md Use this command to generate a detailed log file of the MSI installer process. This log can be helpful for diagnosing installation failures. ```bash msiexec /i "lanraragi.msi" /l*v "install.log" ``` -------------------------------- ### Install Node.js and NPM Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Installs Node.js version 9.x and NPM using NodeSource repository. This is required for running LANraragi's installer scripts. ```bash curl -sL https://deb.nodesource.com/setup_9.x | bash - apt-get install -y nodejs ``` -------------------------------- ### Start LANraragi with Custom Listen Address Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Starts LANraragi and specifies a custom listen address and port. This example sets it to listen on http://127.0.0.1:8000. ```bash npm start http://127.0.0.1:8000 ``` -------------------------------- ### Start LANraragi Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Starts the LANraragi application. By default, it listens on all IPv4 interfaces on port 3000. Use 'npm start' in the LANraragi directory. ```bash npm start ``` -------------------------------- ### LANraragi Production Start Output Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Example output when LANraragi starts in production mode, indicating the listening address and port. ```text > LANraragi@0.5.0 start /mnt/c/Users/Tamamo/Desktop/lanraragi > perl ./script/lanraragi daemon -l "http://127.0.0.1:8000" キタ━━━━━━(゚∀゚)━━━━━━!!!!! [LANraragi] LANraragi 0.5.0 (re-)started. (Production Mode) [Mojolicious] Listening at "http://127.0.0.1:8000" ``` -------------------------------- ### Install LANraragi Dependencies Source: https://github.com/difegue/lanraragi/wiki/Hacking-and-Contributing Executes the installation script to set up backend and frontend dependencies and perform environment checks for LANraragi. ```perl perl install.pl ``` -------------------------------- ### Start Docker Compose Development Environment Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/extending-lanraragi/index.md Starts the LANraragi development environment using Docker Compose. This command should be run from the 'tools/build/docker' directory. ```bash docker compose up -d ``` -------------------------------- ### Install Lanraragi using Homebrew Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/macos.md Install the latest stable version of Lanraragi from the Homebrew repository. ```bash brew install lanraragi ``` -------------------------------- ### Set LRR_NETWORK Environment Variable and Start App Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/advanced-usage/network-interfaces.md Set the LRR_NETWORK environment variable to specify the desired listening address and port. Then, start the application using 'npm start'. This example demonstrates setting it to listen on localhost port 8000. ```bash export LRR_NETWORK=http://127.0.0.1:8000 npm start > lanraragi@0.6.0 start /mnt/c/Users/tiki/Desktop/lrr > perl ./script/launcher.pl -f ./script/lanraragi キタ━━━━━━(゚∀゚)━━━━━━!!!!! [LANraragi] [info] LANraragi 0.6.0-BETA.2 (re-)started. (Debug Mode) [...] [Mojolicious] Listening at "http://127.0.0.1:8000" Server available at http://127.0.0.1:8000 ``` -------------------------------- ### Stop and Start Vagrant VM Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Commands to halt the running Vagrant virtual machine and to start it again. ```bash vagrant halt ``` ```bash vagrant up ``` -------------------------------- ### Clone LANraragi and Run Installer Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Clones the LANraragi git repository and executes the full installation script. It is recommended to run this as a new Linux user. ```bash git clone -b master http://github.com/Difegue/LANraragi /home/koyomi/lanraragi cd /home/koyomi/lanraragi && sudo npm run lanraragi-installer install-full ``` -------------------------------- ### Manually Build and Install LANraragi (Arch Linux) Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/community.md Steps to manually download, build, and install LANraragi from the AUR source. This process also handles dependencies and cleans up build dependencies. ```bash wget https://aur.archlinux.org/cgit/aur.git/snapshot/lanraragi.tar.gz -O - | tar -xz cd lanraragi makepkg -rsi ``` -------------------------------- ### Install Base System Dependencies Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/source.md Update package lists and install essential build tools and libraries required for LANraragi. This includes development tools, archive libraries, image processing tools, and SSL/compression libraries. ```bash apt-get update apt-get upgrade -y apt-get install build-essential make gnupg pkg-config \ cpanminus redis-server libarchive-dev imagemagick webp libssl-dev zlib1g-dev libjxl-dev \ perlmagick npm libvips-dev ``` -------------------------------- ### Clone and Install LANraragi Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/jail.md Clones the LANraragi repository and installs it using npm. This should be done after setting up dependencies and configuring rc.conf. ```bash mkdir /usr/local/etc/LANraragi cd /usr/local/etc/LANraragi git clone -b master http://github.com/Difegue/LANraragi /usr/local/etc/LANraragi npm run lanraragi-installer install-full ``` -------------------------------- ### Install Dependencies for Jail Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/jail.md Installs essential packages required for LANraragi in a FreeBSD jail. Ensure you run this within the jail environment. ```bash pkg update pkg upgrade pkg install gnupg pkg install p5-App-cpanminus pkg install redis pkg install libarchive pkg install ImageMagick7 pkg install libressl pkg install npm pkg install p5-mojolicious pkg install git cpan Parallel::Loops ``` -------------------------------- ### Run Lanraragi Installer Source: https://github.com/difegue/lanraragi/wiki/Updating-LANraragi Installs or updates Lanraragi on a native OS installation. It is recommended to rerun the installer after updating application files. ```bash npm run lanraragi-installer install-full ``` -------------------------------- ### Install libseccomp on Raspbian Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/docker.md This command sequence downloads and installs a specific version of libseccomp on Raspbian to resolve potential 's6-svscan: warning: unable to iopause: Operation not permitted' errors in Docker. Use with caution. ```bash wget http://ftp.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.1-1~bpo10+1_armhf.deb sudo dpkg -i libseccomp2_2.5.1-1~bpo10+1_armhf.deb ``` -------------------------------- ### Install Native Dependencies (MSYS2) Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/extending-lanraragi/index.md Installs native dependencies required for LANraragi development on MSYS2. This script should be run after updating the environment. ```bash ./tools/build/windows/install-deps.sh ``` -------------------------------- ### Run Development Server Source: https://github.com/difegue/lanraragi/wiki/Hacking-and-Contributing Starts the Mojolicious development server which automatically reloads on file changes. Ensure you are in a Linux or WSL environment. ```bash npm run dev-server ``` -------------------------------- ### Install PerlMagick Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Run this command in your Perl environment to install the Image-Magick module, which is required for PerlMagick. ```perl ppm install Image-Magick ``` -------------------------------- ### Create LANraragi Start Script Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/jail.md Creates a shell script to start LANraragi as a specific user and change directory. This script is used for daemonizing the application. ```bash #!/bin/share/doc/handbook/jails-build lrr_start() { user='root' cd /usr/local/etc/LANraragi su ${user} -c "/usr/local/bin/npm start /usr/local/etc/LANraragi/" } lrr_start ``` -------------------------------- ### Install LANraragi from AUR (Arch Linux) Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/community.md Use this command with pikaur to install LANraragi from the Arch User Repository. Other AUR managers should work similarly. ```bash pikaur -S lanraragi ``` -------------------------------- ### Rerun Installer After Updating Files Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/source.md After manually updating LANraragi's files with the latest release, rerun the installer script to ensure a smooth update process. ```bash npm run lanraragi-installer install-full ``` -------------------------------- ### Install Perl Dependencies (MSYS2) Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/extending-lanraragi/index.md Installs Perl dependencies using cpanm. This script should be run after restarting the MSYS2 environment. ```bash ./tools/build/windows/install.sh ``` -------------------------------- ### GET /shinobu Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/shinobu-api.md Retrieves the current status of the Shinobu Filewatcher. ```APIDOC ## GET /shinobu ### Description Retrieves the current status of the Shinobu Filewatcher. ### Method GET ### Endpoint /shinobu ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status** (string) - The current status of the Shinobu Filewatcher (e.g., "running", "stopped"). #### Response Example { "status": "running" } ``` -------------------------------- ### Install Base Dependencies on Debian Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Updates package lists and installs essential software dependencies for LANraragi on Debian-based systems. This includes build tools, Perl package manager, Redis, and image manipulation libraries. ```bash apt-get update apt-get upgrade -y apt-get install build-essential make gnupg cpanminus redis-server unar imagemagick libimage-magick-perl libssl-dev zlib1g-dev ``` -------------------------------- ### GET /info Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/miscellaneous-other-api.md Retrieves general information about the LANraragi instance. ```APIDOC ## GET /info ### Description Retrieves general information about the LANraragi instance. ### Method GET ### Endpoint /info ### Response #### Success Response (200) - **data** (object) - Contains various information fields about the server. #### Response Example { "example": "{\"version\": \"1.1.0\", \"os\": \"Linux\", \"arch\": \"x64\", \"python_version\": \"3.9.12\", \"uptime\": 12345.67, \"disk_usage\": {\"total\": 1000000000000, \"used\": 500000000000, \"free\": 500000000000}}" ``` -------------------------------- ### Create LANraragi rc.d Service Script Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/jail.md Sets up LANraragi to run as a system service using the rc.d framework. This script allows LANraragi to start automatically when the jail boots. ```bash #!/bin/sh . /etc/rc.subr name="lrr" rcvar=`lrrd_enable` command="/usr/local/etc/LANraragi/${name}" run_rc_command "$1" ``` -------------------------------- ### Run LANraragi Docker Container Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/docker.md This command starts the LANraragi Docker container, mapping ports and mounting necessary directories for content, database, and thumbnails. Consider adding `--restart always` for auto-restarts. ```bash docker run --name=lanraragi -p 3000:3000 \ --mount type=bind,source=[YOUR_CONTENT_DIRECTORY],target=/home/koyomi/lanraragi/content \ --mount type=bind,source=[YOUR_DATABASE_DIRECTORY],target=/home/koyomi/lanraragi/database \ --mount type=bind,source=[YOUR_THUMBNAIL_DIRECTORY],target=/home/koyomi/lanraragi/thumb \ difegue/lanraragi ``` -------------------------------- ### Get Database Backup List Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/database-api.md Retrieves a list of existing database backups. ```APIDOC ## GET /database/backup ### Description Retrieves a list of existing database backups. ### Method GET ### Endpoint /database/backup ``` -------------------------------- ### GET /categories Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/category-api.md Retrieves a list of all categories. ```APIDOC ## GET /categories ### Description Retrieves a list of all categories. ### Method GET ### Endpoint /categories ### Parameters ### Request Example ### Response #### Success Response (200) - **categories** (array) - A list of category objects. #### Response Example ```json { "categories": [ { "id": 1, "name": "Category Name", "description": "Category Description" } ] } ``` ``` -------------------------------- ### API Key Authentication Header Example Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/getting-started.md Include your API Key as a Bearer token in the Authorization header for authenticated requests. Ensure the key is base64 encoded. ```bash DELETE /api/search/cache HTTP/1.1 Accept: application/json Authorization: Bearer SEVBVEhFTg== ``` -------------------------------- ### Case-Insensitive Tag Replacement Example Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/advanced-usage/tag-rules.md Demonstrates case-insensitive matching for tag replacement. The replacement preserves the case specified in the rule. ```plaintext serie:one piece -> parody:One Piece ``` -------------------------------- ### GET /info/metrics Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/miscellaneous-other-api.md Retrieves operational metrics in Prometheus exposition format. ```APIDOC ## GET /info/metrics ### Description Returns operational metrics for LANraragi in the Prometheus exposition format. This endpoint is useful for monitoring the application's performance and activity. ### Method GET ### Endpoint /api/info/metrics ### Response #### Success Response (200) - **metrics** (string) - The metrics data in Prometheus text format. #### Response Example ``` # HELP lanraragi_api_requests_total Total number of API requests # TYPE lanraragi_api_requests_total counter lanraragi_api_requests_total{endpoint="/",method="GET"} 4063 lanraragi_api_requests_total{endpoint="/api/archives/:id",method="DELETE"} 2 # ... ``` ``` -------------------------------- ### Translate Placeholder Example Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/extending-lanraragi/translations.md When translating strings with placeholders, ensure the placeholders like %1 and %2 are preserved in the 'msgstr'. ```po msgid "Version %1 %2" msgstr "版本 %1 %2" ``` -------------------------------- ### Basic Metadata Plugin Template Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/plugin-docs/metadata.md A starting template for a Perl metadata plugin. It includes necessary pragmas and imports common modules like Mojo::UserAgent. Remember to adhere to LRR's supported modules. ```perl package LANraragi::Plugin::Metadata::MyNewPlugin; use strict; use warnings; # Plugins can freely use all Perl packages already installed on the system # Try however to restrain yourself to the ones already installed for LRR (see tools/cpanfile) to avoid extra installations by the end-user. use Mojo::UserAgent; # You can also use LRR packages when fitting. # All packages are fair game, but only functions explicitly exported by the Utils packages are supported between versions. ``` -------------------------------- ### Check Docker Version Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/docker.md Command to verify the installed Docker version. This is recommended before deploying LANraragi to ensure compatibility, especially with newer Alpine Linux base images. ```bash docker version ``` -------------------------------- ### Migrate Existing Lanraragi Data Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/macos.md Use these commands to move your existing Lanraragi content, logs, temporary files, and database to the default Homebrew installation directory. ```bash lrr="${HOME}/Library/Application Support/LANraragi/" # if you’re on Linux, use the next line instead: #lrr="${HOME}/LANraragi/" cd mkdir -p "${lrr}" mv content "${lrr}/content" mv log "${lrr}/log" mv temp "${lrr}/temp" mv database.rdb "${lrr}/database/database.rdb" ``` -------------------------------- ### Run Lanraragi in Docker Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/advanced-usage/network-interfaces.md Use 'docker run' to start Lanraragi in a container. Map the host port to the container port using '-p' and mount the content directory. The LRR_NETWORK environment variable is set to listen on all IPv4 interfaces on port 8000. ```bash docker run --name=lanraragi -p 8000:8000 \ --mount type=bind,source=[YOUR_CONTENT_DIRECTORY], target=/home/koyomi/lanraragi/content \ -e LRR_NETWORK=http://*:8000 difegue/lanraragi ``` -------------------------------- ### Read values in the LRR Database Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/plugin-docs/code-examples.md Access the LRR database using a Redis client obtained via LANraragi::Model::Config. This example demonstrates retrieving a value by its key. ```perl my $redis = LANraragi::Model::Config->get_redis; my $value = $redis->get("key"); ``` -------------------------------- ### Get API Info Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/miscellaneous-other-api.md Retrieves general information about the LANraragi API. This endpoint does not require any specific setup or parameters. ```http GET /info ``` -------------------------------- ### Define Plugin Metadata with plugin_info Source: https://github.com/difegue/lanraragi/wiki/Writing-Plugins Implement the `plugin_info` subroutine to provide metadata for your plugin, including name, author, version, and descriptions for global and one-shot arguments. Ensure the namespace is a single word for uniqueness. ```perl #Meta-information about your plugin. sub plugin_info { return ( #Standard metadata name => "My Plugin", namespace => "dummyplug", author => "Hackerman", version => "0.001", description => "This is the description of my Plugin", oneshot_arg => "This is the description for a one-shot argument that can be entered by the user when executing this plugin on a file", global_args => ["This is the description for the first global argument that will be used on all executions of this plugin","second global argument", "third global argument"] ); } ``` -------------------------------- ### Extract files from the archive being examined Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/plugin-docs/code-examples.md For versions 0.5.2 and later, use LANraragi::Utils::Archive to check for and extract files. This example shows how to find 'info.json', extract it, read its content, and then delete the extracted file. ```perl use LANraragi::Utils::Archive qw(is_file_in_archive extract_file_from_archive); # Check if info.json is in the archive located at $file and get its precise path my $info_path = is_file_in_archive($file, "info.json"); if ($info_path) { #Extract info.json my $filepath = extract_file_from_archive($file, $info_path); #Do whatever you need with the extracted file open( my $fh, '<:encoding(UTF-8)', $filepath ) or die "Could not open $filepath!\n"; while ( my $row = <$fh> ) { #... } #Delete it unlink $filepath; } ``` -------------------------------- ### Create Database Backup Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/database-api.md Initiates a new backup of the database. ```APIDOC ## POST /database/backup ### Description Initiates a new backup of the database. ### Method POST ### Endpoint /database/backup ``` -------------------------------- ### POST /download_url Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/miscellaneous-other-api.md Initiates a download from a given URL. ```APIDOC ## POST /download_url ### Description Initiates a download from a given URL. The downloaded content will be processed by LANraragi. ### Method POST ### Endpoint /download_url ### Request Body - **url** (string) - Required - The URL to download from. ### Request Example { "example": "{\"url\": \"http://example.com/somefile.zip\"}" } ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the download has started. #### Response Example { "example": "{\"message\": \"Download initiated successfully.\"}" ``` -------------------------------- ### Create and Use Docker Volumes for LANraragi Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/docker.md This demonstrates creating dedicated Docker volumes for the database and thumbnails, then running the LANraragi container using these volumes. This ensures data persistence across container updates. ```bash docker volume create lrr-database docker volume create lrr-thumbnails docker run --name=lanraragi -p 3000:3000 \ --mount type=bind,source=[YOUR_CONTENT_DIRECTORY],target=/home/koyomi/lanraragi/content \ --mount source=lrr-database,target=/home/koyomi/lanraragi/database \ --mount source=lrr-thumbnails,target=/home/koyomi/lanraragi/thumb \ difegue/lanraragi ``` -------------------------------- ### Sample .po File Structure Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/extending-lanraragi/translations.md This is a sample structure of a .po file used for localization. You only need to modify the 'msgstr' content for translation. ```po # Sample Data msgid "" msgstr "" # ------Start of Backup.html.tt2------ msgid "Database Backup/Restore" msgstr "Database Backup/Restore" msgid "You can backup your existing database here, or restore an existing backup." msgstr "You can backup your existing database here, or restore an existing backup." ... ``` -------------------------------- ### POST /shinobu/restart Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/shinobu-api.md Restarts the Shinobu Filewatcher service. ```APIDOC ## POST /shinobu/restart ### Description Restarts the Shinobu Filewatcher service. ### Method POST ### Endpoint /shinobu/restart ### Parameters None ### Request Example None ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating the service has been restarted. #### Response Example { "message": "Shinobu Filewatcher restarted successfully." } ``` -------------------------------- ### Configure Redis in rc.conf Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/jail.md Adds Redis to the jail's rc.conf to enable it on startup. Use 'ee' or another text editor to modify the file. ```bash ee /etc/rc.conf ``` -------------------------------- ### HTML Example with Extra Space Causing Mismatch Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/extending-lanraragi/translations.md This example demonstrates how an extra space in the 'msgid' within the template can cause a mismatch, preventing correct translation replacement. ```html [% c.lh("Add Archives ") %] ``` -------------------------------- ### Manage LANraragi Systemd Service Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/community.md Commands to control the LANraragi systemd service, including starting, restarting, stopping, and checking its status. The service automatically starts Redis if it's down. ```bash systemctl start lanraragi.service ``` ```bash systemctl restart lanraragi.service ``` ```bash systemctl stop lanraragi.service ``` ```bash systemctl status lanraragi.service ``` -------------------------------- ### Run Lanraragi Docker Container Source: https://github.com/difegue/lanraragi/wiki/Updating-LANraragi Pulls the latest Docker image, stops and removes the existing container, and then runs a new container, mapping port 3000 and mounting a local directory for content. Ensure to replace [YOUR_CONTENT_DIRECTORY] with your actual content path. ```bash docker pull difegue/lanraragi docker stop lanraragi docker rm lanraragi docker run --name=lanraragi -p 3000:3000 --mount type=bind,source=[YOUR_CONTENT_DIRECTORY],target=/home/koyomi/lanraragi/content difegue/lanraragi ``` -------------------------------- ### Symlink Docker for WSL1 Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/installing-lanraragi/docker.md If you are using WSL1, you can create a symbolic link to the Docker for Windows executable to use Docker commands directly. This command should be run with sudo. ```bash sudo ln -s '/mnt/c/Program Files/Docker/Docker/resources/bin/docker.exe' \ /usr/local/bin/docker ``` -------------------------------- ### Login Plugin Input Parameters Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/plugin-docs/login.md The `do_login` subroutine receives plugin parameters in a hash. Ensure your subroutine correctly shifts the first argument and captures the parameter hash. ```perl sub do_login { #First lines you should have in the subroutine shift; my ($params) = @_; # Plugin parameters ``` -------------------------------- ### Create Docker Symlink for WSL Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi If using WSL without native Docker support, create a symbolic link to the Docker for Windows executable. ```bash sudo ln -s '/mnt/c/Program Files/Docker/Docker/resources/bin/docker.exe' /usr/local/bin/docker ``` -------------------------------- ### Get Database Statistics Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/database-api.md Retrieves statistics about the database. ```APIDOC ## GET /database/stats ### Description Retrieves statistics about the database. ### Method GET ### Endpoint /database/stats ``` -------------------------------- ### Get Archive Stamps Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/archive-api.md Retrieves the stamps for a specific archive. ```APIDOC ## GET /archives/{id}/stamps ### Description Retrieves the stamps for a specific archive. ### Method GET ### Endpoint /archives/{id}/stamps ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the archive. ``` -------------------------------- ### Implement provide_url Function in Perl Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/plugin-docs/download.md This function is required for scripts to provide a downloadable URL. It logs the input URL, constructs a reply URL, and uses the provided user agent to check the validity of the input URL before returning the reply URL. Ensure the `get_logger` function is available in your environment. ```perl sub provide_url { shift; my $lrr_info = shift; # Global info hash my ($useposts) = @_; # Plugin parameters my $logger = get_logger( "Dingus Downloader", "plugins" ); # Get the url my $url = $lrr_info->{url}; $logger->debug("We have been given the following URL: $url" ); # This is the downloadable url we'll give back. It can be completely different from the base domain provided. my $reply = "https://archive.org/download/quake-essays-sep-15-fin-4-graco-l-cl/QUAKE_essays_SEP15_FIN4_GRACoL_CL.pdf"; # Just for fun, use the provided useragent to see if we've been given a real URL my $ua = $lrr_info->{user_agent}; my $res = $ua->get($url)->result; if ($res->is_success) { return ( download_url => $reply ); } elsif ($res->is_error) { die "Dingus! " . $res->message; } } 1; ``` -------------------------------- ### Get Archive Page Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/archive-api.md Retrieves a specific page from an archive. ```APIDOC ## GET /archives/{id}/page ### Description Retrieves a specific page from an archive. ### Method GET ### Endpoint /archives/{id}/page ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the archive. ``` -------------------------------- ### Return Download URL Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/plugin-docs/download.md Use this format to return a direct URL to a file that LANraragi should download. ```perl return ( download_url => "http://my.remote.service/download/secret-archive.zip" ); ``` -------------------------------- ### Get Archive Categories Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/archive-api.md Retrieves the categories for a specific archive. ```APIDOC ## GET /archives/{id}/categories ### Description Retrieves the categories for a specific archive. ### Method GET ### Endpoint /archives/{id}/categories ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the archive. ``` -------------------------------- ### Get Archive Thumbnail Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/archive-api.md Retrieves the thumbnail for a specific archive. ```APIDOC ## GET /archives/{id}/thumbnail ### Description Retrieves the thumbnail for a specific archive. ### Method GET ### Endpoint /archives/{id}/thumbnail ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the archive. ``` -------------------------------- ### Define Plugin Metadata Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/plugin-docs/metadata.md Implement the `plugin_info` subroutine to provide essential metadata about your plugin, such as name, author, version, and configuration parameters. This information is used by LANraragi to manage and display plugin details. ```perl use LANraragi::Model::Plugins; use LANraragi::Utils::Logging qw(get_logger); #Meta-information about your plugin. sub plugin_info { return ( #Standard metadata name => "Plugin Boilerplate", type => "metadata", namespace => "dummyplug", #login_from => "dummylogin", author => "Hackerman", version => "0.001", description => "This is base boilerplate for writing LRR plugins.", icon => "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBI\nWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4wYDFCYzptBwXAAAAB1pVFh0Q29tbWVudAAAAAAAQ3Jl\nYXRlZCB3aXRoIEdJTVBkLmUHAAAAjUlEQVQ4y82UwQ7AIAhDqeH/f7k7kRgmiozDPKppyisAkpTG\nM6T5vAQBCIAeQQBCUkiWRTV68KJZ1FuG5vY/oazYGdcWh7diy1Bml5We1yiMW4dmQr+W65mPjFjU\n5PMg2P9jKKvUdxWMU8neqYUW4cBpffnxi8TsXk/Qs8GkGGaWhmes1ZmNmr8kuMPwAJzzZSoHwxbF\nAAAAAElFTkSuQmCC", #If your plugin uses/needs custom arguments, input their name here. #This name will be displayed in plugin configuration next to an input box for global arguments, and in archive edition for one-shot arguments. oneshot_arg => "This is a one-shot argument that can be entered by the user when executing this plugin on a file", parameters => [ 'doomsday' => {type => "bool", desc => "Enable the DOOMSDAY DEVICE"}, 'iterations' => {type => "int", desc => "Number of iterations", default_value => "9001"} ] ); } ``` -------------------------------- ### Get Archive Metadata Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/archive-api.md Retrieves the metadata for a specific archive. ```APIDIDOC ## GET /archives/{id}/metadata ### Description Retrieves the metadata for a specific archive. ### Method GET ### Endpoint /archives/{id}/metadata ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the archive. ``` -------------------------------- ### Return Local File Path Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/plugin-docs/download.md Use this format to return a path to a file that has already been downloaded or created locally. ```perl return ( file_path => "/path/to/downloaded/file.zip" ); ``` -------------------------------- ### GET /categories/{id} Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/category-api.md Retrieves a specific category by its ID. ```APIDOC ## GET /categories/{id} ### Description Retrieves a specific category by its ID. ### Method GET ### Endpoint /categories/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the category to retrieve. ### Request Example ### Response #### Success Response (200) - **category** (object) - The category object. #### Response Example ```json { "category": { "id": 1, "name": "Category Name", "description": "Category Description" } } ``` ``` -------------------------------- ### Get Archive Tankoubons Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/archive-api.md Retrieves the tankoubons associated with a specific archive. ```APIDOC ## GET /archives/{id}/tankoubons ### Description Retrieves the tankoubons associated with a specific archive. ### Method GET ### Endpoint /archives/{id}/tankoubons ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the archive. ``` -------------------------------- ### Get Stamp by ID Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/stamp-api.md Retrieves a specific stamp by its unique identifier. ```APIDOC ## GET /stamps/{id} ### Description Retrieves a specific stamp by its unique identifier. ### Method GET ### Endpoint /stamps/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the stamp. ``` -------------------------------- ### List Plugins Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/plugin-api.md Retrieves a list of available plugins of a specified type. ```APIDOC ## GET /plugins/{type} ### Description Retrieves a list of available plugins of a specified type. ### Method GET ### Endpoint /plugins/{type} ### Parameters #### Path Parameters - **type** (string) - Required - The type of plugins to list. ``` -------------------------------- ### Get OPDS Catalog Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/opds-catalog.md Retrieves the main OPDS catalog feed. ```APIDOC ## GET /opds ### Description Retrieves the main OPDS catalog feed. ### Method GET ### Endpoint /opds ``` -------------------------------- ### GET /categories/bookmark_link Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/category-api.md Retrieves a list of bookmark links associated with categories. ```APIDOC ## GET /categories/bookmark_link ### Description Retrieves a list of bookmark links associated with categories. ### Method GET ### Endpoint /categories/bookmark_link ### Parameters ### Request Example ### Response #### Success Response (200) - **bookmark_links** (array) - A list of bookmark link objects. #### Response Example ```json { "bookmark_links": [ { "id": 1, "category_id": 1, "url": "http://example.com" } ] } ``` ``` -------------------------------- ### Get Specific Archive Stamp Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/archive-api.md Retrieves a specific stamp from an archive by its index. ```APIDOC ## GET /archives/{id}/stamps/{index} ### Description Retrieves a specific stamp from an archive by its index. ### Method GET ### Endpoint /archives/{id}/stamps/{index} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the archive. - **index** (string) - Required - The index of the stamp. ``` -------------------------------- ### Get Tankoubon thumbnail by ID Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/tankoubon-api.md Retrieves the thumbnail image for a specific Tankoubon. ```APIDOC ## GET /tankoubons/{id}/thumbnail ### Description Retrieves the thumbnail image for a specific Tankoubon. ### Method GET ### Endpoint /tankoubons/{id}/thumbnail ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the Tankoubon. ``` -------------------------------- ### Access LANraragi Source: https://github.com/difegue/lanraragi/wiki/Installing-LANraragi Open this URL in your web browser to access the LANraragi application after starting it. ```http http://localhost:3000 ``` -------------------------------- ### HTML Placeholders in Templates Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/extending-lanraragi/translations.md Use `[% version %]` and `[% vername %]` for direct variable insertion in HTML templates. ```html

LANraragi

Version [% version %], "[% vername %]"
``` -------------------------------- ### Initialize Google Analytics Source: https://github.com/difegue/lanraragi/blob/dev/tests/samples/fakku/001_search_response.html This JavaScript code initializes Google Analytics for the FAKKU website. It sets up the tracking ID and sends a pageview event. ```javascript FAKKU (function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); ga('create', 'UA-1533406-1', 'auto'); ga('set', 'anonymizeIp', true); ga('send', 'pageview'); ``` -------------------------------- ### Get Minion Job Detail Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/minion-api.md Retrieves detailed information for a specific minion job. ```APIDOC ## GET /minion/{jobid}/detail ### Description Retrieves detailed information about a specific minion job. ### Method GET ### Endpoint /minion/{jobid}/detail ### Parameters #### Path Parameters - **jobid** (string) - Required - The ID of the job for which to retrieve details. ``` -------------------------------- ### Update MSYS2 Environment Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/extending-lanraragi/index.md Updates the MSYS2 environment packages. This is a prerequisite for installing native dependencies. ```bash pacman -Syu ``` -------------------------------- ### Provide URL Subroutine Signature Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/plugin-docs/download.md This is the expected signature for the `provide_url` subroutine in a downloader plugin. It receives global information and plugin-specific parameters. ```perl sub provide_url { #First lines you should have in the subroutine shift; my $lrr_info = shift; # Global info hash my ($param1, $param2) = @_; # Plugin parameters ``` -------------------------------- ### Get Tankoubon by ID Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/tankoubon-api.md Retrieves detailed information about a specific Tankoubon using its unique identifier. ```APIDOC ## GET /tankoubons/{id} ### Description Retrieves detailed information for a specific Tankoubon. ### Method GET ### Endpoint /tankoubons/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the Tankoubon. ``` -------------------------------- ### Get Specific Database Backup Source: https://github.com/difegue/lanraragi/blob/dev/tools/Documentation/api-documentation/database-api.md Retrieves details of a specific database backup by its job ID. ```APIDOC ## GET /database/backup/{jobid} ### Description Retrieves details of a specific database backup by its job ID. ### Method GET ### Endpoint /database/backup/{jobid} ### Parameters #### Path Parameters - **jobid** (string) - Required - The ID of the backup job. ```