remove unused code ee2cbb

This commit is contained in:
Joey Kimsey
2025-01-28 17:21:25 -05:00
parent 0067c49d4a
commit 2004837a8f
41 changed files with 0 additions and 2989 deletions

View File

@ -1,74 +0,0 @@
stages:
- prepare
- build
- test
- update
- deploy
variables:
TIMEZONE: "America/New_York" # For the system in general
DATE_TIMEZONE: ${TIMEZONE} # For PHP
GIT_DEPTH: 1
GITLAB_API_URL: ${CI_API_V4_URL}
TARGET_BRANCH: ${CI_COMMIT_REF_NAME} # This is the branch chosen in the `Pipeline Schedule`
TARGET_REMOTE: "https://${GITLAB_USERNAME}:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}.git"
# These could/should be overridden in an extending job:
UPDATE_BRANCH_PREFIX: "update_PHP_deps_" # Used for the update branch name, it will be followed by the datetime
GIT_USER: "DependBot" # Used for the update commit
GIT_EMAIL: "webmaster@thetempusproject.com" # Used for the update commit
GITLAB_USERNAME: "root" # Used for pushing the new branch and opening the MR
GITLAB_ACCESS_TOKEN: "glpat-PKEmivGtBfbz4DVPdhzk" # Used for pushing the new branch and opening the MR
MERGE_IF_SUCCESSFUL: "true" # Set to true, to merge automatically if the pipeline succeeds
SECONDS_BETWEEN_POOLING: 10 # Nbr of seconds between checking if the MR pipeline is successful, so then it will merge
JOB_GIT_FLAGS: ""
JOB_CURL_FLAGS: ""
JOB_COMPOSER_FLAGS: ""
composer_update:
stage: update
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
image: composer:latest
interruptible: true # allows to stop the job if a newer pipeline starts, saving resources and allowing new jobs to start because job concurrency is limited
script:
- git ${JOB_GIT_FLAGS} fetch origin ${TARGET_BRANCH}
- git ${JOB_GIT_FLAGS} checkout ${TARGET_BRANCH}
- git reset --hard origin/main
- git pull --allow-unrelated-histories
- export DATE_TIME="$(date '+%Y%m%d%H%M%S')"
- export MR_BRANCH="${UPDATE_BRANCH_PREFIX}${DATE_TIME}"
- git ${JOB_GIT_FLAGS} checkout -b "${MR_BRANCH}"
- composer update ${JOB_COMPOSER_FLAGS}
- if [ "$(git diff)" == "" ]; then echo "No updates needed!"; exit 0; fi
- export TITLE="Update PHP dependencies [${DATE_TIME}]"
- git ${JOB_GIT_FLAGS} commit -a -m "${TITLE}"
- git ${JOB_GIT_FLAGS} push "${TARGET_REMOTE}" "${MR_BRANCH}"
artifacts:
paths:
- vendor/
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/
prepare:
stage: prepare
script:
- echo "Preparing environment..."
build:
stage: build
script:
- echo "Building the project..."
test:
stage: test
script:
- echo "Running tests..."
deploy:
stage: deploy
script:
- echo "Deploying the project..."

View File

@ -1,127 +0,0 @@
<?php
$finder = PhpCsFixer\Finder::create()
//->exclude('somedir')
//->notPath('src/Symfony/Component/Translation/Tests/fixtures/resources.php'
->in(__DIR__)
;
$config = new \PhpCsFixer\Config();
return $config->setRules([
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'class_attributes_separation' => ['elements' => ['method' => 'one',]],
'multiline_whitespace_before_semicolons' => false,
'single_quote' => true,
'strict_param' => false,
'binary_operator_spaces' => [
'operators' => [
// '=>' => 'align',
// '=' => 'align'
]
],
// 'blank_line_after_opening_tag' => true,
// 'blank_line_before_statement' => true,
'braces' => [
'allow_single_line_closure' => true,
'position_after_functions_and_oop_constructs' => 'same'
],
// 'cast_spaces' => true,
// 'class_definition' => array('singleLine' => true),
'concat_space' => ['spacing' => 'one'],
// 'declare_equal_normalize' => true,
// 'function_typehint_space' => true,
// 'single_line_comment_style' => ['comment_types' => ['hash']],
// 'include' => true,
// 'lowercase_cast' => true,
// 'native_function_casing' => true,
// 'new_with_braces' => true,
// 'no_blank_lines_after_class_opening' => true,
// 'no_blank_lines_after_phpdoc' => true,
// 'no_blank_lines_before_namespace' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
// 'no_empty_statement' => true,
'no_extra_blank_lines' => [
'tokens' => [
// 'curly_brace_block',
// 'extra',
// 'parenthesis_brace_block',
// 'square_brace_block',
// 'throw',
// 'use',
]
],
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => ['use' => 'echo'],
'no_multiline_whitespace_around_double_arrow' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => ['positions' => ['outside']],
'no_trailing_comma_in_singleline' => ['elements' => ['arguments', 'array_destructuring', 'array', 'group_import']],
'spaces_inside_parentheses' => ['space' => 'single'],
// 'no_spaces_inside_parenthesis' => false,
'control_structure_braces' => true,
'curly_braces_position' => [
'control_structures_opening_brace' => 'same_line',
'functions_opening_brace' => 'same_line',
'classes_opening_brace' => 'same_line',
],
// need to add space after array declaration
// need to put each element on a line by itself when an array is multi line
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
// 'object_operator_without_whitespace' => true,
// 'php_unit_fqcn_annotation' => true,
// 'phpdoc_align' => true,
// 'phpdoc_annotation_without_dot' => true,
// 'phpdoc_indent' => true,
// 'phpdoc_inline_tag' => true,
// 'phpdoc_no_access' => true,
// 'phpdoc_no_alias_tag' => true,
// 'phpdoc_no_empty_return' => true,
// 'phpdoc_no_package' => true,
// 'phpdoc_no_useless_inheritdoc' => true,
// 'phpdoc_return_self_reference' => true,
// 'phpdoc_scalar' => true,
// 'phpdoc_separation' => true,
// 'phpdoc_single_line_var_spacing' => true,
// 'phpdoc_summary' => true,
// 'phpdoc_to_comment' => true,
// 'phpdoc_trim' => true,
// 'phpdoc_types' => true,
'phpdoc_var_without_name' => false,
'increment_style' => ['style' => 'post'],
'return_type_declaration' => true,
// 'self_accessor' => true, // risky
'short_scalar_cast' => true,
'single_class_element_per_statement' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => true,
'trim_array_spaces' => false,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
'single_blank_line_at_eof' => true
])
->setLineEnding("\n")
;

View File

