commit 6a85528dd1297d74df07d8dabcc48fb4650a5002
author: monaco <arianitkukaj@gmail.com>
date: 2023-11-07 19:41
parents: 2e1b99a2
Some modifications, and improvements !
| M | paste.pl | +179 | -6 |
diff --git a/paste.pl b/paste.pl index b973e80..b7fda16 100644 --- a/paste.pl +++ b/paste.pl @@ -14,6 +14,12 @@ get '/' => sub { $c->render(template => 'index'); }; +get '/installation' => sub { + my $c = shift; + $c->render(template => 'installation'); +}; + + post '/' => sub { my $c = shift; my $content = $c->param('content'); @@ -155,7 +161,10 @@ __DATA__ <a class="navbar-brand" href="/">KISSMO</a> <ul class="navbar-nav mr-auto"> <li class="nav-item"> - <a class="nav-link" href="/">Home</a> + <a class="nav-link" href="https://hax.al">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="/installation">Installation and Updates</a> </li> </ul> </nav> @@ -171,7 +180,7 @@ __DATA__ </form> </div> <footer class="footer"> - <p>This pastebin script has been developed by Arianit. The source code can be found at <a href="https://github.com/hedho/KISSmoPerl">GitHub</a>.</p> + <p>This pastebin script has been developed by Arianit. The source code can be found at <a href="https://man.hax.al/cgit/KISSmoPerl/about">HAX.AL repositories</a>.</p> </footer> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script> @@ -225,7 +234,10 @@ __DATA__ <a class="navbar-brand" href="/">KISSMO</a> <ul class="navbar-nav mr-auto"> <li class="nav-item"> - <a class="nav-link" href="/">Home</a> + <a class="nav-link" href="https://hax.al">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="/installation">Installation and Updates</a> </li> </ul> </nav> @@ -289,7 +301,10 @@ __DATA__ <a class="navbar-brand" href="/">KISSMO</a> <ul class="navbar-nav mr-auto"> <li class="nav-item"> - <a class="nav-link" href="/">Home</a> + <a class="nav-link" href="https://hax.al">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="/installation">Installation and Updates</a> </li> </ul> </nav> @@ -352,7 +367,10 @@ __DATA__ <a class="navbar-brand" href="/">KISSMO</a> <ul class="navbar-nav mr-auto"> <li class="nav-item"> - <a class="nav-link" href="/">Home</a> + <a class="nav-link" href="https://hax.al">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="/installation">Installation and Updates</a> </li> </ul> </nav> @@ -415,7 +433,10 @@ __DATA__ <a class="navbar-brand" href="/">KISSMO</a> <ul class="navbar-nav mr-auto"> <li class="nav-item"> - <a class="nav-link" href="/">Home</a> + <a class="nav-link" href="https://hax.al">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="/installation">Installation and Updates</a> </li> </ul> </nav> @@ -432,3 +453,155 @@ __DATA__ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script> </body> </html> + +@@ installation.html.ep + +<!DOCTYPE html> +<html> +<head> +<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> +<meta name="HandheldFriendly" content="true"> + <title>Installation and Updates</title> + <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css"> + <style> + body { + background-color: #9f9f9f33; + } + .container { + max-width: 800px; + margin-top: 50px; + } + h1 { + text-align: center; + margin-bottom: 30px; + } + .installation-instructions { + margin-top: 30px; + } + .footer { + text-align: center; + margin-top: 50px; + background-color: #00a6ff; + color: #fff; + width: 100%; + position: relative; + bottom: 0; + left: 0; + padding: 15px; + } + .footer a { + color: #ffc107; /* Set the link color to bright yellow */ + } + </style> +</head> +<body> + <nav class="navbar navbar-expand-lg navbar-light bg-light"> + <a class="navbar-brand" href="/">KISSMO</a> + <ul class="navbar-nav mr-auto"> + <li class="nav-item"> + <a class="nav-link" href="https://hax.al">Home</a> + </li> + <li class="nav-item"> + <a class="nav-link" href="/installation">Installation and Updates</a> + </li> + </ul> + </nav> + <div class="container"> + <h1>Installation and Updates</h1> + <div class="installation-instructions"> + <h2>KISSmo Perl Pastebin</h2> + +<p>KISSmo Perl Pastebin is a simple pastebin service implemented in Perl using the Mojolicious framework. It allows users to create and share plain text snippets or code snippets easily. The service stores the pasted content in an SQLite database and provides various features such as expiration of pastes, viewing and downloading pastes, and raw access to the content.</p> + +<h3>Prerequisites</h3> + +<p>To run KISSmo Perl Pastebin, the following dependencies are required:</p> + +<ul> +<li>Perl (5.10.1 or higher)</li> +<li>Mojolicious framework</li> +<li>DBI module</li> +<li>File::Slurp module</li> +<li>SQLite database</li> +</ul> + +<p>Make sure you have Perl installed on your system and install the required modules using the CPAN or CPANM package manager.</p> + +<h3>Installation</h3> + +<ol> +<li>Clone the KISSmo Perl Pastebin repository from GitHub:</li> + +<pre><code>$ git clone https://github.com/hedho/KISSmoPerl.git</code></pre> + +<li>Change to the project directory:</li> + +<pre><code>$ cd KISSmoPerl</code></pre> + +<li>Install the required Perl modules:</li> + +<pre><code>$ cpan Mojolicious DBI File::Slurp</code></pre> + +<li>Create an SQLite database file named <code>pastes.db</code>:</li> + +<pre><code>$ touch pastes.db</code></pre> + +<pre><code>$ mkdir pastes</code></pre> +</ol> + +<h3>Configuration</h3> + +<p>The configuration for KISSmo Perl Pastebin is handled through the Perl script itself. You can modify the script directly to customize the behavior and appearance of the pastebin service. Some of the configurable options include:</p> + +<ul> +<li>Database settings: You can modify the database connection parameters (<code>dbname</code>, <code>username</code>, <code>password</code>) in the line <code>$dbh->connect("dbi:SQLite:dbname=pastes.db","","", { RaiseError => 1, AutoCommit => 1 });</code> to match your environment.</li> +</ul> + +<h3>Running the Service</h3> + +<p>To start the KISSmo Perl Pastebin service, run the following command:</p> + +<pre><code>$ ./pastebin.pl daemon</code></pre> + +<p>The service will start running on the default port (3000) on your local machine. You can access the pastebin service by opening a web browser and visiting <a href="http://localhost:3000">http://localhost:3000</a>.</p> + +<h3>Usage</h3> + +<ol> +<li>Home Page: The home page provides a simple form where you can enter your content. The content can be any plain text or code snippet that you want to share. Enter the content in the provided textarea and click on the "Create paste" button.</li> +<li>View Paste: After creating a paste, you will be redirected to a page that displays the paste details. The content of the paste will be shown along with options to view the raw content or download the paste as a text file. The expiration time of the paste is also displayed.</li> +<li>Raw Content: Clicking on the "RAW" button will display the raw content of the paste in plain text format.</li> +<li>Download: Clicking on the "Download" button will prompt you to download the paste as a text file. The file will be named with the paste ID followed by the <code>.txt</code> extension.</li> +</ol> + +<h3>Customization</h3> + +<p>If you want to customize the appearance or behavior of the pastebin service, you can modify the templates located in the <code>__DATA__</code> section of the Perl script. The templates are written in Embedded Perl (EP) format and use HTML for markup. You can modify the HTML, CSS, and JavaScript code to match your requirements.</p> + +<h3>Maintenance</h3> + +<p>To manage the pastes stored in the database, you can use any SQLite database management tool or interact directly with the <code>pastes.db</code> file using the SQLite command-line tool.</p> + +<h3>Conclusion</h3> + +<p>KISSmo Perl Pastebin is a lightweight and easy-to-use pastebin service written in Perl. It provides a simple web interface for creating, sharing, and managing plain text.</p> + +<br /> +<a href="https://www.buymeacoffee.com/arianit"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=☕&slug=arianit&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" /></a> +<br /> +Source link:<br /> +<br /> +<a href="https://www.buymeacoffee.com/arianit">https://www.buymeacoffee.com/arianit</a></p> + + <!-- Add the installation instructions here --> + ... + </div> + </div> + <footer class="footer"> + <p>This pastebin script has been developed by Arianit. The source code can be found at <a href="https://github.com/hedho/KISSmoPerl">GitHub</a>.</p> + </footer> + <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> + <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script> +</body> +</html>