Sentinel EPRO

System Information

PHP Version: 8.0 Node Version: 16.20.2 Laravel Version: 8.X

Main Development AS400

Development URL: http://164.39.2.139:10011/ Server Path: /www/ADC8/htdocs/epro2/ branch: develop

Custom Development AS400 ( Malak's Work )

Development URL: http://164.39.2.139:10008/login Server Path: /www/epro/htdocs/epro2 branch: master

Git Branch Structure

  1. MPBA Server /develop
  2. MediaDev /stage
  3. MediaUat /qa
  4. Production /master

Other possible branch names are: production main staging *** it is to developers to adopt these as needed.

The Application does not currently use redis nor memcached and has no reliance upon these caching servers.

Important files

There are few important files that change from host to host, these are contained in the provision directory and should be kept upto date with their respective target hosts the Keepass file will contain urls and credentials for the various hosts systems.

Local Development

There are several alternatives when it comes to local development of web application development, One can use vagrant, Laravel Valet or MAMP LAMP etc,one of the best development systems is docker, this builds containers for the various components and is available on all major platforms.

The first thing to do on your development machine is to install docker and docker desktop along with support for docker composer.

Image Storage

When running docker the php artisan storage:link does not resolve to the correct path to overcome this issue do a docker ps and find the container ID

CONTAINER ID   IMAGE             COMMAND             CREATED        STATUS          PORTS                                                                                    NAMES
1dd8f887cebb   sail-8.1/app      "start-container"   19 hours ago   Up 15 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:5173->5173/tcp, :::5173->5173/tcp, 8000/tcp   epro2-sentinal-1
4d60252a7927   mailhog/mailhog   "MailHog"           3 days ago     Up 15 minutes   0.0.0.0:1025->1025/tcp, :::1025->1025/tcp, 0.0.0.0:8025->8025/tcp, :::8025->8025/tcp     mailhog

these execute

docker exec -it   1dd8f887cebb  /bin/sh

navigate to public and remove the storage link, then execute ln -s ../storage/app/public storage

this will link the storage folder correctly and do not run storage link as this wil use the UPLOAD_DIR flag from the .env file that will contain the an incorrect path

On AS400 hosts this is normally /tmp/quotations and storage link does work properly

SSL Self Signed Certificates

to import your local self signed certs into chrome got to settings then setting privacy and security then Authorities click import and navigate to the .valet directory then CA then import .valet/CA/LaravelValetCASelfSigned.pem accepting all the options and then restart chrome, you local site is now using SSL.

Introduction

Laravel Sail is a light-weight command-line interface for interacting with Laravel's default Docker development environment. Sail provides a great starting point for building a Laravel application using PHP, MySQL, and Redis without requiring prior Docker experience. You can also use laravel valet ( see below)

At its heart, Sail is the docker-compose.yml file and the sail script that is stored at the root of your project. The sail script provides a CLI with convenient methods for interacting with the Docker containers defined by the docker-compose.yml file.

Laravel Sail is supported on macOS, Linux, and Windows (via WSL2).

Initial Installation

Laravel Sail is automatically installed with all new Laravel applications so you may start using it immediately. To learn how to create a new Laravel application, please consult Laravel's installation documentation for your operating system. During installation, you will be asked to choose which Sail supported services your application will be interacting with.

To install Laravel sail use composer require --dev laravel\sail

The documentation is available at https://laravel.com/docs/10.x/sail

Docker Notes

Some important docker commands are as follows:

NB when running these commands ensure that you have no running instances for example executing sail down.

docker system prune -a This command will remove the build containers and any downloaded containers, this is useful for saving disk space

docker volume rm $(docker volume ls -q) Used to delete any of the volumes created, this is where the database is stored etc again great for cleaning up and saving disk space.

sail build --no-cache this is perfect for rebuilding your containers

Linux ODBC Installs

The ODBC drivers for linux can present a challenge and its important to install IBM Client Access for Linux, this includes the CLI drivers for many linux distributions The database.php in the config directory is the place to set the drivers and the DSN one also add a specific config file if needed.

We have set credentials in the env file to suite, typically to aid switching between databases we recommend using the same db credentials as 192.168.0.81 ( MPBA AS400 Host)

'odbc_local' => [ 'driver' => 'odbc', 'odbc_driver' => '/opt/ibm/iaccess/lib64/libcwbodbc.so', 'host' => env('DB_HOST', 'localhost'), 'database' => env('DB_DATABASE'), 'username' => env('DB_USERNAME'), 'password' => env('DB_PASSWORD'), 'dsn' => 'Driver={IBM i Access ODBC Driver 64-bit};System=192.168.0.81;AlwaysCalculateResultLength=1;CCSID=1208;NAM=1;DBQ=,'.env('DBQ'), 'options' => [ PDO::ATTR_CASE => PDO::CASE_NATURAL, // PDO::CASE_UPPER PDO::CASE_LOWER PDO::CASE_NATURAL //PDO::ATTR_AUTOCOMMIT => false ],WARN - #c.j.p.b.d.BladeDebugPathMapper

DB2 on docker is presenting more of a challenge as none of the current ODBC drivers see to work as expected.

Laravel Valet Usage Guidelines