Skip to content

Commit

Permalink
Tag 2.6.11
Browse files Browse the repository at this point in the history
  • Loading branch information
magicbug committed May 5, 2024
2 parents edb89a5 + dfae30b commit 03810ef
Show file tree
Hide file tree
Showing 47 changed files with 3,173 additions and 763 deletions.
9 changes: 9 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MYSQL_ROOT_PASSWORD=rootpassword
MYSQL_DATABASE=cloudlog
MYSQL_USER=cloudlog
MYSQL_PASSWORD=cloudlogpassword
MYSQL_HOST=db
MYSQL_PORT=3306
BASE_LOCATOR=IO91WM
WEBSITE_URL=http://localhost
DIRECTORY=/var/www/html
45 changes: 45 additions & 0 deletions .github/workflows/cypress-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Cypress Tests
on: [pull_request]
jobs:
cypress-e2e-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache Cypress
uses: actions/cache@v2
with:
path: ~/.cache/Cypress
key: cypress-${{ hashFiles('package-lock.json') }}
restore-keys: |
cypress-
- name: Install Cypress
run: npm install cypress

- name: Cache .env
uses: actions/cache@v2
with:
path: .env
key: .env-${{ hashFiles('.env.sample') }}
restore-keys: |
.env-
- name: Setup .env
run: |
if [ ! -f .env ]; then
cp .env.sample .env
fi
- name: Build Docker services
run: docker-compose up -d

- name: Wait for services to start
run: sleep 5

- name: Populate dxcc_entities table
run: curl "http://localhost/index.php/update/dxcc"

