Commit d67af0c0 authored by Siick's avatar Siick
Browse files

Initial commit

parents
.git
.git*
.dockerignore
.vagrant
.idea
.DS_Store
.htaccess
*.lock
*.md
*.js
*.sh
.*.yml
*.yml
data/*
plugins/*
tests
ChangeLog
composer.json
Dockerfile
Dockerfile.*
Makefile
package.json
Vagrantfile
web.config
node_modules
assets/sass
assets/vendor
\ No newline at end of file
app/constants.php export-subst
.github export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.dockerignore export-ignore
.travis.yml export-ignore
docker export-ignore
Dockerfile export-ignore
docker-compose.yml export-ignore
Makefile export-ignore
README.md export-ignore
Vagrantfile export-ignore
data/*.sqlite export-ignore
tests export-ignore
CONTRIBUTING export-ignore
app.json export-ignore
composer.json export-ignore
composer.lock export-ignore
gulpfile.js export-ignore
package.json export-ignore
hooks export-ignore
assets/sass export-ignore
assets/js/components export-ignore
assets/js/core export-ignore
assets/js/polyfills export-ignore
assets/js/src export-ignore
assets/sass export-ignore
assets/vendor export-ignore
*.sqlite
*.sqlite-journal
.buildpath
.project
/.settings/
.idea
/nbproject/
.DS_Store
ehthumbs.db
Icon?
Thumbs.db
*.swp
.*.swp
*~
*.out
*.log
.vagrant
data/files
data/cache
data/config.php
*.bak
/config.php
!docker/var/wwww/app/config.php
node_modules
# Pass HTTP Authorization header via environment variable to PHP backend
# to make HTTP Basic Authentication work for Apache/FastCGI/php-fpm
# setups (required to authenticate over the API)
<IfModule mod_setenvif.c>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</IfModule>
<IfModule mod_rewrite.c>
Options -MultiViews
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>
# Uncomment this line depending of your Apache configuration
# RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
############################
## Uncomment the two lines below to enable force HTTPS capabilities
############################
# RewriteCond %{HTTPS} !=on
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
<IfModule pagespeed_module>
ModPagespeed Off
</IfModule>
notifications:
email: false
git:
depth: 3
language: php
sudo: false
php:
- 7.2
- 7.1
- 7.0
- 5.6
env:
- DB=sqlite
- DB=postgres
matrix:
fast_finish: true
before_script:
- composer install
- npm install
script:
- ./node_modules/.bin/jshint assets/js/{core,components}
- ./vendor/bin/phpunit -c tests/units.$DB.xml
- ./vendor/bin/phpunit tests/configtest
This diff is collapsed.
FROM alpine:3.10.0
VOLUME /var/www/app/data
VOLUME /var/www/app/plugins
VOLUME /etc/nginx/ssl
EXPOSE 80 443
ARG VERSION
RUN apk update && \
apk add openssl unzip nginx bash ca-certificates s6 curl ssmtp mailx php7 php7-phar php7-curl \
php7-fpm php7-json php7-zlib php7-xml php7-dom php7-ctype php7-opcache php7-zip php7-iconv \
php7-pdo php7-pdo_mysql php7-pdo_sqlite php7-pdo_pgsql php7-mbstring php7-session php7-bcmath \
php7-gd php7-mcrypt php7-openssl php7-sockets php7-posix php7-ldap php7-simplexml && \
rm -rf /var/cache/apk/* && \
rm -rf /var/www/localhost && \
rm -f /etc/php7/php-fpm.d/www.conf
ADD . /var/www/app
ADD docker/ /
RUN rm -rf /var/www/app/docker && echo $VERSION > /version.txt
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD []
FROM arm32v6/alpine:3.10.0
VOLUME /var/www/app/data
VOLUME /var/www/app/plugins
VOLUME /etc/nginx/ssl
EXPOSE 80 443
ARG VERSION
RUN apk update && \
apk add openssl unzip nginx bash ca-certificates s6 curl ssmtp mailx php7 php7-phar php7-curl \
php7-fpm php7-json php7-zlib php7-xml php7-dom php7-ctype php7-opcache php7-zip php7-iconv \
php7-pdo php7-pdo_mysql php7-pdo_sqlite php7-pdo_pgsql php7-mbstring php7-session php7-bcmath \
php7-gd php7-mcrypt php7-openssl php7-sockets php7-posix php7-ldap php7-simplexml && \
rm -rf /var/cache/apk/* && \
rm -rf /var/www/localhost && \
rm -f /etc/php7/php-fpm.d/www.conf
ADD . /var/www/app
ADD docker/ /
RUN rm -rf /var/www/app/docker && echo $VERSION > /version.txt
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD []
FROM arm32v7/alpine:3.10.0
VOLUME /var/www/app/data
VOLUME /var/www/app/plugins
VOLUME /etc/nginx/ssl
EXPOSE 80 443
ARG VERSION
RUN apk update && \
apk add openssl unzip nginx bash ca-certificates s6 curl ssmtp mailx php7 php7-phar php7-curl \
php7-fpm php7-json php7-zlib php7-xml php7-dom php7-ctype php7-opcache php7-zip php7-iconv \
php7-pdo php7-pdo_mysql php7-pdo_sqlite php7-pdo_pgsql php7-mbstring php7-session php7-bcmath \
php7-gd php7-mcrypt php7-openssl php7-sockets php7-posix php7-ldap php7-simplexml && \
rm -rf /var/cache/apk/* && \
rm -rf /var/www/localhost && \
rm -f /etc/php7/php-fpm.d/www.conf
ADD . /var/www/app
ADD docker/ /
RUN rm -rf /var/www/app/docker && echo $VERSION > /version.txt
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD []
FROM arm64v8/alpine:3.10.0
VOLUME /var/www/app/data
VOLUME /var/www/app/plugins
VOLUME /etc/nginx/ssl
EXPOSE 80 443
ARG VERSION
RUN apk update && \
apk add openssl unzip nginx bash ca-certificates s6 curl ssmtp mailx php7 php7-phar php7-curl \
php7-fpm php7-json php7-zlib php7-xml php7-dom php7-ctype php7-opcache php7-zip php7-iconv \
php7-pdo php7-pdo_mysql php7-pdo_sqlite php7-pdo_pgsql php7-mbstring php7-session php7-bcmath \
php7-gd php7-mcrypt php7-openssl php7-sockets php7-posix php7-ldap php7-simplexml && \
rm -rf /var/cache/apk/* && \
rm -rf /var/www/localhost && \
rm -f /etc/php7/php-fpm.d/www.conf
ADD . /var/www/app
ADD docker/ /
RUN rm -rf /var/www/app/docker && echo $VERSION > /version.txt
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD []
The MIT License (MIT)
Copyright (c) 2014-2019 Frédéric Guillot
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
DOCKER_IMAGE := docker.io/kanboard/kanboard
DOCKER_TAG := master
VERSION := $(shell git rev-parse --short HEAD)
.PHONY: all clean static jshint archive test-sqlite test-mysql test-postgres test-browser \
integration-test-mysql integration-test-postgres integration-test-sqlite sql \
docker-image docker-manifest docker-run docker-sh
all: static
clean:
@ rm -rf ./node_modules
static: clean
@ npm install
@ ./node_modules/.bin/gulp vendor js css
@ ./node_modules/.bin/jshint assets/js/{core,components,polyfills}
jshint:
@ ./node_modules/.bin/jshint assets/js/{core,components,polyfills}
archive:
@ echo "Build archive: version=$(VERSION)"
@ git archive --format=zip --prefix=kanboard/ $(VERSION) -o kanboard-$(VERSION).zip
test-sqlite:
@ ./vendor/bin/phpunit -c tests/units.sqlite.xml
test-mysql:
@ ./vendor/bin/phpunit -c tests/units.mysql.xml
test-postgres:
@ ./vendor/bin/phpunit -c tests/units.postgres.xml
test-browser:
@ ./vendor/bin/phpunit -c tests/acceptance.xml
integration-test-mysql:
@ composer install --dev
@ docker-compose -f tests/docker/compose.integration.mysql.yaml build
@ docker-compose -f tests/docker/compose.integration.mysql.yaml up -d mysql app
@ docker-compose -f tests/docker/compose.integration.mysql.yaml up tests
@ docker-compose -f tests/docker/compose.integration.mysql.yaml down
integration-test-postgres:
@ composer install --dev
@ docker-compose -f tests/docker/compose.integration.postgres.yaml build
@ docker-compose -f tests/docker/compose.integration.postgres.yaml up -d postgres app
@ docker-compose -f tests/docker/compose.integration.postgres.yaml up tests
@ docker-compose -f tests/docker/compose.integration.postgres.yaml down
integration-test-sqlite:
@ composer install --dev
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml build
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml up -d app
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml up tests
@ docker-compose -f tests/docker/compose.integration.sqlite.yaml down
sql:
@ pg_dump --schema-only --no-owner --no-privileges --quote-all-identifiers -n public --file app/Schema/Sql/postgres.sql kanboard
@ pg_dump -d kanboard --column-inserts --data-only --table settings >> app/Schema/Sql/postgres.sql
@ pg_dump -d kanboard --column-inserts --data-only --table links >> app/Schema/Sql/postgres.sql
@ mysqldump -uroot --quote-names --no-create-db --skip-comments --no-data --single-transaction kanboard | sed 's/ AUTO_INCREMENT=[0-9]*//g' > app/Schema/Sql/mysql.sql
@ mysqldump -uroot --quote-names --no-create-info --skip-comments --no-set-names kanboard settings >> app/Schema/Sql/mysql.sql
@ mysqldump -uroot --quote-names --no-create-info --skip-comments --no-set-names kanboard links >> app/Schema/Sql/mysql.sql
@ let password_hash=`php -r "echo password_hash('admin', PASSWORD_DEFAULT);"` ;\
echo "INSERT INTO users (username, password, role) VALUES ('admin', '$$password_hash', 'app-admin');" >> app/Schema/Sql/mysql.sql ;\
echo "INSERT INTO public.users (username, password, role) VALUES ('admin', '$$password_hash', 'app-admin');" >> app/Schema/Sql/postgres.sql
@ let mysql_version=`echo 'select version from schema_version;' | mysql -N -uroot kanboard` ;\
echo "INSERT INTO schema_version VALUES ('$$mysql_version');" >> app/Schema/Sql/mysql.sql
@ let pg_version=`psql -U postgres -A -c 'copy(select version from schema_version) to stdout;' kanboard` ;\
echo "INSERT INTO public.schema_version VALUES ('$$pg_version');" >> app/Schema/Sql/postgres.sql
@ grep -v "SET idle_in_transaction_session_timeout = 0;" app/Schema/Sql/postgres.sql > temp && mv temp app/Schema/Sql/postgres.sql
docker-image:
@ docker build --build-arg VERSION=$(VERSION) -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
docker-manifest:
for version in $(VERSION) latest; do \
docker build --build-arg VERSION=$(VERSION) -t $(DOCKER_IMAGE):amd64-$${version} -f Dockerfile . && \
docker build --build-arg VERSION=$(VERSION) -t $(DOCKER_IMAGE):arm32v6-$${version} -f Dockerfile.arm32v6 . && \
docker build --build-arg VERSION=$(VERSION) -t $(DOCKER_IMAGE):arm32v7-$${version} -f Dockerfile.arm32v7 . && \
docker build --build-arg VERSION=$(VERSION) -t $(DOCKER_IMAGE):arm64v8-$${version} -f Dockerfile.arm64v8 . && \
docker push $(DOCKER_IMAGE):amd64-$${version} && \
docker push $(DOCKER_IMAGE):arm32v6-$${version} && \
docker push $(DOCKER_IMAGE):arm32v7-$${version} && \
docker push $(DOCKER_IMAGE):arm64v8-$${version} && \
docker manifest create --amend $(DOCKER_IMAGE):$${version} \
$(DOCKER_IMAGE):amd64-$${version} \
$(DOCKER_IMAGE):arm32v6-$${version} \
$(DOCKER_IMAGE):arm32v7-$${version} \
$(DOCKER_IMAGE):arm64v8-$${version} && \
docker manifest annotate $(DOCKER_IMAGE):$${version} \
$(DOCKER_IMAGE):arm32v6-$${version} --os linux --arch arm --variant v6 && \
docker manifest annotate $(DOCKER_IMAGE):$${version} \
$(DOCKER_IMAGE):arm32v7-$${version} --os linux --arch arm --variant v7 && \
docker manifest annotate $(DOCKER_IMAGE):$${version} \
$(DOCKER_IMAGE):arm64v8-$${version} --os linux --arch arm64 --variant v8 && \
docker manifest push --purge $(DOCKER_IMAGE):$${version} ;\
done
docker-run:
@ docker run --rm --name=kanboard -p 80:80 -p 443:443 $(DOCKER_IMAGE):$(DOCKER_TAG)
docker-sh:
@ docker exec -ti kanboard bash
Kanboard
========
[![Build Status](https://travis-ci.org/kanboard/kanboard.svg?branch=master)](https://travis-ci.org/kanboard/kanboard)
Kanboard is project management software that focuses on the Kanban methodology.
- Official website: <https://kanboard.org/>
- [List of features](https://kanboard.org/#features)
- [Change Log](https://github.com/kanboard/kanboard/blob/master/ChangeLog)
- [Forum](https://kanboard.discourse.group/)
- Official documentation: <https://docs.kanboard.org/>
- [Requirements](https://docs.kanboard.org/en/latest/admin_guide/requirements.html)
- [Installation instructions](https://docs.kanboard.org/en/latest/admin_guide/installation.html)
- [Upgrade to a new version](https://docs.kanboard.org/en/latest/admin_guide/upgrade.html)
- [Use Kanboard with Docker](https://docs.kanboard.org/en/latest/admin_guide/docker.html)
Credits
-------
- Main developer: Frédéric Guillot
- [Contributors](https://github.com/kanboard/kanboard/graphs/contributors)
- Distributed under [MIT License](https://github.com/kanboard/kanboard/blob/master/LICENSE)
$script = <<SCRIPT
apt-get update
apt-get install -y apache2 libapache2-mod-php7.0 php7.0-cli php7.0-mbstring php7.0-sqlite3 php7.0-zip \
php7.0-opcache php7.0-json php7.0-mysql php7.0-pgsql php7.0-ldap php7.0-gd php7.0-xml php7.0-curl && \
apt-get clean && \
echo "ServerName localhost" >> /etc/apache2/apache2.conf && \
sed -ri 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf && \
a2enmod rewrite
service apache2 restart
rm -f /var/www/html/index.html
date > /etc/vagrant_provisioned_at
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
cd /var/www/html && composer install
wget -q https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
SCRIPT
Vagrant.configure("2") do |config|
config.vm.define "ubuntu" do |m|
m.vm.box = "ubuntu/xenial64"
m.vm.provision "shell", inline: $script
m.vm.synced_folder ".", "/var/www/html", owner: "www-data", group: "www-data"
m.vm.network :forwarded_port, guest: 80, host: 8001
end
end
<IfVersion >= 2.3>
Require all denied
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Deny from all
</IfVersion>
<?php
namespace Kanboard\Action;
use Kanboard\Event\GenericEvent;
/**
* Base class for automatic actions
*
* @package Kanboard\Action
* @author Frederic Guillot
*/
abstract class Base extends \Kanboard\Core\Base
{
/**
* Extended events
*
* @access private
* @var array
*/
private $compatibleEvents = array();
/**
* Keep history of executed events
*
* @access private
* @var array
*/
private $callStack = [];
/**
* Project id
*
* @access private
* @var integer
*/
private $projectId = 0;
/**
* User parameters
*
* @access private
* @var array
*/
private $params = array();
/**
* Get automatic action name
*
* @final
* @access public
* @return string
*/
final public function getName()
{
return '\\'.get_called_class();
}
/**
* Get automatic action description
*
* @abstract
* @access public
* @return string
*/
abstract public function getDescription();
/**
* Execute the action
*
* @abstract
* @access public
* @param array $data Event data dictionary
* @return bool True if the action was executed or false when not executed
*/
abstract public function doAction(array $data);
/**
* Get the required parameter for the action (defined by the user)
*
* @abstract
* @access public
* @return array
*/
abstract public function getActionRequiredParameters();
/**
* Get the required parameter for the event (check if for the event data)
*
* @abstract
* @access public
* @return array
*/
abstract public function getEventRequiredParameters();
/**
* Get the compatible events
*
* @abstract
* @access public
* @return array
*/
abstract public function getCompatibleEvents();
/**
* Check if the event data meet the action condition
*
* @access public
* @param array $data Event data dictionary
* @return bool
*/
abstract public function hasRequiredCondition(array $data);
/**
* Return class information
*
* @access public
* @return string
*/
public function __toString()
{
$params = array();
foreach ($this->params as $key => $value) {
$params[] = $key.'='.var_export($value, true);
}
return $this->getName().'('.implode('|', $params).')';
}
/**
* Set project id
*
* @access public
* @param integer $project_id
* @return Base
*/
public function setProjectId($project_id)
{
$this->projectId = $project_id;
return $this;
}
/**
* Get project id
*
* @access public
* @return integer
*/
public function getProjectId()
{
return $this->projectId;
}
/**
* Set an user defined parameter
*
* @access public
* @param string $name Parameter name
* @param mixed $value Value
* @return Base
*/
public function setParam($name, $value)
{
$this->params[$name] = $value;
return $this;
}
/**
* Get an user defined parameter
*
* @access public
* @param string $name Parameter name
* @param mixed $default Default value
* @return mixed
*/