diff --git a/www-api/.editorconfig b/www-api/.editorconfig deleted file mode 100644 index 39f48d95..00000000 --- a/www-api/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true - -# Matches multiple files with brace expansion notation -# Set default charset -[*] -charset = utf-8 - -# Tab indentation (no size specified) -indent_style = tab diff --git a/www-api/Dockerfile b/www-api/Dockerfile index 3704340c..b4a9df55 100644 --- a/www-api/Dockerfile +++ b/www-api/Dockerfile @@ -1,9 +1,10 @@ FROM nginx COPY . /opt/mainsite/wrenchboard/www-api/ -COPY index.php /opt/mainsite/wrenchboard/www-api/index.php +COPY public /opt/mainsite/wrenchboard/www-api/public COPY backend.php /opt/mainsite/wrenchboard/www-api/backend.php -COPY application /opt/mainsite/wrenchboard/www-api/application +COPY app /opt/mainsite/wrenchboard/www-api/app COPY system /opt/mainsite/wrenchboard/www-api/system +#COPY svs /opt/mainsite/wrenchboard/www-api/svs COPY composer.json /opt/mainsite/wrenchboard/www-api/composer.json COPY vendor /opt/mainsite/wrenchboard/www-api/vendor COPY writable /opt/mainsite/wrenchboard/www-api/writable diff --git a/www-api/license.txt b/www-api/LICENSE similarity index 90% rename from www-api/license.txt rename to www-api/LICENSE index 82be622d..31425034 100644 --- a/www-api/license.txt +++ b/www-api/LICENSE @@ -1,6 +1,7 @@ The MIT License (MIT) -Copyright (c) 2019 - 2022, CodeIgniter Foundation +Copyright (c) 2014-2019 British Columbia Institute of Technology +Copyright (c) 2019-2022 CodeIgniter Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/www-api/README.md b/www-api/README.md new file mode 100644 index 00000000..ebc758ed --- /dev/null +++ b/www-api/README.md @@ -0,0 +1,56 @@ +# CodeIgniter 4 Framework + +## What is CodeIgniter? + +CodeIgniter is a PHP full-stack web framework that is light, fast, flexible and secure. +More information can be found at the [official site](http://codeigniter.com). + +This repository holds the distributable version of the framework, +including the user guide. It has been built from the +[development repository](https://github.com/codeigniter4/CodeIgniter4). + +More information about the plans for version 4 can be found in [the announcement](http://forum.codeigniter.com/thread-62615.html) on the forums. + +The user guide corresponding to this version of the framework can be found +[here](https://codeigniter4.github.io/userguide/). + + +## Important Change with index.php + +`index.php` is no longer in the root of the project! It has been moved inside the *public* folder, +for better security and separation of components. + +This means that you should configure your web server to "point" to your project's *public* folder, and +not to the project root. A better practice would be to configure a virtual host to point there. A poor practice would be to point your web server to the project root and expect to enter *public/...*, as the rest of your logic and the +framework are exposed. + +**Please** read the user guide for a better explanation of how CI4 works! + +## Repository Management + +We use GitHub issues, in our main repository, to track **BUGS** and to track approved **DEVELOPMENT** work packages. +We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss +FEATURE REQUESTS. + +This repository is a "distribution" one, built by our release preparation script. +Problems with it can be raised on our forum, or as issues in the main repository. + +## Contributing + +We welcome contributions from the community. + +Please read the [*Contributing to CodeIgniter*](https://github.com/codeigniter4/CodeIgniter4/blob/develop/CONTRIBUTING.md) section in the development repository. + +## Server Requirements + +PHP version 7.4 or higher is required, with the following extensions installed: + +- [intl](http://php.net/manual/en/intl.requirements.php) +- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library + +Additionally, make sure that the following extensions are enabled in your PHP: + +- json (enabled by default - don't turn it off) +- [mbstring](http://php.net/manual/en/mbstring.installation.php) +- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php) +- xml (enabled by default - don't turn it off) diff --git a/www-api/apache_log/error.log b/www-api/apache_log/error.log deleted file mode 100644 index e15daaa1..00000000 --- a/www-api/apache_log/error.log +++ /dev/null @@ -1,15 +0,0 @@ -[Fri Nov 18 01:23:31.724975 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/7.4.33 configured -- resuming normal operations -[Fri Nov 18 01:23:31.725362 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND' -[Fri Nov 18 01:28:30.448983 2022] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully -[Fri Nov 18 01:28:38.846502 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/7.4.33 configured -- resuming normal operations -[Fri Nov 18 01:28:38.846765 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND' -[Fri Nov 18 01:43:30.493559 2022] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully -[Fri Nov 18 01:43:33.322175 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/7.4.33 configured -- resuming normal operations -[Fri Nov 18 01:43:33.322469 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND' -[Fri Nov 18 01:43:48.896358 2022] [autoindex:error] [pid 18] [client 172.24.0.1:47222] AH01276: Cannot serve directory /var/www/html/public/svs/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive -[Fri Nov 18 01:46:42.750129 2022] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully -[Fri Nov 18 01:46:45.512615 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/7.4.33 configured -- resuming normal operations -[Fri Nov 18 01:46:45.512925 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND' -[Sat Nov 19 22:40:16.634065 2022] [mpm_prefork:notice] [pid 1] AH00170: caught SIGWINCH, shutting down gracefully -[Sat Nov 19 23:00:20.141921 2022] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.54 (Debian) PHP/7.4.33 configured -- resuming normal operations -[Sat Nov 19 23:00:20.142224 2022] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND' diff --git a/www-api/apache_log/other_vhosts_access.log b/www-api/apache_log/other_vhosts_access.log deleted file mode 100644 index cedbcd55..00000000 --- a/www-api/apache_log/other_vhosts_access.log +++ /dev/null @@ -1,18 +0,0 @@ -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:30:56 +0000] "GET / HTTP/1.1" 200 6388 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:30:57 +0000] "GET /favicon.ico HTTP/1.1" 200 5731 "http://localhost:9083/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:30:59 +0000] "GET / HTTP/1.1" 200 6387 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:31:48 +0000] "-" 408 0 "-" "-" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:43:48 +0000] "GET /svs/ HTTP/1.1" 403 416 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:43:54 +0000] "GET /svs/users/ HTTP/1.1" 301 507 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:43:54 +0000] "GET /svs/users HTTP/1.1" 404 2165 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:43:58 +0000] "GET /svs/users HTTP/1.1" 404 2165 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:44:33 +0000] "GET /svs/user/ HTTP/1.1" 400 3599 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:45:25 +0000] "-" 408 0 "-" "-" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:47:52 +0000] "GET /svs/user/ HTTP/1.1" 400 519 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:01:47:52 +0000] "GET /favicon.ico HTTP/1.1" 304 250 "http://localhost:9083/svs/user/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:02:27:41 +0000] "GET / HTTP/1.1" 200 6388 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:02:27:42 +0000] "GET /favicon.ico HTTP/1.1" 200 5731 "http://10.0.0.202:9083/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.24.0.1 - - [18/Nov/2022:02:28:34 +0000] "-" 408 0 "-" "-" -wrenchboard-api:80 172.25.0.1 - - [19/Nov/2022:23:01:00 +0000] "GET / HTTP/1.1" 200 6388 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.25.0.1 - - [19/Nov/2022:23:01:01 +0000] "GET /favicon.ico HTTP/1.1" 200 5731 "http://localhost:9083/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36" -wrenchboard-api:80 172.25.0.1 - - [19/Nov/2022:23:01:52 +0000] "-" 408 0 "-" "-" diff --git a/www-api/application/.htaccess b/www-api/app/.htaccess similarity index 90% rename from www-api/application/.htaccess rename to www-api/app/.htaccess index 6c63ed4c..f24db0ac 100644 --- a/www-api/application/.htaccess +++ b/www-api/app/.htaccess @@ -3,4 +3,4 @@ Deny from all - \ No newline at end of file + diff --git a/www-api/app/Common.php b/www-api/app/Common.php new file mode 100644 index 00000000..23e3e614 --- /dev/null +++ b/www-api/app/Common.php @@ -0,0 +1,15 @@ + SYSTEMPATH, + * 'App' => APPPATH + * ]; + *``` + * + * @var array + */ + public $psr4 = [ + APP_NAMESPACE => APPPATH, // For custom app namespace + 'Config' => APPPATH . 'Config', + ]; + + /** + * ------------------------------------------------------------------- + * Class Map + * ------------------------------------------------------------------- + * The class map provides a map of class names and their exact + * location on the drive. Classes loaded in this manner will have + * slightly faster performance because they will not have to be + * searched for within one or more directories as they would if they + * were being autoloaded through a namespace. + * + * Prototype: + *``` + * $classmap = [ + * 'MyClass' => '/path/to/class/file.php' + * ]; + *``` + * + * @var array + */ + public $classmap = []; + + /** + * ------------------------------------------------------------------- + * Files + * ------------------------------------------------------------------- + * The files array provides a list of paths to __non-class__ files + * that will be autoloaded. This can be useful for bootstrap operations + * or for loading functions. + * + * Prototype: + * ``` + * $files = [ + * '/path/to/my/file.php', + * ]; + * ``` + * + * @var array + */ + public $files = []; +} diff --git a/www-api/app/Config/Boot/development.php b/www-api/app/Config/Boot/development.php new file mode 100644 index 00000000..05a86125 --- /dev/null +++ b/www-api/app/Config/Boot/development.php @@ -0,0 +1,32 @@ + + */ + public $file = [ + 'storePath' => WRITEPATH . 'cache/', + 'mode' => 0640, + ]; + + /** + * ------------------------------------------------------------------------- + * Memcached settings + * ------------------------------------------------------------------------- + * Your Memcached servers can be specified below, if you are using + * the Memcached drivers. + * + * @see https://codeigniter.com/user_guide/libraries/caching.html#memcached + * + * @var array + */ + public $memcached = [ + 'host' => '127.0.0.1', + 'port' => 11211, + 'weight' => 1, + 'raw' => false, + ]; + + /** + * ------------------------------------------------------------------------- + * Redis settings + * ------------------------------------------------------------------------- + * Your Redis server can be specified below, if you are using + * the Redis or Predis drivers. + * + * @var array + */ + public $redis = [ + 'host' => '127.0.0.1', + 'password' => null, + 'port' => 6379, + 'timeout' => 0, + 'database' => 0, + ]; + + /** + * -------------------------------------------------------------------------- + * Available Cache Handlers + * -------------------------------------------------------------------------- + * + * This is an array of cache engine alias' and class names. Only engines + * that are listed here are allowed to be used. + * + * @var array + */ + public $validHandlers = [ + 'dummy' => DummyHandler::class, + 'file' => FileHandler::class, + 'memcached' => MemcachedHandler::class, + 'predis' => PredisHandler::class, + 'redis' => RedisHandler::class, + 'wincache' => WincacheHandler::class, + ]; +} diff --git a/www-api/app/Config/Constants.php b/www-api/app/Config/Constants.php new file mode 100644 index 00000000..47b92f83 --- /dev/null +++ b/www-api/app/Config/Constants.php @@ -0,0 +1,94 @@ +` element. + * + * Will default to self if not overridden + * + * @var string|string[]|null + */ + public $baseURI; + + /** + * Lists the URLs for workers and embedded frame contents + * + * @var string|string[] + */ + public $childSrc = 'self'; + + /** + * Limits the origins that you can connect to (via XHR, + * WebSockets, and EventSource). + * + * @var string|string[] + */ + public $connectSrc = 'self'; + + /** + * Specifies the origins that can serve web fonts. + * + * @var string|string[] + */ + public $fontSrc; + + /** + * Lists valid endpoints for submission from `
` tags. + * + * @var string|string[] + */ + public $formAction = 'self'; + + /** + * Specifies the sources that can embed the current page. + * This directive applies to ``, `