Skip to content

Commit f3a8dd6

Browse files
authored
Merge pull request wavelog#289 from wavelog/dev
Hotfix Release 1.5.2
2 parents 0eca970 + 188e012 commit f3a8dd6

File tree

16 files changed

+395
-153
lines changed

16 files changed

+395
-153
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Dockerfile
2+
.git
3+
.github

.github/workflows/accessibility-alt-text-bot.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/docker-image.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Wavelog create Dockerimage and publish it
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: 'Login to GitHub Container Registry'
17+
uses: docker/login-action@v1
18+
with:
19+
registry: ghcr.io
20+
username: ${{github.actor}}
21+
password: ${{secrets.GITHUB_TOKEN}}
22+
- name: Docker meta
23+
id: meta
24+
uses: docker/metadata-action@v5
25+
with:
26+
images: ${{ env.REGISTRY_IMAGE }}
27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@v3
29+
- name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v3
31+
- name: Build and push
32+
uses: docker/build-push-action@v5
33+
with:
34+
context: .
35+
platforms: linux/amd64,linux/arm64,linux/arm/v7
36+
push: true
37+
tags: ghcr.io/wavelog/wavelog:${{ github.ref_name == 'master' && 'latest' || github.ref_name }}

Dockerfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
FROM php:8.3-apache
2+
RUN touch /usr/local/etc/php/conf.d/uploads.ini \
3+
&& echo "file_uploads = On" >> /usr/local/etc/php/conf.d/uploads.ini \
4+
&& echo "memory_limit = 256M" >> /usr/local/etc/php/conf.d/uploads.ini \
5+
&& echo "upload_max_filesize = 64M" >> /usr/local/etc/php/conf.d/uploads.ini \
6+
&& echo "post_max_size = 64M" >> /usr/local/etc/php/conf.d/uploads.ini \
7+
&& echo "max_execution_time = 600" >> /usr/local/etc/php/conf.d/uploads.ini
8+
RUN apt-get update \
9+
&& apt-get install -y curl libxml2-dev libonig-dev libzip-dev cron \
10+
&& docker-php-ext-install mysqli mbstring xml zip
11+
RUN a2enmod rewrite
12+
ENV CI_ENV=docker
13+
14+
COPY ./ /var/www/html/
15+
WORKDIR /var/www/html
16+
RUN chown -R www-data:www-data /var/www/html
17+
18+
RUN mkdir ./userdata
19+
RUN mkdir ./application/config/docker
20+
RUN mv ./.htaccess.sample ./.htaccess
21+
RUN echo "Setting www-data as owner of the html folder" \
22+
&& chown -R www-data:www-data /var/www/html
23+
RUN echo "Setting permissions to the install folder" \
24+
&& cd /var/www/html \
25+
&& chmod -R g+rw ./application/config/ \
26+
&& chmod -R g+rw ./application/logs/ \
27+
&& chmod -R g+rw ./assets/qslcard/ \
28+
&& chmod -R g+rw ./backup/ \
29+
&& chmod -R g+rw ./updates/ \
30+
&& chmod -R g+rw ./uploads/ \
31+
&& chmod -R g+rw ./userdata/ \
32+
&& chmod -R g+rw ./images/eqsl_card_images/ \
33+
&& chmod -R g+rw ./assets/ \
34+
&& chmod -R g+rw ./application/config/docker/ \
35+
&& chmod -R 777 /var/www/html/install
36+
RUN echo "Installing cronjobs" \
37+
RUN touch /etc/crontab && \
38+
echo "0 */12 * * * curl --silent http://localhost/clublog/upload &>/dev/null" >> /etc/crontab && \
39+
echo "10 */12 * * * curl --silent http://localhost/eqsl/sync &>/dev/null" >> /etc/crontab && \
40+
echo "20 */12 * * * curl --silent http://localhost/qrz/upload &>/dev/null" >> /etc/crontab && \
41+
echo "30 */12 * * * curl --silent http://localhost/qrz/download &>/dev/null" >> /etc/crontab && \
42+
echo "40 */12 * * * curl --silent http://localhost/hrdlog/upload &>/dev/null" >> /etc/crontab && \
43+
echo "0 1 * * * curl --silent http://localhost/lotw/lotw_upload &>/dev/null" >> /etc/crontab && \
44+
echo "10 1 * * * curl --silent http://localhost/update/lotw_users &>/dev/null" >> /etc/crontab && \
45+
echo "20 1 * * 1 curl --silent http://localhost/update/update_clublog_scp &>/dev/null" >> /etc/crontab && \
46+
echo "0 2 1 */1 * curl --silent http://localhost/update/update_sota &>/dev/null" >> /etc/crontab && \
47+
echo "10 2 1 */1 * curl --silent http://localhost/update/update_wwff &>/dev/null" >> /etc/crontab && \
48+
echo "20 2 1 */1 * curl --silent http://localhost/update/update_pota &>/dev/null" >> /etc/crontab && \
49+
echo "0 3 1 */1 * curl --silent http://localhost/update/update_dok &>/dev/null" >> /etc/crontab
50+
RUN chmod 0644 /etc/crontab
51+
RUN crontab </etc/crontab
52+
RUN mkdir -p /var/log/cron
53+
RUN sed -i 's/^exec /service cron start\n\nexec /' /usr/local/bin/apache2-foreground

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@ https://demo.wavelog.org
2222