@ -1,47 +0,0 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at webmaster@thetempusproject.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@ -1,135 +0,0 @@
# Contribution Guidelines for TheTempusProject
Contributing to TheTempusProject is completely voluntary and should follow all of the guidelines listed here in order to ensure the highest probability of acceptance. It is highly recommended to use a php linter to automate more of this process. The project is maintained on github and all contributions need to be submitted via pull request to their specific repository under the `dev` branch. In order to contribute, simply follow the instructions for [creating a pull request](#creating-a-pull-request) below.
## Pull Request Requirements
- All revisions must follow TTP naming conventions (see [Naming Conventions](#naming-conventions) Section)
- Include a clear and concise explanation of the features or changes included in your revision listed by file.
- All code must follow [PSR 2](http://www.php-fig.org/psr/psr-2/) standards
- prefer the use of [] for arrays over array()
- All functions must be documented with the exception of controller methods (see [Documentation](#documentation) Section)
- Controller methods may be doc-blocked when necessary for clarity (see [Documentation](#documentation) Section)
- All new Classes must include a class level doc-block (see [Documentation](#documentation) Section)
- Any new dependencies will have a longer validation process and should be accompanied by the required information (see [Dependencies](#dependencies) Section)
## Naming Conventions
- File names are to be lower case
- All class names must be upper case
- Any data being stored as a file must be saved in the app directory (with the exception of config which should be stored under config/)
- Controllers must have a constructor and destructor using the constructor and destructor methods found in resources/
- Views must be named using lowerCamelCase
## Dependencies
Whenever a dependency is updated or added, pull requests must include a section that answers the following questions.
- Why is this dependency required
- Could this be reasonably accomplished within the app by implementing new features in a later version? explain.
- What is the latest stable version that can be used
- What features are absolutely necessary for your feature or modification to work
## Documentation
### Classes
New classes must be prefaced with a doc-block following this style:
```
/**
* app/controllers/admin/admin.php
*
* This is the admin controller.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
```
From top to bottom:
- Filename on the second line
- A description for the file
- The TTP version this file was built for
`@version 1.0`
- The Authors name or alias and email
`@author first last <email@link.com>`
- A copy of the MIT license
`@license https://opensource.org/licenses/MIT [MIT LICENSE]`
- May include a link for more information
`@link http://link.com`
### Functions
Functions must be prefaced with a doc-block following this style:
```
/**
* Intended as a self-destruct session. If the specified session does not
* exist, it is created. If the specified session does exist, it will be
* destroyed and returned.
*
* @param string $name - Session name to be created or checked
* @param string $string - The string to be used if session needs to be
* created. (optional)
*
* @return bool|string - Returns bool if creating, and a string if the
* check is successful.
*/
```
From top to bottom:
- There must be a description of the functions intended usage on the second line
- All parameters should be documented like this
`@param [type] $name - description`
- Any function with a return statement must also be documented as such
`@return [type] - description`
## Creating a Pull Request
This is a simple explanation of how to create a pull request for changes to TheTempusProject. You can find a detailed walk-through on how to [create a pull request](https://help.github.com/articles/creating-a-pull-request/) on github.
1. First ensure you have followed all the contributing guidelines
2. Squash your merge into a single revision. This will make it easier to view the changes as a whole.
3. You can submit a pull request [here](https://github.com/TheTempusProject/TheTempusProject/compare)
4. Please submit all pull requests to the dev branch or they will be ignored.
add spaces after everything
avoid "return;" just make the previous line the return
use []
do not use array()
do not use (array)
do not add useless variables
if you are going to set something or check if its empty, just never set it to begin with, don't set it to null

25
LICENSE
View File

@ -1,25 +0,0 @@
Copyright (c) 2024-present Joey Kimsey
Portions of this software are licensed as follows:
* All content residing under the "app/" directory of this repository, excluding "app/plugins/"; is licensed under "Creative Commons: CC BY-SA 4.0 license".
* All third party components incorporated into The Tempus Project Software including plugins are licensed under the original license provided by the owner of the applicable component.
* Content outside of the above mentioned directories or restrictions above is available under the "MIT Expat" license as defined below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

374
README.md
View File

@ -1,374 +0,0 @@
# The Tempus Project
need to make a vs battle for dnd. someone makes a truly broken character, we take the base character and hand it to two people and give them some time to figure out how they would break it
need to track points once a week
a huge table tracks points day to day then we add and erase the old data, or move it to historical...
## Rapid Prototyping Framework
### Developer(s): Joey Kimsey
The aim of this project is to provide a simple and stable platform from which to easily add functionality. The goal being the ability to quickly build and test new projects with a lightweight ecosystem to help.
**Notice: This code is in _still_ not production ready. This framework is provided as is, use at your own risk.**
I am working very hard to ensure the system is safe and reliable enough for me to endorse its widespread use. Unfortunately, it still needs a lot of QA and improvements.
Currently I am in the process of testing all the systems in preparation for the first production ready release. The beta is still on-going. If you would like to participate or stay up to date with the latest, you can find more information at: https://TheTempusProject.com/beta
## Features
A User management system with groups, permissions, preferences, registration, and recovery. (All Controlled dynamically via our plugin interface)
A Plugin system that allows plug-and-play functionality for a huge number of features.
Compatibility with both Apache and NGINX.
Built with Bootstrap with a focus on mobile compatibility.
Incredibly easy to set-up, deploy, and develop with.
## Installation
Preferred method for installation is using composer.
### Manually
### Docker
### Composer
1. Clone the directory to wherever you want to install the framework.
2. Open your terminal to the directory you previously cloned the repository.
3. Install using composer:
`php composer.phar install`
4. Open your browser and navigate to install.php (it will be in the root directory of your installation)
5. When prompted, complete the forms and complete the process.
#### Apache
#### NGINX
#### Docker-Compose
If you have any trouble with the installation, you can check out our FAQ page on the wiki for answers to common issues.
If you would like a full copy of the project with all of its included dependencies you can find it at https://github.com/TheTempusProject/TempusProjectFull
Please note this repository is only up to the latest _stable_ release. Please continue to use composer update to get the latest development releases.
**Do not forget to remove install.php once you have finished installation!**
#### Currently being developed
- [ ] Adding documentation
- [ ] Unit tests
#### Future updates
- [ ] Expansion of PDO to allow different database types
- [ ] Update installer to account for updates.
- [ ] Implement uniformity in terms of error reporting, exceptions, logging.
- [ ] The templating system has gotten too large and needs to be split into its own repo
TTP ToDo:
need to integrate new plugins for some moved features
canary
comments
members
messages
Split inbox and outbox apart
split messages from usercp
redirects
need to make sure all 'use ' statements are updated to new repo names
namespace TempusDebugger; => namespace TheTempusProject\Canary;
namespace TheTempusProject\Houdini; => namespace TheTempusProject\houdini;
namespace TheTempusProject/TempusTool; => namespace TheTempusProject\Overwatch;
need a mechanism for handeling config/constants.php in each plugin
migrate all 'secondary' constants (constants not used in the default execution of the application) to plugin folders
Perform final F & R for:
"tpc"
need better handeling around blog filters like month and day
split profile from usercp
need a way to secure the api
need a standard way to do apis
need a way to show parts conditionally like {@if}
need
if
else
elseif
need a way to show something conditionally if a plugin is enabled
like {@enabled:comments}
{comments}
{@enabled}
https://css-tricks.com/drag-and-drop-file-uploading/
https://www.smashingmagazine.com/2018/01/drag-drop-file-uploader-vanilla-js/
need to merge both autoloaders into the same one under bin
need to be able to install multiple database tables for the same plugin
rename default.js and .css to main.js/css
fix where i moved those to the app/css and app/js folders
make a new template repo/dependency
make a new Debug repo/dependency
Fix the plugin
fix the console logger
add the ability to include js files
add the ability to include css files as needed
chat should include a config for the refresh timer
and better error handeling for models and plugins
need to make a singular list function to remove or combine these:
listGroupsSimple
listPosts
i need to move everything moderator relateed to comments
i also need to make sure that moderators can actually moderate
the get form html thing should work perfectly with the database array to create hella simple to generate forms for anything
we are not doing anything with requiredPlugins
comments and blog are being manually added in the admin dashboard, this could be a problem when they are disabled
removed from blog filter
commentCount
need to address the error handler just failing to work
and the exception handler picking up random errors
need to revisit all of the form checking and make sure it is apparent to the user when and how they mess something up.
many pages are missing descriptions, need to add them
https://jsonapi.org/format/
need a way for the template system to:
switch between the meta-header content types for the sharing info
xlarge
large
etc
need better checking around title, meta-image, and descriptions
prevent accidently feeding bad images or text to these fields
need to manages js and css includes better, and incorperate it into templating system
the get timezone getdate gettime format functions all need to be migrated to app, stored as static vars and refactored
in core, am i using htaccess.html or nginx.html anywhere, if not, change them to .example
Routes -> getHost is using a terrible conditional for docker hosts, need to improve
Need to test all the filters for the editor stuff
need the ability for the autoloader to accept specific file name associations
needs a require_all
need to re-namespace all classes and functions
some classes need to be converted to non-static
some functions need to be converted to more static
run from the command line
initiated // is in so many controllers, i def want this removed initialized
tempus_project.php
test running commands from cli
if we move install.php to the bin, it will be unaccessible to the web server??
if its unaccessible except theough the index.php router, we don't need to delete it because its unaccessible again
can i use submodules?
errors should be able to be customized
if its in the app
should add more logging, esp for admin actions
need to add self::$pageDescription to many pages
man, messages is hot garbage, def needs a rework
need a mechanism to add listeners and events
ability to restore backups of perms prefs and configs
if your controller has no index method, you're just SOL
a blank page is called and no method is loaded
Warns should be for failed checks
add a check for having write access to the config folder and the uploads folder
and whatever is going to be needed to the plugin downloading
some configs have been removed and need to be accounted for
Unused:
---------------------------
Config::getValue('bugReports/sendEmail')
Config::getValue('bugReports/emailTemplate')
Config::getValue('feedback/sendEmail')
Config::getValue('feedback/emailTemplate')
Config::getValue('uploads/files')
Config::getValue('uploads/images')
Config::getValue('uploads/maxFileSize')
after all changes are pushed up and available, docker needs to be tested and updated
when using composer, the composer page is populated and correct
the config step of install should be checking the db creds
// need to make notes of other standards as i go to update the contributing document
// need to cross refrence the configs from core and ttp
// ensure the resources folder is current
// document, fix, and remove @TODO's where possible
Search for cuss words, they make you look stupid
fuck
shit
dam
damm
damn
god
ass
cunt
bitch
ffs
wtf
had to remove the tracking pixel that was to be used with the contacts form, this will need to be re- added in a future update
had to remove the rest controller, its currently just unused
// this can be used for the tempus project
composer create-project laravel/laravel example-app
# Release Checklist
=====================
- [] Spell check every file.
- [] All documentation must be reviewed for accuracy.
- [] If a new year has passed, ensure the year has been updated where applicable.
- [] If default permissions, preferences, configs, base classes or models have been updated, update resources accordingly.
- []
namespace TempusDebugger; => namespace TheTempusProject\Canary;
need to make sure a template loader can be called and still use the default template file, IE always add these CSS or JS resources.
discord bot that shares updates on your party from the site
maybe a summary after each session
warning that time is coming up
changes made to anything
D&D news
is it possible to store a campaigns state on the blockchain?
keeping this as a repository for podcasts would get more people to check it out
same for youtube
people love sharing their resources, so make it EASY to find podcasts, and youtube channels, and etsy stores, and give people a place to share it with their groups
try and earn commisions from this and do featured XYZ every x days or weeks or whatever
have different "kinds" of dice to portray on the dice roll page
maybe spinners instead of conventional die
maybe weird health potions for D4's
What is my goal here?
I would like to play Dungeons and Dragons once a week with my friends. In an ideal world, I would DM this game and spend all week building tools for us to use that I then put on a website which sells memberships to other players so they can use the tools too.

View File

@ -1,179 +0,0 @@
{
"main": {
"name": {
"type": "text",
"pretty": "Site Name",
"default": "TTP Example",
"value": "TTP Example"
},
"loginLimit": {
"type": "text",
"pretty": "Maximum Login Attempts per hour",
"default": 5,
"value": 5
},
"logo": {
"type": "file",
"pretty": "Site Logo (Used mostly in emails)",
"default": "images/logo.png",
"value": "images/logo.png"
},
"template": {
"type": "text",
"pretty": "Default Site Template",
"default": "default",
"value": "default"
},
"tokenEnabled": {
"type": "radio",
"pretty": "Enable CSRF Token for all forms.",
"default": true,
"value": true
}
},
"uploads": {
"files": {
"type": "radio",
"pretty": "Enable File Uploads",
"default": true,
"value": true
},
"images": {
"type": "radio",
"pretty": "Enable Image Uploads",
"default": true,
"value": true
},
"maxFileSize": {
"type": "text",
"pretty": "Maximum File Size",
"default": 5000000,
"value": 5000000
},
"maxImageSize": {
"type": "text",
"pretty": "Maximum Image Size",
"default": 500000,
"value": 500000
}
},
"database": {
"dbHost": {
"type": "text",
"pretty": "Database Host (IE: http://localhost:3306)",
"default": "127.0.0.1",
"protected": true,
"value": "127.0.0.1"
},
"dbUsername": {
"type": "text",
"pretty": "Database Username",
"default": "root",
"protected": true,
"value": "root"
},
"dbPrefix": {
"type": "text",
"pretty": "Database table Prefix",
"default": "TTP_",
"protected": true,
"value": "TTP_"
},
"dbPassword": {
"type": "text",
"pretty": "Database Password",
"default": "",
"protected": true,
"value": ""
},
"dbName": {
"type": "text",
"pretty": "Database Name",
"default": "ttp-example",
"protected": true,
"value": "ttp-example"
},
"dbEnabled": {
"type": "radio",
"pretty": "Database Enabled",
"default": true,
"protected": true,
"value": true
},
"dbMaxQuery": {
"type": "text",
"pretty": "Maximum results per query",
"default": 100,
"protected": true,
"value": 100
}
},
"group": {
"defaultGroup": {
"type": "customSelect",
"pretty": "The Default Group for new registrations.",
"default": 5,
"value": 5
}
},
"logging": {
"admin": {
"type": "radio",
"pretty": "Enable Admin Action Logging.",
"default": true,
"value": true
},
"errors": {
"type": "radio",
"pretty": "Enable Error Logging",
"default": true,
"value": true
},
"logins": {
"type": "radio",
"pretty": "Enable Login Logging",
"default": true,
"value": true
}
},
"bugReports": {
"enabled": {
"type": "radio",
"pretty": "Enable Bug reporting.",
"default": true,
"value": true
},
"sendEmail": {
"type": "radio",
"pretty": "Email the user after submiting.",
"default": true,
"value": true
},
"emailTemplate": {
"type": "text",
"pretty": "Email Template",
"default": "BugReportEmail",
"value": "BugReportEmail"
}
},
"feedback": {
"enabled": {
"type": "radio",
"pretty": "Enable User Feedback.",
"default": true,
"value": true
},
"sendEmail": {
"type": "radio",
"pretty": "Email the user after submiting.",
"default": false,
"value": false
},
"emailTemplate": {
"type": "text",
"pretty": "Email Template",
"default": "feedbackEmail",
"value": "feedbackEmail"
}
}
}

View File

@ -1,162 +0,0 @@
{
"installHash": "014c857a650bcb0e4b08b14e1924287c",
"installStep": "complete",
"modules": {
"Group": {
"name": "Group",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/models/",
"installTable": "Success",
"installPermissions": "Success",
"installConfigs": "Success",
"installResources": "Success",
"installPreferences": "Not Required",
"installedResources": ["1", "2", "3", "4", "5", "6"]
},
"Log": {
"name": "Log",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/models/",
"installTable": "Success",
"installPermissions": "Not Required",
"installConfigs": "Success",
"installResources": "Not Required",
"installPreferences": "Not Required"
},
"Message": {
"name": "Message",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/models/",
"installTable": "Success",
"installPermissions": "Success",
"installConfigs": "Not Required",
"installResources": "Not Required",
"installPreferences": "Not Required"
},
"Routes": {
"name": "Routes",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/models/",
"installTable": "Success",
"installPermissions": "Success",
"installConfigs": "Not Required",
"installResources": "Success",
"installPreferences": "Not Required",
"installedResources": ["1", "2", "3", "4", "5"]
},
"Sessions": {
"name": "Sessions",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/models/",
"installTable": "Success",
"installPermissions": "Not Required",
"installConfigs": "Not Required",
"installResources": "Not Required",
"installPreferences": "Not Required"
},
"User": {
"name": "User",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/models/",
"installTable": "Success",
"installPermissions": "Success",
"installConfigs": "Not Required",
"installResources": "Not Required",
"installPreferences": "Success"
},
"Blog": {
"name": "Blog",
"enabled": true,
"enabled_txt": "yes",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/plugins/",
"installTable": "Success",
"installPermissions": "Not Required",
"installConfigs": "Not Required",
"installResources": "Success",
"installPreferences": "Not Required",
"installedResources": ["1"]
},
"Bugreport": {
"name": "Bugreport",
"enabled": true,
"enabled_txt": "yes",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/plugins/",
"installTable": "Success",
"installPermissions": "Success",
"installConfigs": "Success",
"installResources": "Not Required",
"installPreferences": "Not Required"
},
"Comments": {
"name": "Comments",
"enabled": true,
"enabled_txt": "yes",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/plugins/",
"installTable": "Success",
"installPermissions": "Not Required",
"installConfigs": "Not Required",
"installResources": "Not Required",
"installPreferences": "Not Required"
},
"Feedback": {
"name": "Feedback",
"enabled": true,
"enabled_txt": "yes",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/plugins/",
"installTable": "Success",
"installPermissions": "Success",
"installConfigs": "Success",
"installResources": "Not Required",
"installPreferences": "Not Required"
},
"Subscribe": {
"name": "Subscribe",
"enabled": true,
"enabled_txt": "yes",
"installDate": 1670000000,
"lastUpdate": 1670000000,
"installStatus": "Installed",
"installedVersion": "3.0",
"folder": "/var/www/app/plugins/",
"installTable": "Success",
"installPermissions": "Not Required",
"installConfigs": "Not Required",
"installResources": "Not Required",
"installPreferences": "Not Required"
}
}
}

View File

@ -1,34 +0,0 @@
{
"adminAccess": {
"pretty": "Access Administrator Areas",
"default": false
},
"modAccess": {
"pretty": "Access Moderator Areas",
"default": false
},
"memberAccess": {
"pretty": "Access Member Areas",
"default": false
},
"sendMessages": {
"pretty": "Send messages to other users",
"default": false
},
"addRoute": {
"pretty": "Add Custom Routes",
"default": false
},
"uploadImages": {
"pretty": "Upload images (such as avatars)",
"default": false
},
"bugReport": {
"pretty": "Can Submit Bug Reports",
"default": false
},
"feedback": {
"pretty": "Can Submit Feedback",
"default": false
}
}

View File

@ -1,78 +0,0 @@
{
"gender": {
"pretty": "Gender",
"type": "select",
"default": "unspecified",
"options": ["male", "female", "other", "unspecified"],
"avatar": "/var/www/apache/images/defaultAvatar.png"
},
"email": {
"pretty": "IDK what this is for",
"type": "checkbox",
"default": "true",
"avatar": "/var/www/apache/images/defaultAvatar.png",
"options": null
},
"newsletter": {
"pretty": "Receive our Newsletter?",
"type": "checkbox",
"default": "true",
"avatar": "/var/www/apache/images/defaultAvatar.png",
"options": null
},
"avatar": {
"pretty": "Avatar",
"type": "file",
"default": "images/defaultAvatar.png",
"avatar": "/var/www/apache/images/defaultAvatar.png",
"options": null
},
"timezone": {
"pretty": "Timezone",
"type": "timezone",
"default": "America/New_York",
"avatar": "/var/www/apache/images/defaultAvatar.png",
"options": null
},
"dateFormat": {
"pretty": "Date Format",
"type": "select",
"default": "F j, Y",
"options": {
"1-8-1991": "n-j-Y",
"8-1-1991": "j-n-Y",
"01-08-1991": "m-d-Y",
"08-01-1991": "d-m-Y",
"January 8, 1991": "F-j-Y",
"8 January, 1991": "j-F-Y",
"January 08, 1991": "F-d-Y",
"08 January, 1991": "d-F-Y",
"Jan 8, 1991": "M-j-Y",
"8 Jan 1991": "j-M-Y",
"Jan 08, 1991": "M-d-Y",
"08 Jan 1991": "d-M-Y"
},
"avatar": "/var/www/apache/images/defaultAvatar.png"
},
"timeFormat": {
"pretty": "Time Format",
"type": "select",
"default": "g:i:s A",
"options": {
"3:33:33 AM": "g:i:s A",
"03:33:33 AM": "h:i:s A",
"3:33:33 am": "g:i:s a",
"03:33:33 am": "h:i:s a",
"3:33:33 (military)": "G:i:s",
"03:33:33 (military)": "H:i:s"
},
"avatar": "/var/www/apache/images/defaultAvatar.png"
},
"pageLimit": {
"pretty": "Items Displayed Per Page",
"type": "select",
"default": "10",
"options": ["10", "15", "20", "25", "50"],
"avatar": "/var/www/apache/images/defaultAvatar.png"
}
}

View File

@ -1,54 +0,0 @@
<?php
/**
* app/resources/controllers/example.php
*
* This is an example controller layout.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Controllers;
use TheTempusProject\Classes\Controller;
use TheTempusProject\Houdini\Classes\Template;
use TheTempusProject\Houdini\Classes\Views;
use TheTempusProject\Canary\Bin\Canary as Debug;
// The new controller must extend the default controller class or some functionality will be lost.
class Example extends Controller {
/**
* A constructor does not have to be defined.
* If a constructor is used, it must call the parent constructor first.
*/
public function __construct() {
parent::__construct();
Template::noFollow();
Template::noIndex();
Template::setTemplate( 'example' );
}
/**
* A destructor does not have to be defined.
* If a destructor is used, it must call the parent destructor last.
*/
public function __destruct() {
Debug::log( 'Something to log before the app ends execution.' );
parent::__destruct();
}
public function index() {
self::$title = 'Example Controller';
Issues::add( 'error', [ 'This is an error with multiple parts.' => [ 'Error 1', 'Error 2' ] ] );
Issues::add( 'error', 'This is a single error.' );
Issues::add( 'success', [ 'This is a success with multiple parts.' => [ 'Success 1', 'Success 2' ] ] );
Issues::add( 'success', 'This is a single success.' );
Issues::add( 'notice', 'This is a single notice.' );
Issues::add( 'info', 'This is a single info.' );
Components::set( 'simple', Views::simpleView( 'simple' ) );
Components::set( 'complex', Views::simpleView( 'complex' ) );
Views::view( 'example' );
$example = Views::simpleView( 'example' );
}
}

View File

@ -1,44 +0,0 @@
server {
listen 8080 default_server;
listen [::]:8080 default_server;
listen 8081 ssl default_server;
listen [::]:8081 ssl default_server;
ssl_prefer_server_ciphers on;
include snippets/common.conf;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location ~* \.(?:js|css|png|jpg|gif|ico)$ {
access_log off;
log_not_found off;
}
location /js/ {
access_log off;
log_not_found off;
try_files $uri /index.php?error=js404&file=$uri;
}
location /css/ {
access_log off;
log_not_found off;
try_files $uri /index.php?error=css404&file=$uri;
}
location / {
if (!-e $request_filename){
rewrite ^/images/(.*)$ /index.php?error=image404&url=$1 break;
rewrite ^/uploads/(.*)$ /index.php?error=upload404&url=$1 break;
}
rewrite ^/errors/(.*)$ /index.php?error=$1 break;
rewrite ^/(.+)$ /index.php?url=$1&$args;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
include snippets/fastcgi-php.conf;
}
}

View File

@ -1,20 +0,0 @@
<?php
/**
* app/resources/models/example.php
*
* This is an example model.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Models;
use TheTempusProject\Bedrock\Classes\Model;
class Example extends Model {
public function __construct() {
parent::__construct();
}
}

View File

@ -1,99 +0,0 @@
<?php
/**
* app/plugins/XXXXXXXXXX/plugin.php
*
* This houses all of the main plugin info and functionality.
*
* @package TP XXXXXXXXXX
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Plugins;
use ReflectionClass;
use TheTempusProject\Classes\Installer;
use TheTempusProject\Houdini\Navigation;
use TheTempusProject\Models\forealthough as forealthoughModel;
use TheTempusProject\TheTempusProject as App;
class notrealplugin extends forealthoughModel {
public static $initialized;
public $pluginName = 'TP XXXXXXXXXX';
public $pluginAuthor = 'JoeyK';
public $pluginWebsite = 'https://TheTempusProject.com';
public $modelVersion = '1.0';
public $pluginVersion = '1.0';
public $pluginDescription = 'A simple plugin which adds a site wide XXXXXXXXXX system.';
public $configName = 'XXXXXXXXXX';
public $databaseMatrix = [
[ 'title', 'varchar', '86' ],
[ 'suggestion', 'text', '' ],
[ 'suggestedOn', 'int', '10' ],
[ 'approved', 'varchar', '5' ],
[ 'approvedOn', 'int', '10' ],
[ 'approvedBy', 'int', '11' ],
[ 'author', 'int', '11' ],
];
public $configMatrix = [
'enabled' => [
'type' => 'radio',
'pretty' => 'Enable XXXXXXXXXX.',
'default' => true,
],
];
public $permissionMatrix = [
'XXXXXXXXXX' => [
'pretty' => 'Can create XXXXXXXXXX',
'default' => false,
],
];
public $admin_links = [
[
'text' => '<i class="fa fa-fw fa-copy"></i> Suggestions',
'url' => '{ROOT_URL}admin/suggestions',
],
];
public $main_links = [
[
'text' => 'Suggestions',
'url' => '{ROOT_URL}suggestions/index',
],
];
public $resourceMatrix = [
[
'title' => 'Welcome',
'content' => '<p>This is just a simple message to say thank you for installing The Tempus Project. If you have any questions you can find everything through our website <a href="https://TheTempusProject.com">here</a>.</p>',
'author' => 1,
'created{time}' => 0,
'edited{time}' => 0,
'draft' => 0,
],
];
public $contact_footer_links = [
[
'text' => 'Bug Report',
'url' => '{ROOT_URL}bugreport',
],
];
public function __construct() {
$reflect = new ReflectionClass( $this );
if ( true === self::$initialized || !Installer::pluginEnabled( $reflect->getShortName() ) ) {
return;
}
foreach ( $this->contact_footer_links as $key => $link ) {
Navigation::addLink( App::CONTACT_FOOTER_MENU_NAME, $link );
}
foreach ( $this->info_footer_links as $key => $link ) {
Navigation::addLink( App::INFO_MENU_NAME, $link );
}
foreach ( $this->main_links as $key => $link ) {
Navigation::addLink( App::MAIN_MENU_NAME, $link );
}
foreach ( $this->admin_links as $key => $link ) {
Navigation::addLink( App::ADMIN_MENU_NAME, $link );
}
self::$initialized = true;
}
}

View File

@ -1,80 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<!--
* app/resources/templates/example.tpl
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{TITLE}</title>
<meta name="description" content="{PAGE_DESCRIPTION}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="The Tempus Project">
{ROBOT}
<link rel="alternate" hreflang="en-us" href="alternateURL">
<link rel="icon" href="{BASE}images/favicon.ico">
<!-- Required CSS -->
<!-- Custom styles for this template -->
<link rel="stylesheet" href="{BASE}Templates/default/default.css">
<!-- Required JS -->
<script language="JavaScript" type="text/javascript" src="{BASE}JS/default.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<!--Brand and toggle should get grouped for better mobile display
but I had to account for additional menus-->
<div class="navbar-header">
<a href="{BASE}" class="navbar-brand">{SITENAME}</a>
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target=".navbar-ex1-collapse" style="">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="container-fluid">
<div class="collapse navbar-collapse navbar-ex1-collapse">
{topNavLeft}
<div class="navbar-right">
<ul class=" navbar-nav">
{topNavRight}
</ul>
</div>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="foot-pad">
{ISSUES}
<div class="row">
<div class="container">
{ERROR}
{NOTICE}
{SUCCESS}
{INFO}
</div>
</div>
{/ISSUES}
<div class="row">
<div class="container">
{CONTENT}
</div>
</div>
</div>
<div class="row">
<footer>
{FOOT}
{COPY}
</footer>
</div>
</div>
<!-- Bootstrap core JavaScript and jquery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="{BASE}vendor/twbs/bootstrap/dist/js/bootstrap.min.js"></script>
</body>
</html>

View File

@ -1,34 +0,0 @@
<?php
/**
* app/resources/templates/example.inc.php
*
* This is an example loader for the example template.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Templates;
use TheTempusProject\Houdini\Classes\Views;
use TheTempusProject\Houdini\Classes\Navigation;
use TheTempusProject\Houdini\Classes\Components;
use TheTempusProject\Bedrock\Classes\Config;
use TheTempusProject\TheTempusProject as App;
class ExampleLoader {
public function __construct() {
Components::set( 'TEMPLATE_URL', Template::parse( '{ROOT_URL}app/templates/default/' ) );
Components::set( 'LOGO', Config::get( 'main/logo' ) );
Components::set( 'FOOT', Views::simpleView( 'foot' ) );
Components::set( 'COPY', Views::simpleView( 'copy' ) );
if ( App::$isLoggedIn ) {
Components::set( 'STATUS', Views::simpleView( 'nav.statusLoggedIn' ) );
Components::set( 'USERNAME', App::$activeUser->username );
} else {
Components::set( 'STATUS', Views::simpleView( 'nav.statusLoggedOut' ) );
}
Components::set( 'topNavLeft', Navigation::activePageSelect( 'nav.main' ) );
}
}

View File

@ -1,3 +0,0 @@
<p>This is a more complex component that includes another component...</p>
{simple}
<p>...right in the middle!</p>

View File

@ -1,141 +0,0 @@
<p>It is comprised entirely of free form HTML</p>
<p>If you are feeling extra bold you can use the templating engine to set variables to be replaced at runtime such as {variable} or even {variable2}, or maybe even just look through some data:</p>
{loop}
{value1} is the first value.<br />
{value2} is the second value.<br />
{value3} is the third value.<br />
{/loop}
{ALT}No Loop{/ALT}
{footer}
<h1>This is a default view </h1>
<p>The Tempus-Project template-processor works with the backend to render html for the end user. This process has several steps and components that can get pretty complex. For the moment let's just review a few that can be used to generate web pages. </p>
<h2>Views</h2>
<p>Views are the most basic interaction between the front-end and back-end. Inside of a controler, you can call a view in two ways:</p>
<h3>1. Normal - Views::view</h3>
<pre></pre>
<h3>2. Inline - Views::simpleView</h3>
<pre></pre>
<h2>Components</h2>
<p>You can think of components as a sort of front-end variable that can be filled in by the back-end before being send to the end-user. You can include components in all template parsing with a simple command:</p>
<pre></pre>
Adding this to a controler will give access to that component's value in the rendering engine. For example:
<pre></pre>
<h2>Pagination</h2>
PAGINATION
if (Pagination::totalPages() <= 1) {
Components::set('PAGINATION', '<lb>');
} else {
Components::set('PAGINATION', Views::simpleView('nav.pagination', $pageData));
}
<h2>Navigation</h2>
<h2>Filters</h2>
<p>In some cases, you may want to hide or show text on a page conditionally. For example, you may have administrator controls on a commonly used page. Obviously you would like to hide those controls from regular users; even if you have safeguards to prevent them from performing any restricted actions.</p>
<p>This is where filters come in. They do exactly that, conditionally hide or show part of a page based on back-end logic. The admin example is so common, its already built in. If a user has the isAdmin permission on thier group, they will be able to see anything within the "ADMIN" tag:</p>
<pre>
Filters::add('member', '#{MEMBER}(.*?){/MEMBER}#is', (self::$isMember ? '$1' : ''), true);
Filters::add('mod', '#{MOD}(.*?){/MOD}#is', (self::$isMod ? '$1' : ''), true);
Filters::add('admin', '#{ADMIN}(.*?){/ADMIN}#is', (self::$isAdmin ? '$1' : ''), true);
</pre>
'#\[b\](.*?)\[/b\]#is' => '<b>$1</b>',
'#\[p\](.*?)\[/p\]#is' => '<p>$1</p>',
'#\[i\](.*?)\[/i\]#is' => '<i>$1</i>',
'#\[u\](.*?)\[/u\]#is' => '<u>$1</u>',
'#\[s\](.*?)\[/s\]#is' => '<del>$1</del>',
'#\[code\](.*?)\[/code\]#is' => '<code>$1</code>',
'#\[color=(.*?)\](.*?)\[/color\]#is' => "<font color='$1'>$2</font>",
'#\[img\](.*?)\[/img\]#is' => "<img src='$1'>",
'#\[url=(.*?)\](.*?)\[/url\]#is' => "<a href='$1'>$2</a>",
'#\[quote=(.*?)\](.*?)\[/quote\]#is' => "<blockquote cite='$1'>$2</blockquote>",
'#\(c\)#is' => '&#10004;',
'#\(x\)#is' => '&#10006;',
'#\(!\)#is' => '&#10069;',
'#\(\?\)#is' => '&#10068;',
'#\[list\](.*?)\[/list\]#is' => '<ul>$1</ul>',
'#\(\.\)(.*)$#m' => '<li>$1</li>',
'/(^|\s)@(\w*[a-zA-Z_]+\w*)/' => ' <a href="http://twitter.com/search?q=%40\2">@\2</a>',
'/(^|\s)#(\w*[a-zA-Z_]+\w*)/' => ' <a href="http://twitter.com/search?q=%23\2">#\2</a>',
'#/\*.*?\*/#s' => null,
'#(?<!:)//.*#' => null,
"#{CHECKED:(.*?)=(.*?)}#s" => null,
<h2>Issues</h2>
<p>One of the pre-existing filters happens to be Issues. In the controller for this file, you should see a block that includes several examples of Issues. These issues are automatically added as individual components and hidden with the issues filter.<p>
<pre>
Issues::add( 'error', [ 'This is an error with multiple parts.' => [ 'Error 1', 'Error 2' ] ] );
Issues::add( 'error', 'This is a single error.' );
Issues::add( 'success', [ 'This is a success with multiple parts.' => [ 'Success 1', 'Success 2' ] ] );
Issues::add( 'success', 'This is a single success.' );
Issues::add( 'notice', 'This is a single notice.' );
Issues::add( 'info', 'This is a single info.' );
Filters::add('issues', '#{ISSUES}(.*?){/ISSUES}#is', (Issues::hasIssues() ? '$1' : ''), true);
Components::set( 'NOTICE', $test );
Components::set( 'SUCCESS', $test );
Components::set( 'ERROR', $test );
Components::set( 'INFO', $test );
</pre>
<h2>Forms</h2>
select Radio
$selected = 'CHECKED:' . $fieldName . '=' . $value;
Components::set($selected, 'checked="checked"');
select Option
$find = "#\<option (.*?)value=\'" . $value . "\'#s";
$replace = "<option $1value='" . $value . "' selected";
self::$options[$find] = $replace;

View File

@ -1 +0,0 @@
<p>This is a simple component.</p>

View File

@ -1,57 +0,0 @@
version: "3.8"
volumes:
db-data:
services:
ttp-database:
container_name: TTP-MySQL
image: mysql:8.0
ports:
- ${DOCKER_DB_PORT}:3306
environment:
MYSQL_ROOT_PASSWORD: ${DOCKER_DB_PASSWORD}
MYSQL_DATABASE: ${DOCKER_DB_DATABASE}
MYSQL_USER: ${DOCKER_DB_USERNAME}
MYSQL_PASSWORD: ${DOCKER_DB_PASSWORD}
volumes:
- db-data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin" ,"ping"]
interval: 5s
timeout: 10s
retries: 10
ttp-phpmyadmin:
container_name: TTP-PhpMyAdmin
image: phpmyadmin:latest
ports:
- '7000:80'
restart: always
environment:
PMA_HOST: database
depends_on:
ttp-database:
condition: service_healthy
ttp-nginx:
container_name: TTP-Nginx
build:
context: .
dockerfile: ./docker/ttp-nginx/Dockerfile
target: php-fpm
ports:
- "8080:80"
environment:
- APP_ENV=${APP_ENV}
ttp-apache:
container_name: TTP-Apache
build:
context: .
dockerfile: ./docker/ttp-apache/Dockerfile
target: apache
ports:
- "8000:80"
environment:
- APP_ENV=${APP_ENV}

View File

@ -1,5 +0,0 @@
APP_ENV = "docker"
DOCKER_DB_PORT = 3306
DOCKER_DB_USERNAME = dbadmin
DOCKER_DB_PASSWORD = secret
DOCKER_DB_DATABASE = ttp

View File

@ -1,11 +0,0 @@
FROM nginx:latest as nginx
FROM php:8-fpm as php-fpm
RUN apt-get update -y
RUN apt-get install -y libmariadb-dev
RUN docker-php-ext-install mysqli pdo pdo_mysql
FROM php:8-apache as apache
RUN a2enmod ssl && a2enmod rewrite
RUN docker-php-ext-install mysqli pdo pdo_mysql
WORKDIR /var/www/html

View File

@ -1,11 +0,0 @@
ServerName localhost
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot /var/www/html/
<Directory /var/www/html/>
DirectoryIndex index.php
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

View File

@ -1,66 +0,0 @@
server {
listen 80 default_server;
index index.php;
server_name TheTempusProject;
error_log /var/www/html/logs/nginx-error.log;
access_log /var/www/html/logs/nginx-access.log;
root /var/www/html;
charset utf-8;
sendfile off;
client_max_body_size 100m;
location /images/ {
if (!-e $request_filename){
rewrite ^/images/(.*)$ /index.php?error=image404&url=$1 last;
}
access_log off;
log_not_found off;
}
location /uploads/ {
if (!-e $request_filename){
rewrite ^/uploads/(.*)$ /index.php?error=upload404&url=$1 last;
}
access_log off;
log_not_found off;
}
location ~* \.(?:js|css|png|jpg|gif|ico)$ {
access_log off;
log_not_found off;
}
location = /favicon.ico {
access_log off;
log_not_found off;
rewrite ^(.+)$ /images/favicon.ico break;
}
location = /robots.txt {
allow all;
access_log off;
log_not_found off;
rewrite ^(.+)$ /bin/robots.txt break;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 60s;
fastcgi_read_timeout 60s;
fastcgi_send_timeout 60s;
}
location / {
rewrite ^/errors/(.*)$ /index.php?error=$1 last;
rewrite ^(.+)$ /index.php?url=$1 last;
}
}

View File

@ -1,13 +0,0 @@
FROM php:8-apache as apache
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN apt-get update -y
RUN apt-get install git libzip-dev -y
RUN a2enmod ssl && a2enmod rewrite
RUN docker-php-ext-install mysqli pdo pdo_mysql zip
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
WORKDIR /var/www
RUN rm -rf html/
RUN composer create-project thetempusproject/thetempusproject html
RUN chmod -R 777 html/
RUN chown -R www-data:www-data html/

View File

@ -1,19 +0,0 @@
# TheTempusProject Apache Docker Image
This image will build an apache webserver off php and use composer to clone the project to create a webserver TTP App.
## Build the image
```
docker build -t thetempusproject/ttp-apache:latest .
docker build --no-cache -t thetempusproject/ttp-apache:latest .
```
## Set the proper tag for dockerhub (in cases where you need to build your own image)
```
docker tag ttp-apache:latest thetempusproject/ttp-apache:latest
```
## Run the image
```
docker run -d -p 80:80 thetempusproject/ttp-apache
```

View File

@ -1,29 +0,0 @@
FROM php:8-fpm as php-fpm
# Env
ENV COMPOSER_ALLOW_SUPERUSER=1
# Install Packages
RUN apt-get update -y
RUN apt-get install -y nginx libmariadb-dev git libzip-dev zip unzip supervisor
RUN docker-php-ext-install mysqli pdo pdo_mysql zip
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
#Install TTP
WORKDIR /var/www
RUN rm -rf html/
RUN composer create-project thetempusproject/thetempusproject html
RUN chmod -R 777 html/
RUN chown -R www-data:www-data html/
# Copy Nginx configuration file
RUN cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.old
COPY ./docker/ttp-nginx/nginx.conf /etc/nginx/nginx.conf
# Copy Supervisor configuration file
COPY ./docker/ttp-nginx/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Start Supervisor, which will start both Nginx and PHP-FPM
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

View File

@ -1,19 +0,0 @@
# TheTempusProject Nginx Docker Image
This image will build an nginx webserver off php and use composer to clone the project to create a webserver TTP App.
## Build the image
```
docker build -t thetempusproject/ttp-nginx:latest .
docker build --no-cache -t thetempusproject/ttp-nginx:latest .
```
## Set the proper tag for dockerhub (in cases where you need to build your own image)
```
docker tag thetempusproject/ttp-nginx:latest <username>/ttp-nginx:latest
```
## Run the image
```
docker run -d -p 8000:80 thetempusproject/ttp-nginx
```

View File

@ -1,27 +0,0 @@
location /api/ {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Request-Headers' 'Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Request-Headers' 'Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Request-Headers' 'Authorization,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
}

View File

@ -1,90 +0,0 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
tcp_nopush on;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
gzip on;
server {
listen 80 default_server;
index index.php;
server_name TheTempusProject;
root /var/www/html;
charset utf-8;
sendfile on;
client_max_body_size 100m;
location /js/ {
access_log off;
log_not_found off;
try_files $uri /index.php?error=js404&file=$uri;
}
location /css/ {
try_files $uri /index.php?error=css404&file=$uri;
}
location /images/ {
try_files $uri /index.php?error=image404&url=$uri;
}
location /uploads/ {
try_files $uri /index.php?error=upload404&url=$uri;
}
location /errors/ {
try_files $uri /index.php?error=$uri;
}
location = /favicon.ico {
access_log off;
log_not_found off;
rewrite ^(.+)$ /images/favicon.ico break;
}
location = /robots.txt {
allow all;
access_log off;
log_not_found off;
rewrite ^(.+)$ /bin/robots.txt break;
}
location ~* \.(?:js|css|png|jpg|gif|ico)$ {
access_log off;
log_not_found off;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 60s;
fastcgi_read_timeout 60s;
fastcgi_send_timeout 60s;
}
location / {
rewrite ^/(.+)$ /index.php?url=$1&$args last;
}
}
include /etc/nginx/conf.d/*.conf;
}

View File

@ -1,8 +0,0 @@
[supervisord]
nodaemon=true
[program:php-fpm]
command=/usr/local/sbin/php-fpm
[program:nginx]
command=/usr/sbin/nginx -g 'daemon off;'

View File

@ -1,76 +0,0 @@
#!/usr/bin/env sh
ACCESS_TOKEN=""
CURL_FLAGS=""
GITLAB_API="${CI_API_V4_URL}"
MERGE_IF_SUCCESSFUL="true"
MR_BRANCH=""
MR_TITLE="Auto-Merge-$(date '+%Y%m%d%H%M%S')"
PROJECT_ID="${CI_PROJECT_ID}"
SECONDS_BETWEEN_POOLING=10
TARGET_BRANCH="main"
eval "${@}"
if [ "${MR_BRANCH}" = '' ]; then
echo "[ERROR] No MR branch was given."
exit 1
fi
if [ "${ACCESS_TOKEN}" = '' ]; then
echo "[ERROR] No access token was given."
exit 2
fi
if [ "${MERGE_IF_SUCCESSFUL}" = "1" ] || [ "${MERGE_IF_SUCCESSFUL}" = "true" ]; then
MERGE_IF_SUCCESSFUL="true"
else
MERGE_IF_SUCCESSFUL="false"
fi
MR_JSON=$(curl ${CURL_FLAGS} \
--request POST \
--header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" \
--data-urlencode "source_branch=${MR_BRANCH}" \
--data-urlencode "target_branch=${TARGET_BRANCH}" \
--data-urlencode "title=${MR_TITLE}" \
--data-urlencode "remove_source_branch=true" \
"${GITLAB_API}/projects/${PROJECT_ID}/merge_requests"
)
CURL_EXIT_CODE=$?
if [ "${CURL_EXIT_CODE}" != "0" ]; then
echo "[ERROR] Please check the returned response for details."
echo "[INFO] CURL_EXIT_CODE=${CURL_EXIT_CODE}"
echo "[INFO] MR_JSON=${MR_JSON}"
exit ${CURL_EXIT_CODE}
fi
echo "[SUCCESS] Merge request created successfully!"
MR_URL=$(echo "${MR_JSON}" | jq '.web_url')
echo "[INFO] Merge request URL: ${MR_URL}"
if [ "${MERGE_IF_SUCCESSFUL}" = "true" ]; then
MR_ID=$(echo "${MR_JSON}" | jq '.iid')
echo "[INFO] Will merge MR ID ${MR_ID} (branch '${MR_BRANCH}' into '${TARGET_BRANCH}'), if and when the pipeline passes."
echo "[INFO] Waiting for pipeline to finish..."
while true; do
PIPELINE_STATUS=$(curl ${CURL_FLAGS} --silent --header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" \
"${GITLAB_API}/projects/${PROJECT_ID}/merge_requests/${MR_ID}/pipelines" | jq '.[0].status')
if [ "${PIPELINE_STATUS}" = "\"success\"" ]; then
echo "[INFO] Pipeline succeeded!"
# Merge the merge request
curl ${CURL_FLAGS} --request PUT --header "PRIVATE-TOKEN: ${ACCESS_TOKEN}" \
"${GITLAB_API}/projects/${PROJECT_ID}/merge_requests/${MR_ID}/merge"
echo "[SUCCESS] Merge request merged successfully!"
exit 0
elif [ "${PIPELINE_STATUS}" = "\"failed\"" ]; then
echo "[ERROR] Pipeline failed!"
exit 1
else
echo "[INFO] Pipeline still running..."
sleep ${SECONDS_BETWEEN_POOLING}
fi
done
fi

View File

@ -1,46 +0,0 @@
.update_PHP_deps:
variables:
TIMEZONE: "Europe/Amsterdam" # For the system in general
DATE_TIMEZONE: ${TIMEZONE} # For PHP
GIT_DEPTH: 1
GITLAB_API_URL: ${CI_API_V4_URL}
TARGET_BRANCH: ${CI_COMMIT_REF_NAME} # This is the branch chosen in the `Pipeline Schedule`
TARGET_REMOTE: "https://${GITLAB_USERNAME}:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}.git"
# These could/should be overridden in an extending job:
UPDATE_BRANCH_PREFIX: "update_PHP_deps_" # Used for the update branch name, it will be followed by the datetime
GIT_USER: "" # Used for the update commit
GIT_EMAIL: "" # Used for the update commit
GITLAB_USERNAME: "" # Used for pushing the new branch and opening the MR
GITLAB_ACCESS_TOKEN: "" # Used for pushing the new branch and opening the MR
MERGE_IF_SUCCESSFUL: "false" # Set to true, to merge automatically if the pipeline succeeds
SECONDS_BETWEEN_POOLING: 10 # Nbr of seconds between checking if the MR pipeline is successful, so then it will merge
JOB_GIT_FLAGS: ""
JOB_CURL_FLAGS: ""
JOB_COMPOSER_FLAGS: ""
interruptible: true # allows to stop the job if a newer pipeline starts, saving resources and allowing new jobs to start because job concurrency is limited
stage: "update_PHP_deps"
rules:
- if: '$SCHEDULED_PIPELINE == $CI_JOB_NAME'
script: # `git`, `jq` and `curl` are needed, so if they are not already installed, they should be installed in the `before_script` of the extending job
- git ${JOB_GIT_FLAGS} fetch origin ${TARGET_BRANCH}
- git ${JOB_GIT_FLAGS} checkout ${TARGET_BRANCH}
- export DATE_TIME="$(date '+%Y%m%d%H%M%S')"
- export MR_BRANCH="${UPDATE_BRANCH_PREFIX}${DATE_TIME}"
- git ${JOB_GIT_FLAGS} checkout -b "${MR_BRANCH}"
- composer update ${JOB_COMPOSER_FLAGS}
- if [ "$(git diff)" == "" ]; then echo "No updates needed!"; exit 0; fi
- export TITLE="Update PHP dependencies [${DATE_TIME}]"
- git ${JOB_GIT_FLAGS} commit -a -m "${TITLE}"
- git ${JOB_GIT_FLAGS} push "${TARGET_REMOTE}" "${MR_BRANCH}"
- |
vendor/hgraca/ci-cd-composer-update/src/GitLab/auto_merge_mr.sh \
MERGE_IF_SUCCESSFUL="${MERGE_IF_SUCCESSFUL}" \
MR_BRANCH="${MR_BRANCH}" \
MR_TITLE="\"${TITLE}\"" \
TARGET_BRANCH="${TARGET_BRANCH}" \
ACCESS_TOKEN="${GITLAB_ACCESS_TOKEN}" \
SECONDS_BETWEEN_POOLING="${SECONDS_BETWEEN_POOLING}" \
GITLAB_API="${GITLAB_API_URL}" \
CURL_FLAGS="${JOB_CURL_FLAGS}"

View File

@ -1,421 +0,0 @@
<?php
/**
* install.php
*
* This is the install controller for the application.
* After completion: YOU SHOULD DELETE THIS FILE.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Controllers;
require_once 'bin/autoload.php';
use TheTempusProject\TheTempusProject;
use TheTempusProject\Classes\Controller;
use TheTempusProject\Classes\Plugin;
use TheTempusProject\Classes\Installer;
use TheTempusProject\Classes\Forms;
use TheTempusProject\Models\User;
use TheTempusProject\Classes\Email;
use TheTempusProject\Bedrock\Functions\Code;
use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Bedrock\Functions\Cookie;
use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\Bedrock\Functions\Upload;
use TheTempusProject\Bedrock\Functions\Hash;
use TheTempusProject\Bedrock\Functions\Session;
use TheTempusProject\Houdini\Classes\Issues;
use TheTempusProject\Houdini\Classes\Views;
use TheTempusProject\Houdini\Classes\Components;
use TheTempusProject\Houdini\Classes\Template;
use TheTempusProject\Hermes\Functions\Redirect;
use TheTempusProject\Hermes\Functions\Route;
use TheTempusProject\Canary\Bin\Canary as Debug;
class Install extends Controller {
private $installer;
private $location = false;
private $steps = [
'Welcome',
'Terms',
'Verify',
'Configure',
'Routing',
'Models',
'Plugins',
'Install',
'Resources',
'User',
'Complete',
];
/**
* This is the main builder for the rest of the controller. It mostly handle template variables used on all pages.
*/
public function __construct() {
parent::__construct();
self::$title = 'TP Installer';
self::$pageDescription = 'This is the install script for The Tempus Project.';
$this->installer = new Installer();
Template::noIndex();
Template::noFollow();
foreach ( $this->steps as $step ) {
Components::set( 'menu-' . $step, 'disabled' );
}
if ( $this->checkSession() !== false ) {
$this->location = $this->getStep();
Components::set( 'menu-' . ucfirst( $this->location ), 'active' );
} else {
Components::set( 'menu-Welcome', 'active' );
}
Components::set( 'installer-nav', Views::simpleView( 'install.nav' ) );
}
/**
* This method will reset the install hash, set the saved install step, update the session and cookie, and refresh if required.
*
* @param string $page
* @param boolean $redirect
* @return void
*/
public function nextStep( $page, $redirect = false ) {
$newHash = Code::genInstall();
$this->installer->setNode( 'installHash', $newHash, true );
$this->installer->setNode( 'installStep', $page, true );
Session::put( 'installHash', $newHash );
Cookie::put( 'installHash', $newHash );
if ( $redirect === true ) {
Redirect::reload();
}
return true;
}
public function checkSession() {
if ( empty( $this->installer->getNode('installHash') ) ) {
Debug::error( 'install hash not found on file.' );
return false;
}
$session = Session::get( 'installHash' );
$cookie = Cookie::get( 'installHash' );
$file = $this->installer->getNode('installHash');
if ( ! $session && ! $cookie ) {
Debug::error( 'install hash not found in session or cookie.' );
return false;
}
if ( $cookie && ! $session ) {
if ( $cookie !== $file ) {
Debug::error( 'install cookie did not match install file.' );
Cookie::delete( 'installHash' );
return false;
}
Debug::error( 'cookie matches file, using as session' );
Session::put( 'installHash', $cookie );
return true;
}
if ( $session !== $file ) {
Debug::error( 'session did not match file, deleting session' );
Session::delete( 'installHash' );
return false;
}
return true;
}
public function getStep() {
if ( !empty( $this->installer->getNode('installStep') ) ) {
return $this->installer->getNode('installStep');
}
Debug::error( 'install status not found.' );
return false;
}
/**
* The index method is called on the first request and all requests thereafter and is responsible for routing
* the current request to the appropriate installer step/method.
*/
public function index() {
if ( false === $this->location ) {
return $this->welcome();
}
// this seems dumb, i could probably do this better
$location = $this->location;
return $this->$location();
}
/**
* The welcome method is is just a page to submit a form and save the install.json for the first time.
*/
public function welcome() {
if ( Forms::Check( 'installStart' ) ) {
return $this->nextStep( 'terms', true );
}
if ( Input::exists( 'submit' ) ) {
Issues::add( 'error', ['There was an error with the Installation.' => Check::userErrors()] );
}
Views::view( 'install.start' );
}
/**
* The terms step is pretty straight forward. You simply need to continue to the next step, understanding
* that you agree to these terms when you continue the installation.
*/
public function terms() {
if ( Forms::Check( 'installAgreement' ) ) {
return $this->nextStep( 'verify', true );
}
if ( Input::exists( 'submit' ) ) {
Issues::add( 'error', [ 'There was an error with the Installation.' => Check::userErrors() ] );
}
Components::set( 'TERMS', Views::simpleView( 'terms' ) );
Views::view( 'install.agreement' );
}
/**
* There is a small list a of requirements for the application to run properly. These are things like sessions, emails, cookies, etc.
* This step verifies that all of these features are working as expected.
*/
public function verify() {
if ( Forms::Check( 'installCheck' ) ) {
return $this->nextStep( 'configure', true );
}
if ( Input::exists( 'submit' ) ) {
Issues::add( 'error', ['There was an error with the Installation.' => array_merge( Check::userErrors(), Check::systemErrors() )] );
}
Views::view( 'install.check' );
}
/**
* One of the most important steps for installation, is the configuration. In this step, we will define some very core settings
* for the app including the app's name and database credentials.
*/
public function configure() {
if ( Forms::Check( 'installConfigure' ) ) {
$logo = 'images/logo.png';
if ( Input::exists( 'logo' ) && Upload::image( 'logo', 'System' ) ) {
$logo = 'Uploads/Images/System/' . Upload::last();
}
TheTempusProject::$activeConfig->load( BEDROCK_CONFIG_JSON );
$baseConfig = TheTempusProject::$configMatrix;
$baseConfig['main']['logo']['value'] = $logo;
$baseConfig['main']['name']['value'] = Input::postNull( 'siteName' );
$baseConfig['main']['template']['value'] = $baseConfig['main']['template']['default'];
$baseConfig['main']['tokenEnabled']['value'] = $baseConfig['main']['tokenEnabled']['default'];
$baseConfig['main']['loginLimit']['value'] = $baseConfig['main']['loginLimit']['default'];
$baseConfig['database']['dbEnabled']['value'] = $baseConfig['database']['dbEnabled']['default'];
$baseConfig['database']['dbHost']['value'] = Input::postNull( 'dbHost' );
$baseConfig['database']['dbMaxQuery']['value'] = $baseConfig['database']['dbMaxQuery']['default'];
$baseConfig['database']['dbName']['value'] = Input::postNull( 'dbName' );
$baseConfig['database']['dbPassword']['value'] = Input::postNull( 'dbPassword' );
$baseConfig['database']['dbPrefix']['value'] = Input::postNull( 'dbPrefix' );
$baseConfig['database']['dbUsername']['value'] = Input::postNull( 'dbUsername' );
if ( ! TheTempusProject::$activeConfig->generate( CONFIG_JSON, $baseConfig ) ) {
return Issues::add( 'error', 'Config file already exists so the installer has been halted. If there was an error with installation, please delete app/config/config.json manually and try again. The installer should automatically bring you back to this step.' );
}
Session::flash( 'success', 'Config saved successfully.' );
return $this->nextStep( 'routing', true );
}
if ( Input::exists( 'submit' ) ) {
Issues::add( 'error', ['There was an error with your form.' => Check::userErrors()] );
}
Views::view( 'install.configure' );
}
/**
* For the application to function properly on nginx or apache, the web servers must be configured correctly.
* Depending on which server you use, this step will help you set up and test the routing required for the
* application to function as expected.
*/
public function routing() {
if ( Input::exists( 'submit' ) && Forms::Check( 'installRouting' ) ) {
// if its Apache, attempt to generate the htaccess file before testing
if ( Check::isApache() ) {
if ( !$this->installer->checkHtaccess() ) {
if ( !$this->installer->saveHtaccess() ) {
Issues::add( 'error', 'There was an unexpected error when generating your htaccess file. Please see the error logs for more information.' );
}
}
}
// Apache should have the htaccess now, and Nginx should have been configured this way out of the box
if ( Route::testRouting() ) {
Session::flash( 'success', 'Routing is working as expected.' );
return $this->nextStep( 'models', true );
} else {
Issues::add( 'error', 'Could not verify url routing' );
}
// routing is busted, if its Apache, we already have the error from htaccess generation
// so Nginx is the only one that needs more info
if ( Check::isNginx() ) {
Issues::add( 'error', 'There appears to be an issue with your configuration. Certain urls are not being routed as expected.' );
}
} elseif ( Input::exists( 'submit' ) ) {
Issues::add( 'error', ['There was an error with your form.' => Check::userErrors()] );
}
Views::view( 'install.routing' );
}
/**
* Since models are required for the proper function of the app, this step is required and has no selection to make.
* This step will install all the required models excluding resources.
*/
public function models() {
$errors = [];
$options = [ 'installResources' => false ];
$models = $this->installer->getModelList( MODEL_DIRECTORY );
if ( Input::exists( 'submit' ) && Forms::Check( 'installModels' ) ) {
$error = false;
foreach ( $models as $model ) {
$result = $this->installer->installModel( $model, $options );
if ( $result === false ) {
$error = true;
continue;
}
}
if ( $error ) {
Issues::add( 'error', [ 'There was an error with the Installation.' => $this->installer->getErrors() ] );
} else {
Session::flash( 'success', [ 'Models Have been installed successfully.' => $this->installer->getErrors() ] );
return $this->nextStep( 'plugins', true );
}
} elseif ( Input::exists( 'submit' ) ) {
Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] );
}
Views::view( 'install.models', $models );
}
/**
* This step will allow the user to install any plugins currently available for installing excluding resources.
*/
public function plugins() {
$errors = [];
$options = [ 'resources_installed' => false ];
$plugins = $this->installer->getAvailablePlugins();
$selected_plugins = Input::post( 'P_' );
if ( Input::exists( 'submit' ) && Forms::Check( 'installPlugins' ) ) {
$error = false;
foreach ( $plugins as $plugin ) {
if ( ! in_array( $plugin->name, $selected_plugins ) ) {
continue;
}
$result = $this->installer->installPlugin( $plugin, $options );
if ( !$result ) {
$error = true;
continue;
}
Plugin::enable( $plugin->name, true );
}
if ( $error ) {
Issues::add( 'error', ['There was an error with the Installation.' => $this->installer->getErrors()] );
} else {
Session::flash( 'success', [ 'Plugins Have been installed successfully.' => $this->installer->getErrors() ] );
return $this->nextStep( 'resources', true );
}
} elseif ( Input::exists( 'submit' ) ) {
Issues::add( 'error', ['There was an error with your form.' => Check::userErrors()] );
}
Views::view( 'install.plugins', $plugins );
}
/**
* The resource step will cycle through the partially installed models and install any missing resources.
*/
public function resources() {
$errors = [];
if ( Input::exists( 'submit' ) && Forms::Check( 'installResources' ) ) {
$error = false;
$allModules = $this->installer->getModules(true);
foreach ( $allModules as $name => $module ) {
if ( empty( $module ) || 'unknown' === $name || empty( $name ) || empty( $module['installedVersion'] ) ) {
continue;
}
if ( 'plugin' == $module['type'] ) {
$installResult = $this->installer->installPlugin( (object) $module, [ 'resources_installed' => true ], false );
} else {
$installResult = $this->installer->installModel( (object) $module, [ 'installResources' => true ], false );
}
if ( !$installResult ) {
$error = true;
}
}
if ( $error ) {
Issues::add( 'error', ['There was an error with the Installation.' => $this->installer->getErrors()] );
} else {
Session::flash( 'success', ['Resources have been installed successfully.' => $this->installer->getErrors()] );
return $this->nextStep( 'user', true );
}
} elseif ( Input::exists( 'submit' ) ) {
Issues::add( 'error', ['There was an error with your form.' => Check::userErrors()] );
}
Views::view( 'install.resources' );
}
/**
* This is the registration step; allowing the installer to create the super admin account.
*/
public function user() {
if ( Input::exists( 'submit' ) && Forms::Check( 'installAdminUser' ) ) {
$user = new User();
if ( !$user->create( [
'username' => Input::post( 'newUsername' ),
'password' => Hash::make( Input::post( 'userPassword' ) ),
'email' => Input::post( 'userEmail' ),
'lastLogin' => time(),
'registered' => time(),
'confirmed' => 1,
'terms' => 1,
'userGroup' => 1,
] ) ) {
Issues::add( 'error', 'There was an error creating the admin user.' );
return;
}
$this->nextStep( 'complete' );
return $this->complete( true );
} elseif ( Input::exists( 'submit' ) ) {
Issues::add( 'error', ['There was an error with your form.' => Check::userErrors()] );
}
Views::view( 'install.adminUser' );
}
/**
* This is the final step of installation. On first load it will send an email and show the final view.
* It will then redirect to the index controller and prompt the user to delete this file on any subsequent loads.
*
* @param bool $sendEmail
*/
public function complete( $sendEmail = false ) {
if ( $sendEmail ) {
Issues::add( 'success', 'The Tempus Project has been installed successfully.' );
Email::send( Input::post( 'email' ), 'install', null, [ 'template' => true ] );
return Views::view( 'install.complete' );
}
Session::flash( 'notice', 'Installation has been completed. Updates and installation can be managed in the admin panel. Please delete the install.php file.' );
Redirect::to( 'home/index' );
}
}
$app = new TheTempusProject();
if ( CANARY_ENABLED ) {
// ini_set( 'display_errors', '1' );
// ini_set( 'display_startup_errors', '1' );
// error_reporting( E_ALL );
// $app->printDebug();
}
$app->setUrl( 'install/index' );
$app->load();
if ( CANARY_DEBUG_TO_CONSOLE ) {
Components::set( 'DEBUGGING_LOG', Debug::dump() );
register_shutdown_function( [ $app::class, 'handle_shutdown' ] );
}
exit;

View File

@ -1,62 +0,0 @@
# fresh install
## Install required apps
```
apt install git composer php8.1-curl -y
```
## Set-Up the SSL folder to keep things together
```
mkdir /etc/nginx/ssl/
```
- Now That you have the directory created, copy the `.key` and `.pem` files into the newly made ssl folder on the server.
- You will then need to modify the filer ownership and permissions
```
chmod -R 655 /etc/nginx/ssl
chown -R www-data:www-data /etc/nginx/ssl
```
## Add configs for the site
- First, copy `ttp.conf` into the `/etc/nginx/snippets/` folder.
- Next, copy the `thetempusproject.com.conf` file into the `/etc/nginx/sites-available/` folder.
- The next block will acomplish a few things: backup the old config, enable the new config, disable the old config, and restart the server.
```
mkdir /etc/nginx/sites-available/old/
sudo mv /etc/nginx/sites-available/* /etc/nginx/sites-available/old/
sudo ln -s /etc/nginx/sites-available/thetempusproject.com.conf /etc/nginx/sites-enabled/thetempusproject.com.conf
sudo rm -rf /etc/nginx/sites-enabled/*
sudo systemctl restart nginx.service
```
## Set-Up the files
```
cd /var/www/
git config --global credential.helper store
git clone https://git.thetempusproject.com/thetempusproject/thetempusproject-com.git thetempusproject.com
cd thetempusproject.com
git fetch
git checkout production
```
_You will be prompted for git creds, use the creds shared below_
```
git config --global --add safe.directory /var/www/thetempusproject.com
git config --global --add safe.directory /var/www/thetempusproject.com/vendor/thetempusproject/hermes
git config --global user.name "Production Server"
git config --global user.email webmaster@thetempusproject.com
cd thetempusproject.com
composer install
chmod -R 777 .
chown -R www-data:www-data .
```
#### GitLab Credentials:
User: `root`\
Password: `rdFtVPhzlu6u6orxN4NAsbgAE4AyqZPTXPXQTleyA5I=`

View File

@ -1,25 +0,0 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
tcp_nopush on;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
gzip on;
include /etc/nginx/sites-enabled/*;
include /etc/nginx/conf.d/*.conf;
}

View File

@ -1,119 +0,0 @@
apt-get update
sudo add-apt-repository ppa:ondrej/php
apt-get update
sudo apt-get install php8.2-cli php8.2-fpm
sudo apt install php8.2-common php8.2-mysql php8.2-xml php8.2-xmlrpc php8.2-curl php8.2-gd php8.2-imagick php8.2-cli php8.2-dev php8.2-imap php8.2-mbstring php8.2-opcache php8.2-soap php8.2-zip php8.2-redis php8.2-intl unzip -y
mkdir /etc/nginx/ssl/
chmod -R 655 /etc/nginx/ssl
chown -R www-data:www-data /etc/nginx/ssl
<copy paste the key and pem files from cloudflare ssl setup>
mkdir /etc/nginx/sites-available/old/
sudo mv /etc/nginx/sites-available/* /etc/nginx/sites-available/old/
sudo touch /etc/nginx/sites-available/thetempusproject.com.conf
<updated the main site conf>
<uploaded the ttp snippet>
<updated the nginx.conf>
sudo rm -rf /etc/nginx/sites-enabled/*
sudo ln -s /etc/nginx/sites-available/thetempusproject.com.conf /etc/nginx/sites-enabled/thetempusproject.com.conf
sudo systemctl restart nginx.service
cd ~
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
HASH=`curl -sS https://composer.github.io/installer.sig`
php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
cd /var/www/
composer create-project thetempusproject/thetempusproject thetempusproject.com
sudo ln -s /etc/nginx/sites-available/black-airplane /etc/nginx/sites-enabled/
1Ag5calIO8xXwS
mysql
CREATE USER 'ttp'@'localhost' IDENTIFIED BY '1Ag5calIO8xXwS';
GRANT ALL PRIVILEGES ON * . * TO 'ttp'@'localhost';
FLUSH PRIVILEGES;
CREATE DATABASE ttp;

View File

@ -1,24 +0,0 @@
upstream php {
server unix:/run/php/php8.2-fpm.sock;
}
server {
listen 80 default_server;
index index.php;
server_name thetempusproject.com;
root /var/www/thetempusproject.com;
charset utf-8;
sendfile off;
client_max_body_size 100m;
# custom TTP code
include snippets/ttp.conf;
location ~* \.php$ {
fastcgi_pass php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_intercept_errors on;
}
}

View File

@ -1,29 +0,0 @@
-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCgBC55LW3hfrJv
Ouf7akrC195/aRqkcIWVTPjiL4YmfoeVnVDKDQgSi4R+UPvr//MN7vOyeB5fuN8t
YkX2JCLmZ1t+qxLK0p0Iz3jzSvTqozWBJUgEggq5qWyZz09u65kHK5pN0Pen0AXW
TccHHlAufQlASO8okLYGf1JFA0wsP//QtkkGaEt+UqoickKDXhhkk5dJSqLNCIh/
VPvC2x+HupCeG9TemnhgzRU/cjPakdlr+bClXDVs7lziCKRJRpe6QDMb6+kZTmz+
HTD2tWQ0hevDwedckFAu7VZbrpdGh5wtdai337xJmK7KbkHeT2aP5MTODB5F4ofo
HV0jxc/RAgMBAAECggEAALzYMoCQPL2C6NKckmsEZnbMjKmRQQAQS5aH4LIPpCKJ
8TmBD3dlKcG5JgRtTuKWjiJDfxeA61fMtpa5BBgZTZbdI/25p9P1+54KPJPkQmcn
dl2TwgqP7lhuutxK7VPaeB8eNlzf4WcK+diQsfKUs8wphGF5scYOAsRoPo9z9NHC
WEvY54rfqZAMPoHTd4CvNh4nWfaBrpXRt1eBDhmHmEcchAWfPFm5haioYDve6qcP
RnnmqmrLbey0/CeedDsBDgyu4DLS1CSV0y+ZTsW712js94ahoB4dHiUDXJx9SiiL
e+peP9suQwqB5C55wZ+xPHpHmhLMvxgsYu+YI4U1QQKBgQDKuDVGxU5WYZO9SmcI
H7k4vFWp+zUzy8K1AHHqJT6XVB5I1s2jOElmI7ptW7AgCqbcMtI0PA5fF8h0BEdx
DH80XamXli6oxPtlNgQ+p8EdUxAaJJHJkGTIurbv0Zij7iolDGD2ne/xsBdGYnZV
4qn8Xok++Ix+U/XciqAE7ZIUYQKBgQDKEro+03Q8jcrYdh4acRK9S8kFdgdUcrVQ
BdmEjYvYHq0VkSve2KkW/2IQTykBrkGwnYT+8tEynKHNcfMZu7PDfQJIKRr22hBU
jZcZLtOO41osU8xSHwF+IFJbay2nYj/mYAO3GePUJ/JfPj6DyG0Ud+JkmEGavSPe
N+fVTsxxcQKBgG11l7bV9N2ppHdyRD3bu0yKTQsSjICiRkkrq1bNs4VMs2mLKtA2
JVPUeOZxuqEif0So4F26C9yG4ALdCKJfKBRjep5SRnF0o3Xb++DE/f5SioBDPMEE
iZblUsAdgXkKsZD9pSGk2Bm9hmPH6LOpRzXw6dSpqlrQBRKHe64NhXIhAoGAZFUA
HImpQRe2C9w5/i7+evbSDOAZq5h45g7Bfcs6EEjK79ZwzekNq9mJu0dSuP7opuTP
UDcIH/UdcYCOj8xe6UV8iI/AT6jeSt0ylNJnQJ8p+rBw1qWGfDVYLwP8WwuxZpVt
wtAcCw76jMe/CnfNkUglJIVkrYwT7xYbChJh+EECgYB014MoYDxTXXSOL4ewL+jb
L5Edu8IEOitb3ACXiH3179067aBSV1ETROVb/ldPXJzXTJSSP19Ud7EFp03BECVM
/dmaMK24gHHhamQuS2Fn7WGeiCO35R3Hd+0XnD+9Tb68Q5+wcI7f9EHZdLuo7xBk
Exwxx3cDKRg9B+K35WNLGQ==
-----END PRIVATE KEY-----

View File

@ -1,28 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIEtDCCA5ygAwIBAgIULHScUpTRNz5y8oPSPW/dOw+qK0AwDQYJKoZIhvcNAQEL
BQAwgYsxCzAJBgNVBAYTAlVTMRkwFwYDVQQKExBDbG91ZEZsYXJlLCBJbmMuMTQw
MgYDVQQLEytDbG91ZEZsYXJlIE9yaWdpbiBTU0wgQ2VydGlmaWNhdGUgQXV0aG9y
aXR5MRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlh
MB4XDTI0MDgxMjIzNTAwMFoXDTM5MDgwOTIzNTAwMFowYjEZMBcGA1UEChMQQ2xv
dWRGbGFyZSwgSW5jLjEdMBsGA1UECxMUQ2xvdWRGbGFyZSBPcmlnaW4gQ0ExJjAk
BgNVBAMTHUNsb3VkRmxhcmUgT3JpZ2luIENlcnRpZmljYXRlMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoAQueS1t4X6ybzrn+2pKwtfef2kapHCFlUz4
4i+GJn6HlZ1Qyg0IEouEflD76//zDe7zsngeX7jfLWJF9iQi5mdbfqsSytKdCM94
80r06qM1gSVIBIIKualsmc9PbuuZByuaTdD3p9AF1k3HBx5QLn0JQEjvKJC2Bn9S
RQNMLD//0LZJBmhLflKqInJCg14YZJOXSUqizQiIf1T7wtsfh7qQnhvU3pp4YM0V
P3Iz2pHZa/mwpVw1bO5c4gikSUaXukAzG+vpGU5s/h0w9rVkNIXrw8HnXJBQLu1W
W66XRoecLXWot9+8SZiuym5B3k9mj+TEzgweReKH6B1dI8XP0QIDAQABo4IBNjCC
ATIwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcD
ATAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBR+wLMvzqvwy0XS0W7kaRbDG8Dr8zAf
BgNVHSMEGDAWgBQk6FNXXXw0QIep65TbuuEWePwppDBABggrBgEFBQcBAQQ0MDIw
MAYIKwYBBQUHMAGGJGh0dHA6Ly9vY3NwLmNsb3VkZmxhcmUuY29tL29yaWdpbl9j
YTA3BgNVHREEMDAughYqLnRoZXRlbXB1c3Byb2plY3QuY29tghR0aGV0ZW1wdXNw
cm9qZWN0LmNvbTA4BgNVHR8EMTAvMC2gK6AphidodHRwOi8vY3JsLmNsb3VkZmxh
cmUuY29tL29yaWdpbl9jYS5jcmwwDQYJKoZIhvcNAQELBQADggEBAJ0XENfsLO9z
/jjsDMYNjN53Cqaz1y4UuHJptQ+Mg+H6GaOgw99XdN6SWY0lVj/D/tQ09bdRVPv/
JK99pikHGWnNgpybJHyhLM6Vj32sECfo3OUb8rSgEM4pMkQS7j97wFZxFiXoolY7
Rk+o76T1R9rHrUQZEeZ1Td/Vwhp1DScPKaMU+DpgzTHfXBWMyTUWCqX/Q+XirnWf
iCUT6HR08rslwGjRctKQ0f5jj8kCj2IUmyKyHJ+2SQe9iDRQ9g7hnmH+Tmale0at
D912ywToG1f/Q4LVXfViemp8VIBobjZIoRRpTv2l0XnDEpUlAr5UjrH0XiHNzzqT
wmRBvbWDmbc=
-----END CERTIFICATE-----

View File

@ -1,93 +0,0 @@
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
index index.php;
error_page 404 /index.php;
ssl_certificate /etc/nginx/ssl/thetempusproject.com.pem;
ssl_certificate_key /etc/nginx/ssl/thetempusproject.com.key;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ /\.(?!well-known).* {
deny all;
}
location ~ /\.ht {
deny all;
}
location ~ ^/(doc|sql|setup)/ {
deny all;
}
location ~ /\. {
deny all;
}
location ~* \.(?:js|css|png|jpg|gif|ico|woff|tff|woff2|min.css.map)$ {
access_log off;
log_not_found off;
}
location /js/ {
access_log off;
log_not_found off;
try_files $uri /index.php?error=js404&file=$uri;
}
location /css/ {
access_log off;
log_not_found off;
try_files $uri /index.php?error=css404&file=$uri;
}
location /images/ {
try_files $uri /index.php?error=image404&url=$uri;
}
location /uploads/ {
try_files $uri /index.php?error=upload404&url=$uri;
}
location /errors/ {
try_files $uri /index.php?error=$uri;
}
location /api/ {
# Handle CORS for all requests
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Authorization, DNT, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length, Content-Range' always;
}
# Handle preflight requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Headers' 'Authorization, DNT, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Range' always;
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8' always;
return 204; # Return no content for preflight
}
rewrite ^/(.+)$ /index.php?url=$1&$args;
}
location / {
rewrite ^/(.+)$ /index.php?url=$1&$args;
}