This commit is contained in:
Joey Kimsey
2024-12-02 19:05:04 -05:00
parent bf7b7ba1c9
commit 6f0b75cfd0
17 changed files with 888 additions and 108 deletions

10
.gitignore vendored
View File

@ -34,9 +34,6 @@ $RECYCLE.BIN/
.VolumeIcon.icns .VolumeIcon.icns
# Directories potentially created on remote AFP share # Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items Temporary Items
.apdisk .apdisk
@ -45,16 +42,11 @@ Temporary Items
!bin/cli/.gitignore !bin/cli/.gitignore
# keep main directories # keep main directories
!css/.gitignore
!vendor/.gitignore !vendor/.gitignore
# SublimeText
*.sublime-project
*.sublime-workspace
# TheTempusProject Specific # TheTempusProject Specific
.htaccess .htaccess
app/config/*
!app/config/constants.php !app/config/constants.php
uploads/images/* uploads/images/*
logs/* logs/*

441
README.md
View File

@ -1,131 +1,374 @@
# The Tempus Project # The Tempus Project
_Rapid Prototyping Framework built on PHP utilizing the MVC pattern with a Bootstrap front-end_
__Developer(s):__ 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
- __Joey Kimsey__ - _Lead Developer_ 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. 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.**\ **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. 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.
## Table of contents 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
[[_TOC_]]
## Find Us
* [DockerHub](https://hub.docker.com/repositories/thetempusproject)
* [Packagist](https://packagist.org/users/joeyk4816/packages/)
* [GitLab](https://git.thetempusproject.com/the-tempus-project/thetempusproject)
## Summary
The Tempus Project is a PHP application utilizing the MVC pattern to serve up simple pages and APIs with minimal effort. It requires a MySQL database to function and is designed to run equally well with nginx or apache powering the webserver. Most of the core functionality is developed in house and provided through dependencies. At this time, the frontend is driven on bootstrap 3 and FontAwesome for simplicity.
## Features ## Features
- A Plugin system that allows plug-and-play functionality A User management system with groups, permissions, preferences, registration, and recovery. (All Controlled dynamically via our plugin interface)
- A User management system A Plugin system that allows plug-and-play functionality for a huge number of features.
- groups Compatibility with both Apache and NGINX.
- permissions Built with Bootstrap with a focus on mobile compatibility.
- preferences Incredibly easy to set-up, deploy, and develop with.
- registration and recovery
(All Controlled dynamically via our plugin interface)
- Compatibility with both Apache and NGINX
- Built with Bootstrap with a focus on mobile compatibility
- Incredibly easy to set-up, deploy, and develop
## Installation ## Installation
The preferred method for installation is [Composer](#composer) but special attention has been given to installation and usage [without Composer](#composer). Preferred method for installation is using composer.
### Composer
The simplest method to start a new project is to use composer to create a new project and automatically clone all the necessary files:
#### via create-project
```
composer create-project thetempusproject/thetempusproject test-app
```
#### via clone & install
1. Clone the directory to wherever you want to install the framework.
`git clone https://git.thetempusproject.com/the-tempus-project/thetempusproject.git <test-app>`
1. Open your terminal to the directory you previously cloned the repository.
`cd <test-app>`
1. Install using composer:
`php composer.phar install`
### Manually ### Manually
### Docker
### Composer
1. Clone the directory to wherever you want to install the framework. 1. Clone the directory to wherever you want to install the framework.
`git clone https://git.thetempusproject.com/the-tempus-project/thetempusproject.git <test-app>` 2. Open your terminal to the directory you previously cloned the repository.
1. Open your terminal to the directory you previously cloned the repository. 3. Install using composer:
`cd <test-app>/` `php composer.phar install`
1. Clone the dependency directories to the vendor/ folder. 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.
cd vendor/
git clone https://git.thetempusproject.com/the-tempus-project/bedrock.git bedrock
git clone https://git.thetempusproject.com/the-tempus-project/canary.git canary
git clone https://git.thetempusproject.com/the-tempus-project/hermes.git hermes
git clone https://git.thetempusproject.com/the-tempus-project/houdini.git houdini
```
__Note:__ The autoloader should automatically detect and use the dependencies, but they need to be sorted into the folders ans shown above. #### Apache
#### NGINX
## Docker #### Docker-Compose
To enable quick deployment and collaboration The Tempus Project is distributed with the files to build your own docker images or stack with apache or nginx The included `docker-compose.yml` will load up an entire stack including apache and nginx, as well as a MySQL server with phpmyadmin. If you have any trouble with the installation, you can check out our FAQ page on the wiki for answers to common issues.
You will need docker installed on your system then you can either download the latest images from DockerHud: 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!**
docker pull thetempusproject/ttp-apache
docker pull thetempusproject/ttp-nginx
```
Or you can build your own images from this repository. More information can be found in the included README files: #### Currently being developed
* [Apache Image](docker/ttp-apache/README.md)
* [Nginx Image](docker/ttp-nginx/README.md)
### Docker-Compose
The Docker stack included here will build new versions of the nginx and apache webserver and launch them in individual containers. It will also create 2 more containers; one for php, and one for phpmyadmin.
```
docker-compose -f docker-compose.yml up --build -d --no-cache
```
__Note:__ If you cloned the repository from git, you will need to copy the `docker/.env.example` to `.env` in the root directory and update the contents before proceeding with docker-compose.
## Contributing
TheTempusProject is an open source project and welcomes community contributions. Please refer to the [Contributing file](CONTRIBUTING.md) for more details.
## License
See the [LICENSE](LICENSE) file for licensing information as it pertains to files in this repository.
## Known Issues
- [ ] The blog plugin should add a welcome post during the installResources step of the installer. It doesn't work right now.
## Currently being developed
- [ ] Adding documentation - [ ] Adding documentation
- [ ] Unit testing - [ ] Unit tests
## Future updates #### Future updates
- [ ] Expansion of PDO to allow different database types - [ ] Expansion of PDO to allow different database types
- [ ] Update installer to account for database deltas, allowing easy updating. - [ ] Update installer to account for updates.
- [ ] Implement uniformity in terms of error reporting, exceptions, logging. - [ ] Implement uniformity in terms of error reporting, exceptions, logging.
- [ ] I want to make an api that allows you to download and install new plugins from a centralized repository - [ ] The templating system has gotten too large and needs to be split into its own repo
- [ ] i want plugin instalation to be compatible with composer for easier management of added plugins.
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.

222
app/config/config.json Normal file
View File

@ -0,0 +1,222 @@
{
"main":
{
"logo":
{
"type": "file",
"pretty": "Site Logo (Used mostly in emails)",
"default": "images/logo.png",
"value": "images/logo.png"
},
"name":
{
"type": "text",
"pretty": "Site Name",
"default": "TTP Example",
"value": "TheTempusProject"
},
"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
},
"loginLimit":
{
"type": "text",
"pretty": "Maximum Login Attempts per hour",
"default": 5,
"value": "5"
}
},
"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":
{
"dbMaxQuery":
{
"type": "text",
"pretty": "Maximum results per query",
"default": 100,
"protected": true,
"value": 100
},
"dbEnabled":
{
"type": "radio",
"pretty": "Database Enabled",
"default": true,
"protected": true,
"value": true
},
"dbHost":
{
"type": "text",
"pretty": "Database Host (IE: http://localhost:3306)",
"default": "127.0.0.1",
"protected": true,
"value": "194.195.208.99"
},
"dbName":
{
"type": "text",
"pretty": "Database Name",
"default": "ttp-example",
"protected": true,
"value": "ttp-com"
},
"dbPassword":
{
"type": "text",
"pretty": "Database Password",
"default": "",
"protected": true,
"value": "lsVb#$D74816"
},
"dbPrefix":
{
"type": "text",
"pretty": "Database table Prefix",
"default": "TTP_",
"protected": true,
"value": "TTP_"
},
"dbUsername":
{
"type": "text",
"pretty": "Database Username",
"default": "root",
"protected": true,
"value": "joeyk"
}
},
"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 submitting.",
"default": true,
"value": true
},
"emailTemplate":
{
"type": "text",
"pretty": "Email Template",
"default": "BugReportEmail",
"value": "BugReportEmail"
}
},
"bugtracker":
{
"enabled":
{
"type": "radio",
"pretty": "Enable Bug tracking.",
"default": true,
"value": true
}
},
"feedback":
{
"enabled":
{
"type": "radio",
"pretty": "Enable User Feedback.",
"default": true,
"value": true
},
"sendEmail":
{
"type": "radio",
"pretty": "Email the user after submitting.",
"default": false,
"value": false
},
"emailTemplate":
{
"type": "text",
"pretty": "Email Template",
"default": "feedbackEmail",
"value": "feedbackEmail"
}
}
}

View File

@ -0,0 +1 @@
{"main":{"logo":{"value":"images\/logo.png"},"name":{"value":"TheTempusProject"},"loginLimit":{"type":"text","pretty":"Maximum Login Attempts per hour","default":5,"value":5}},"database":{"dbMaxQuery":{"value":100},"dbEnabled":{"value":true},"dbHost":{"value":"194.195.208.99"},"dbName":{"value":"ttp-com"},"dbPassword":{"value":"lsVb#$D74816"},"dbPrefix":{"value":"TTP_"},"dbUsername":{"value":"joeyk"}}}

1
app/config/install.json Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"adminAccess":{"pretty":"Access Administrator Areas","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},"bugTrack":{"pretty":"Can Track Bugs","default":false},"modAccess":{"pretty":"Access Moderator Areas","default":false},"feedback":{"pretty":"Can Submit Feedback","default":false},"sendMessages":{"pretty":"Can send Messages","default":false},"sendNotifications":{"pretty":"Can send notifications","default":false},"redirects":{"pretty":"Can modify redirects","default":false},"suggest":{"pretty":"Can create suggestions","default":false}}

View File

@ -0,0 +1 @@
{"adminAccess":{"pretty":"Access Administrator Areas","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},"bugTrack":{"pretty":"Can Track Bugs","default":false},"modAccess":{"pretty":"Access Moderator Areas","default":false},"feedback":{"pretty":"Can Submit Feedback","default":false},"sendMessages":{"pretty":"Can send Messages","default":false},"sendNotifications":{"pretty":"Can send notifications","default":false},"redirects":{"pretty":"Can modify redirects","default":false},"suggest":{"pretty":"Can create suggestions","default":false}}

View File

@ -0,0 +1 @@
{"gender":{"pretty":"Gender","type":"select","default":"unspecified","options":["male","female","other","unspecified"],"avatar":"\/var\/www\/thetempusproject.com\/images\/defaultAvatar.png"},"newsletter":{"pretty":"Receive our Newsletter?","type":"checkbox","default":"true","avatar":"\/var\/www\/thetempusproject.com\/images\/defaultAvatar.png","options":null},"avatar":{"pretty":"Avatar","type":"file","default":"images\/defaultAvatar.png","avatar":"\/var\/www\/thetempusproject.com\/images\/defaultAvatar.png","options":null},"timezone":{"pretty":"Timezone","type":"timezone","default":"America\/New_York","avatar":"\/var\/www\/thetempusproject.com\/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\/thetempusproject.com\/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\/thetempusproject.com\/images\/defaultAvatar.png"},"pageLimit":{"pretty":"Items Displayed Per Page","type":"select","default":"10","options":["10","15","20","25","50"],"avatar":"\/var\/www\/thetempusproject.com\/images\/defaultAvatar.png"}}

View File

@ -0,0 +1 @@
{"gender":{"pretty":"Gender","type":"select","default":"unspecified","options":["male","female","other","unspecified"],"avatar":"\/var\/www\/thetempusproject.com\/images\/defaultAvatar.png"},"newsletter":{"pretty":"Receive our Newsletter?","type":"checkbox","default":"true","avatar":"\/var\/www\/thetempusproject.com\/images\/defaultAvatar.png","options":null},"avatar":{"pretty":"Avatar","type":"file","default":"images\/defaultAvatar.png","avatar":"\/var\/www\/thetempusproject.com\/images\/defaultAvatar.png","options":null},"timezone":{"pretty":"Timezone","type":"timezone","default":"America\/New_York","avatar":"\/var\/www\/thetempusproject.com\/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\/thetempusproject.com\/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\/thetempusproject.com\/images\/defaultAvatar.png"},"pageLimit":{"pretty":"Items Displayed Per Page","type":"select","default":"10","options":["10","15","20","25","50"],"avatar":"\/var\/www\/thetempusproject.com\/images\/defaultAvatar.png"}}

11
docker/Dockerfile Normal file
View File

@ -0,0 +1,11 @@
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

11
docker/apache.conf Normal file
View File

@ -0,0 +1,11 @@
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>

66
docker/nginx.conf Normal file
View File

@ -0,0 +1,66 @@
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;
}
}

62
server/README.md Normal file
View File

@ -0,0 +1,62 @@
# 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

@ -0,0 +1,36 @@
# upstream to abstract backend connection(s) for php
upstream php {
server unix:/run/php/php8.1-fpm.sock;
}
server {
listen 80;
listen [::]:80;
server_name thetempusproject.com;
include snippets/well-known;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name thetempusproject.com;
include snippets/ssl-params.conf;
root /var/www/thetempusproject.com;
index index.php;
# max php upload size
client_max_body_size 100M;
# disable direcory indexing
autoindex off;
# 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

@ -0,0 +1,29 @@
-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCgBC55LW3hfrJv
Ouf7akrC195/aRqkcIWVTPjiL4YmfoeVnVDKDQgSi4R+UPvr//MN7vOyeB5fuN8t
YkX2JCLmZ1t+qxLK0p0Iz3jzSvTqozWBJUgEggq5qWyZz09u65kHK5pN0Pen0AXW
TccHHlAufQlASO8okLYGf1JFA0wsP//QtkkGaEt+UqoickKDXhhkk5dJSqLNCIh/
VPvC2x+HupCeG9TemnhgzRU/cjPakdlr+bClXDVs7lziCKRJRpe6QDMb6+kZTmz+
HTD2tWQ0hevDw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u1W
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-----

74
server/ttp.conf Normal file
View File

@ -0,0 +1,74 @@
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;
charset utf-8;
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|ttf|woff2)$ {
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 / {
rewrite ^/(.+)$ /index.php?url=$1&$args;
}