Skip to content

Commit 9880d19

Browse files
authored
Merge pull request #88 from bowphp/fix-session-config
fix: session and mail configs
2 parents 8dc167e + 204f2d3 commit 9880d19

9 files changed

Lines changed: 150 additions & 38 deletions

File tree

.env.example.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"DB_SOCKET": "",
2626
"DB_PREFIX": "",
2727

28-
"SESSION_NAME": "BOW",
28+
"SESSION_DRIVER": "file",
29+
"SESSION_NAME": "BOW_APP",
2930
"SESSION_LIFE": 648000,
3031
"SESSION_PATH": "/",
3132
"SESSION_DOMAIN": null,

config/mail.php

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,37 @@
2929
"port" => app_env("SMTP_PORT"),
3030
"tls" => app_env("SMTP_TLS"),
3131
"ssl" => app_env("SMTP_SSL"),
32-
"timeout" => app_env("SMTP_TIMEOUT")
32+
"timeout" => app_env("SMTP_TIMEOUT"),
33+
34+
/**
35+
* DKIM (DomainKeys Identified Mail) allows an organization to take
36+
* responsibility for a message by signing it. It allows the receiver
37+
* to verify that the message was not modified in transit.
38+
*/
39+
'dkim' => [
40+
'enabled' => app_env('MAIL_DKIM_ENABLED', false),
41+
'domain' => app_env('MAIL_DKIM_DOMAIN'),
42+
'selector' => app_env('MAIL_DKIM_SELECTOR', 'default'),
43+
'private_key' => app_env('MAIL_DKIM_PRIVATE_KEY'),
44+
'passphrase' => app_env('MAIL_DKIM_PASSPHRASE'),
45+
'identity' => app_env('MAIL_DKIM_IDENTITY'),
46+
'algo' => 'rsa-sha256',
47+
],
48+
49+
/**
50+
* SPF (Sender Policy Framework) is an email authentication method designed
51+
* to prevent email spoofing by allowing domain owners to specify which
52+
* mail servers are authorized to send mail for their domains.
53+
*/
54+
'spf' => [
55+
'enabled' => app_env('MAIL_SPF_ENABLED', false),
56+
'strict' => app_env('MAIL_SPF_STRICT', true),
57+
'policies' => [
58+
'fail' => 'reject', // reject, mark, accept
59+
'softfail' => 'mark',
60+
'neutral' => 'accept',
61+
],
62+
],
3363
],
3464