- name: Run Cypress tests
run: npx cypress run
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
/assets/qslcard/*
/assets/sstvimages/*
/assets/js/sections/custom.js
/cypress/screenshots
/node_modules/
.idea/*
.DS_Store
sync.sh
Expand Down
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use the official image for PHP and Apache
FROM php:7.4-apache

# Set the working directory to /var/www/html
WORKDIR /var/www/html

# Install system dependencies, including git and libxml2
RUN apt-get update && apt-get install -y \
libcurl4-openssl-dev \
libxml2-dev \
libzip-dev \
zlib1g-dev \
libpng-dev \
libonig-dev \
default-mysql-client \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install gd \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install zip \
&& docker-php-ext-install xml \
&& a2enmod rewrite

# Expose port 80
EXPOSE 80
8 changes: 8 additions & 0 deletions Dockerfile-db
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Dockerfile-db
FROM mariadb:latest

# Add the install.sql file to the docker image
ADD install/assets/install.sql /docker-entrypoint-initdb.d

# Expose port 3306
EXPOSE 3306
89 changes: 82 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,99 @@ Core Contributors: 2M0SQL ([@magicbug](https://github.com/magicbug)), LA8AJA ([@
Website: [http://www.cloudlog.co.uk](http://www.cloudlog.co.uk)

## Requirements
* Linux based Operating System
* Apache (Nginx should work)
* PHP Version 7.4 (PHP 8.2 works)
* MySQL (MySQL 5.7 or higher)

- Linux based Operating System
- Apache (Nginx should work)
- PHP Version 7.4 (PHP 8.2 works)
- MySQL (MySQL 5.7 or higher)

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.

- 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.

## Setup

Installation information can be found on the [wiki](https://github.com/magicbug/Cloudlog/wiki).

# Docker Development Environment

This guide provides instructions for setting up a local development environment using Docker and Docker Compose. Please note that this setup is not recommended for production use.

## Prerequisites

Before you begin, you need to install Docker and Docker Compose. You can download them using the following links:

- [Docker](https://docs.docker.com/get-docker/)
- [Docker Compose](https://docs.docker.com/compose/install/)

## Configuration

1. Copy the `.env.sample` file to `.env`:

```bash
cp .env.sample .env
```

2. Open the `.env` file and update the values to match your setup. The values from the `.env` file will be used to populate the database connection details on the install page. You should not need to change these unless your setup requires different values.

**Note:** Docker Compose creates a network for your application, and each service (container) in the Docker Compose file can reach each other via the service name. This is why the `DB_HOST` value in the `.env` file and on the install page should match the service name of the database in the `docker-compose.yml` file. For example, if the database service in `docker-compose.yml` is defined as `db`, then `DB_HOST` should be set as 'db'. This allows the application to communicate with the database service on its internal docker network.

## Starting the Development Environment

To start the development environment, run the following command in your terminal:

```bash
docker-compose up
```

# Running Cypress Tests Locally

Follow these steps to run the Cypress tests locally on your machine:

1. **Clone the repository**

If you haven't already, clone the repository to your local machine

2. **Setup .env file**

Copy the sample `.env` file and adjust it to your local environment:

```bash
cd your-repo
cp .env.sample .env
```

3. **Build Docker services**

Build and start the Docker services:

```bash
docker-compose up -d
```

4. **Install Cypress**

Navigate into the project directory and install Cypress:

```bash
npm install cypress
```

5. **Run the Cypress tests**

After the installation is complete, you can run the Cypress tests:

```bash
npx cypress run
```

## Support

Cloudlog has two support systems for code issues use Github issues, however if you have general issues with setting up your server please use our general discussion forum [https://github.com/magicbug/Cloudlog/discussions](https://github.com/magicbug/Cloudlog/discussions).

## Security Vulnerabilities

If you discover a security vulnerability within Cloudlog, please send an e-mail to Peter Goodhall, 2M0SQL via [peter@magicbug.co.uk](mailto:peter@magicbug.co.uk). All security vulnerabilities will be promptly addressed.

## Want Cloudlog Hosting?
Expand All @@ -53,4 +128,4 @@ Cloudlog is supported by Patreon and donations via PayPal, thanks to the followi

Paul (M0TZO), Tim (G4VXE), Paul (N8HM), Michelle (W5NYV), Mitchell (AD0HJ), Dan (M0TCB), Martin (DK3ML), Juan Carlos (EA5WA), Iain (M0PCB), Charlie (GM1TGY), Ondrej (OK1CDJ), Trystan (G0KAY), Oliver (DL6KBG), Volkmar Schirmer, Jordan (M0PIR), Thomas Ziegler, Mathis (DB9MAT), Ken (VE3HLS), Tyler (WL7T), Jeremy Taylor, Ben Kuhn, Eric Thresher, Michael Cullen, Juuso (OH1JW), Anthony Castiglia, Fernando Ramirez-Ferrer, Robert Dixon, Mark Percival, Julia (KV1V), Timo Tomasini, Ant (NU1U), Christopher Williams, Danny Barnes, Vic, Tom (M0LTE), smurphboy, Lars (SM0TGU), Theo (PD9DP), Stefan (SM0RGM). Peter (G0ABI), Lou (KI5FTY), Michael (DG3NAB), Dragan (4O4A), minorsecond, Emily (W7AYQ), Steve (M0SKM), Rob (M0VFC), Doug (WA6L), Petr (OK1PKR), Fabian (HB9HIL), Daniel (OK2VLK), John (M5JFS).

If you'd like to donate to Cloudlog to help allow @magicbug spend less time doing commercial work and more time coding Cloudlog then you can donate via [PayPal](https://paypal.me/PGoodhall), [Github Sponsor](https://github.com/sponsors/magicbug) or become a [Patreon](https://www.patreon.com/2m0sql)
If you'd like to donate to Cloudlog to help allow @magicbug spend less time doing commercial work and more time coding Cloudlog then you can donate via [PayPal](https://paypal.me/PGoodhall), [Github Sponsor](https://github.com/sponsors/magicbug) or become a [Patreon](https://www.patreon.com/2m0sql)
2 changes: 1 addition & 1 deletion application/config/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
|
*/

$config['migration_version'] = 179;
$config['migration_version'] = 181;

/*
|--------------------------------------------------------------------------
Expand Down
23 changes: 23 additions & 0 deletions application/controllers/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,29 @@ function auth($key) {
}
}

function check_auth($key) {
$this->load->model('api_model');
header("Content-type: text/xml");
if($this->api_model->access($key) == "No Key Found" || $this->api_model->access($key) == "Key Disabled") {
// set the content type as json
header("Content-type: application/json");

// set the http response code to 401
http_response_code(401);

// return the json with the status as failed
echo json_encode(['status' => 'failed', 'reason' => "missing or invalid api key"]);
} else {
// set the content type as json
header("Content-type: application/json");

// set the http response code to 200
http_response_code(200);
// return the json
echo json_encode(['status' => 'valid', 'rights' => $this->api_model->access($key)]);
}
}

function station_info($key) {
$this->load->model('api_model');
$this->load->model('stations');
Expand Down

0 comments on commit 03810ef

Please sign in to comment.