From 5db8258b1f1615d0543dd126395031db1b8ed37f Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 15 Apr 2024 11:37:15 +0200 Subject: [PATCH 01/31] Fix SAT count for DXCC award --- application/models/Dxcc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index ecaf4a473..3a6f53383 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -88,7 +88,7 @@ class DXCC extends CI_Model { if ($postdata['confirmed'] != NULL) { $confirmedDXCC = $this->getDxccBandConfirmed($location_list, $band, $postdata); foreach ($confirmedDXCC as $cdxcc) { - $dxccMatrix[$cdxcc->dxcc][$band] = '
name).'","'. $band . '","'. $postdata['sat'] . '","'. $postdata['orbit'] . '","' . $postdata['mode'] . '","DXCC","'.$qsl.'")\'>C
'; + $dxccMatrix[$cdxcc->dxcc][$band] = '
name).'","'. $band . '","'. $postdata['sat'] . '","'. $postdata['orbit'] . '","' . $postdata['mode'] . '","DXCC","'.$qsl.'")\'>C
'; } } } @@ -402,7 +402,7 @@ class DXCC extends CI_Model { if ($band == 'SAT') { $sql .= " and thcv.col_prop_mode ='" . $band . "'"; - if ($band != 'All') { + if ($band != 'All' && $postdata['sat'] != 'All') { $sql .= " and col_sat_name ='" . $postdata['sat'] . "'"; } } else if ($band == 'All') { From eb0be429dabed1900075efffd790d8a907b0e665 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 15 Apr 2024 12:24:43 +0200 Subject: [PATCH 02/31] check config --- application/views/debug/index.php | 78 +++++++++++++++++++------------ 1 file changed, 48 insertions(+), 30 deletions(-) diff --git a/application/views/debug/index.php b/application/views/debug/index.php index 8af44a95e..a4726a3bf 100644 --- a/application/views/debug/index.php +++ b/application/views/debug/index.php @@ -131,6 +131,47 @@ +
+
+ Config Maintenance +
+
+ config->item('auth_mode') != '3') { ?> +
+ +

Please edit your ./application/config/config.php File:
+ Go to your application/config Folder and compare config.sample.php with your config.php

+ Change $config['auth_mode'] to the value 3 (Strongly recommended) +

+
+ +
+ Ok Authentication Mode is set correctly +
+ + + config->item('cl_multilanguage')) { ?> +
+ +

Please edit your ./application/config/config.php File and add some rows to it:

+ Go to your application/config Folder and compare config.sample.php with your config.php
+ You'll probably find a block with language-settings. Please include this block into your current config.php +

+
+ + +
+ Ok Multiuser-Language Support is enabled +
+ +
+
Migrate Userdata
@@ -208,7 +249,7 @@
-
- - -
+
+ + +
@@ -439,29 +480,6 @@ - -
-
- Settings Maintenance -
- config->item('cl_multilanguage')) { ?> - -
-

Please edit your ./application/config/config.php File and add some rows to it:

- Go to your application/config Folder and compare config.sample.php with your config.php
- You'll probably find a block with language-settings. Please include this block into your current config.php -

-
- - - - -
@@ -473,4 +491,4 @@ var local_branch = 'n/a'; - + \ No newline at end of file From 3e5e5e4b339636195df3884f5637134478181fee Mon Sep 17 00:00:00 2001 From: "Joerg (DJ7NT)" Date: Mon, 15 Apr 2024 12:56:04 +0200 Subject: [PATCH 03/31] Added link to Docker-Tutorial --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index b08203113..f3a6aaf55 100644 --- a/README.md +++ b/README.md @@ -22,11 +22,15 @@ https://demo.wavelog.org ## Requirements +### Recommended: Classic-LAMP-Stack: * Linux based Operating System (Windows stack may also work) * Apache (Nginx should work) * PHP Version 7.4 up to PHP 8.2 (PHP 8.3. in friendly Usertest) * MySQL or MariaDB (MySQL 5.7 or higher // MariaDB 10.1 or higher) +### Experimental: +* [Docker Support](https://github.com/wavelog/wavelog/wiki/Installation-via-Docker) + Notes * If you want to log microwave QSOs you will need to use a 64bit operating system. * We do not provide Docker support, however you are free to use it if you wish but we will not handle support. From 9cf957fd55b5bf1e2521e0c282316c1f9373dee3 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 15 Apr 2024 12:57:56 +0200 Subject: [PATCH 04/31] environment and codeigniter --- application/views/debug/index.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/application/views/debug/index.php b/application/views/debug/index.php index a4726a3bf..b4b41bf03 100644 --- a/application/views/debug/index.php +++ b/application/views/debug/index.php @@ -39,6 +39,10 @@ Migration There is something wrong with your Migration in Database!"); ?> + + Environment + + @@ -62,16 +66,8 @@ MySQL Version db->version(); ?> - - - - -
-
Codeigniter
-
- - +
VersionCodeigniter Version
From 1edef55330a0c4827b4e82bf0c3f3b81d36af8a3 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 15 Apr 2024 13:26:11 +0200 Subject: [PATCH 05/31] php settings --- application/views/debug/index.php | 199 ++++++++++++++++++++++-------- 1 file changed, 146 insertions(+), 53 deletions(-) diff --git a/application/views/debug/index.php b/application/views/debug/index.php index b4b41bf03..5c6640b98 100644 --- a/application/views/debug/index.php +++ b/application/views/debug/index.php @@ -181,64 +181,157 @@
-
PHP Modules
+
PHP
- - - - - +
+
+

Modules

+
curl - - Installed - - Not Installed - -
+ + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - -
curl + + Installed + + Not Installed + +
MySQL - - Installed - - Not Installed - -
MySQL + + Installed + + Not Installed + +
mbstring - - Installed - - Not Installed - -
mbstring + + Installed + + Not Installed + +
xml - - Installed - - Not Installed - -
xml + + Installed + + Not Installed + +
zip - - Installed - - Not Installed - -
+ + zip + + + Installed + + Not Installed + + + + +
+
+

Settings

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
max_execution_time ' . $max_execution_time . ' s'; ?> + = $max_execution_time) { ?> + + + + +
max_upload_file_size ' . $max_upload_file_size . 'M'; ?> + = ($max_upload_file_size * 1024 * 1024)) { // compare with given value in bytes + ?> + + + + +
post_max_size ' . $post_max_size . 'M'; ?> + = ($post_max_size * 1024 * 1024)) { // compare with given value in bytes + ?> + + + + +
memory_limit ' . $memory_limit . 'M'; ?> + = ($memory_limit * 1024 * 1024)) { // compare with given value in bytes + ?> + + + + +
allow_url_fopenOn + + On + + Off + +
+
+
From 7dfa51e6d04c0454b5f17dbe11f1c1f4f84dce3a Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 15 Apr 2024 13:35:33 +0200 Subject: [PATCH 06/31] write modules like the are called actually --- application/views/debug/index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/views/debug/index.php b/application/views/debug/index.php index 5c6640b98..c41bb3bf0 100644 --- a/application/views/debug/index.php +++ b/application/views/debug/index.php @@ -188,7 +188,7 @@

Modules

- + - + - + - + - +
curlphp-curl Installed @@ -199,7 +199,7 @@
MySQLphp-mysql Installed @@ -210,7 +210,7 @@
mbstringphp-mbstring Installed @@ -221,7 +221,7 @@
xmlphp-xml Installed @@ -232,7 +232,7 @@
zipphp-zip Installed From 4f9179f5d2703782ddf4427cf180d5236d9fb8a4 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Mon, 15 Apr 2024 13:36:51 +0200 Subject: [PATCH 07/31] formatting code --- application/views/debug/index.php | 156 +++++++++++++++--------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/application/views/debug/index.php b/application/views/debug/index.php index c41bb3bf0..cf891f0a0 100644 --- a/application/views/debug/index.php +++ b/application/views/debug/index.php @@ -245,90 +245,90 @@

Settings

- - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - + + + + + + + + + + +
max_execution_time ' . $max_execution_time . ' s'; ?> - = $max_execution_time) { ?> - - - - -
max_execution_time ' . $max_execution_time . ' s'; ?> + = $max_execution_time) { ?> + + + + +
max_upload_file_size ' . $max_upload_file_size . 'M'; ?> - = ($max_upload_file_size * 1024 * 1024)) { // compare with given value in bytes - ?> - - - - -
max_upload_file_size ' . $max_upload_file_size . 'M'; ?> + = ($max_upload_file_size * 1024 * 1024)) { // compare with given value in bytes + ?> + + + + +
post_max_size ' . $post_max_size . 'M'; ?> - = ($post_max_size * 1024 * 1024)) { // compare with given value in bytes - ?> - - - - -
post_max_size ' . $post_max_size . 'M'; ?> + = ($post_max_size * 1024 * 1024)) { // compare with given value in bytes + ?> + + + + +
memory_limit ' . $memory_limit . 'M'; ?> - = ($memory_limit * 1024 * 1024)) { // compare with given value in bytes - ?> - - - - -
allow_url_fopenOn - - On - - Off - -
memory_limit ' . $memory_limit . 'M'; ?> + = ($memory_limit * 1024 * 1024)) { // compare with given value in bytes + ?> + + + + +
allow_url_fopenOn + + On + + Off + +
From f09a45d3b3c39327404f4c86a2d179abab389f6f Mon Sep 17 00:00:00 2001 From: "Joerg (DJ7NT)" Date: Mon, 15 Apr 2024 17:12:28 +0200 Subject: [PATCH 08/31] Removed shitty image-checker --- .../workflows/accessibility-alt-text-bot.yml | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 .github/workflows/accessibility-alt-text-bot.yml diff --git a/.github/workflows/accessibility-alt-text-bot.yml b/.github/workflows/accessibility-alt-text-bot.yml deleted file mode 100644 index 999db0852..000000000 --- a/.github/workflows/accessibility-alt-text-bot.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Accessibility-alt-text-bot -on: - issues: - types: [opened, edited] - pull_request: - types: [opened, edited] - issue_comment: - types: [created, edited] - discussion: - types: [created, edited] - discussion_comment: - types: [created, edited] - -permissions: - issues: write - pull-requests: write - discussions: write - -jobs: - accessibility_alt_text_bot: - name: Check alt text is set on issue or pull requests - runs-on: ubuntu-latest - if: ${{ github.event.issue || github.event.pull_request || github.event.discussion }} - steps: - - name: Get action 'github/accessibility-alt-text-bot' - uses: github/accessibility-alt-text-bot@v1.2.0 # Set to latest \ No newline at end of file From 7137099d10c222e588fdb81cb28323b97a0704cd Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 15 Apr 2024 18:25:19 +0200 Subject: [PATCH 09/31] Upgrade API to also respond with confirmation state --- application/controllers/Api.php | 27 ++++++++++++++++++++++----- application/models/Logbook_model.php | 26 ++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/application/controllers/Api.php b/application/controllers/Api.php index ebad93112..b30de75f5 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -364,6 +364,13 @@ class API extends CI_Controller { $band = null; } + // If $obj['cnfm'] exists + if(isset($obj['cnfm'])) { + $cnfm = $obj['cnfm']; + } else { + $cnfm = null; + } + $this->load->model('logbooks_model'); if($this->logbooks_model->public_slug_exists($logbook_slug)) { @@ -388,15 +395,25 @@ class API extends CI_Controller { // Search Logbook for callsign $this->load->model('logbook_model'); - $result = $this->logbook_model->check_if_grid_worked_in_logbook($grid, $logbooks_locations_array, $band); - + $query = $this->logbook_model->check_if_grid_worked_in_logbook($grid, $logbooks_locations_array, $band, $cnfm); http_response_code(201); - if($result > 0) - { + if ($query->num_rows() == 0) { + echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Not Found']); + } else if ($cnfm == null) { echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Found']); } else { - echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Not Found']); + $arr = []; + foreach($query->result() as $line) { + $arr[] = $line->gridorcnfm; + } + if (in_array('Y', $arr)) { + print_r($arr); + echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Confirmed']); + } else { + echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Worked']); + } } + } else { // Logbook not found http_response_code(404); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index ad0626076..630875ff7 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2136,7 +2136,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = } - function check_if_grid_worked_in_logbook($grid, $StationLocationsArray = null, $band = null) { + function check_if_grid_worked_in_logbook($grid, $StationLocationsArray = null, $band = null, $cnfm = null) { if($StationLocationsArray == null) { $this->load->model('logbooks_model'); @@ -2145,7 +2145,26 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = $logbooks_locations_array = $StationLocationsArray; } - $this->db->select('COL_GRIDSQUARE'); + switch($cnfm) { + case 'qsl': + $this->db->select('COL_QSL_RCVD as gridorcnfm'); + $this->db->group_by('COL_QSL_RCVD'); + break; + case 'lotw': + $this->db->select('COL_LOTW_QSL_RCVD as gridorcnfm'); + $this->db->group_by('COL_LOTW_QSL_RCVD'); + break; + case 'eqsl': + $this->db->select('COL_EQSL_QSL_RCVD as gridorcnfm'); + $this->db->group_by('COL_EQSL_QSL_RCVD'); + break; + default: + $this->db->select('SUBSTR(COL_GRIDSQUARE,1 ,4) as gridorcnfm'); + $this->db->group_by('gridorcnfm'); + break; + break; + } + $this->db->order_by('gridorcnfm'); $this->db->where_in('station_id', $logbooks_locations_array); $this->db->group_start(); $this->db->like('COL_GRIDSQUARE', $grid); @@ -2158,11 +2177,10 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = // Where col_sat_name is not empty $this->db->where('COL_SAT_NAME !=', ''); } - $this->db->limit('2'); $query = $this->db->get($this->config->item('table_name')); - return $query->num_rows(); + return $query; } From 0a16f897a15a5dbef801a2c4bb166949a24db9b7 Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 15 Apr 2024 18:26:35 +0200 Subject: [PATCH 10/31] Delete erroneous line --- application/models/Logbook_model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 630875ff7..7654393ed 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2162,7 +2162,6 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = $this->db->select('SUBSTR(COL_GRIDSQUARE,1 ,4) as gridorcnfm'); $this->db->group_by('gridorcnfm'); break; - break; } $this->db->order_by('gridorcnfm'); $this->db->where_in('station_id', $logbooks_locations_array); From 23ebb808203505ee822c82c3c3fac61e928e7ca3 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 16 Apr 2024 01:27:32 +0200 Subject: [PATCH 11/31] Remove debug output --- application/controllers/Api.php | 1 - 1 file changed, 1 deletion(-) diff --git a/application/controllers/Api.php b/application/controllers/Api.php index b30de75f5..191fdafaa 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -407,7 +407,6 @@ class API extends CI_Controller { $arr[] = $line->gridorcnfm; } if (in_array('Y', $arr)) { - print_r($arr); echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Confirmed']); } else { echo json_encode(['gridsquare' => strtoupper($grid), 'result' => 'Worked']); From 1b00c1fd62ea3bc83f8c8bbc1d9d8823a0f3a134 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 16 Apr 2024 04:52:49 +0000 Subject: [PATCH 12/31] CI-Pipe Action --- .github/workflows/docker-image.yml | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 000000000..09b5d728b --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,32 @@ +name: Wavelog Image CI DEV + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - name: 'Login to GitHub Container Registry' + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: ghcr.io/int2001/wavelog:dev From 2fb9660b1802b335aa95e46af2a7882d1026eeaa Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 16 Apr 2024 04:53:05 +0000 Subject: [PATCH 13/31] Dockerfile --- Dockerfile | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..d64ca26b4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,52 @@ +FROM php:8.3-apache +RUN touch /usr/local/etc/php/conf.d/uploads.ini \ +&& echo "file_uploads = On" >> /usr/local/etc/php/conf.d/uploads.ini \ +&& echo "memory_limit = 256M" >> /usr/local/etc/php/conf.d/uploads.ini \ +&& echo "upload_max_filesize = 64M" >> /usr/local/etc/php/conf.d/uploads.ini \ +&& echo "post_max_size = 64M" >> /usr/local/etc/php/conf.d/uploads.ini \ +&& echo "max_execution_time = 600" >> /usr/local/etc/php/conf.d/uploads.ini +RUN apt-get update \ +&& apt-get install -y curl libxml2-dev libonig-dev libzip-dev cron \ +&& docker-php-ext-install mysqli mbstring xml zip +RUN a2enmod rewrite + +WORKDIR /var/www/html +RUN curl -L https://api.github.com/repos/wavelog/wavelog/tarball/dev | tar -xz --strip=1 +RUN chown -R www-data:www-data /var/www/html + +RUN mkdir ./userdata +RUN mkdir ./application/config/docker +RUN mv ./.htaccess.sample ./.htaccess +RUN echo "Setting www-data as owner of the html folder" \ +&& chown -R www-data:www-data /var/www/html +RUN echo "Setting permissions to the install folder" \ +&& cd /var/www/html \ +&& chmod -R g+rw ./application/config/ \ +&& chmod -R g+rw ./application/logs/ \ +&& chmod -R g+rw ./assets/qslcard/ \ +&& chmod -R g+rw ./backup/ \ +&& chmod -R g+rw ./updates/ \ +&& chmod -R g+rw ./uploads/ \ +&& chmod -R g+rw ./userdata/ \ +&& chmod -R g+rw ./images/eqsl_card_images/ \ +&& chmod -R g+rw ./assets/ \ +&& chmod -R g+rw ./application/config/docker/ \ +&& chmod -R 777 /var/www/html/install +RUN echo "Installing cronjobs" \ +RUN touch /etc/crontab && \ + echo "0 */12 * * * curl --silent http://localhost/clublog/upload &>/dev/null" >> /etc/crontab && \ + echo "10 */12 * * * curl --silent http://localhost/eqsl/sync &>/dev/null" >> /etc/crontab && \ + echo "20 */12 * * * curl --silent http://localhost/qrz/upload &>/dev/null" >> /etc/crontab && \ + echo "30 */12 * * * curl --silent http://localhost/qrz/download &>/dev/null" >> /etc/crontab && \ + echo "40 */12 * * * curl --silent http://localhost/hrdlog/upload &>/dev/null" >> /etc/crontab && \ + echo "0 1 * * * curl --silent http://localhost/lotw/lotw_upload &>/dev/null" >> /etc/crontab && \ + echo "10 1 * * * curl --silent http://localhost/update/lotw_users &>/dev/null" >> /etc/crontab && \ + echo "20 1 * * 1 curl --silent http://localhost/update/update_clublog_scp &>/dev/null" >> /etc/crontab && \ + echo "0 2 1 */1 * curl --silent http://localhost/update/update_sota &>/dev/null" >> /etc/crontab && \ + echo "10 2 1 */1 * curl --silent http://localhost/update/update_wwff &>/dev/null" >> /etc/crontab && \ + echo "20 2 1 */1 * curl --silent http://localhost/update/update_pota &>/dev/null" >> /etc/crontab && \ + echo "0 3 1 */1 * curl --silent http://localhost/update/update_dok &>/dev/null" >> /etc/crontab +RUN chmod 0644 /etc/crontab +RUN crontab Date: Tue, 16 Apr 2024 07:02:58 +0200 Subject: [PATCH 14/31] Update docker-image.yml --- .github/workflows/docker-image.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 09b5d728b..9c0b537a3 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,5 +1,7 @@ name: Wavelog Image CI DEV +on: workflow_dispatch + jobs: build: runs-on: ubuntu-latest From f64a4e314b54ac731f8a288273e65ee25db83695 Mon Sep 17 00:00:00 2001 From: "Joerg (DJ7NT)" Date: Tue, 16 Apr 2024 07:08:43 +0200 Subject: [PATCH 15/31] Update docker-image.yml --- .github/workflows/docker-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9c0b537a3..27e5ca3d6 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,6 +1,7 @@ name: Wavelog Image CI DEV -on: workflow_dispatch +on: + workflow_dispatch: jobs: build: From ba8ba50a39e2e45d4e52297634dd060154298607 Mon Sep 17 00:00:00 2001 From: "Joerg (DJ7NT)" Date: Tue, 16 Apr 2024 07:25:26 +0200 Subject: [PATCH 16/31] Update docker-image.yml --- .github/workflows/docker-image.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 27e5ca3d6..622c2c1a7 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,7 +1,9 @@ name: Wavelog Image CI DEV -on: - workflow_dispatch: +on: + push: + branches: + - 'CI_Pipe' jobs: build: From a671b94e6d923ef8ff29e32102c5ba095927cea8 Mon Sep 17 00:00:00 2001 From: "Joerg (DJ7NT)" Date: Tue, 16 Apr 2024 07:29:48 +0200 Subject: [PATCH 17/31] Update docker-image.yml --- .github/workflows/docker-image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 622c2c1a7..891aef093 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -4,6 +4,7 @@ on: push: branches: - 'CI_Pipe' + workflow_dispatch: jobs: build: From 0a86138d7b8d228101cc9230dc30db2eb16c403e Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 16 Apr 2024 07:47:51 +0200 Subject: [PATCH 18/31] Fix gridchecker to be compliant with recent changes --- application/views/components/hamsat/table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/components/hamsat/table.php b/application/views/components/hamsat/table.php index 8238d644a..cc20e3094 100644 --- a/application/views/components/hamsat/table.php +++ b/application/views/components/hamsat/table.php @@ -107,7 +107,7 @@ // Load the logbook model and call check_if_grid_worked_in_logbook foreach ($rove['grids'] as $grid) { $worked = $CI->logbook_model->check_if_grid_worked_in_logbook($grid, null, "SAT"); - if ($worked != 0) { + if ($worked->num_rows() != 0) { echo " " . $grid . ""; } else { echo " " . $grid . ""; From f120b7cbf2638722da66af0c3c88eb6172f2656c Mon Sep 17 00:00:00 2001 From: "Joerg (DJ7NT)" Date: Tue, 16 Apr 2024 08:11:24 +0200 Subject: [PATCH 19/31] User Branch as Tag (with master-rule) --- .github/workflows/docker-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 891aef093..009562f39 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -33,6 +33,6 @@ jobs: uses: docker/build-push-action@v5 with: context: . - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true - tags: ghcr.io/int2001/wavelog:dev + tags: ghcr.io/int2001/wavelog:${{ github.ref_name == 'master' && 'latest' || github.ref_name }} From 388d4bfafa3b5e8a8282c370be4ead7a956ce8ca Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 16 Apr 2024 06:15:59 +0000 Subject: [PATCH 20/31] Preset ENV to docker for dockerfile --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index d64ca26b4..7600bd91d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update \ && apt-get install -y curl libxml2-dev libonig-dev libzip-dev cron \ && docker-php-ext-install mysqli mbstring xml zip RUN a2enmod rewrite +ENV CI_ENV=docker WORKDIR /var/www/html RUN curl -L https://api.github.com/repos/wavelog/wavelog/tarball/dev | tar -xz --strip=1 From 5233bcbf21c6c8fb703379a918a5e1caff3c5e4a Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 16 Apr 2024 06:37:54 +0000 Subject: [PATCH 21/31] Build from tree instead of refetching everything --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7600bd91d..4954815e7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,8 @@ RUN apt-get update \ RUN a2enmod rewrite ENV CI_ENV=docker +COPY ./ /var/www/html/ WORKDIR /var/www/html -RUN curl -L https://api.github.com/repos/wavelog/wavelog/tarball/dev | tar -xz --strip=1 RUN chown -R www-data:www-data /var/www/html RUN mkdir ./userdata From 78c86beddb6519ecfcba4065dc564ada3853bb64 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 16 Apr 2024 08:41:57 +0200 Subject: [PATCH 22/31] fix internal function calls to check grids function --- application/controllers/Logbook.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 74be8f53a..5215ac583 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -855,7 +855,7 @@ class Logbook extends CI_Controller { } if (isset($data['callsign']['gridsquare'])) { $this->load->model('logbook_model'); - $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')); + $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(); } if (isset($callsign['callsign']['dxcc'])) { $this->load->model('logbook_model'); @@ -879,7 +879,7 @@ class Logbook extends CI_Controller { if (isset($callsign['callsign']['gridsquare'])) { $this->load->model('logbook_model'); - $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')); + $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'))->num_rows(); } if (isset($callsign['callsign']['error'])) { $callsign['error'] = $callsign['callsign']['error']; @@ -935,7 +935,7 @@ class Logbook extends CI_Controller { $data['callsign'] = $this->qrz->search($id, $this->session->userdata('qrz_session_key'), $this->config->item('use_fullname')); if (isset($data['callsign']['gridsquare'])) { - $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')); + $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(); } if (isset($data['callsign']['dxcc'])) { $entity = $this->logbook_model->get_entity($data['callsign']['dxcc']); @@ -962,7 +962,7 @@ class Logbook extends CI_Controller { $data['callsign'] = $this->hamqth->search($id, $this->session->userdata('hamqth_session_key')); } if (isset($data['callsign']['gridsquare'])) { - $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')); + $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(); } if (isset($data['callsign']['dxcc'])) { $entity = $this->logbook_model->get_entity($data['callsign']['dxcc']); From 2878ee41665cdc68e1e3dd9eb9f1cb45a1b63e21 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 16 Apr 2024 07:10:47 +0000 Subject: [PATCH 23/31] Added dockerignore --- .dockerignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..4588567e0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +Dockerfile +.git +.github From d6b536c35675b5164615b4222bc0eea7204d0ab5 Mon Sep 17 00:00:00 2001 From: int2001 Date: Tue, 16 Apr 2024 07:11:50 +0000 Subject: [PATCH 24/31] Trigger on master-push --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 009562f39..47305c212 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -3,7 +3,7 @@ name: Wavelog Image CI DEV on: push: branches: - - 'CI_Pipe' + - 'master' workflow_dispatch: jobs: From 5c9287f68d7309a1f34a08db56f6ecf3665f91b7 Mon Sep 17 00:00:00 2001 From: "Joerg (DJ7NT)" Date: Tue, 16 Apr 2024 09:50:10 +0200 Subject: [PATCH 25/31] Produce new x-image on new release (or on demand) --- .github/workflows/docker-image.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 47305c212..6e69f0aab 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,9 +1,8 @@ -name: Wavelog Image CI DEV +name: Wavelog create Dockerimage and publish it on: - push: - branches: - - 'master' + release: + types: [published] workflow_dispatch: jobs: @@ -35,4 +34,4 @@ jobs: context: . platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true - tags: ghcr.io/int2001/wavelog:${{ github.ref_name == 'master' && 'latest' || github.ref_name }} + tags: ghcr.io/wavelog/wavelog:${{ github.ref_name == 'master' && 'latest' || github.ref_name }} From 738c36a06527c1bfb7daee71a60c713755977ba1 Mon Sep 17 00:00:00 2001 From: "Joerg (DJ7NT)" Date: Tue, 16 Apr 2024 10:11:43 +0200 Subject: [PATCH 26/31] Trigger once to register --- .github/workflows/docker-image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 6e69f0aab..16c24f5fe 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,6 +1,9 @@ name: Wavelog create Dockerimage and publish it on: + push: + branches: + - 'dev' release: types: [published] workflow_dispatch: From 1bc6ea394500786f5d414099b3d07fba48237e4b Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 16 Apr 2024 10:14:09 +0200 Subject: [PATCH 27/31] Remove debug statement --- application/models/Satellite_model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/application/models/Satellite_model.php b/application/models/Satellite_model.php index dced7a992..7f0c4f770 100644 --- a/application/models/Satellite_model.php +++ b/application/models/Satellite_model.php @@ -99,7 +99,6 @@ class Satellite_model extends CI_Model { $this->db->select('satellite.name AS satellite, satellitemode.name AS satmode, satellitemode.uplink_mode AS Uplink_Mode, satellitemode.uplink_freq AS Uplink_Freq, satellitemode.downlink_mode AS Downlink_Mode, satellitemode.downlink_freq AS Downlink_Freq'); $this->db->join('satellitemode', 'satellite.id = satellitemode.satelliteid', 'LEFT OUTER'); $query = $this->db->get('satellite'); - log_message('debug', 'SQL: '.$this->db->last_query()); return $query->result(); } From 1c83944346e3912aff370a266f9514fdbf78ea84 Mon Sep 17 00:00:00 2001 From: "Joerg (DJ7NT)" Date: Tue, 16 Apr 2024 10:17:50 +0200 Subject: [PATCH 28/31] Removed pushtrigger for dev --- .github/workflows/docker-image.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 16c24f5fe..6e69f0aab 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,9 +1,6 @@ name: Wavelog create Dockerimage and publish it on: - push: - branches: - - 'dev' release: types: [published] workflow_dispatch: From d6255bface34a28fed457f74280f5eabda54d4e5 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 16 Apr 2024 10:23:39 +0200 Subject: [PATCH 29/31] Use current band to check if grid worked --- application/controllers/Logbook.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 5215ac583..8e55a95b0 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -134,7 +134,7 @@ class Logbook extends CI_Controller { $lookupcall=$this->get_plaincall($callsign); - $return['partial'] = $this->partial($lookupcall); + $return['partial'] = $this->partial($lookupcall, $band); $callbook = $this->logbook_model->loadCallBook($callsign, $this->config->item('use_fullname')); @@ -625,7 +625,7 @@ class Logbook extends CI_Controller { $this->load->view('interface_assets/footer'); } - function partial($id) { + function partial($id, $band = null) { $this->load->model('user_model'); if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; } @@ -879,7 +879,7 @@ class Logbook extends CI_Controller { if (isset($callsign['callsign']['gridsquare'])) { $this->load->model('logbook_model'); - $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'))->num_rows(); + $callsign['grid_worked'] = $this->logbook_model->check_if_grid_worked_in_logbook(strtoupper(substr($callsign['callsign']['gridsquare'],0,4)), 0, $band)->num_rows(); } if (isset($callsign['callsign']['error'])) { $callsign['error'] = $callsign['callsign']['error']; From cc1700d0596859edcbb87a698f27feb058ffd1a8 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 16 Apr 2024 11:40:34 +0200 Subject: [PATCH 30/31] Get rid of type variable and set band = SAT if needed --- application/controllers/Logbook.php | 15 +++++++-------- assets/js/sections/contesting.js | 2 +- assets/js/sections/qso.js | 9 +++------ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 8e55a95b0..920d15839 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -84,11 +84,10 @@ class Logbook extends CI_Controller { echo json_encode($return, JSON_PRETTY_PRINT); } - function json($tempcallsign, $temptype, $tempband, $tempmode, $tempstation_id = null) { + function json($tempcallsign, $tempband, $tempmode, $tempstation_id = null) { session_write_close(); // Cleaning for security purposes $callsign = $this->security->xss_clean($tempcallsign); - $type = $this->security->xss_clean($temptype); $band = $this->security->xss_clean($tempband); $mode = $this->security->xss_clean($tempmode); $station_id = $this->security->xss_clean($tempstation_id); @@ -152,8 +151,8 @@ class Logbook extends CI_Controller { $return['qsl_manager'] = $this->nval($callbook['qslmgr'] ?? '', $this->logbook_model->call_qslvia($callsign)); $return['callsign_state'] = $this->nval($callbook['state'] ?? '', $this->logbook_model->call_state($callsign)); $return['callsign_us_county'] = $this->nval($callbook['us_county'] ?? '', $this->logbook_model->call_us_county($callsign)); - $return['workedBefore'] = $this->worked_grid_before($return['callsign_qra'], $type, $band, $mode); - $return['confirmed'] = $this->confirmed_grid_before($return['callsign_qra'], $type, $band, $mode); + $return['workedBefore'] = $this->worked_grid_before($return['callsign_qra'], $band, $mode); + $return['confirmed'] = $this->confirmed_grid_before($return['callsign_qra'], $band, $mode); $return['timesWorked'] = $this->logbook_model->times_worked($lookupcall); if ($this->session->userdata('user_show_profile_image')) { @@ -201,7 +200,7 @@ class Logbook extends CI_Controller { return (($val2 ?? "") === "" ? ($val1 ?? "") : ($val2 ?? "")); } - function confirmed_grid_before($gridsquare, $type, $band, $mode) { + function confirmed_grid_before($gridsquare, $band, $mode) { if (strlen($gridsquare) < 4) return false; @@ -235,7 +234,7 @@ class Logbook extends CI_Controller { } - if($type == "SAT") { + if($band == "SAT") { $this->db->where('COL_PROP_MODE', 'SAT'); if ($extrawhere != '') { $this->db->where('('.$extrawhere.')'); @@ -270,7 +269,7 @@ class Logbook extends CI_Controller { return false; } - function worked_grid_before($gridsquare, $type, $band, $mode) + function worked_grid_before($gridsquare, $band, $mode) { if (strlen($gridsquare) < 4) return false; @@ -279,7 +278,7 @@ class Logbook extends CI_Controller { $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); if(!empty($logbooks_locations_array)) { - if($type == "SAT") { + if($band == "SAT") { $this->db->where('COL_PROP_MODE', 'SAT'); } else { $this->db->where('COL_MODE', $this->logbook_model->get_main_mode_from_mode($mode)); diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index acab7338e..60e3376a3 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -300,7 +300,7 @@ $("#callsign").keyup(async function (e) { async function getCallbook() { var call = $("#callsign").val(); if (call.length >= 3) { - $.getJSON(base_url + 'index.php/logbook/json/' + call + '/0/'+$("#band").val()+'/'+$("#band").val() + '/' + current_active_location, function(result) { + $.getJSON(base_url + 'index.php/logbook/json/' + call + '/'+$("#band").val()+'/'+$("#band").val() + '/' + current_active_location, function(result) { try { $('#bearing_info').html(result.bearing); } catch {} diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 8abdcdf03..a5e166cb6 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -752,14 +752,11 @@ $( document ).ready(function() { $('.callsign-suggest').hide(); if($("#sat_name").val() != ""){ - var sat_type = "SAT"; - var json_band = "0"; - var json_mode = "0"; + var json_band = "SAT"; } else { - var sat_type = "0"; var json_band = $("#band").val(); - var json_mode = $("#mode").val(); } + var json_mode = $("#mode").val(); var find_callsign = $(this).val().toUpperCase(); var callsign = find_callsign; @@ -768,7 +765,7 @@ $( document ).ready(function() { find_callsign=find_callsign.replace('Ø', '0'); // Replace / in a callsign with - to stop urls breaking - $.getJSON(base_url + 'index.php/logbook/json/' + find_callsign + '/' + sat_type + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val(), async function(result) + $.getJSON(base_url + 'index.php/logbook/json/' + find_callsign + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val(), async function(result) { // Make sure the typed callsign and json result match From 188e0121ede0a23897198654d6d366dba84ef2e9 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 16 Apr 2024 13:21:30 +0200 Subject: [PATCH 31/31] Add tag migration 1.5.2 --- application/config/migration.php | 2 +- application/migrations/194_tag_1_5_2.php | 36 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 application/migrations/194_tag_1_5_2.php diff --git a/application/config/migration.php b/application/config/migration.php index 04d4b909f..0491cbfd4 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 193; +$config['migration_version'] = 194; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/194_tag_1_5_2.php b/application/migrations/194_tag_1_5_2.php new file mode 100644 index 000000000..87074667a --- /dev/null +++ b/application/migrations/194_tag_1_5_2.php @@ -0,0 +1,36 @@ +db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '1.5.2')); + + // Trigger Version Info Dialog + $this->db->where('option_type', 'version_dialog'); + $this->db->where('option_name', 'confirmed'); + $this->db->update('user_options', array('option_value' => 'false')); + + // Also set Version Dialog to "both" if only custom text is applied + $this->db->where('option_name', 'version_dialog'); + $this->db->where('option_value', 'custom_text'); + $this->db->update('options', array('option_value' => 'both')); + + + } + + public function down() + { + $this->db->where('option_name', 'version'); + $this->db->update('options', array('option_value' => '1.5.1')); + } +}