xgit simple git

KISSmoPerl

KISSmo Perl

clone git clone https://kb.hax.al/KISSmoPerl

README.md

1 # KISSmo Perl Pastebin
2 
3 KISSmo Perl is a lightweight and efficient pastebin application built with Mojolicious. This guide provides comprehensive instructions for setting up and running the application, including troubleshooting common dependency issues on various operating systems.
4 
5 ---
6 
7 ## Table of Contents
8 
9 * [Features](#features)
10 * [Setting Up and Running KISSmo Perl](#setting-up-and-running-kissmo-perl)
11     * [Step 1: Install Required Modules](#step-1-install-required-modules)
12     * [Step 2: Create the SQLite Database](#step-2-create-the-sqlite-database)
13     * [Step 3: Run the Perl Script](#step-3-run-the-perl-script)
14     * [Step 4: Access the Application](#step-4-access-the-application)
15     * [Step 5: Test the Application](#step-5-test-the-application)
16     * [Step 6: Accessing Raw Paste Data](#step-6-accessing-raw-paste-data)
17 * [Troubleshooting Common Perl Module Issues](#troubleshooting-common-perl-module-issues)
18 * [Release Notes](#release-notes)
19 * [Demo](#demo)
20 
21 ---
22 
23 ## Features
24 
25 * Simple and efficient paste management.
26 * Uses SQLite for data storage.
27 * Web interface for creating and viewing pastes.
28 * Raw paste data access.
29 
30 ---
31 
32 ## Setting Up and Running KISSmo Perl
33 
34 This guide assumes you're using a Unix-like system (e.g., Linux, \*BSD, or macOS) and have Perl installed.
35 
36 ### Step 1: Install Required Modules
37 
38 Before running the code, you need to install the necessary Perl modules. The recommended approach is to use your operating system's package manager, as this ensures proper integration and dependency management.
39 
40 **General Fallback (Using `cpanm`):**
41 
42 If your distribution's packages are unavailable or outdated, you can use **cpanminus**. First, ensure `cpanminus` is installed:
43 
44 ```bash
45 sudo cpan App::cpanminus # Or `sudo apt install cpanminus`, `sudo apk add perl-app-cpanminus`, etc.
46 
47 ```
48 
49 Then, install the modules:
50 
51 Bash
52 
53 ```
54 sudo cpanm Mojolicious DBI File::Slurp DBD::SQLite
55 
56 ```
57 
58 **Operating System Specific Instructions:**
59 
60 ----------
61 
62 #### Debian (and Ubuntu, Pop!_OS, Mint, etc.)
63 
64 Bash
65 
66 ```
67 sudo apt update
68 sudo apt install libmojolicious-perl libdbi-perl libfile-slurp-perl libdbd-sqlite3-perl
69 
70 ```
71 
72 ----------
73 
74 #### Alpine Linux
75 
76 Bash
77 
78 ```
79 sudo apk update
80 sudo apk add perl perl-mojolicious perl-dbi perl-file-slurp perl-dbd-sqlite
81 
82 ```
83 
84 ----------
85 
86 #### OpenBSD
87 
88 ```
89 doas pkg_add perl-Mojolicious perl-DBI perl-File-Slurp perl-DBD-SQLite
90 
91 ```
92 
93 ----------
94 
95 #### Arch Linux (and Manjaro, EndeavourOS, etc.)
96 
97 ```
98 sudo pacman -Sy
99 sudo pacman -S perl-mojolicious perl-dbi perl-file-slurp perl-dbd-sqlite
100 
101 ```
102 
103 ----------
104 
105 ### Step 2: Create the SQLite Database
106 
107 The application uses an SQLite database to store pastes. Create an empty SQLite database file named `pastes.db` and a directory for pastes in the same directory as your Perl script.
108 
109 ```
110 touch pastes.db && mkdir pastes
111 
112 ```
113 
114 ### Step 3: Run the Perl Script
115 
116 Once you've installed the modules and created the database file, navigate to the directory containing your script and execute the following command:
117 
118 ```
119 perl paste.pl daemon -m production -l http://0.0.0.0:7878
120 
121 ```
122 
123 This command starts the Mojolicious application as a daemon process, listening on all network interfaces on port `7878`. You should see output similar to:
124 
125 ```
126 [Sun Jun 23 12:34:56 2023] [info] Listening at "http://<your_server_ip>:7878"
127 
128 ```
129 
130 ### Step 4: Access the Application
131 
132 Open a web browser and visit `http://<your_server_ip>:7878` to access the application. Replace `<your_server_ip>` with the actual IP address or hostname of the machine running the script. You should be presented with a web page featuring a text area for content input.
133 
134 ### Step 5: Test the Application
135 
136 To test the application, enter some content into the text area and click the "**Create paste**" button. The application will generate a unique ID for the paste and display its details.
137 
138 ### Step 6: Accessing Raw Paste Data
139 
140 To view the raw content of a paste, navigate to its detail page and click the "**RAW**" button.
141 
142 ----------
143 
144 ## Troubleshooting Common Perl Module Issues
145 
146 If you encounter errors like `Can't locate Mojolicious/Lite.pm in @INC`, `Can't locate DBI.pm in @INC`, `Can't locate File/Slurp.pm in @INC`, or `install_driver(SQLite) failed: Can't locate DBD/SQLite.pm in @INC`, it means the required Perl modules aren't found in your system's Perl library paths.
147 
148 These issues are typically resolved by installing the missing modules. Refer to **Step 1: Install Required Modules** and use the instructions specific to your operating system. Ensure you're installing the correct package names as provided for Debian, Alpine, OpenBSD, or Arch Linux. If your system's package manager doesn't provide the module, or you need a specific version, **cpanminus** is a reliable alternative.
149 
150 ----------
151 
152 ## Release Notes
153 
154 For detailed information about the latest version, KISSmo 1.1.9, please refer to the official release notes:
155 
156 [https://git.hax.al/KISSmoPerl/tag/?h=v1.9](https://git.hax.al/KISSmoPerl/tag/?h=v1.9)
157 
158 ----------
159 
160 ## Demo
161 
162 Experience KISSmo Perl in action:
163 
164 [https://paste.hax.al/](https://paste.hax.al/)