3565
/**
@@ -51,7 +81,7 @@
5181
*/
5282
"mail" => [
5383
"default" => "contact",
54-
"froms" => [
84+
"from" => [
5585
"contact" => [
5686
"address" => app_env("MAIL_FROM_EMAIL"),
5787
"name" => app_env("MAIL_FROM_NAME")

config/messaging.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
return [
4+
'telegram' => [
5+
'token' => app_env('TELEGRAM_TOKEN'),
6+
'chat_id' => app_env('TELEGRAM_CHAT_ID'),
7+
],
8+
9+
'slack' => [
10+
'token' => app_env('SLACK_TOKEN'),
11+
'channel' => app_env('SLACK_CHANNEL'),
12+
'webhook_url' => app_env('SLACK_WEBHOOK_URL'),
13+
],
14+
15+
'twilio' => [
16+
'account_sid' => app_env('TWILIO_ACCOUNT_SID'),
17+
'auth_token' => app_env('TWILIO_AUTH_TOKEN'),
18+
'from' => app_env('TWILIO_FROM'),
19+
],
20+
];

config/session.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* The session driver
1111
*/
12-
'driver' => 'file',
12+
'driver' => app_env('SESSION_DRIVER', "file"),
1313

1414
/**
1515
* The session database drive option
@@ -31,7 +31,7 @@
3131
*
3232
* @see: http://php.net/manual/fr/session.configuration.php#ini.session.cookie-path.
3333
*/
34-
'path' => '/',
34+
'path' => app_env('SESSION_PATH', '/'),
3535

3636
/**
3737
* The cookie domain, for example 'www.example.com'.
@@ -40,21 +40,21 @@
4040
*
4141
* @see http://php.net/manual/fr/session.configuration.php#ini.session.cookie-domain
4242
*/
43-
'domain' => null,
43+
'domain' => app_env('SESSION_DOMAIN', 'localhost'),
4444

4545
/**
4646
* If true, the cookie will only be sent over a secure connection.
4747
*
4848
* @see: http://php.net/manual/fr/session.configuration.php#ini.session.cookie-secure
4949
*/
50-
'secure' => false,
50+
'secure' => (bool) app_env('SESSION_SECURE', false),
5151

5252
/**
5353
* If true, PHP will attempt to send the httponly option when configuring the cookie.
5454
*
5555
* @see http://php.net/manual/fr/session.configuration.php#ini.session.cookie-httponly
5656
*/
57-
'httponly' => false,
57+
'httponly' => (bool) app_env('SESSION_HTTPONLY', true),
5858

5959
/**
6060
* Session data path.
@@ -63,6 +63,6 @@
6363
* On some operating systems, you will have to choose a path to a folder
6464
* able to handle a large number of small files efficiently.
6565
* For example, on Linux, reiserfs can be more efficient than ext2fs.
66-
*/
66+
*/
6767
'save_path' => __DIR__ . '/../var/session',
6868
];

package.json

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
11
{
22
"private": true,
3-
"version": "0.0.1",
43
"type": "module",
54
"scripts": {
6-
"dev": "vite",
7-
"build": "tsc -b && vite build",
8-
"lint": "eslint .",
9-
"preview": "vite preview"
10-
},
11-
"dependencies": {
12-
"axios": "^1.7.9",
13-
"react": "^18.3.1",
14-
"react-dom": "^18.3.1"
5+
"build": "vite build",
6+
"dev": "vite"
157
},
168
"devDependencies": {
17-
"@eslint/js": "^9.17.0",
18-
"@types/react": "^18.3.18",
19-
"@types/react-dom": "^18.3.5",
9+
"@tailwindcss/vite": "^4.0.1",
2010
"@vitejs/plugin-react": "^4.3.4",
21-
"eslint": "^9.17.0",
22-
"eslint-plugin-react-hooks": "^5.0.0",
23-
"eslint-plugin-react-refresh": "^0.4.16",
24-
"globals": "^15.14.0",
25-
"typescript": "~5.6.2",
26-
"typescript-eslint": "^8.18.2",
27-
"vite": "^6.0.5"
11+
"@vitejs/plugin-vue": "^5.2.1",
12+
"autoprefixer": "^10.4.20",
13+
"axios": "^1.7.4",
14+
"concurrently": "^9.0.1",
15+
"laravel-vite-plugin": "^1.2.0",
16+
"postcss": "^8.4.47",
17+
"tailwindcss": "^3.4.17",
18+
"vite": "^6.0.11"
19+
},
20+
"dependencies": {
21+
"react": "^19.0.0",
22+
"react-dom": "^19.0.0"
2823
}
2924
}

postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};

readme.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ You must make sure the following items are installed on your machine.
2929

3030
We would like to extend our thanks to the following sponsors for funding Bow Framework development. If you are interested in becoming a sponsor, please contact [Franck DAKIA](https://github.com/papac):
3131

32+
- [Papac & Co](https://papacandco.com)
3233
- [Adjemin](https://adjemin.com)
33-
- [Akil Technologies](https://akiltechnologies.com/)
34+
- [Akil Technologies](https://akiltechnologies.com)
3435
- [Etudesk](https://etudesk.com)
3536

3637
## Contributing
@@ -40,16 +41,10 @@ Thank you for considering contributing to Bow Framework! The contribution guide
4041
- [Franck DAKIA](https://github.com/papac)
4142
- [Thank's collaborators](https://github.com/bowphp/app/graphs/contributors)
4243

43-
## Contact
44-
45-
- [Franck DAKIA](https://github.com/papac)
46-
- [Thank's collaborators](https://github.com/bowphp/docs/graphs/contributors)
47-
4844
1. Fork it
4945
2. Create your feature branch (`git checkout -b my-new-feature`)
5046
3. Commit your changes (`git commit -am 'Add some feature'`)
5147
4. Push to the branch (`git push origin my-new-feature`)
5248
5. Create new Pull Request
5349

54-
Please, if there is a bug on the project contact me by email or leave me a message on [Slack](https://bowphp.slack.com). or [join us on Slask](https://join.slack.com/t/bowphp/shared_invite/enQtNzMxOTQ0MTM2ODM5LTQ3MWQ3Mzc1NDFiNDYxMTAyNzBkNDJlMTgwNDJjM2QyMzA2YTk4NDYyN2NiMzM0YTZmNjU1YjBhNmJjZThiM2Q)
55-
50+
Please, if there is a bug on the project contact me by email or leave me a message on [Telegram](https://t.me/+PiAXH-w9qLUyOTU0)

tailwind.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import defaultTheme from "tailwindcss/defaultTheme";
2+
3+
/** @type {import('tailwindcss').Config} */
4+
export default {
5+
content: [
6+
"./storage/views/*.php",
7+
"./templates/**/*.blade.php",
8+
"./templates/**/*.js",
9+
"./templates/**/*.vue",
10+
],
11+
theme: {
12+
extend: {
13+
fontFamily: {
14+
sans: ["Figtree", ...defaultTheme.fontFamily.sans],
15+
},
16+
},
17+
},
18+
plugins: [],
19+
};

vite.config.js

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,52 @@
11
import { defineConfig } from "vite";
22
import react from "@vitejs/plugin-react";
3+
import vue from "@vitejs/plugin-vue";
4+
import path from "path";
5+
import tailwindcss from "@tailwindcss/vite";
36

47
export default defineConfig({
5-
plugins: [react()],
8+
plugins: [react(), vue(), tailwindcss()],
9+
root: path.resolve(__dirname, 'frontend'),
10+
build: {
11+
outDir: path.resolve(__dirname, 'public'),
12+
emptyOutDir: true,
13+
rollupOptions: {
14+
input: {
15+
app: path.resolve(__dirname, 'frontend/js/app.js')
16+
},
17+
output: {
18+
entryFileNames: 'js/[name].js',
19+
chunkFileNames: 'js/[name]-[hash].js',
20+
assetFileNames: (assetInfo) => {
21+
const info = assetInfo.name.split('.')
22+
const ext = info[info.length - 1]
23+
if (/\.(css|scss|sass|less)$/.test(assetInfo.name)) {
24+
return 'css/[name]-[hash][extname]'
25+
}
26+
return `${ext}/[name]-[hash][extname]`
27+
}
28+
}
29+
}
30+
},
31+
css: {
32+
preprocessorOptions: {
33+
scss: {
34+
additionalData: `@import "${path.resolve(__dirname, 'frontend/sass/variables.scss')}";`
35+
},
36+
less: {
37+
javascriptEnabled: true
38+
}
39+
}
40+
},
41+
resolve: {
42+
alias: {
43+
'@': path.resolve(__dirname, 'frontend/js'),
44+
'@sass': path.resolve(__dirname, 'frontend/sass')
45+
}
46+
},
47+
server: {
48+
watch: {
49+
usePolling: true
50+
}
51+
}
652
});

0 commit comments

Comments
 (0)