mirror of
https://github.com/flarum/flarum.git
synced 2025-06-24 00:00:15 -04:00
Compare commits
177 Commits
v0.1.0-bet
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
4bbaae25f6 | ||
|
ecb5b6b9ab | ||
|
5d98f8965b | ||
|
30bc7b40ce | ||
|
fb04e78b1f | ||
|
177e6e16d0 | ||
|
b0316baf72 | ||
|
0be676095d | ||
|
887f9e288c | ||
|
9ad5d2cb18 | ||
|
151257ee7a | ||
|
bceb9cae11 | ||
|
64ca250e44 | ||
|
4ce0568122 | ||
|
1b23531e8c | ||
|
20a2be9946 | ||
|
a18c94aedc | ||
|
bfc0693fc0 | ||
|
dd31375264 | ||
|
ffed65ca63 | ||
|
9c2f747f92 | ||
|
d5b2515f54 | ||
|
ea8723b4f2 | ||
|
ceb7c7fcf3 | ||
|
46c648991c | ||
|
cd4b673d98 | ||
|
cc0046bcc1 | ||
|
5950779a1a | ||
|
07379ba4a5 | ||
|
5abd213039 | ||
|
e39a512e0c | ||
|
68110bf52e | ||
|
e786d788ea | ||
|
4ffaf91ec4 | ||
|
0ef4318913 | ||
|
3aeffd15aa | ||
|
9400a34ab0 | ||
|
adada6456f | ||
|
7fc74eb36c | ||
|
542331b6b4 | ||
|
41497429f6 | ||
|
abe7a51cf5 | ||
|
7a875ce203 | ||
|
0aeead1259 | ||
|
cb7312b84a | ||
|
38a0c4558b | ||
|
f1d5b46b4e | ||
|
60299dd9e5 | ||
|
03223e3c69 | ||
|
b196d2cc32 | ||
|
4acab4a46f | ||
|
1683328c86 | ||
|
e2544a2a22 | ||
|
60005b67cc | ||
|
69bd886df8 | ||
|
fb56b87a49 | ||
|
b4a09a072f | ||
|
3ec2aad36e | ||
|
8492ce3a0b | ||
|
8b9da9be31 | ||
|
084d1b2ff2 | ||
|
dfebb5c8ca | ||
|
dd740b4c40 | ||
|
655aa9cea9 | ||
|
54d9228ab8 | ||
|
7b5bd17c77 | ||
|
fe3a0ac993 | ||
|
a82b4f209f | ||
|
995a2621db | ||
|
01e5fde09c | ||
|
17926d696d | ||
|
088fdb4110 | ||
|
2798440851 | ||
|
84f8ef0395 | ||
|
d43085eaee | ||
|
23a1ed3e58 | ||
|
0e0d443f85 | ||
|
0e9810b1bc | ||
|
8ab7784514 | ||
|
ddf49f77f8 | ||
|
df852638f9 | ||
|
7dc7f97f3c | ||
|
530c8a9946 | ||
|
f87217c6d9 | ||
|
47c8012869 | ||
|
4549c53c46 | ||
|
e3ed1adb73 | ||
|
c5c81c8651 | ||
|
7cf64af7f9 | ||
|
e1c0f1794a | ||
|
d779c97ced | ||
|
18c1750f3a | ||
|
6916205522 | ||
|
1ed484990f | ||
|
0ba01391e8 | ||
|
ba53bc77fd | ||
|
72eeac2b2e | ||
|
4479d857b6 | ||
|
569e3a3b5e | ||
|
70a765a2c8 | ||
|
a5b4c2eacd | ||
|
0c975a7f10 | ||
|
46c951349a | ||
|
de19d0a95b | ||
|
7e17408634 | ||
|
cc8e9aa6e6 | ||
|
158f2020c8 | ||
|
2a53b0367d | ||
|
6fa9800e55 | ||
|
e4d90d6017 | ||
|
30dfd952b8 | ||
|
533e7d4051 | ||
|
8caebc73e6 | ||
|
e54e60a44b | ||
|
eeeca56481 | ||
|
f99aa84034 | ||
|
cfd8650ab2 | ||
|
db911e8263 | ||
|
ca4cc753cb | ||
|
78a72648b4 | ||
|
4be4e6209f | ||
|
18c471f015 | ||
|
fad38c0bbd | ||
|
8b6697dea9 | ||
|
af0850d842 | ||
|
1b0d6c89e6 | ||
|
93ed335a8e | ||
|
7bff4a2d80 | ||
|
0acb8857f4 | ||
|
1e15cabd06 | ||
|
261ac0366f | ||
|
98c12db5c2 | ||
|
1bd84561f1 | ||
|
ccf979c80d | ||
|
ea61c22556 | ||
|
d637522ad5 | ||
|
25cfc56a89 | ||
|
f52143ac87 | ||
|
accda91bf5 | ||
|
771549c015 | ||
|
7f90c99087 | ||
|
290f1aff55 | ||
|
b009ea6b1c | ||
|
e3b14ea8ce | ||
|
f3d8d7b58f | ||
|
3a0d8a656a | ||
|
c090d0ebc3 | ||
|
1626964689 | ||
|
83b8fcaa2b | ||
|
9f15204dff | ||
|
472553ceaf | ||
|
91d6e5578b | ||
|
5b5bd5ed89 | ||
|
6c565c1d25 | ||
|
215c8e03d2 | ||
|
c29323b3f4 | ||
|
5f0315d0fc | ||
|
894e9a9d4d | ||
|
dee61d288c | ||
|
c3f1d8a627 | ||
|
982e1bffba | ||
|
5f00d56f41 | ||
|
ccc9c1adf8 | ||
|
efcffa795f | ||
|
b1324ef703 | ||
|
c17588f1cd | ||
|
4c8be76285 | ||
|
fce07ad258 | ||
|
4a44ceb6a8 | ||
|
d1c7368ecb | ||
|
1a5d27109e | ||
|
cb92d205ba | ||
|
acfdb55460 | ||
|
8b0644ee63 | ||
|
9539bd9934 | ||
|
ba3e9dfb88 | ||
|
c4f9c8f4b8 |
@ -15,5 +15,5 @@ indent_size = 2
|
|||||||
[*.{diff,md}]
|
[*.{diff,md}]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
[*.php]
|
[*.{php,json}]
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1,3 +1,5 @@
|
|||||||
.gitattributes export-ignore
|
.gitattributes export-ignore
|
||||||
.gitignore export-ignore
|
.gitignore export-ignore
|
||||||
.gitmodules export-ignore
|
.gitmodules export-ignore
|
||||||
|
|
||||||
|
composer.lock -merge
|
||||||
|
11
.gitignore
vendored
11
.gitignore
vendored
@ -1,8 +1,11 @@
|
|||||||
.env
|
|
||||||
.env.*
|
|
||||||
!.env.example
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
.vagrant
|
.vagrant
|
||||||
config.php
|
config.php
|
||||||
.idea
|
.idea
|
||||||
|
vendor
|
||||||
|
server
|
||||||
|
core
|
||||||
|
studio.json
|
||||||
|
composer.lock
|
||||||
|
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
|||||||
[submodule "flarum/core"]
|
|
||||||
path = flarum/core
|
|
||||||
url = https://github.com/flarum/core.git
|
|
15
.htaccess
15
.htaccess
@ -1,15 +0,0 @@
|
|||||||
<IfModule mod_rewrite.c>
|
|
||||||
RewriteEngine on
|
|
||||||
|
|
||||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
||||||
|
|
||||||
RewriteRule ^api(.*)$ api.php [QSA,L]
|
|
||||||
RewriteRule ^admin(.*)$ admin.php [QSA,L]
|
|
||||||
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
|
||||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
|
||||||
|
|
||||||
# MultiViews can mess up our rewriting scheme
|
|
||||||
Options -MultiViews
|
|
||||||
</IfModule>
|
|
73
.nginx.conf
Normal file
73
.nginx.conf
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# Pass requests that don't refer directly to files in the filesystem to index.php
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php?$query_string;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Uncomment the following lines if you are not using a `public` directory
|
||||||
|
# to prevent sensitive resources from being exposed.
|
||||||
|
# <!-- BEGIN EXPOSED RESOURCES PROTECTION -->
|
||||||
|
# location ~* ^/(\.git|composer\.(json|lock)|auth\.json|config\.php|flarum|storage|vendor) {
|
||||||
|
# deny all;
|
||||||
|
# return 404;
|
||||||
|
# }
|
||||||
|
# <!-- END EXPOSED RESOURCES PROTECTION -->
|
||||||
|
|
||||||
|
# The following directives are based on best practices from H5BP Nginx Server Configs
|
||||||
|
# https://github.com/h5bp/server-configs-nginx
|
||||||
|
|
||||||
|
# Expire rules for static content
|
||||||
|
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
|
||||||
|
add_header Cache-Control "max-age=0";
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* \.(?:rss|atom)$ {
|
||||||
|
add_header Cache-Control "max-age=3600";
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {
|
||||||
|
add_header Cache-Control "max-age=2592000";
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* \.(?:css|js)$ {
|
||||||
|
add_header Cache-Control "max-age=31536000";
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
|
||||||
|
add_header Cache-Control "max-age=2592000";
|
||||||
|
access_log off;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Gzip compression
|
||||||
|
gzip on;
|
||||||
|
gzip_comp_level 5;
|
||||||
|
gzip_min_length 256;
|
||||||
|
gzip_proxied any;
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_types
|
||||||
|
application/atom+xml
|
||||||
|
application/javascript
|
||||||
|
application/json
|
||||||
|
application/ld+json
|
||||||
|
application/manifest+json
|
||||||
|
application/rss+xml
|
||||||
|
application/vnd.geo+json
|
||||||
|
application/vnd.ms-fontobject
|
||||||
|
application/x-font-ttf
|
||||||
|
application/x-web-app-manifest+json
|
||||||
|
application/xhtml+xml
|
||||||
|
application/xml
|
||||||
|
font/opentype
|
||||||
|
image/bmp
|
||||||
|
image/svg+xml
|
||||||
|
image/x-icon
|
||||||
|
text/cache-manifest
|
||||||
|
text/css
|
||||||
|
text/javascript
|
||||||
|
text/plain
|
||||||
|
text/vcard
|
||||||
|
text/vnd.rim.location.xloc
|
||||||
|
text/vtt
|
||||||
|
text/x-component
|
||||||
|
text/x-cross-domain-policy;
|
84
CHANGELOG.md
Normal file
84
CHANGELOG.md
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
## [1.8.0](https://github.com/flarum/flarum/compare/v1.7.0...v1.8.0)
|
||||||
|
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
## [1.7.0](https://github.com/flarum/flarum/compare/v1.6.0...v1.7.0)
|
||||||
|
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
## [1.6.0](https://github.com/flarum/flarum/compare/v1.5.0...v1.6.0)
|
||||||
|
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
## [1.5.0](https://github.com/flarum/flarum/compare/v1.4.0...v1.5.0)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update copyright [#85]
|
||||||
|
- Link logo to official website [#84]
|
||||||
|
|
||||||
|
## [1.4.0](https://github.com/flarum/flarum/compare/v1.3.0...v1.4.0)
|
||||||
|
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
## [1.3.0](https://github.com/flarum/flarum/compare/v1.2.0...v1.3.0)
|
||||||
|
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
## [1.2.0](https://github.com/flarum/flarum/compare/v1.1.0...v1.2.0)
|
||||||
|
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
## [1.1.0](https://github.com/flarum/flarum/compare/v1.0.0...v1.1.0)
|
||||||
|
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
## [1.0.0](https://github.com/flarum/flarum/compare/v0.1.0-beta.16...v1.0.0)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Updated constraints of core and bundled extensions for v1.0.0 stable release (https://github.com/flarum/flarum/pull/74)
|
||||||
|
|
||||||
|
## [0.1.0-beta.16](https://github.com/flarum/flarum/compare/v0.1.0-beta.15...v0.1.0-beta.16)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Remove list of developers and refer to https://flarum.org/team (https://github.com/flarum/flarum/pull/71)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Missing image on README.md (https://github.com/flarum/flarum/pull/72)
|
||||||
|
|
||||||
|
## [0.1.0-beta.15](https://github.com/flarum/flarum/compare/v0.1.0-beta.14...v0.1.0-beta.15)
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Nicknames added to our bundled list (https://github.com/flarum/flarum/pull/70)
|
||||||
|
|
||||||
|
## [0.1.0-beta.14](https://github.com/flarum/flarum/compare/v0.1.0-beta.13...v0.1.0-beta.14)
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Nginx rules to prevent access to sensitive files (#65)
|
||||||
|
- IIS configuration added (#66)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Minimum PHP requirement is now 7.2+
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Logo path in readme didn't resolve correctly (#68)
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Social auth drivers removed (#67)
|
||||||
|
|
||||||
|
## [0.1.0-beta.13](https://github.com/flarum/flarum/compare/v0.1.0-beta.12...v0.1.0-beta.13)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Prevent access to authorisation tokens saved by composer next to the composer.json file ([adada64](https://github.com/flarum/flarum/commit/adada6456f210ea5c94a805a39d88fa613a9e4a2)).
|
||||||
|
|
||||||
|
## [0.1.0-beta.12](https://github.com/flarum/flarum/compare/v0.1.0-beta.8.1...v0.1.0-beta.12)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Consolidate site setup into shared file (#63).
|
||||||
|
|
||||||
|
## [0.1.0-beta.8.1](https://github.com/flarum/flarum/compare/v0.1.0-beta.8...v0.1.0-beta.8.1)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Prevent caching of JSON:API responses ([e2544a2](https://github.com/flarum/flarum/commit/e2544a2a223b8ab2fb9efe00036b755b6e2cd7e7))
|
@ -1,13 +0,0 @@
|
|||||||
# Contributing to Flarum
|
|
||||||
|
|
||||||
Thanks for your interest in contributing to Flarum! Please read the [Contributing docs](http://flarum.org/docs/contributing) to learn how you can help.
|
|
||||||
|
|
||||||
## Contributor License Agreement
|
|
||||||
|
|
||||||
By contributing your code to Flarum you grant Toby Zerner a non-exclusive, irrevocable, worldwide, royalty-free, sublicenseable, transferable license under all of Your relevant intellectual property rights (including copyright, patent, and any other rights), to use, copy, prepare derivative works of, distribute and publicly perform and display the Contributions on any licensing terms, including without limitation: (a) open source licenses like the MIT license; and (b) binary, proprietary, or commercial licenses. Except for the licenses granted herein, You reserve all right, title, and interest in and to the Contribution.
|
|
||||||
|
|
||||||
You confirm that you are able to grant us these rights. You represent that You are legally entitled to grant the above license. If Your employer has rights to intellectual property that You create, You represent that You have received permission to make the Contributions on behalf of that employer, or that Your employer has waived such rights for the Contributions.
|
|
||||||
|
|
||||||
You represent that the Contributions are Your original works of authorship, and to Your knowledge, no other person claims, or has the right to claim, any right in any invention or patent related to the Contributions. You also represent that You are not legally obligated, whether by entering into an agreement or otherwise, in any way that conflicts with the terms of this license.
|
|
||||||
|
|
||||||
Toby Zerner acknowledges that, except as explicitly described in this Agreement, any Contribution which you provide is on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
|
|
3
LICENSE
3
LICENSE
@ -1,6 +1,7 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2014-2015 Toby Zerner
|
Copyright (c) 2019-2022 Stichting Flarum (Flarum Foundation)
|
||||||
|
Copyright (c) 2014-2019 Toby Zerner (toby.zerner@gmail.com)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
40
README.md
Normal file
40
README.md
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<p align="center">
|
||||||
|
<a href="https://flarum.org/"><img src="https://flarum.org/images/flarum.svg"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://packagist.org/packages/flarum/core"><img src="https://poser.pugx.org/flarum/core/d/total.svg" alt="Total Downloads"></a>
|
||||||
|
<a href="https://packagist.org/packages/flarum/core"><img src="https://poser.pugx.org/flarum/core/v/stable.svg" alt="Latest Stable Version"></a>
|
||||||
|
<a href="https://packagist.org/packages/flarum/core"><img src="https://poser.pugx.org/flarum/core/license.svg" alt="License"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## About Flarum
|
||||||
|
|
||||||
|
**[Flarum](https://flarum.org/) is a delightfully simple discussion platform for your website.** It's fast and easy to use, with all the features you need to run a successful community. It is designed to be:
|
||||||
|
|
||||||
|
* **Fast and simple.** No clutter, no bloat, no complex dependencies. Flarum is built with PHP so it’s quick and easy to deploy. The interface is powered by Mithril, a performant JavaScript framework with a tiny footprint.
|
||||||
|
|
||||||
|
* **Beautiful and responsive.** This is forum software for humans. Flarum is carefully designed to be consistent and intuitive across platforms, out-of-the-box.
|
||||||
|
|
||||||
|
* **Powerful and extensible.** Customize, extend, and integrate Flarum to suit your community. Flarum’s architecture is amazingly flexible, with a powerful Extension API.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Read the **[Installation guide](https://docs.flarum.org/install)** to get started. For support, refer to the [documentation](https://docs.flarum.org/), and ask questions on the [community forum](https://discuss.flarum.org/) or [Discord chat](https://flarum.org/discord/).
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Thank you for considering contributing to Flarum! Please read the **[Contributing guide](https://docs.flarum.org/contributing)** to learn how you can help.
|
||||||
|
|
||||||
|
This repository only holds the Flarum skeleton application. Most development happens in [flarum/core](https://github.com/flarum/core).
|
||||||
|
|
||||||
|
## Security Vulnerabilities
|
||||||
|
|
||||||
|
If you discover a security vulnerability within Flarum, please follow our [security policy](https://github.com/flarum/core/security/policy) so we can address it promptly.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Flarum is open-source software licensed under the [MIT License](https://github.com/flarum/flarum/blob/master/LICENSE).
|
||||||
|
|
322
Vagrantfile
vendored
322
Vagrantfile
vendored
@ -1,322 +0,0 @@
|
|||||||
# -*- mode: ruby -*-
|
|
||||||
# vi: set ft=ruby :
|
|
||||||
|
|
||||||
# Config Github Settings
|
|
||||||
github_username = "fideloper"
|
|
||||||
github_repo = "Vaprobash"
|
|
||||||
github_branch = "1.3.0"
|
|
||||||
github_url = "https://raw.githubusercontent.com/#{github_username}/#{github_repo}/#{github_branch}"
|
|
||||||
|
|
||||||
# Server Configuration
|
|
||||||
hostname = "flarum.dev"
|
|
||||||
|
|
||||||
# Set a local private network IP address.
|
|
||||||
# See http://en.wikipedia.org/wiki/Private_network for explanation
|
|
||||||
# You can use the following IP ranges:
|
|
||||||
# 10.0.0.1 - 10.255.255.254
|
|
||||||
# 172.16.0.1 - 172.31.255.254
|
|
||||||
# 192.168.0.1 - 192.168.255.254
|
|
||||||
server_ip = "192.168.29.29"
|
|
||||||
server_cpus = "1" # Cores
|
|
||||||
server_memory = "512" # MB
|
|
||||||
server_swap = "768" # Options: false | int (MB) - Guideline: Between one or two times the server_memory
|
|
||||||
|
|
||||||
# UTC for Universal Coordinated Time
|
|
||||||
# EST for Eastern Standard Time
|
|
||||||
# US/Central for American Central
|
|
||||||
# US/Eastern for American Eastern
|
|
||||||
server_timezone = "UTC"
|
|
||||||
|
|
||||||
# Database Configuration
|
|
||||||
mysql_root_password = "root" # We'll assume user "root"
|
|
||||||
mysql_version = "5.5" # Options: 5.5 | 5.6
|
|
||||||
mysql_enable_remote = "false" # remote access enabled when true
|
|
||||||
pgsql_root_password = "root" # We'll assume user "root"
|
|
||||||
mongo_enable_remote = "false" # remote access enabled when true
|
|
||||||
|
|
||||||
# Languages and Packages
|
|
||||||
php_timezone = "UTC" # http://php.net/manual/en/timezones.php
|
|
||||||
php_version = "5.6" # Options: 5.5 | 5.6
|
|
||||||
ruby_version = "latest" # Choose what ruby version should be installed (will also be the default version)
|
|
||||||
ruby_gems = [ # List any Ruby Gems that you want to install
|
|
||||||
#"jekyll",
|
|
||||||
#"sass",
|
|
||||||
#"compass",
|
|
||||||
]
|
|
||||||
|
|
||||||
# To install HHVM instead of PHP, set this to "true"
|
|
||||||
hhvm = "false"
|
|
||||||
|
|
||||||
# PHP Options
|
|
||||||
composer_packages = [ # List any global Composer packages that you want to install
|
|
||||||
#"phpunit/phpunit:4.0.*",
|
|
||||||
#"codeception/codeception=*",
|
|
||||||
#"phpspec/phpspec:2.0.*@dev",
|
|
||||||
#"squizlabs/php_codesniffer:1.5.*",
|
|
||||||
"franzl/studio:dev-master"
|
|
||||||
]
|
|
||||||
|
|
||||||
# Default web server document root
|
|
||||||
# Symfony's public directory is assumed "web"
|
|
||||||
# Laravel's public directory is assumed "public"
|
|
||||||
public_folder = "/vagrant"
|
|
||||||
|
|
||||||
laravel_root_folder = "/vagrant/laravel" # Where to install Laravel. Will `composer install` if a composer.json file exists
|
|
||||||
laravel_version = "latest-stable" # If you need a specific version of Laravel, set it here
|
|
||||||
symfony_root_folder = "/vagrant/symfony" # Where to install Symfony.
|
|
||||||
|
|
||||||
nodejs_version = "latest" # By default "latest" will equal the latest stable version
|
|
||||||
nodejs_packages = [ # List any global NodeJS packages that you want to install
|
|
||||||
"bower",
|
|
||||||
"gulp"
|
|
||||||
]
|
|
||||||
|
|
||||||
sphinxsearch_version = "rel22" # rel20, rel21, rel22, beta, daily, stable
|
|
||||||
|
|
||||||
|
|
||||||
Vagrant.configure("2") do |config|
|
|
||||||
|
|
||||||
# Set server to Ubuntu 14.04
|
|
||||||
config.vm.box = "ubuntu/trusty32"
|
|
||||||
|
|
||||||
config.vm.define "Vaprobash" do |vapro|
|
|
||||||
end
|
|
||||||
|
|
||||||
if Vagrant.has_plugin?("vagrant-hostmanager")
|
|
||||||
config.hostmanager.enabled = true
|
|
||||||
config.hostmanager.manage_host = true
|
|
||||||
config.hostmanager.ignore_private_ip = false
|
|
||||||
config.hostmanager.include_offline = false
|
|
||||||
end
|
|
||||||
|
|
||||||
# Create a hostname, don't forget to put it to the `hosts` file
|
|
||||||
# This will point to the server's default virtual host
|
|
||||||
# TO DO: Make this work with virtualhost along-side xip.io URL
|
|
||||||
config.vm.hostname = hostname
|
|
||||||
|
|
||||||
# Create a static IP
|
|
||||||
config.vm.network :private_network, ip: server_ip
|
|
||||||
|
|
||||||
# A private dhcp network is required for NFS to work (on Windows hosts, at least)
|
|
||||||
# Windows users should use the winnfsd plugin: https://github.com/GM-Alex/vagrant-winnfsd
|
|
||||||
config.vm.network :private_network, type: "dhcp"
|
|
||||||
|
|
||||||
# Use NFS for the shared folder
|
|
||||||
config.vm.synced_folder ".", "/vagrant",
|
|
||||||
id: "core",
|
|
||||||
:nfs => true,
|
|
||||||
:mount_options => ['nolock,vers=3,udp,noatime,actimeo=1']
|
|
||||||
|
|
||||||
# If using VirtualBox
|
|
||||||
config.vm.provider :virtualbox do |vb|
|
|
||||||
|
|
||||||
vb.name = "FlarumVm"
|
|
||||||
|
|
||||||
# Set server cpus
|
|
||||||
vb.customize ["modifyvm", :id, "--cpus", server_cpus]
|
|
||||||
|
|
||||||
# Set server memory
|
|
||||||
vb.customize ["modifyvm", :id, "--memory", server_memory]
|
|
||||||
|
|
||||||
# Set the timesync threshold to 10 seconds, instead of the default 20 minutes.
|
|
||||||
# If the clock gets more than 15 minutes out of sync (due to your laptop going
|
|
||||||
# to sleep for instance, then some 3rd party services will reject requests.
|
|
||||||
vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
|
|
||||||
|
|
||||||
# Prevent VMs running on Ubuntu to lose internet connection
|
|
||||||
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
|
||||||
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
# If using VMWare Fusion
|
|
||||||
config.vm.provider "vmware_fusion" do |vb, override|
|
|
||||||
override.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
|
|
||||||
|
|
||||||
# Set server memory
|
|
||||||
vb.vmx["memsize"] = server_memory
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
# If using Vagrant-Cachier
|
|
||||||
# http://fgrehm.viewdocs.io/vagrant-cachier
|
|
||||||
if Vagrant.has_plugin?("vagrant-cachier")
|
|
||||||
# Configure cached packages to be shared between instances of the same base box.
|
|
||||||
# Usage docs: http://fgrehm.viewdocs.io/vagrant-cachier/usage
|
|
||||||
config.cache.scope = :box
|
|
||||||
|
|
||||||
config.cache.synced_folder_opts = {
|
|
||||||
type: :nfs,
|
|
||||||
mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Adding vagrant-digitalocean provider - https://github.com/smdahlen/vagrant-digitalocean
|
|
||||||
# Needs to ensure that the vagrant plugin is installed
|
|
||||||
config.vm.provider :digital_ocean do |provider, override|
|
|
||||||
override.ssh.private_key_path = '~/.ssh/id_rsa'
|
|
||||||
override.vm.box = 'digital_ocean'
|
|
||||||
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
|
|
||||||
|
|
||||||
provider.token = 'YOUR TOKEN'
|
|
||||||
provider.image = 'Ubuntu 14.04 x64'
|
|
||||||
provider.region = 'nyc2'
|
|
||||||
provider.size = '512mb'
|
|
||||||
end
|
|
||||||
|
|
||||||
####
|
|
||||||
# Base Items
|
|
||||||
##########
|
|
||||||
|
|
||||||
# Provision Base Packages
|
|
||||||
config.vm.provision "shell", path: "#{github_url}/scripts/base.sh", args: [github_url, server_swap, server_timezone]
|
|
||||||
|
|
||||||
# optimize base box
|
|
||||||
config.vm.provision "shell", path: "#{github_url}/scripts/base_box_optimizations.sh", privileged: true
|
|
||||||
|
|
||||||
# Provision PHP
|
|
||||||
config.vm.provision "shell", path: "#{github_url}/scripts/php.sh", args: [php_timezone, hhvm, php_version]
|
|
||||||
|
|
||||||
# Enable MSSQL for PHP
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/mssql.sh"
|
|
||||||
|
|
||||||
# Provision Vim
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/vim.sh", args: github_url
|
|
||||||
|
|
||||||
# Provision Docker
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/docker.sh"
|
|
||||||
|
|
||||||
|
|
||||||
####
|
|
||||||
# Web Servers
|
|
||||||
##########
|
|
||||||
|
|
||||||
# Provision Apache Base
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/apache.sh", args: [server_ip, public_folder, hostname, github_url]
|
|
||||||
|
|
||||||
# Provision Nginx Base
|
|
||||||
config.vm.provision "shell", path: "#{github_url}/scripts/nginx.sh", args: [server_ip, public_folder, hostname, github_url]
|
|
||||||
|
|
||||||
|
|
||||||
####
|
|
||||||
# Databases
|
|
||||||
##########
|
|
||||||
|
|
||||||
# Provision MySQL
|
|
||||||
config.vm.provision "shell", path: "#{github_url}/scripts/mysql.sh", args: [mysql_root_password, mysql_version, mysql_enable_remote]
|
|
||||||
|
|
||||||
# Provision PostgreSQL
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/pgsql.sh", args: pgsql_root_password
|
|
||||||
|
|
||||||
# Provision SQLite
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/sqlite.sh"
|
|
||||||
|
|
||||||
# Provision RethinkDB
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/rethinkdb.sh", args: pgsql_root_password
|
|
||||||
|
|
||||||
# Provision Couchbase
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/couchbase.sh"
|
|
||||||
|
|
||||||
# Provision CouchDB
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/couchdb.sh"
|
|
||||||
|
|
||||||
# Provision MongoDB
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/mongodb.sh", args: mongo_enable_remote
|
|
||||||
|
|
||||||
# Provision MariaDB
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/mariadb.sh", args: [mysql_root_password, mysql_enable_remote]
|
|
||||||
|
|
||||||
####
|
|
||||||
# Search Servers
|
|
||||||
##########
|
|
||||||
|
|
||||||
# Install Elasticsearch
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/elasticsearch.sh"
|
|
||||||
|
|
||||||
# Install SphinxSearch
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/sphinxsearch.sh", args: [sphinxsearch_version]
|
|
||||||
|
|
||||||
####
|
|
||||||
# Search Server Administration (web-based)
|
|
||||||
##########
|
|
||||||
|
|
||||||
# Install ElasticHQ
|
|
||||||
# Admin for: Elasticsearch
|
|
||||||
# Works on: Apache2, Nginx
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/elastichq.sh"
|
|
||||||
|
|
||||||
|
|
||||||
####
|
|
||||||
# In-Memory Stores
|
|
||||||
##########
|
|
||||||
|
|
||||||
# Install Memcached
|
|
||||||
config.vm.provision "shell", path: "#{github_url}/scripts/memcached.sh"
|
|
||||||
|
|
||||||
# Provision Redis (without journaling and persistence)
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/redis.sh"
|
|
||||||
|
|
||||||
# Provision Redis (with journaling and persistence)
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/redis.sh", args: "persistent"
|
|
||||||
# NOTE: It is safe to run this to add persistence even if originally provisioned without persistence
|
|
||||||
|
|
||||||
|
|
||||||
####
|
|
||||||
# Utility (queue)
|
|
||||||
##########
|
|
||||||
|
|
||||||
# Install Beanstalkd
|
|
||||||
config.vm.provision "shell", path: "#{github_url}/scripts/beanstalkd.sh"
|
|
||||||
|
|
||||||
# Install Heroku Toolbelt
|
|
||||||
# config.vm.provision "shell", path: "https://toolbelt.heroku.com/install-ubuntu.sh"
|
|
||||||
|
|
||||||
# Install Supervisord
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/supervisord.sh"
|
|
||||||
|
|
||||||
# Install ØMQ
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/zeromq.sh"
|
|
||||||
|
|
||||||
####
|
|
||||||
# Additional Languages
|
|
||||||
##########
|
|
||||||
|
|
||||||
# Install Nodejs
|
|
||||||
config.vm.provision "shell", path: "https://raw.githubusercontent.com/franzliedke/Vaprobash/patch-1/scripts/nodejs.sh", privileged: false, args: nodejs_packages.unshift(nodejs_version, github_url)
|
|
||||||
|
|
||||||
# Install Ruby Version Manager (RVM)
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/rvm.sh", privileged: false, args: ruby_gems.unshift(ruby_version)
|
|
||||||
|
|
||||||
####
|
|
||||||
# Frameworks and Tooling
|
|
||||||
##########
|
|
||||||
|
|
||||||
# Provision Composer
|
|
||||||
config.vm.provision "shell", path: "#{github_url}/scripts/composer.sh", privileged: false, args: composer_packages.join(" ")
|
|
||||||
|
|
||||||
# Provision Laravel
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/laravel.sh", privileged: false, args: [server_ip, laravel_root_folder, public_folder, laravel_version]
|
|
||||||
|
|
||||||
# Provision Symfony
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/symfony.sh", privileged: false, args: [server_ip, symfony_root_folder, public_folder]
|
|
||||||
|
|
||||||
# Install Screen
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/screen.sh"
|
|
||||||
|
|
||||||
# Install Mailcatcher
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/mailcatcher.sh"
|
|
||||||
|
|
||||||
# Install git-ftp
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/git-ftp.sh", privileged: false
|
|
||||||
|
|
||||||
# Install Ansible
|
|
||||||
# config.vm.provision "shell", path: "#{github_url}/scripts/ansible.sh"
|
|
||||||
|
|
||||||
####
|
|
||||||
# Local Scripts
|
|
||||||
# Any local scripts you may want to run post-provisioning.
|
|
||||||
# Add these to the same directory as the Vagrantfile.
|
|
||||||
##########
|
|
||||||
config.vm.provision "shell", path: "./flarum/vagrant/environment.sh", privileged: false
|
|
||||||
|
|
||||||
end
|
|
46
admin.php
46
admin.php
@ -1,46 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Flarum.
|
|
||||||
*
|
|
||||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Flarum\Core;
|
|
||||||
use Flarum\Forum\Middleware\HandleErrors;
|
|
||||||
use Franzl\Middleware\Whoops\Middleware as WhoopsMiddleware;
|
|
||||||
use Zend\Diactoros\Server;
|
|
||||||
use Zend\Stratigility\MiddlewarePipe;
|
|
||||||
|
|
||||||
$app = require __DIR__.'/flarum/bootstrap.php';
|
|
||||||
|
|
||||||
$app->register('Flarum\Admin\AdminServiceProvider');
|
|
||||||
|
|
||||||
$admin = new MiddlewarePipe();
|
|
||||||
$admin->pipe($app->make('Flarum\Api\Middleware\ReadJsonParameters'));
|
|
||||||
$admin->pipe($app->make('Flarum\Admin\Middleware\LoginWithCookieAndCheckAdmin'));
|
|
||||||
|
|
||||||
$adminPath = parse_url(Core::url('admin'), PHP_URL_PATH);
|
|
||||||
$router = $app->make('Flarum\Http\RouterMiddleware', ['routes' => $app->make('flarum.admin.routes')]);
|
|
||||||
|
|
||||||
$admin->pipe($adminPath, $router);
|
|
||||||
|
|
||||||
if (Core::inDebugMode()) {
|
|
||||||
$admin->pipe(new WhoopsMiddleware());
|
|
||||||
} else {
|
|
||||||
$admin->pipe(new HandleErrors(base_path('error')));
|
|
||||||
}
|
|
||||||
|
|
||||||
$server = Server::createServer(
|
|
||||||
$admin,
|
|
||||||
$_SERVER,
|
|
||||||
$_GET,
|
|
||||||
$_POST,
|
|
||||||
$_COOKIE,
|
|
||||||
$_FILES
|
|
||||||
);
|
|
||||||
|
|
||||||
$server->listen();
|
|
42
api.php
42
api.php
@ -1,42 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Flarum.
|
|
||||||
*
|
|
||||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Flarum\Api\Middleware\JsonApiErrors;
|
|
||||||
use Flarum\Core;
|
|
||||||
use Franzl\Middleware\Whoops\Middleware as WhoopsMiddleware;
|
|
||||||
use Zend\Diactoros\Server;
|
|
||||||
use Zend\Stratigility\MiddlewarePipe;
|
|
||||||
|
|
||||||
$app = require __DIR__.'/flarum/bootstrap.php';
|
|
||||||
|
|
||||||
$app->register('Flarum\Api\ApiServiceProvider');
|
|
||||||
|
|
||||||
$api = new MiddlewarePipe();
|
|
||||||
$api->pipe($app->make('Flarum\Api\Middleware\ReadJsonParameters'));
|
|
||||||
$api->pipe($app->make('Flarum\Api\Middleware\LoginWithHeader'));
|
|
||||||
|
|
||||||
$apiPath = parse_url(Core::url('api'), PHP_URL_PATH);
|
|
||||||
$router = $app->make('Flarum\Http\RouterMiddleware', ['routes' => $app->make('flarum.api.routes')]);
|
|
||||||
|
|
||||||
$api->pipe($apiPath, $router);
|
|
||||||
|
|
||||||
$api->pipe(new JsonApiErrors());
|
|
||||||
|
|
||||||
$server = Server::createServer(
|
|
||||||
$api,
|
|
||||||
$_SERVER,
|
|
||||||
$_GET,
|
|
||||||
$_POST,
|
|
||||||
$_COOKIE,
|
|
||||||
$_FILES
|
|
||||||
);
|
|
||||||
|
|
||||||
$server->listen();
|
|
87
build.sh
87
build.sh
@ -1,87 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
base=${PWD}
|
|
||||||
release=/tmp/flarum-release
|
|
||||||
|
|
||||||
rm -rf ${release}
|
|
||||||
mkdir ${release}
|
|
||||||
|
|
||||||
git archive --format zip --worktree-attributes HEAD > ${release}/release.zip
|
|
||||||
|
|
||||||
cd ${release}
|
|
||||||
unzip release.zip -d ./
|
|
||||||
rm release.zip
|
|
||||||
|
|
||||||
# Delete files
|
|
||||||
rm -rf ${release}/build.sh
|
|
||||||
rm -rf ${release}/Vagrantfile
|
|
||||||
rm -rf ${release}/flarum/vagrant
|
|
||||||
rm -rf ${release}/flarum/core
|
|
||||||
rm -rf ${release}/flarum/studio.json
|
|
||||||
|
|
||||||
# Install all Composer dependencies
|
|
||||||
cd ${release}/flarum
|
|
||||||
composer require flarum/core:dev-master@dev --prefer-dist --update-no-dev
|
|
||||||
composer install --prefer-dist --optimize-autoloader --ignore-platform-reqs --no-dev
|
|
||||||
|
|
||||||
# Copy public files
|
|
||||||
cp -R ${release}/flarum/vendor/flarum/core/public/* ${release}/assets
|
|
||||||
|
|
||||||
# Install frontend dependencies
|
|
||||||
# Assumes: npm install -g gulp flarum-gulp babel-core
|
|
||||||
cd ${release}/flarum/vendor/flarum/core/js
|
|
||||||
bower install
|
|
||||||
|
|
||||||
for app in forum admin; do
|
|
||||||
cd "${release}/flarum/vendor/flarum/core/js/${app}"
|
|
||||||
npm link gulp flarum-gulp babel-core
|
|
||||||
gulp --production
|
|
||||||
rm -rf "${release}/flarum/vendor/flarum/core/js/${app}/node_modules"
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -rf ${release}/flarum/vendor/flarum/core/js/bower_components
|
|
||||||
|
|
||||||
# Bundle extensions
|
|
||||||
for extension in bbcode emoji likes lock markdown mentions pusher sticky subscriptions suspend tags; do
|
|
||||||
mkdir "${release}/extensions/${extension}"
|
|
||||||
cd "${base}/extensions/${extension}"
|
|
||||||
git archive --format zip --worktree-attributes HEAD > "${release}/extensions/${extension}/release.zip"
|
|
||||||
|
|
||||||
cd "${release}/extensions/${extension}"
|
|
||||||
unzip release.zip -d ./
|
|
||||||
rm release.zip
|
|
||||||
composer install --prefer-dist --optimize-autoloader --ignore-platform-reqs --no-dev
|
|
||||||
|
|
||||||
cd "${release}/extensions/${extension}/js"
|
|
||||||
|
|
||||||
if [ -f bower.json ]; then
|
|
||||||
bower install
|
|
||||||
fi
|
|
||||||
|
|
||||||
for app in forum admin; do
|
|
||||||
cd "${release}/extensions/${extension}/js"
|
|
||||||
|
|
||||||
if [ -d $app ]; then
|
|
||||||
cd $app
|
|
||||||
|
|
||||||
if [ -f bower.json ]; then
|
|
||||||
bower install
|
|
||||||
fi
|
|
||||||
|
|
||||||
npm link gulp flarum-gulp
|
|
||||||
gulp --production
|
|
||||||
rm -rf node_modules bower_components
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
rm -rf "${release}/extensions/${extension}/js/bower_components"
|
|
||||||
wait
|
|
||||||
done
|
|
||||||
|
|
||||||
# Finally, create the release archive
|
|
||||||
cd ${release}
|
|
||||||
find . -type d -exec chmod 0750 {} +
|
|
||||||
find . -type f -exec chmod 0644 {} +
|
|
||||||
chmod 0775 .
|
|
||||||
chmod -R 0775 assets flarum/storage
|
|
||||||
zip -r release.zip ./
|
|
46
composer.json
Normal file
46
composer.json
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"name": "flarum/flarum",
|
||||||
|
"description": "Delightfully simple forum software.",
|
||||||
|
"type": "project",
|
||||||
|
"keywords": [
|
||||||
|
"forum",
|
||||||
|
"discussion"
|
||||||
|
],
|
||||||
|
"homepage": "https://flarum.org/",
|
||||||
|
"license": "MIT",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Flarum",
|
||||||
|
"email": "info@flarum.org",
|
||||||
|
"homepage": "https://flarum.org/team"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/flarum/core/issues",
|
||||||
|
"source": "https://github.com/flarum/flarum",
|
||||||
|
"docs": "https://docs.flarum.org/"
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"flarum/core": "^1.8",
|
||||||
|
"flarum/approval": "*",
|
||||||
|
"flarum/bbcode": "*",
|
||||||
|
"flarum/emoji": "*",
|
||||||
|
"flarum/lang-english": "*",
|
||||||
|
"flarum/flags": "*",
|
||||||
|
"flarum/likes": "*",
|
||||||
|
"flarum/lock": "*",
|
||||||
|
"flarum/markdown": "*",
|
||||||
|
"flarum/mentions": "*",
|
||||||
|
"flarum/nicknames": "*",
|
||||||
|
"flarum/pusher": "*",
|
||||||
|
"flarum/statistics": "*",
|
||||||
|
"flarum/sticky": "*",
|
||||||
|
"flarum/subscriptions": "*",
|
||||||
|
"flarum/suspend": "*",
|
||||||
|
"flarum/tags": "*"
|
||||||
|
},
|
||||||
|
"config": {
|
||||||
|
"preferred-install": "dist",
|
||||||
|
"sort-packages": true
|
||||||
|
}
|
||||||
|
}
|
14
extend.php
Normal file
14
extend.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Flarum.
|
||||||
|
*
|
||||||
|
* For detailed copyright and license information, please view the
|
||||||
|
* LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Flarum\Extend;
|
||||||
|
|
||||||
|
return [
|
||||||
|
// Register extenders here to customize your forum!
|
||||||
|
];
|
24
flarum
Normal file
24
flarum
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Flarum.
|
||||||
|
*
|
||||||
|
* For detailed copyright and license information, please view the
|
||||||
|
* LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$site = require 'site.php';
|
||||||
|
|
||||||
|
/*
|
||||||
|
|-------------------------------------------------------------------------------
|
||||||
|
| Interpret console arguments
|
||||||
|
|-------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Flarum's console interprets all command-line arguments to select and then
|
||||||
|
| execute corresponding commands for certain administrative tasks.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$server = new Flarum\Console\Server($site);
|
||||||
|
$server->listen();
|
1
flarum/.gitignore
vendored
1
flarum/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
vendor
|
|
@ -1 +0,0 @@
|
|||||||
Deny from All
|
|
@ -1,149 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Flarum.
|
|
||||||
*
|
|
||||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Flarum\Core;
|
|
||||||
use Flarum\Core\Application;
|
|
||||||
use Illuminate\Cache\FileStore;
|
|
||||||
use Illuminate\Cache\Repository;
|
|
||||||
use Illuminate\Config\Repository as ConfigRepository;
|
|
||||||
use Illuminate\Filesystem\Filesystem;
|
|
||||||
|
|
||||||
define('FLARUM_START', microtime(true));
|
|
||||||
|
|
||||||
require __DIR__ . '/vendor/autoload.php';
|
|
||||||
|
|
||||||
// franzliedke/studio currently doesn't autoload files (see issue below), so we
|
|
||||||
// will need to load them manually if we're using studio.
|
|
||||||
// https://github.com/franzliedke/studio/issues/29
|
|
||||||
if (file_exists(__DIR__ . '/core')) {
|
|
||||||
require __DIR__ . '/core/src/helpers.php';
|
|
||||||
require __DIR__ . '/core/vendor/swiftmailer/swiftmailer/lib/swift_required.php';
|
|
||||||
}
|
|
||||||
|
|
||||||
$app = new Application(realpath(__DIR__));
|
|
||||||
$app->instance('path.public', __DIR__.'/..');
|
|
||||||
|
|
||||||
Illuminate\Container\Container::setInstance($app);
|
|
||||||
|
|
||||||
if (file_exists($configFile = __DIR__.'/../config.php')) {
|
|
||||||
$app->instance('flarum.config', include $configFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
date_default_timezone_set('UTC');
|
|
||||||
|
|
||||||
$app->instance('config', $config = new ConfigRepository([
|
|
||||||
'view' => [
|
|
||||||
'paths' => [
|
|
||||||
realpath(base_path('resources/views'))
|
|
||||||
],
|
|
||||||
'compiled' => realpath(storage_path().'/framework/views'),
|
|
||||||
],
|
|
||||||
'mail' => [
|
|
||||||
'driver' => 'mail',
|
|
||||||
],
|
|
||||||
'cache' => [
|
|
||||||
'default' => 'file',
|
|
||||||
'stores' => [
|
|
||||||
'file' => [
|
|
||||||
'driver' => 'file',
|
|
||||||
'path' => storage_path().'/framework/cache',
|
|
||||||
],
|
|
||||||
],
|
|
||||||
'prefix' => 'flarum',
|
|
||||||
],
|
|
||||||
'filesystems' => [
|
|
||||||
'default' => 'local',
|
|
||||||
'cloud' => 's3',
|
|
||||||
'disks' => [
|
|
||||||
'flarum-avatars' => [
|
|
||||||
'driver' => 'local',
|
|
||||||
'root' => public_path('assets/avatars')
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
|
||||||
]));
|
|
||||||
|
|
||||||
$logger = new Monolog\Logger($app->environment());
|
|
||||||
$logPath = $app->storagePath() . '/logs/flarum.log';
|
|
||||||
$handler = new \Monolog\Handler\StreamHandler($logPath, Monolog\Logger::DEBUG);
|
|
||||||
$handler->setFormatter(new \Monolog\Formatter\LineFormatter(null, null, true, true));
|
|
||||||
$logger->pushHandler($handler);
|
|
||||||
|
|
||||||
$app->instance('log', $logger);
|
|
||||||
$app->alias('log', 'Psr\Log\LoggerInterface');
|
|
||||||
|
|
||||||
$app->singleton('cache', function ($app) {
|
|
||||||
$store = new FileStore(new Filesystem(), storage_path('framework/cache'));
|
|
||||||
$repository = new Repository($store);
|
|
||||||
$repository->setEventDispatcher($app->make('events'));
|
|
||||||
return $repository;
|
|
||||||
});
|
|
||||||
$app->alias('cache', 'Illuminate\Contracts\Cache\Repository');
|
|
||||||
|
|
||||||
$serviceProviders = [
|
|
||||||
'Flarum\Core\DatabaseServiceProvider',
|
|
||||||
'Flarum\Core\Settings\SettingsServiceProvider',
|
|
||||||
'Flarum\Locale\LocaleServiceProvider',
|
|
||||||
|
|
||||||
'Illuminate\Bus\BusServiceProvider',
|
|
||||||
'Illuminate\Filesystem\FilesystemServiceProvider',
|
|
||||||
'Illuminate\Hashing\HashServiceProvider',
|
|
||||||
'Illuminate\Mail\MailServiceProvider',
|
|
||||||
'Illuminate\View\ViewServiceProvider',
|
|
||||||
'Illuminate\Events\EventServiceProvider',
|
|
||||||
'Illuminate\Validation\ValidationServiceProvider',
|
|
||||||
];
|
|
||||||
|
|
||||||
foreach ($serviceProviders as $provider) {
|
|
||||||
$app->register(new $provider($app));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Core::isInstalled()) {
|
|
||||||
$settings = $app->make('Flarum\Core\Settings\SettingsRepository');
|
|
||||||
|
|
||||||
$app->register(new \Flarum\Core\CoreServiceProvider($app));
|
|
||||||
|
|
||||||
$config->set('mail.driver', Core::config('mail_driver'));
|
|
||||||
$config->set('mail.host', Core::config('mail_host'));
|
|
||||||
$config->set('mail.port', Core::config('mail_port'));
|
|
||||||
$config->set('mail.from.address', Core::config('mail_from'));
|
|
||||||
$config->set('mail.from.name', Core::config('forum_title'));
|
|
||||||
$config->set('mail.encryption', Core::config('mail_encryption'));
|
|
||||||
$config->set('mail.username', Core::config('mail_username'));
|
|
||||||
$config->set('mail.password', Core::config('mail_password'));
|
|
||||||
|
|
||||||
// Register extensions and tell them to listen for events
|
|
||||||
$app->register(new \Flarum\Support\ExtensionsServiceProvider($app));
|
|
||||||
}
|
|
||||||
|
|
||||||
$app->boot();
|
|
||||||
|
|
||||||
// If the version stored in the database doesn't match the version of the
|
|
||||||
// code, then run the upgrade script (migrations). This is temporary - a
|
|
||||||
// proper, more secure upgrade method is planned.
|
|
||||||
if (Core::isInstalled() && $settings->get('version') !== $app::VERSION) {
|
|
||||||
$input = new \Symfony\Component\Console\Input\StringInput('');
|
|
||||||
$output = new \Symfony\Component\Console\Output\BufferedOutput;
|
|
||||||
|
|
||||||
app('Flarum\Console\UpgradeCommand')->run($input, $output);
|
|
||||||
|
|
||||||
$settings->set('version', $app::VERSION);
|
|
||||||
|
|
||||||
app('flarum.formatter')->flush();
|
|
||||||
|
|
||||||
$forum = app('Flarum\Forum\Actions\ClientAction');
|
|
||||||
$forum->flushAssets();
|
|
||||||
|
|
||||||
$admin = app('Flarum\Admin\Actions\ClientAction');
|
|
||||||
$admin->flushAssets();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $app;
|
|
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "flarum/flarum",
|
|
||||||
"description": "The Flarum forum skeleton.",
|
|
||||||
"keywords": ["forum", "flarum"],
|
|
||||||
"license": "MIT",
|
|
||||||
"type": "project",
|
|
||||||
"require": {
|
|
||||||
"illuminate/container": "5.1.*",
|
|
||||||
"monolog/monolog": "^1.16.0",
|
|
||||||
"zendframework/zend-stratigility": "^1.1",
|
|
||||||
"franzl/whoops-middleware": "dev-master",
|
|
||||||
"flarum/core": "0.1.x@dev"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"franzl/studio": "1.0.x@dev"
|
|
||||||
},
|
|
||||||
"config": {
|
|
||||||
"preferred-install": "dist"
|
|
||||||
}
|
|
||||||
}
|
|
2258
flarum/composer.lock
generated
2258
flarum/composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
|||||||
Subproject commit 53f7112248ff4bfb0878d7fcb4487e846a2a8c37
|
|
@ -1,13 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head lang="en">
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<h1>404 Not Found</h1>
|
|
||||||
<p>Looks like this page could not be found.</p>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,13 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head lang="en">
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title></title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<h1>500 Internal Server Error</h1>
|
|
||||||
<p>Something went wrong on our server.</p>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,31 +0,0 @@
|
|||||||
#!/usr/bin/env php
|
|
||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Flarum.
|
|
||||||
*
|
|
||||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Flarum\Console\GenerateExtensionCommand;
|
|
||||||
use Flarum\Console\UpgradeCommand;
|
|
||||||
use Flarum\Core;
|
|
||||||
use Flarum\Install\Console\InstallCommand;
|
|
||||||
use Symfony\Component\Console\Application;
|
|
||||||
|
|
||||||
$app = require_once __DIR__.'/bootstrap.php';
|
|
||||||
|
|
||||||
$console = new Application('Flarum', $app::VERSION);
|
|
||||||
|
|
||||||
if (!Core::isInstalled()) {
|
|
||||||
$app->register(new \Flarum\Install\InstallServiceProvider($app));
|
|
||||||
$console->add(new InstallCommand($app));
|
|
||||||
}
|
|
||||||
|
|
||||||
$console->add(new UpgradeCommand($app));
|
|
||||||
$console->add(new GenerateExtensionCommand($app));
|
|
||||||
|
|
||||||
exit($console->run());
|
|
1
flarum/storage/.gitignore
vendored
1
flarum/storage/.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
laravel.log
|
|
6
flarum/storage/framework/.gitignore
vendored
6
flarum/storage/framework/.gitignore
vendored
@ -1,6 +0,0 @@
|
|||||||
config.php
|
|
||||||
routes.php
|
|
||||||
compiled.php
|
|
||||||
services.json
|
|
||||||
events.scanned.php
|
|
||||||
routes.scanned.php
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"packages": {
|
|
||||||
"flarum/core": "core"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,69 +0,0 @@
|
|||||||
#process & file related aliases
|
|
||||||
alias 755='sudo chmod -R 755 *'
|
|
||||||
alias 644='sudo chmod -R 644 *'
|
|
||||||
|
|
||||||
#copy stuff to clipboard
|
|
||||||
alias cl='fc -e - | pbcopy'
|
|
||||||
alias cpwd='pwd | tr -d "\n" | pbcopy'
|
|
||||||
alias pbcopy='xclip -selection clipboard'
|
|
||||||
alias pbpaste='xclip -selection clipboard -o'
|
|
||||||
|
|
||||||
#version control
|
|
||||||
alias ga='git add -A'
|
|
||||||
alias gc='git commit -m'
|
|
||||||
alias gp='git push origin $(current_branch)'
|
|
||||||
alias gpm='git push origin master'
|
|
||||||
alias gpd='git push origin develop'
|
|
||||||
alias gl='git log'
|
|
||||||
alias glp='git log --pretty=format:"%an %s"'
|
|
||||||
alias gs='git status'
|
|
||||||
alias ungit="find . -name '.git' -exec rm -rf {} \;"
|
|
||||||
|
|
||||||
#application specific
|
|
||||||
alias art='php artisan' #laravel
|
|
||||||
alias srv='php artisan serve' #laravel
|
|
||||||
alias tnk='php artisan tinker' #laravel
|
|
||||||
alias gmig='php artisan generate:migration'
|
|
||||||
alias gcon='php artisan generate:controller'
|
|
||||||
alias gmod='php artisan generate:model'
|
|
||||||
alias cc='./vendor/bin/codecept'
|
|
||||||
alias ccr='./vendor/bin/codecept run'
|
|
||||||
alias cca='./vendor/bin/codecept Acceptance'
|
|
||||||
alias ccf='./vendor/bin/codecept Functional'
|
|
||||||
alias ccu='./vendor/bin/codecept run Unit'
|
|
||||||
|
|
||||||
#function aliases
|
|
||||||
alias ghc=ghc
|
|
||||||
alias grl=grl
|
|
||||||
alias grln=grln
|
|
||||||
alias gac=gac
|
|
||||||
alias gacm=gacm
|
|
||||||
alias gacd=gacd
|
|
||||||
alias ggacm=gulpacm
|
|
||||||
alias ggac=gulpac
|
|
||||||
##functions
|
|
||||||
ghc() {
|
|
||||||
git clone git@github.com:$1/$2
|
|
||||||
}
|
|
||||||
gac() {
|
|
||||||
git add -A && git commit -m "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
gacm() {
|
|
||||||
git add -A && git commit -m "$1" && git push origin master
|
|
||||||
}
|
|
||||||
gacd() {
|
|
||||||
git add -A && git commit -m "$1" && git push origin develop
|
|
||||||
}
|
|
||||||
|
|
||||||
gulpacm() {
|
|
||||||
gulp && git add -A && git commit -m "$1" && git push origin master
|
|
||||||
}
|
|
||||||
|
|
||||||
gulpac() {
|
|
||||||
gulp && git add -A && git commit -m "$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
grl() {
|
|
||||||
grep -rl "$1" *
|
|
||||||
}
|
|
@ -1,96 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
|
|
||||||
block="
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
|
|
||||||
root /vagrant;
|
|
||||||
index index.html index.htm index.php app.php app_dev.php;
|
|
||||||
|
|
||||||
# Make site accessible from ...
|
|
||||||
server_name 192.168.29.29.xip.io flarum.dev;
|
|
||||||
|
|
||||||
access_log /var/log/nginx/vagrant.com-access.log;
|
|
||||||
error_log /var/log/nginx/vagrant.com-error.log error;
|
|
||||||
|
|
||||||
charset utf-8;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files \$uri \$uri/ /app.php?\$query_string /index.php?\$query_string;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api {
|
|
||||||
try_files \$uri \$uri/ /api.php?\$query_string;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /admin {
|
|
||||||
try_files \$uri \$uri/ /admin.php?\$query_string;
|
|
||||||
}
|
|
||||||
|
|
||||||
location = /favicon.ico { log_not_found off; access_log off; }
|
|
||||||
location = /robots.txt { access_log off; log_not_found off; }
|
|
||||||
|
|
||||||
# pass the PHP scripts to php5-fpm
|
|
||||||
# Note: .php$ is susceptible to file upload attacks
|
|
||||||
# Consider using: \"location ~ ^/(index|app|app_dev|config).php(/|$) {\"
|
|
||||||
location ~ \.php$ {
|
|
||||||
try_files \$uri =404;
|
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
||||||
# With php5-fpm:
|
|
||||||
fastcgi_pass 127.0.0.1:9000;
|
|
||||||
fastcgi_index index.php;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
|
|
||||||
fastcgi_param LARA_ENV local; # Environment variable for Laravel
|
|
||||||
fastcgi_param HTTPS off;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Deny .htaccess file access
|
|
||||||
location ~ /\.ht {
|
|
||||||
deny all;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"
|
|
||||||
|
|
||||||
echo "$block" | sudo tee /etc/nginx/sites-available/vagrant
|
|
||||||
sudo service nginx restart
|
|
||||||
|
|
||||||
### Setup NPM globals and create necessary directories ###
|
|
||||||
sudo apt-get install -y phantomjs zsh exuberant-ctags
|
|
||||||
mkdir /home/vagrant/npm
|
|
||||||
sudo chown -R vagrant:vagrant /home/vagrant
|
|
||||||
|
|
||||||
cp /vagrant/scripts/aliases ~/.aliases
|
|
||||||
|
|
||||||
### Create rc file ###
|
|
||||||
if [ -e "/home/vagrant/.zshrc" ]
|
|
||||||
then
|
|
||||||
echo "source ~/.aliases" >> ~/.zshrc
|
|
||||||
else
|
|
||||||
echo "source ~/.aliases" >> ~/.bashrc
|
|
||||||
fi
|
|
||||||
|
|
||||||
mysql -u root -proot -e 'create database flarum'
|
|
||||||
|
|
||||||
### Setup flarum/core and install dependencies ###
|
|
||||||
cd /vagrant/flarum/core
|
|
||||||
git pull
|
|
||||||
composer install --prefer-dist
|
|
||||||
|
|
||||||
cd /vagrant/flarum
|
|
||||||
composer install --prefer-dist
|
|
||||||
composer dump-autoload
|
|
||||||
|
|
||||||
cd /vagrant/flarum/core/js
|
|
||||||
bower install
|
|
||||||
|
|
||||||
cd /vagrant/flarum/core/js/forum
|
|
||||||
npm install
|
|
||||||
gulp
|
|
||||||
|
|
||||||
cd /vagrant/flarum/core/js/admin
|
|
||||||
npm install
|
|
||||||
gulp
|
|
||||||
|
|
||||||
cd /vagrant/flarum
|
|
||||||
php flarum install --defaults
|
|
60
index.php
60
index.php
@ -1,60 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of Flarum.
|
|
||||||
*
|
|
||||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
use Flarum\Core;
|
|
||||||
use Flarum\Forum\Middleware\HandleErrors;
|
|
||||||
use Franzl\Middleware\Whoops\Middleware as WhoopsMiddleware;
|
|
||||||
use Zend\Diactoros\Server;
|
|
||||||
use Zend\Stratigility\MiddlewarePipe;
|
|
||||||
|
|
||||||
$app = require __DIR__.'/flarum/bootstrap.php';
|
|
||||||
|
|
||||||
// If Flarum's configuration exists, then we can assume that installation has
|
|
||||||
// been completed. We will set up a middleware pipe to route the request through
|
|
||||||
// to one of the main forum actions.
|
|
||||||
if (Core::isInstalled()) {
|
|
||||||
$app->register('Flarum\Forum\ForumServiceProvider');
|
|
||||||
|
|
||||||
$flarum = new MiddlewarePipe();
|
|
||||||
$flarum->pipe($app->make('Flarum\Forum\Middleware\LoginWithCookie'));
|
|
||||||
$flarum->pipe($app->make('Flarum\Api\Middleware\ReadJsonParameters'));
|
|
||||||
|
|
||||||
$basePath = parse_url(Core::url(), PHP_URL_PATH);
|
|
||||||
$router = $app->make('Flarum\Http\RouterMiddleware', ['routes' => $app->make('flarum.forum.routes')]);
|
|
||||||
|
|
||||||
$flarum->pipe($basePath, $router);
|
|
||||||
|
|
||||||
if (Core::inDebugMode()) {
|
|
||||||
$flarum->pipe(new WhoopsMiddleware());
|
|
||||||
} else {
|
|
||||||
$flarum->pipe(new HandleErrors(base_path('error')));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$app->register('Flarum\Install\InstallServiceProvider');
|
|
||||||
|
|
||||||
$flarum = new MiddlewarePipe();
|
|
||||||
|
|
||||||
$basePath = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
|
||||||
$router = $app->make('Flarum\Http\RouterMiddleware', ['routes' => $app->make('flarum.install.routes')]);
|
|
||||||
$flarum->pipe($basePath, $router);
|
|
||||||
$flarum->pipe(new WhoopsMiddleware());
|
|
||||||
}
|
|
||||||
|
|
||||||
$server = Server::createServer(
|
|
||||||
$flarum,
|
|
||||||
$_SERVER,
|
|
||||||
$_GET,
|
|
||||||
$_POST,
|
|
||||||
$_COOKIE,
|
|
||||||
$_FILES
|
|
||||||
);
|
|
||||||
|
|
||||||
$server->listen();
|
|
133
public/.htaccess
Normal file
133
public/.htaccess
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine on
|
||||||
|
|
||||||
|
# Ensure the Authorization HTTP header is available to PHP
|
||||||
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||||
|
|
||||||
|
# Uncomment the following lines if you are not using a `public` directory
|
||||||
|
# to prevent sensitive resources from being exposed.
|
||||||
|
# <!-- BEGIN EXPOSED RESOURCES PROTECTION -->
|
||||||
|
# RewriteRule /\.git / [F,L]
|
||||||
|
# RewriteRule ^auth\.json$ / [F,L]
|
||||||
|
# RewriteRule ^composer\.(lock|json)$ / [F,L]
|
||||||
|
# RewriteRule ^config.php$ / [F,L]
|
||||||
|
# RewriteRule ^flarum$ / [F,L]
|
||||||
|
# RewriteRule ^storage/(.*)?$ / [F,L]
|
||||||
|
# RewriteRule ^vendor/(.*)?$ / [F,L]
|
||||||
|
# <!-- END EXPOSED RESOURCES PROTECTION -->
|
||||||
|
|
||||||
|
# Pass requests that don't refer directly to files in the filesystem to index.php
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule ^ index.php [QSA,L]
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Disable directory listings
|
||||||
|
Options -Indexes
|
||||||
|
|
||||||
|
# MultiViews can mess up our rewriting scheme
|
||||||
|
Options -MultiViews
|
||||||
|
|
||||||
|
# The following directives are based on best practices from H5BP Apache Server Configs
|
||||||
|
# https://github.com/h5bp/server-configs-apache
|
||||||
|
|
||||||
|
# Expire rules for static content
|
||||||
|
<IfModule mod_expires.c>
|
||||||
|
ExpiresActive on
|
||||||
|
ExpiresDefault "access plus 1 month"
|
||||||
|
ExpiresByType text/css "access plus 1 year"
|
||||||
|
ExpiresByType application/atom+xml "access plus 1 hour"
|
||||||
|
ExpiresByType application/rdf+xml "access plus 1 hour"
|
||||||
|
ExpiresByType application/rss+xml "access plus 1 hour"
|
||||||
|
ExpiresByType application/json "access plus 0 seconds"
|
||||||
|
ExpiresByType application/ld+json "access plus 0 seconds"
|
||||||
|
ExpiresByType application/schema+json "access plus 0 seconds"
|
||||||
|
ExpiresByType application/vnd.geo+json "access plus 0 seconds"
|
||||||
|
ExpiresByType application/vnd.api+json "access plus 0 seconds"
|
||||||
|
ExpiresByType application/xml "access plus 0 seconds"
|
||||||
|
ExpiresByType text/calendar "access plus 0 seconds"
|
||||||
|
ExpiresByType text/xml "access plus 0 seconds"
|
||||||
|
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
|
||||||
|
ExpiresByType image/x-icon "access plus 1 week"
|
||||||
|
ExpiresByType text/html "access plus 0 seconds"
|
||||||
|
ExpiresByType application/javascript "access plus 1 year"
|
||||||
|
ExpiresByType application/x-javascript "access plus 1 year"
|
||||||
|
ExpiresByType text/javascript "access plus 1 year"
|
||||||
|
ExpiresByType application/manifest+json "access plus 1 week"
|
||||||
|
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
|
||||||
|
ExpiresByType text/cache-manifest "access plus 0 seconds"
|
||||||
|
ExpiresByType text/markdown "access plus 0 seconds"
|
||||||
|
ExpiresByType audio/ogg "access plus 1 month"
|
||||||
|
ExpiresByType image/bmp "access plus 1 month"
|
||||||
|
ExpiresByType image/gif "access plus 1 month"
|
||||||
|
ExpiresByType image/jpeg "access plus 1 month"
|
||||||
|
ExpiresByType image/png "access plus 1 month"
|
||||||
|
ExpiresByType image/svg+xml "access plus 1 month"
|
||||||
|
ExpiresByType image/webp "access plus 1 month"
|
||||||
|
ExpiresByType video/mp4 "access plus 1 month"
|
||||||
|
ExpiresByType video/ogg "access plus 1 month"
|
||||||
|
ExpiresByType video/webm "access plus 1 month"
|
||||||
|
ExpiresByType application/wasm "access plus 1 year"
|
||||||
|
ExpiresByType font/collection "access plus 1 month"
|
||||||
|
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
|
||||||
|
ExpiresByType font/eot "access plus 1 month"
|
||||||
|
ExpiresByType font/opentype "access plus 1 month"
|
||||||
|
ExpiresByType font/otf "access plus 1 month"
|
||||||
|
ExpiresByType application/x-font-ttf "access plus 1 month"
|
||||||
|
ExpiresByType font/ttf "access plus 1 month"
|
||||||
|
ExpiresByType application/font-woff "access plus 1 month"
|
||||||
|
ExpiresByType application/x-font-woff "access plus 1 month"
|
||||||
|
ExpiresByType font/woff "access plus 1 month"
|
||||||
|
ExpiresByType application/font-woff2 "access plus 1 month"
|
||||||
|
ExpiresByType font/woff2 "access plus 1 month"
|
||||||
|
ExpiresByType text/x-cross-domain-policy "access plus 1 week"
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Gzip compression
|
||||||
|
<IfModule mod_deflate.c>
|
||||||
|
<IfModule mod_filter.c>
|
||||||
|
AddOutputFilterByType DEFLATE "application/atom+xml" \
|
||||||
|
"application/javascript" \
|
||||||
|
"application/json" \
|
||||||
|
"application/ld+json" \
|
||||||
|
"application/manifest+json" \
|
||||||
|
"application/rdf+xml" \
|
||||||
|
"application/rss+xml" \
|
||||||
|
"application/schema+json" \
|
||||||
|
"application/vnd.geo+json" \
|
||||||
|
"application/vnd.ms-fontobject" \
|
||||||
|
"application/wasm" \
|
||||||
|
"application/x-font-ttf" \
|
||||||
|
"application/x-javascript" \
|
||||||
|
"application/x-web-app-manifest+json" \
|
||||||
|
"application/xhtml+xml" \
|
||||||
|
"application/xml" \
|
||||||
|
"font/collection" \
|
||||||
|
"font/eot" \
|
||||||
|
"font/opentype" \
|
||||||
|
"font/otf" \
|
||||||
|
"font/ttf" \
|
||||||
|
"image/bmp" \
|
||||||
|
"image/svg+xml" \
|
||||||
|
"image/vnd.microsoft.icon" \
|
||||||
|
"image/x-icon" \
|
||||||
|
"text/cache-manifest" \
|
||||||
|
"text/calendar" \
|
||||||
|
"text/css" \
|
||||||
|
"text/html" \
|
||||||
|
"text/javascript" \
|
||||||
|
"text/plain" \
|
||||||
|
"text/markdown" \
|
||||||
|
"text/vcard" \
|
||||||
|
"text/vnd.rim.location.xloc" \
|
||||||
|
"text/vtt" \
|
||||||
|
"text/x-component" \
|
||||||
|
"text/x-cross-domain-policy" \
|
||||||
|
"text/xml"
|
||||||
|
</IfModule>
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# Fix for https://httpoxy.org vulnerability
|
||||||
|
<IfModule mod_headers.c>
|
||||||
|
RequestHeader unset Proxy
|
||||||
|
</IfModule>
|
26
public/index.php
Normal file
26
public/index.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Flarum.
|
||||||
|
*
|
||||||
|
* For detailed copyright and license information, please view the
|
||||||
|
* LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
$site = require '../site.php';
|
||||||
|
|
||||||
|
/*
|
||||||
|
|-------------------------------------------------------------------------------
|
||||||
|
| Accept incoming HTTP requests
|
||||||
|
|-------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Every HTTP request pointed to the web server that cannot be served by simply
|
||||||
|
| responding with one of the files in the "public" directory will be sent to
|
||||||
|
| this file. Now is the time to boot up Flarum's internal HTTP server, which
|
||||||
|
| will try its best to interpret the request and return the appropriate
|
||||||
|
| response, which could be a JSON document (for API responses) or a lot of HTML.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$server = new Flarum\Http\Server($site);
|
||||||
|
$server->listen();
|
29
public/web.config
Normal file
29
public/web.config
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration>
|
||||||
|
<system.webServer>
|
||||||
|
<defaultDocument>
|
||||||
|
<files>
|
||||||
|
<clear />
|
||||||
|
<add value="Index.php" />
|
||||||
|
</files>
|
||||||
|
</defaultDocument>
|
||||||
|
<rewrite>
|
||||||
|
<rules>
|
||||||
|
<!-- Changed `enabled=` to true in the rule below if you are not using the `public` directory to
|
||||||
|
prevent sensitive resources from being exposed -->
|
||||||
|
<rule name="Disallow sensitive directories" enabled="false" stopProcessing="true">
|
||||||
|
<match url="^/(\.git|composer\.(json|lock)|auth\.json|config\.php|flarum|storage|vendor)" ignoreCase="false" />
|
||||||
|
<action type="CustomResponse" url="/" statusCode="403" statusReason="Forbidden" statusDescription="Forbidden" />
|
||||||
|
</rule>
|
||||||
|
<rule name="Handle index.php re-write" stopProcessing="true">
|
||||||
|
<match url="^" ignoreCase="false" />
|
||||||
|
<conditions logicalGrouping="MatchAll">
|
||||||
|
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
|
||||||
|
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
|
||||||
|
</conditions>
|
||||||
|
<action type="Rewrite" url="index.php" appendQueryString="true" />
|
||||||
|
</rule>
|
||||||
|
</rules>
|
||||||
|
</rewrite>
|
||||||
|
</system.webServer>
|
||||||
|
</configuration>
|
36
readme.md
36
readme.md
@ -1,36 +0,0 @@
|
|||||||

|
|
||||||
|
|
||||||
**[Flarum](http://flarum.org) is free, open-source forum software with a focus on simplicity.** You can use Flarum to easily set up a discussion forum for your website.
|
|
||||||
|
|
||||||
[Features](http://flarum.org/features) -
|
|
||||||
[Download](http://flarum.org/download) -
|
|
||||||
[Documentation](http://flarum.org/docs) -
|
|
||||||
[Community](http://discuss.flarum.org) -
|
|
||||||
[Gitter Chat](https://gitter.im/flarum/flarum) -
|
|
||||||
[Twitter](http://twitter.com/flarum) -
|
|
||||||
[Contact](mailto:toby@flarum.org) -
|
|
||||||
[Donate](http://flarum.org/donate)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Goals
|
|
||||||
|
|
||||||
Flarum is the combined successor of [esoTalk](http://esotalk.org) and [FluxBB](http://fluxbb.org). It aims to be:
|
|
||||||
|
|
||||||
- **Fast and simple.** No clutter, no bloat, no complex dependencies. Flarum is built with PHP so it's quick and easy to deploy. The interface is powered by Mithril, a performant JavaScript framework with a tiny footprint.
|
|
||||||
- **Beautiful and responsive.** This is forum software for humans. Flarum is carefully designed to be consistent and intuitive across platforms, out-of-the-box.
|
|
||||||
- **Powerful and extensible.** Customize, extend, and integrate Flarum to suit your community. Flarum's architecture is amazingly flexible, prioritizing comprehensive APIs and great [documentation](http://flarum.org/docs).
|
|
||||||
- **Free and open.** Flarum is released under the [MIT license](https://github.com/flarum/flarum/blob/master/LICENSE).
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
> **Flarum is currently in beta and should not be used in production.** It is being developed openly on GitHub. Check out the [Roadmap](http://flarum.org/roadmap) to follow along with our progress.
|
|
||||||
|
|
||||||
To give Flarum a spin, go to the [Download](http://flarum.org/download) page. You'll need a server with **PHP 5.5+** and **MySQL 5.5+**.
|
|
||||||
|
|
||||||
If you want to hack on Flarum, you'll need to set up a development environment. Read how in the [Contributing docs](http://flarum.org/docs/contributing)!
|
|
||||||
|
|
||||||
## Core Team
|
|
||||||
|
|
||||||
- Toby Zerner ([GitHub](http://github.com/tobscure), [Twitter](http://twitter.com/tobscure))
|
|
||||||
- Franz Liedke ([GitHub](http://github.com/franzliedke), [Twitter](http://twitter.com/franzliedke))
|
|
50
site.php
Normal file
50
site.php
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Flarum.
|
||||||
|
*
|
||||||
|
* For detailed copyright and license information, please view the
|
||||||
|
* LICENSE file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|-------------------------------------------------------------------------------
|
||||||
|
| Load the autoloader
|
||||||
|
|-------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| First, let's include the autoloader, which is generated automatically by
|
||||||
|
| Composer (PHP's package manager) after installing our dependencies.
|
||||||
|
| From now on, all classes in our dependencies will be usable without
|
||||||
|
| explicitly loading any files.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
require __DIR__.'/vendor/autoload.php';
|
||||||
|
|
||||||
|
/*
|
||||||
|
|-------------------------------------------------------------------------------
|
||||||
|
| Configure the site
|
||||||
|
|-------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| A Flarum site represents your local installation of Flarum. It can be
|
||||||
|
| configured with a bunch of paths:
|
||||||
|
|
|
||||||
|
| - The *base path* is Flarum's root directory and contains important files
|
||||||
|
| such as config.php and extend.php.
|
||||||
|
| - The *public path* is the directory that serves as document root for the
|
||||||
|
| web server. Files in this place are accessible to the public internet.
|
||||||
|
| This is where assets such as JavaScript files or CSS stylesheets need to
|
||||||
|
| be stored in a default install.
|
||||||
|
| - The *storage path* is a place for Flarum to store files it generates during
|
||||||
|
| runtime. This could be caches, session data or other temporary files.
|
||||||
|
|
|
||||||
|
| The fully configured site instance is returned to the including script, which
|
||||||
|
| then uses it to boot up the Flarum application and e.g. accept web requests.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
return Flarum\Foundation\Site::fromPaths([
|
||||||
|
'base' => __DIR__,
|
||||||
|
'public' => __DIR__.'/public',
|
||||||
|
'storage' => __DIR__.'/storage',
|
||||||
|
]);
|
2
storage/locale/.gitignore
vendored
Normal file
2
storage/locale/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
2
storage/views/.gitignore
vendored
Normal file
2
storage/views/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
Loading…
x
Reference in New Issue
Block a user