2323

2424
## Requirements
25+
### Recommended: Classic-LAMP-Stack:
2526
* Linux based Operating System (Windows stack may also work)
2627
* Apache (Nginx should work)
2728
* PHP Version 7.4 up to PHP 8.2 (PHP 8.3. in friendly Usertest)
2829
* MySQL or MariaDB (MySQL 5.7 or higher // MariaDB 10.1 or higher)
2930

31+
### Experimental:
32+
* [Docker Support](https://github.com/wavelog/wavelog/wiki/Installation-via-Docker)
33+
3034
Notes
3135
* If you want to log microwave QSOs you will need to use a 64bit operating system.
3236
* We do not provide Docker support, however you are free to use it if you wish but we will not handle support.

application/config/migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
|
2323
*/
2424

25-
$config['migration_version'] = 193;
25+
$config['migration_version'] = 194;
2626

2727
/*
2828
|--------------------------------------------------------------------------

application/controllers/Api.php

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,13 @@ function logbook_check_grid() {
364364
$band = null;
365365
}
366366

367+
// If $obj['cnfm'] exists
368+
if(isset($obj['cnfm'])) {
369+
$cnfm = $obj['cnfm'];
370+
} else {
371+
$cnfm = null;
372+
}
373+
367374
$this->load->model('logbooks_model');
368375

369376
if($this->logbooks_model->public_slug_exists($logbook_slug)) {
@@ -388,15 +395,24 @@ function logbook_check_grid() {
388395
// Search Logbook for callsign
389396
$this->load->model('logbook_model');
390397

391-
$result = $this->logbook_model->check_if_grid_worked_in_logbook($grid, $logbooks_locations_array, $band);
392-
398+
$query = $this->logbook_model->check_if_grid_worked_in_logbook($grid, $logbooks_locations_array, $band, $cnfm);
393399
http_response_code(201);
394-
if($result > 0)
395-
{
400+
if ($query->num_rows() == 0) {
401+
echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Not Found']);
402+
} else if ($cnfm == null) {
396403
echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Found']);
397404
} else {
398-
echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Not Found']);
405+
$arr = [];
406+
foreach($query->result() as $line) {
407+
$arr[] = $line->gridorcnfm;
408+
}
409+
if (in_array('Y', $arr)) {
410+
echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Confirmed']);
411+
} else {
412+
echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Worked']);
413+
}
399414
}
415+
400416
} else {
401417
// Logbook not found
402418
http_response_code(404);

application/controllers/Logbook.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,10 @@ function jsonentity($adif) {
8484
echo json_encode($return, JSON_PRETTY_PRINT);
8585
}
8686

87-
function json($tempcallsign, $temptype, $tempband, $tempmode, $tempstation_id = null) {
87+
function json($tempcallsign, $tempband, $tempmode, $tempstation_id = null) {
8888
session_write_close();
8989
// Cleaning for security purposes
9090
$callsign = $this->security->xss_clean($tempcallsign);
91-
$type = $this->security->xss_clean($temptype);
9291
$band = $this->security->xss_clean($tempband);
9392
$mode = $this->security->xss_clean($tempmode);
9493
$station_id = $this->security->xss_clean($tempstation_id);
@@ -134,7 +133,7 @@ function json($tempcallsign, $temptype, $tempband, $tempmode, $tempstation_id =
134133

135134
$lookupcall=$this->get_plaincall($callsign);
136135

137-
$return['partial'] = $this->partial($lookupcall);
136+
$return['partial'] = $this->partial($lookupcall, $band);
138137

139138
$callbook = $this->logbook_model->loadCallBook($callsign, $this->config->item('use_fullname'));
140139

@@ -152,8 +151,8 @@ function json($tempcallsign, $temptype, $tempband, $tempmode, $tempstation_id =
152151
$return['qsl_manager'] = $this->nval($callbook['qslmgr'] ?? '', $this->logbook_model->call_qslvia($callsign));
153152
$return['callsign_state'] = $this->nval($callbook['state'] ?? '', $this->logbook_model->call_state($callsign));
154153
$return['callsign_us_county'] = $this->nval($callbook['us_county'] ?? '', $this->logbook_model->call_us_county($callsign));
155-
$return['workedBefore'] = $this->worked_grid_before($return['callsign_qra'], $type, $band, $mode);
156-
$return['confirmed'] = $this->confirmed_grid_before($return['callsign_qra'], $type, $band, $mode);
154+
$return['workedBefore'] = $this->worked_grid_before($return['callsign_qra'], $band, $mode);
155+
$return['confirmed'] = $this->confirmed_grid_before($return['callsign_qra'], $band, $mode);
157156
$return['timesWorked'] = $this->logbook_model->times_worked($lookupcall);
158157

159158
if ($this->session->userdata('user_show_profile_image')) {
@@ -201,7 +200,7 @@ function nval($val1, $val2) {
201200
return (($val2 ?? "") === "" ? ($val1 ?? "") : ($val2 ?? ""));
202201
}
203202

204-
function confirmed_grid_before($gridsquare, $type, $band, $mode) {
203+
function confirmed_grid_before($gridsquare, $band, $mode) {
205204
if (strlen($gridsquare) < 4)
206205
return false;
207206

@@ -235,7 +234,7 @@ function confirmed_grid_before($gridsquare, $type, $band, $mode) {
235234
}
236235

237236

238-
if($type == "SAT") {
237+
if($band == "SAT") {
239238
$this->db->where('COL_PROP_MODE', 'SAT');
240239
if ($extrawhere != '') {
241240
$this->db->where('('.$extrawhere.')');
@@ -270,7 +269,7 @@ function confirmed_grid_before($gridsquare, $type, $band, $mode) {
270269
return false;
271270
}
272271

273-
function worked_grid_before($gridsquare, $type, $band, $mode)
272+
function worked_grid_before($gridsquare, $band, $mode)
274273
{
275274
if (strlen($gridsquare) < 4)
276275
return false;
@@ -279,7 +278,7 @@ function worked_grid_before($gridsquare, $type, $band, $mode)
279278
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
280279

281280
if(!empty($logbooks_locations_array)) {
282-
if($type == "SAT") {
281+
if($band == "SAT") {
283282
$this->db->where('COL_PROP_MODE', 'SAT');
284283
} else {
285284
$this->db->where('COL_MODE', $this->logbook_model->get_main_mode_from_mode($mode));
@@ -625,7 +624,7 @@ function view($id) {
625624
$this->load->view('interface_assets/footer');
626625
}
627626

628-
function partial($id) {
627+
function partial($id, $band = null) {
629628
$this->load->model('user_model');
630629
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
631630

@@ -855,7 +854,7 @@ function partial($id) {
855854
}
856855
if (isset($data['callsign']['gridsquare'])) {
857856
$this->load->model('logbook_model');
858-
$callsign['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
857+
$callsign['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'))->num_rows();
859858
}
860859
if (isset($callsign['callsign']['dxcc'])) {
861860
$this->load->model('logbook_model');
@@ -879,7 +878,7 @@ function partial($id) {
879878

880879
if (isset($callsign['callsign']['gridsquare'])) {
881880
$this->load->model('logbook_model');
882-
$callsign['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($callsign['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
881+
$callsign['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($callsign['callsign']['gridsquare'],0,4)), 0, $band)->num_rows();
883882
}
884883
if (isset($callsign['callsign']['error'])) {
885884
$callsign['error'] = $callsign['callsign']['error'];
@@ -935,7 +934,7 @@ function search_result($id="", $id2="") {
935934

936935
$data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname'));
937936
if (isset($data['callsign']['gridsquare'])) {
938-
$data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
937+
$data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'))->num_rows();
939938
}
940939
if (isset($data['callsign']['dxcc'])) {
941940
$entity = $this->logbook_model->get_entity($data['callsign']['dxcc']);
@@ -962,7 +961,7 @@ function search_result($id="", $id2="") {
962961
$data['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key'));
963962
}
964963
if (isset($data['callsign']['gridsquare'])) {
965-
$data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'));
964+
$data['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($data['callsign']['gridsquare'],0,4)), 0, $this->session->userdata('user_default_band'))->num_rows();
966965
}
967966
if (isset($data['callsign']['dxcc'])) {
968967
$entity = $this->logbook_model->get_entity($data['callsign']['dxcc']);
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
defined('BASEPATH') OR exit('No direct script access allowed');
4+
5+
/*
6+
Tag Wavelog as Version 1.5.2
7+
*/
8+
9+
class Migration_tag_1_5_2 extends CI_Migration {
10+
11+
public function up()
12+
{
13+
14+
// Tag Wavelog New Version
15+
$this->db->where('option_name', 'version');
16+
$this->db->update('options', array('option_value' => '1.5.2'));
17+
18+
// Trigger Version Info Dialog
19+
$this->db->where('option_type', 'version_dialog');
20+
$this->db->where('option_name', 'confirmed');
21+
$this->db->update('user_options', array('option_value' => 'false'));
22+
23+
// Also set Version Dialog to "both" if only custom text is applied
24+
$this->db->where('option_name', 'version_dialog');
25+
$this->db->where('option_value', 'custom_text');
26+
$this->db->update('options', array('option_value' => 'both'));
27+
28+
29+
}
30+
31+
public function down()
32+
{
33+
$this->db->where('option_name', 'version');
34+
$this->db->update('options', array('option_value' => '1.5.1'));
35+
}
36+
}

application/models/Dxcc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ function get_dxcc_array($dxccArray, $bands, $postdata) {
8888
if ($postdata['confirmed'] != NULL) {
8989
$confirmedDXCC = $this->getDxccBandConfirmed($location_list, $band, $postdata);
9090
foreach ($confirmedDXCC as $cdxcc) {
91-
$dxccMatrix[$cdxcc->dxcc][$band] = '<div class="bg-success awardsBgSuccess"><a href=\'javascript:displayContacts("'.str_replace("&", "%26", $cdxcc->name).'","'. $band . '","'. $postdata['sat'] . '","'. $postdata['orbit'] . '","' . $postdata['mode'] . '","DXCC","'.$qsl.'")\'>C</a></div>';
91+
$dxccMatrix[$cdxcc->dxcc][$band] = '<div class="bg-success awardsBgSuccess"><a href=\'javascript:displayContacts("'.str_replace("&", "%26", $cdxcc->name).'","'. $band . '","'. $postdata['sat'] . '","'. $postdata['orbit'] . '","' . $postdata['mode'] . '","DXCC","'.$qsl.'")\'>C</a></div>';
9292
}
9393
}
9494
}
@@ -402,7 +402,7 @@ function getSummaryByBand($band, $postdata, $location_list) {
402402

403403
if ($band == 'SAT') {
404404
$sql .= " and thcv.col_prop_mode ='" . $band . "'";
405-
if ($band != 'All') {
405+
if ($band != 'All' && $postdata['sat'] != 'All') {
406406
$sql .= " and col_sat_name ='" . $postdata['sat'] . "'";
407407
}
408408
} else if ($band == 'All') {

0 commit comments

Comments
 (0)