Compare commits

..

No commits in common. "master" and "v0.1.0-beta.2" have entirely different histories.

47 changed files with 3294 additions and 535 deletions

View File

@ -15,5 +15,5 @@ indent_size = 2
[*.{diff,md}]
trim_trailing_whitespace = false
[*.{php,json}]
[*.php]
indent_size = 4

2
.gitattributes vendored
View File

@ -1,5 +1,3 @@
.gitattributes export-ignore
.gitignore export-ignore
.gitmodules export-ignore
composer.lock -merge

11
.gitignore vendored
View File

@ -1,11 +1,8 @@
.env
.env.*
!.env.example
.DS_Store
Thumbs.db
.vagrant
config.php
.idea
vendor
server
core
studio.json
composer.lock
.idea

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "flarum/core"]
path = flarum/core
url = https://github.com/flarum/core.git

15
.htaccess Normal file
View File

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

View File

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

View File

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

13
CONTRIBUTING.md Normal file
View File

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

View File

@ -1,7 +1,6 @@
The MIT License (MIT)
Copyright (c) 2019-2022 Stichting Flarum (Flarum Foundation)
Copyright (c) 2014-2019 Toby Zerner (toby.zerner@gmail.com)
Copyright (c) 2014-2015 Toby Zerner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,40 +0,0 @@
<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 its 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. Flarums architecture is amazingly flexible, with a powerful Extension API.
![screenshot](https://flarum.org/assets/img/home-screenshot.png)
## 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 Normal file
View File

@ -0,0 +1,322 @@
# -*- 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 Normal file
View File

@ -0,0 +1,46 @@
<?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 Normal file
View File

@ -0,0 +1,42 @@
<?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 Executable file
View File

@ -0,0 +1,87 @@
#!/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 ./

View File

@ -1,46 +0,0 @@
{
"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
}
}

View File

@ -1,14 +0,0 @@
<?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
View File

@ -1,24 +0,0 @@
#!/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 Normal file
View File

@ -0,0 +1 @@
vendor

1
flarum/.htaccess Normal file
View File

@ -0,0 +1 @@
Deny from All

149
flarum/bootstrap.php Normal file
View File

@ -0,0 +1,149 @@
<?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;

20
flarum/composer.json Normal file
View File

@ -0,0 +1,20 @@
{
"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 Normal file

File diff suppressed because it is too large Load Diff

1
flarum/core Submodule

@ -0,0 +1 @@
Subproject commit 53f7112248ff4bfb0878d7fcb4487e846a2a8c37

13
flarum/error/404.html Normal file
View File

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

13
flarum/error/500.html Normal file
View File

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

31
flarum/flarum Normal file
View File

@ -0,0 +1,31 @@
#!/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 Normal file
View File

@ -0,0 +1 @@
laravel.log

6
flarum/storage/framework/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
config.php
routes.php
compiled.php
services.json
events.scanned.php
routes.scanned.php

5
flarum/studio.json Normal file
View File

@ -0,0 +1,5 @@
{
"packages": {
"flarum/core": "core"
}
}

69
flarum/vagrant/aliases Normal file
View File

@ -0,0 +1,69 @@
#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" *
}

View File

@ -0,0 +1,96 @@
#! /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 Normal file
View File

@ -0,0 +1,60 @@
<?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();

View File

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

View File

@ -1,26 +0,0 @@
<?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();

View File

@ -1,29 +0,0 @@
<?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 Normal file
View File

@ -0,0 +1,36 @@
![Flarum](http://flarum.org/img/logo.png)
**[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)
![screenshot](http://flarum.org/img/screenshot.png)
## 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))

View File

@ -1,50 +0,0 @@
<?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',
]);

View File

@ -1,2 +0,0 @@
*
!.gitignore

View File

@ -1,2 +0,0 @@
*
!.gitignore