Skip to content

Commit

Permalink
Add randomized maintenance, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jxmx committed May 10, 2023
1 parent 35fa557 commit 1230724
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Anniversary Special Event.

# Installation
## Prerequisites
* A websever running PHP 7.4 or better with the mysqli native client library
* A websever running PHP 8.0 or better with the mysqli native client library
This code should work with earlier versions of PHP but is not supported.
* A database running MariaDB 10.0+ (or MySQL 5.6+)
* ImageMagick 6.x or better with the ImageMagick PHP library (imagick) installed
* Basic ability to use an xxMP stack (e.g. LAMP, WAMP, etc.)
Expand All @@ -19,45 +20,45 @@ Anniversary Special Event.
3. Copy all of the files to your webserver directory
4. Ensure the `cards` subdirectory is writable by the webserver. If this is
being installed in a hosting provider than this is likely the default.
4. Load the qsl.sql into your MySQL server
5. Setup some form of cron or other automated task to run the qslmaint.php
on a periodic basis (recommended 1hr for busier sites; see note bleow).
5. Load the qsl.sql into your MySQL server

## Basic Coniderations
The application is designed to have simple, user-friendly URLs. For example,
putting the base files in a subdirectory /qsl resultes in the URL
https://example.com/qsl for the main application and https://example.com/qsl/load
putting the base files in a subdirectory `/qsl` resultes in the URL
`https://example.com/qsl` for the main application and `https://example.com/qsl/load`
for the ADIF loader. All references to includes, configs, images, etc. are
all relative pathed so the application should be installable virtually anywhere.

In order to make this as platform agnostic as possible, all temporary information
is stored in the MySQL database. In order to accomodate large ADIF imports,
the staging column type for the pre-commit data is a MySQL LONGTEXT field. This
will create a tremendous amount of empty-but-used space in MySQL when using
InnoDB. Ensure that the qslmaint.php script is being executed periodically as
one of its tasks is to run an OPTIMIZE TABLE on the transaction commit log.
InnoDB. Ensure that the `qslmaint.php` script is being executed periodically as
one of its tasks is to run an `OPTIMIZE TABLE` on the transaction commit log.
The `qslmaint.php` script is run randomly on an index.php page with a 1 in 4
randomized chance by default.

# Using Smooth QSL
For hams, all the hams need is the "load key" set in qslconf.php. Smooth QSL
For hams, all the hams need is the "load key" set in `qslconf.php`. SmoothQSL
operates on a semi-trust basis in that hams are relied upon to use their
legitimate call signs as is expected throughout amateur radio. Set a strong
"load key" as that is the only protection against mischef such as loading
bogus QSOs or malicious actors attempting to DoS the database by filling it up
or overworking the system.

The load process uses the following workflow:
1. Navigate to https://example.com/qsl/load
1. Navigate to `https://example.com/qsl/load`
2. Enter the callsign of the station operator, the load key, and select
the ADIF file. Upload the ADIF file.
3. Review the ADIF checkload on the next screen. Click Commit
4. A "receipt" page will apepr.
4. A "receipt" page will appear.

The QSL retrieval process is straight forward:
1. A ham navigates to https://example.com/qsl
1. A ham navigates to `https://example.com/qsl`
2. Enters their callsign
3. Selects the QSO(s) they want to print on the card or certificate
4. Requests the print
5. Saves the PDF to their computer (or prints it directly)
5. QSL card is displayed. Save or print as desired.

# Printing QSOs on the template
Smooth QSO uses ImageMagick to "draw" text on top of the QSL template
Expand Down Expand Up @@ -85,7 +86,3 @@ this is a part-part-part time project for me. I will help as I can
with installation-related questions insofar as they deal with unclear
directions or bugs on particular platforms but I will not help with
general installation and configuration of a webserver, PHP, MySQL, etc.

# Platform
This system was designed and tested on a Raspberry Pi 3B running
Raspbian 8 Jessie + backports. The webserver was Apache.
12 changes: 11 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,17 @@
<div class="container">
<hr>
<p class="text-muted">Site information &copy;&nbsp;<?php print date("Y"); ?>&nbsp;<?php print $club_name; ?><br/>
Powered by <a href="https://github.com/jxmx/smooth-qsl" target="_blank">Smooth QSL</a></p>
Powered by <a href="https://github.com/jxmx/smooth-qsl" target="_blank">Smooth QSL</a><br/>
This page load
<?php
if(random_int(1,4) > 3){
include("qslmaint.php");
print("ran");
} else {
print("did not run");
}
?>
maintenance.</p>
</div>
</div>
<script src="js/jquery.min.js"></script>
Expand Down

0 comments on commit 1230724

Please sign in to comment.