Skip to content

Commit 1e380e5

Browse files
committed
Added Docker Support
1 parent c709812 commit 1e380e5

12 files changed

+84
-20
lines changed

.DS_Store

8 KB
Binary file not shown.

.dockerignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/bin
15+
**/charts
16+
**/docker-compose*
17+
**/compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM php:8.1.6-apache
2+
3+
ENV APACHE_DOCUMENT_ROOT /var/www/html
4+
5+
RUN docker-php-ext-install pdo pdo_mysql mysqli

README.md

+2-12
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ Install with **Homebrew**:
8181
* PHP v8.1.6
8282
* jQuery v2.1.3
8383
* Bootstrap v3.3.5
84-
* MariaDB v10.4.21
85-
* XAMPP v8.1.6
84+
* MySQL v8.0.31
85+
* Docker v20.10.21
8686

8787
## Dependencies:
8888

@@ -91,16 +91,6 @@ Install with **Homebrew**:
9191

9292
## Quick Start
9393

94-
1. I'd recommend using the XAMPP stack to run this application (although, its not required).
95-
* Download the latest version of **XAMPP** [here](https://www.apachefriends.org/download.html).
96-
* XAMPP comes a Apache HTTP Server, PHP, and a MariaDB database stack already installed - everything you need to get Palm Tree up and running.
97-
2. Start the XAMPP MySQL and Apache Web Server Services.
98-
3. Import the provided database shell located in `Palm-Tree/sql/palm_tree.sql` into your MySQL database.
99-
4. Place Palm-Tree in the htdocs folder and reach it using your machines IP address i.e. `http://127.0.0.1/Palm-Tree` or ``http://localhost/Palm-Tree``.
100-
5. Upload the provided email templates in ``Palm-Tree/templates`` in the *Email Template* menu (adjust it according to your needs or create your own).
101-
6. Configure your Email Template and Business.
102-
7. Add Customers.
103-
10494
* You're ready to go!
10595

10696
## License

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.1
1+
1.1.0

commands.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
$mail_cc = $_POST['mail_cc'];
181181
$mail_bcc = $_POST['mail_bcc'];
182182
$mail_subject = $_POST['mail_subject'];
183-
$mail_body = htmlspecialchars($_POST['mail_body']);
183+
$mail_body = htmlspecialchars($_POST['mail_body'] ?? '');
184184

185185
if (empty($mail_from_password)) {
186186
$encrypted_password = NULL;

docker-compose.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
version: '3.4'
2+
services:
3+
db:
4+
image: mysql:latest
5+
environment:
6+
MYSQL_DATABASE: palm_tree
7+
MYSQL_ROOT_PASSWORD:
8+
MYSQL_ALLOW_EMPTY_PASSWORD: 1
9+
volumes:
10+
- "./sql:/docker-entrypoint-initdb.d"
11+
networks:
12+
- palm-tree-docker
13+
www:
14+
depends_on:
15+
- db
16+
image: php:8.1.6-apache
17+
build:
18+
context: .
19+
dockerfile: ./Dockerfile
20+
volumes:
21+
- "./:/var/www/html/Palm-Tree"
22+
ports:
23+
- 80:80
24+
- 443:443
25+
networks:
26+
- palm-tree-docker
27+
phpmyadmin:
28+
depends_on:
29+
- db
30+
image: phpmyadmin/phpmyadmin
31+
ports:
32+
- 8001:80
33+
environment:
34+
- PMA_HOST=db
35+
- PMA_PORT=3306
36+
networks:
37+
- palm-tree-docker
38+
networks:
39+
palm-tree-docker:
40+
driver: bridge
41+
42+

email.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<label style="font-size: 1rem;color: gray">This will be the Body of your Email</label><br>
6161
<label style="font-size: 1rem;color: gray">You can save your HTML template directly in this box</label><br>
6262
<label style="font-size: 1rem;color: gray">Depending on where this software sits, you may need to host email images using an outside source like <a target="_blank" rel="noopener noreferrer" href="https://imgur.com/">imgur.com</a> for the images to render properly in the Email</label><br>
63-
<textarea id="mail_body" class="mailBodyText" name="mail_body" rows="20" cols="52" style="text-align: left;" placeholder="<!DOCTYPE html><br><html><br><body><br><p>You can use HTML for a more professional, responsive email.</p><p>Paste the entire HTML message here.</p></body></html>" data-mail-id="<?php echo $mail['mail_id']; ?>"><?php echo htmlspecialchars_decode($mail['mail_body']); ?></textarea><br>
63+
<textarea id="mail_body" class="mailBodyText" name="mail_body" rows="20" cols="52" style="text-align: left;" placeholder="<!DOCTYPE html><br><html><br><body><br><p>You can use HTML for a more professional, responsive email.</p><p>Paste the entire HTML message here.</p></body></html>" data-mail-id="<?php echo $mail['mail_id']; ?>"><?php echo htmlspecialchars_decode($mail['mail_body'] ?? ''); ?></textarea><br>
6464
<?php } ?>
6565
<br>
6666
<button type="submit" class="btn btn-default read-more" style="background:#000081;color:white;" name="command" value="updateEmailTemplate">Update Email Template</button>

encryption.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ function encrypt_decrypt($action, $string)
2525
$iv = substr(hash('sha256', $secret_iv), 0, 16);
2626
if ($action == 'encrypt') {
2727
$output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);
28-
$output = base64_encode($output);
28+
$output = base64_encode($output ?? '');
2929
} else if ($action == 'decrypt') {
30-
$output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);
30+
$output = openssl_decrypt(base64_decode($string ?? '') ?? '', $encrypt_method, $key, 0, $iv);
3131
}
3232
return $output;
3333
}

phpinfo.php

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
phpinfo();

send_email.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function sendEmail($cust_id, $flag, $type)
152152

153153
// Set Email Subject and Body
154154
$email_subject = $email_build['mail_subject'];
155-
$email_body = htmlspecialchars_decode($email_build['mail_body']);
155+
$email_body = htmlspecialchars_decode($email_build['mail_body'] ?? '');
156156

157157
// Replace Template Variables with Database Values
158158
foreach ($variables as $key => $value) {

sql/config.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ app_version = 1.0.0
1414

1515
;Database
1616
[database]
17-
db_host = localhost
17+
db_host = db
1818
db_name = palm_tree
1919
db_user = root
2020
db_pass =
2121
db_port = 3306
2222
db_charset = UTF-8
23-
db_host_ip = 10.0.1.7
23+
db_host_ip = localhost

0 commit comments

Comments
 (0)