mirror of
https://github.com/flarum/flarum.git
synced 2025-06-23 00:00:10 -04:00
Compare commits
120 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 |
@ -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
|
||||||
|
81
.htaccess
81
.htaccess
@ -1,81 +0,0 @@
|
|||||||
# Allow access if Flarum is installed in a subdirectory,
|
|
||||||
# but another .htaccess in a higher directory denies access.
|
|
||||||
|
|
||||||
<IfModule mod_authz_core.c>
|
|
||||||
Require all granted
|
|
||||||
</IfModule>
|
|
||||||
<IfModule !mod_authz_core.c>
|
|
||||||
Order Allow,Deny
|
|
||||||
Allow from all
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
<IfModule mod_rewrite.c>
|
|
||||||
RewriteEngine on
|
|
||||||
|
|
||||||
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
||||||
|
|
||||||
RewriteRule ^vendor/(.*)?$ / [F,L]
|
|
||||||
RewriteRule ^storage/(.*)?$ / [F,L]
|
|
||||||
RewriteRule ^config.php$ / [F,L]
|
|
||||||
|
|
||||||
RewriteRule ^api(.*)$ api.php [QSA,L]
|
|
||||||
RewriteRule ^admin(.*)$ admin.php [QSA,L]
|
|
||||||
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
|
||||||
RewriteRule !^assets index.php [QSA,L]
|
|
||||||
|
|
||||||
# MultiViews can mess up our rewriting scheme
|
|
||||||
Options -MultiViews
|
|
||||||
|
|
||||||
# Autoindex will list all assets files which is not so good
|
|
||||||
Options -Indexes
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
<IfModule mod_deflate.c>
|
|
||||||
# Compress all output labeled with one of the following MIME-types
|
|
||||||
<IfModule mod_filter.c>
|
|
||||||
AddOutputFilterByType DEFLATE application/atom+xml \
|
|
||||||
application/javascript \
|
|
||||||
application/json \
|
|
||||||
application/vnd.ms-fontobject \
|
|
||||||
application/x-font-ttf \
|
|
||||||
application/x-web-app-manifest+json \
|
|
||||||
application/xhtml+xml \
|
|
||||||
application/xml \
|
|
||||||
font/opentype \
|
|
||||||
image/svg+xml \
|
|
||||||
image/x-icon \
|
|
||||||
text/css \
|
|
||||||
text/html \
|
|
||||||
text/plain \
|
|
||||||
text/xml
|
|
||||||
</IfModule>
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
# Configure cache expiry for different file types
|
|
||||||
<IfModule mod_expires.c>
|
|
||||||
ExpiresActive on
|
|
||||||
ExpiresDefault "access plus 1 second"
|
|
||||||
|
|
||||||
ExpiresByType text/css "access plus 1 year"
|
|
||||||
ExpiresByType application/json "access plus 0 seconds"
|
|
||||||
ExpiresByType application/xml "access plus 0 seconds"
|
|
||||||
ExpiresByType text/xml "access plus 0 seconds"
|
|
||||||
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-web-app-manifest+json "access plus 0 seconds"
|
|
||||||
ExpiresByType text/cache-manifest "access plus 0 seconds"
|
|
||||||
ExpiresByType image/gif "access plus 1 month"
|
|
||||||
ExpiresByType image/jpeg "access plus 1 month"
|
|
||||||
ExpiresByType image/png "access plus 1 month"
|
|
||||||
ExpiresByType application/atom+xml "access plus 1 hour"
|
|
||||||
ExpiresByType application/rss+xml "access plus 1 hour"
|
|
||||||
ExpiresByType application/font-woff2 "access plus 1 month"
|
|
||||||
ExpiresByType application/font-woff "access plus 1 month"
|
|
||||||
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
|
|
||||||
ExpiresByType application/x-font-ttf "access plus 1 month"
|
|
||||||
ExpiresByType font/opentype "access plus 1 month"
|
|
||||||
ExpiresByType image/svg+xml "access plus 1 month"
|
|
||||||
</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,67 +0,0 @@
|
|||||||
# Contributing to Flarum
|
|
||||||
|
|
||||||
Howdy! We're really excited that you are interested in contributing to Flarum. Before submitting your contribution, please take a moment and read through the following guidelines.
|
|
||||||
|
|
||||||
## Reporting Bugs
|
|
||||||
|
|
||||||
- Before opening an issue, debug your problem by following [these instructions](http://flarum.org/docs/contributing). Only open an issue if you are confident it is a bug with Flarum, not with your own setup.
|
|
||||||
|
|
||||||
- All issues should be reported on the [flarum/core](https://github.com/flarum/core/issues) repository. Issues pertaining to a specific extension should include the extension name in their title, e.g. `[Tags] Issue title`.
|
|
||||||
|
|
||||||
- Try to search for your issue – it may have already been answered or even fixed in the development branch.
|
|
||||||
|
|
||||||
- Check if the issue is reproducible with the latest version of Flarum. If you are using a pre-release or development version, please indicate the specific version you are using.
|
|
||||||
|
|
||||||
- It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Issues with no clear repro steps will not be triaged. If an issue labeled "needs verification" receives no further input from the issue author for more than 5 days, it will be closed.
|
|
||||||
|
|
||||||
### Security Vulnerabilities
|
|
||||||
|
|
||||||
If you discover a security vulnerability within Flarum, please send an email to [security@flarum.org](mailto:security@flarum.org).
|
|
||||||
|
|
||||||
## Pull Request Guidelines
|
|
||||||
|
|
||||||
- Read the [Contributor License Agreement](#contributor-license-agreement).
|
|
||||||
|
|
||||||
- Checkout a topic branch from `master` and merge back against `master`.
|
|
||||||
|
|
||||||
- Do NOT checkin the JavaScript `dist` files in commits.
|
|
||||||
|
|
||||||
- [Squash the commits](http://davidwalsh.name/squash-commits-git) if there are too many small ones.
|
|
||||||
|
|
||||||
- Follow the [code style](#code-style).
|
|
||||||
|
|
||||||
## Code Style
|
|
||||||
|
|
||||||
- PHP: [PSR-2 coding standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md), [PHPDoc](http://www.phpdoc.org/docs/latest/index.html)
|
|
||||||
|
|
||||||
- JavaScript: [Airbnb Style Guide](https://github.com/airbnb/javascript), [ESDoc](https://esdoc.org/tags.html)
|
|
||||||
|
|
||||||
- When in doubt, read the source code.
|
|
||||||
|
|
||||||
## Development Setup
|
|
||||||
|
|
||||||
[flarum/flarum](https://github.com/flarum/flarum) is a "skeleton" application which uses Composer to download [flarum/core](https://github.com/flarum/core) and a [bunch of extensions](https://github.com/flarum). In order to work on these, you will need to change their versions to `dev-master` in `composer.json` and install them from source:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ composer update --prefer-source
|
|
||||||
```
|
|
||||||
|
|
||||||
Flarum's front-end code is written in ES6 and transpiled into JavaScript. The compiled JavaScript is only committed when we tag a release; during development you will need to do it yourself. To recompile the JavaScript you will need [Node.js](http://nodejs.org).
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ npm install -g gulp
|
|
||||||
$ cd vendor/flarum/core
|
|
||||||
$ ./scripts/compile.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Check out the [Roadmap](https://github.com/flarum/core/issues/74) for an overview of what needs to be done. See the [Good For New Contributors](https://github.com/flarum/core/labels/Good%20for%20New%20Contributors) label for a list of issues that should be relatively easy to get started with.
|
|
||||||
|
|
||||||
## Contributor License Agreement
|
|
||||||
|
|
||||||
By contributing your code to Flarum you grant Toby Zerner a non-exclusive, irrevocable, worldwide, royalty-free, sublicensable, 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.4.1"
|
|
||||||
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-3/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: "./scripts/environment.sh", privileged: false
|
|
||||||
|
|
||||||
end
|
|
16
admin.php
16
admin.php
@ -1,16 +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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
require 'vendor/autoload.php';
|
|
||||||
|
|
||||||
$server = new Flarum\Admin\Server(__DIR__);
|
|
||||||
|
|
||||||
$server->listen();
|
|
16
api.php
16
api.php
@ -1,16 +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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
require 'vendor/autoload.php';
|
|
||||||
|
|
||||||
$server = new Flarum\Api\Server(__DIR__);
|
|
||||||
|
|
||||||
$server->listen();
|
|
@ -2,51 +2,45 @@
|
|||||||
"name": "flarum/flarum",
|
"name": "flarum/flarum",
|
||||||
"description": "Delightfully simple forum software.",
|
"description": "Delightfully simple forum software.",
|
||||||
"type": "project",
|
"type": "project",
|
||||||
"keywords": ["forum", "discussion"],
|
"keywords": [
|
||||||
"homepage": "http://flarum.org",
|
"forum",
|
||||||
|
"discussion"
|
||||||
|
],
|
||||||
|
"homepage": "https://flarum.org/",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Toby Zerner",
|
"name": "Flarum",
|
||||||
"email": "toby.zerner@gmail.com"
|
"email": "info@flarum.org",
|
||||||
},
|
"homepage": "https://flarum.org/team"
|
||||||
{
|
|
||||||
"name": "Franz Liedke",
|
|
||||||
"email": "franz@develophp.org"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/flarum/core/issues",
|
"issues": "https://github.com/flarum/core/issues",
|
||||||
"source": "https://github.com/flarum/flarum",
|
"source": "https://github.com/flarum/flarum",
|
||||||
"docs": "http://flarum.org/docs"
|
"docs": "https://docs.flarum.org/"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"flarum/composer-installer": "*",
|
"flarum/core": "^1.8",
|
||||||
"flarum/core": "^0.1.0",
|
"flarum/approval": "*",
|
||||||
"flarum/akismet": "^0.1.0",
|
"flarum/bbcode": "*",
|
||||||
"flarum/approval": "^0.1.0",
|
"flarum/emoji": "*",
|
||||||
"flarum/auth-facebook": "^0.1.0",
|
"flarum/lang-english": "*",
|
||||||
"flarum/auth-github": "^0.1.0",
|
"flarum/flags": "*",
|
||||||
"flarum/auth-twitter": "^0.1.0",
|
"flarum/likes": "*",
|
||||||
"flarum/bbcode": "^0.1.0",
|
"flarum/lock": "*",
|
||||||
"flarum/emoji": "^0.1.0",
|
"flarum/markdown": "*",
|
||||||
"flarum/english": "^0.1.0",
|
"flarum/mentions": "*",
|
||||||
"flarum/flags": "^0.1.0",
|
"flarum/nicknames": "*",
|
||||||
"flarum/likes": "^0.1.0",
|
"flarum/pusher": "*",
|
||||||
"flarum/lock": "^0.1.0",
|
"flarum/statistics": "*",
|
||||||
"flarum/markdown": "^0.1.0",
|
"flarum/sticky": "*",
|
||||||
"flarum/mentions": "^0.1.0",
|
"flarum/subscriptions": "*",
|
||||||
"flarum/pusher": "^0.1.0",
|
"flarum/suspend": "*",
|
||||||
"flarum/sticky": "^0.1.0",
|
"flarum/tags": "*"
|
||||||
"flarum/subscriptions": "^0.1.0",
|
|
||||||
"flarum/suspend": "^0.1.0",
|
|
||||||
"flarum/tags": "^0.1.0"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"franzl/studio": "0.10.x@dev"
|
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"preferred-install": "dist"
|
"preferred-install": "dist",
|
||||||
},
|
"sort-packages": true
|
||||||
"minimum-stability": "beta"
|
}
|
||||||
}
|
}
|
||||||
|
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!
|
||||||
|
];
|
22
flarum
22
flarum
@ -1,18 +1,24 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of Flarum.
|
* This file is part of Flarum.
|
||||||
*
|
*
|
||||||
* (c) Toby Zerner <toby.zerner@gmail.com>
|
* For detailed copyright and license information, please view the
|
||||||
*
|
* LICENSE file that was distributed with this source code.
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('FLARUM_START', microtime(true));
|
$site = require 'site.php';
|
||||||
|
|
||||||
require 'vendor/autoload.php';
|
/*
|
||||||
|
|-------------------------------------------------------------------------------
|
||||||
$server = new Flarum\Console\Server(__DIR__);
|
| 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();
|
$server->listen();
|
||||||
|
16
index.php
16
index.php
@ -1,16 +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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
require 'vendor/autoload.php';
|
|
||||||
|
|
||||||
$server = new Flarum\Forum\Server(__DIR__);
|
|
||||||
|
|
||||||
$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>
|
33
readme.md
33
readme.md
@ -1,33 +0,0 @@
|
|||||||

|
|
||||||
|
|
||||||
**[Flarum](http://flarum.org) is free, open-source forum software** built with PHP and [Mithril.js](http://mithril.js.org). It is:
|
|
||||||
|
|
||||||
* **Simple**, with a responsive UI that is optimized for touch devices
|
|
||||||
* **Fast**, with a total JS payload size of ~130 KB gzipped
|
|
||||||
* **Extensible**, so you can tailor it to your use-case
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 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.
|
|
||||||
|
|
||||||
You must have SSH access to a server with **PHP 5.5+** and **MySQL 5.5+**, and install [Composer](https://getcomposer.org).
|
|
||||||
|
|
||||||
```
|
|
||||||
composer create-project flarum/flarum . --stability=beta
|
|
||||||
```
|
|
||||||
|
|
||||||
Read the [Installation Guide](http://flarum.org/docs/installation) for more information.
|
|
||||||
|
|
||||||
## Support
|
|
||||||
|
|
||||||
Refer to the [FAQ](http://flarum.org/docs/faq), [Documentation](http://flarum.org/docs), and ask questions on the [Community Forum](http://discuss.flarum.org) or [Gitter Chat](https://gitter.im/flarum/flarum).
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
Flarum is open-source and we would love your help building it! Please read the [Contributing Guide](https://github.com/flarum/flarum/blob/master/CONTRIBUTING.md) to learn how you can help.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
Copyright (c) 2015 Toby Zerner. Code released under the [MIT License](https://github.com/flarum/flarum/blob/master/LICENSE).
|
|
@ -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,64 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# This script builds a release of Flarum by installing dependencies and bundled
|
|
||||||
# extensions, compiling production assets, removing development files, and
|
|
||||||
# zipping up the result. It should be run from the root directory.
|
|
||||||
|
|
||||||
base=$PWD
|
|
||||||
release=/tmp/flarum
|
|
||||||
|
|
||||||
# Make a copy of the files
|
|
||||||
rm -rf ${release}
|
|
||||||
mkdir ${release}
|
|
||||||
git archive --format tar --worktree-attributes HEAD | tar -xC ${release}
|
|
||||||
|
|
||||||
# Install 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
|
|
||||||
|
|
||||||
# Compile assets
|
|
||||||
cd ${release}/flarum/vendor/flarum/core
|
|
||||||
bash scripts/compile.sh
|
|
||||||
|
|
||||||
# Delete dev files
|
|
||||||
cd ${release}
|
|
||||||
rm -rf Vagrantfile
|
|
||||||
rm -rf scripts
|
|
||||||
rm -rf flarum/core
|
|
||||||
rm -rf flarum/studio.json
|
|
||||||
rm -rf `find . -type d -name node_modules`
|
|
||||||
rm -rf `find . -type d -name bower_components`
|
|
||||||
|
|
||||||
# Bundle default extensions
|
|
||||||
for extension in akismet approval bbcode emoji english flags likes lock markdown mentions pusher sticky subscriptions suspend tags; do
|
|
||||||
|
|
||||||
# Download and extract the extension archive
|
|
||||||
cd ${release}/extensions
|
|
||||||
curl "https://github.com/flarum/${extension}/archive/master.zip" -L -o ${extension}.zip
|
|
||||||
unzip ${extension}.zip -d ./${extension}
|
|
||||||
rm ${extension}.zip
|
|
||||||
|
|
||||||
# Compile assets
|
|
||||||
cd $extension
|
|
||||||
bash scripts/compile.sh
|
|
||||||
|
|
||||||
# Delete dev files
|
|
||||||
rm -rf `find . -type d -name node_modules`
|
|
||||||
rm -rf `find . -type d -name bower_components`
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
# Set file permissions
|
|
||||||
cd $release
|
|
||||||
find . -type d -exec chmod 0750 {} +
|
|
||||||
find . -type f -exec chmod 0644 {} +
|
|
||||||
chmod 0775 .
|
|
||||||
chmod -R 0775 assets flarum/storage
|
|
||||||
|
|
||||||
# Create the release archive
|
|
||||||
zip -r release.zip ./
|
|
||||||
mv release.zip ${base}/release.zip
|
|
@ -1,105 +0,0 @@
|
|||||||
#! /bin/bash
|
|
||||||
|
|
||||||
block="
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
|
|
||||||
root /vagrant;
|
|
||||||
index index.html index.htm index.php;
|
|
||||||
|
|
||||||
# Make site accessible from ...
|
|
||||||
server_name flarum.dev 192.168.29.29.xip.io;
|
|
||||||
|
|
||||||
access_log /var/log/nginx/flarum-access.log;
|
|
||||||
error_log /var/log/nginx/flarum-error.log error;
|
|
||||||
|
|
||||||
charset utf-8;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files \$uri \$uri/ /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;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~* \.html$ {
|
|
||||||
expires -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~* \.(css|js|gif|jpe?g|png)$ {
|
|
||||||
expires 1M;
|
|
||||||
add_header Pragma public;
|
|
||||||
add_header Cache-Control \"public, must-revalidate, proxy-revalidate\";
|
|
||||||
}
|
|
||||||
|
|
||||||
gzip on;
|
|
||||||
gzip_http_version 1.1;
|
|
||||||
gzip_vary on;
|
|
||||||
gzip_comp_level 6;
|
|
||||||
gzip_proxied any;
|
|
||||||
gzip_types application/atom+xml \
|
|
||||||
application/javascript \
|
|
||||||
application/json \
|
|
||||||
application/vnd.ms-fontobject \
|
|
||||||
application/x-font-ttf \
|
|
||||||
application/x-web-app-manifest+json \
|
|
||||||
application/xhtml+xml \
|
|
||||||
application/xml \
|
|
||||||
font/opentype \
|
|
||||||
image/svg+xml \
|
|
||||||
image/x-icon \
|
|
||||||
text/css \
|
|
||||||
text/html \
|
|
||||||
text/plain \
|
|
||||||
text/xml;
|
|
||||||
gzip_buffers 16 8k;
|
|
||||||
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
|
|
||||||
|
|
||||||
}
|
|
||||||
"
|
|
||||||
|
|
||||||
echo "$block" | sudo tee /etc/nginx/sites-available/vagrant
|
|
||||||
sudo service nginx restart
|
|
||||||
|
|
||||||
### Setup NPM globals and create necessary directories ###
|
|
||||||
sudo chown -R vagrant:vagrant /home/vagrant
|
|
||||||
|
|
||||||
cp /vagrant/scripts/aliases ~/.aliases
|
|
||||||
|
|
||||||
### Create rc file ###
|
|
||||||
echo "source ~/.aliases" >> ~/.bashrc
|
|
||||||
|
|
||||||
mysql -u root -proot -e 'create database if not exists flarum'
|
|
||||||
|
|
||||||
cd /vagrant
|
|
||||||
composer install --prefer-dist
|
|
||||||
composer dump-autoload
|
|
||||||
php flarum install --defaults
|
|
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
|
Loading…
x
Reference in New Issue
Block a user