Skip to content

Commit

Permalink
Merge pull request #805 from neontribe/develop
Browse files Browse the repository at this point in the history
release v1.17.0
  • Loading branch information
charlesstrange2 authored Jan 22, 2025
2 parents d125d99 + 297e086 commit ba7340d
Show file tree
Hide file tree
Showing 245 changed files with 9,303 additions and 8,410 deletions.
16 changes: 11 additions & 5 deletions .docker/passport-install.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
<?php

if (! is_writeable("/opt/project/.env")) {
$projectHome = "/opt/project";

if (count($argv) > 1) {
// The first param is the project hme
$projectHome = $argv[1];
}

if (! is_writeable($projectHome . "/.env")) {
echo "Can't write to .env file\n";
exit(1);
}

$contents = file_get_contents("/opt/project/.env");
$contents = file_get_contents($projectHome . "/.env");
if (getenv("APP_ENV") == "prod" && strpos($contents, "PASSWORD_CLIENT_SECRET")) {
echo "PASSWORD_CLIENT_SECRET exists and env is production, not overwriting\n";
exit(0);
}

$lines = explode("\n", $contents);
$cleaned = [];
print_r($lines);
foreach ($lines as $line) {
if (!strpos($line, "PASSWORD_CLIENT") || !strpos($line, "PASSWORD_CLIENT_SECRET")) {
$cleaned[] = $line;
Expand All @@ -35,6 +41,6 @@
$cleaned[] = "PASSWORD_CLIENT_SECRET=" . $elements[2];
}
}
exec("chmod 600 /opt/project/storage/*.key");
exec("chmod 600 " . $projectHome . "/storage/*.key");

file_put_contents("/opt/project/.env", implode("\n", $lines + $cleaned));
file_put_contents($projectHome . "/.env", implode("\n", $lines + $cleaned));
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ DB_TESTING_MYSQL_USERNAME=homestead
DB_TESTING_MYSQL_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
CACHE_STORE=file
SESSION_DRIVER=file
QUEUE_DRIVER=database
QUEUE_CONNECTION=database

# Set this to true for production envs
SESSION_SECURE_COOKIE=false
Expand Down
34 changes: 34 additions & 0 deletions .env.ghactions
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
APP_DEBUG="true"
APP_ENV="local"
APP_KEY=
APP_LOG_LEVEL="debug"
APP_NAME="ARCVService"
APP_SEEDS="Dev"
APP_TIMEZONE="Europe/London"
APP_URL="http://0.0.0.0:8000"
APP_VER="1.9.0"
ARC_MARKET_URL="http://localhost:8081/"
ARC_SCHOOL_MONTH="9"
ARC_SERVICE_DOMAIN="arcv-service.test"
ARC_STORE_DOMAIN="arcv-store.test"
BROADCAST_DRIVER="log"
CACHE_STORE="file"
DB_CONNECTION="sqlite"
DB_DATABASE="/tmp/data.db"
MAIL_MAILER="log"
MAIL_ENCRYPTION="null"
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="Mailer Name"
MAIL_HOST="127.0.0.1"
MAIL_PASSWORD="null"
MAIL_PORT="1025"
MAIL_TO_ADMIN_ADDRESS="[email protected]"
MAIL_TO_ADMIN_NAME="Buck Rogers"
MAIL_TO_DEVELOPER_NAME="User Support"
MAIL_TO_DEVELOPER_TEAM="[email protected]"
MAIL_USERNAME="null"
PASSWORD_CLIENT=1
PASSWORD_CLIENT_SECRET=0
QUEUE_CONNECTION="sync"
SESSION_DRIVER="file"
SESSION_SECURE_COOKIE="false"
37 changes: 0 additions & 37 deletions .env.travis

This file was deleted.

16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://mglaman.dev/blog/my-dependabot-configuration-drupal-and-other-php-projects
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
commit-message:
prefix: chore

- package-ecosystem: composer
directory: /
schedule:
interval: weekly
commit-message:
prefix: chore
51 changes: 31 additions & 20 deletions .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,46 @@ name: Laravel

on:
workflow_dispatch:
# push:
# branches: [ "1.16/release" ]
# pull_request:
# branches: [ "1.16/release" ]
push:
# pull_request:
# branches: [ "1.16/release" ]

jobs:
laravel-tests:

test:
runs-on: ubuntu-latest

steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.0'
- uses: actions/checkout@v3

- uses: actions/checkout@v4

- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
run: php -r "file_exists('.env') || copy('.env.ghactions', '.env');"

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Create DB
run: |
touch /tmp/data.db
php artisan migrate
- name: Generate key
run: php artisan key:generate

- name: Passport install
run: php .docker/passport-install.php .

- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database

- name: Key Permissions
run: chmod 600 ./storage/*.key

- name: Run tests
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: vendor/bin/phpunit
PHPUNIT_SKIP_MYSQL_TEST=1 XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-xml target/coverage
- name: Check coverage
run: |
php artisan arc:test:coverage target/coverage/index.xml
# gh act -j test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ coverage
.php-cs-fixer.cache
*.swp
app/local
.env.local
arc_test_file_*
build
1 change: 0 additions & 1 deletion .husky/commit-msg

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
stable
20.11.1
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ ENV DB_PASSWORD=secret
ENV BROADCAST_DRIVER=log
ENV CACHE_DRIVER=file
ENV SESSION_DRIVER=file
ENV QUEUE_DRIVER=database
ENV QUEUE_CONNECTION=database
ENV SESSION_SECURE_COOKIE=false
ENV MAIL_MAILER=log
ENV MAIL_HOST=smtp.mailtrap.io
Expand Down
Loading

0 comments on commit ba7340d

Please sign in to comment.