Skip to content

Commit

Permalink
Merge branch '3.8' into fix-latest-merge
Browse files Browse the repository at this point in the history
Conflicts:
	README.md
	composer.json
	composer.lock
	config/configuration.sample.yml
	lib/Alchemy/Phrasea/Application/Api.php
	lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php
	lib/Alchemy/Phrasea/Controller/Api/Oauth2.php
	lib/Alchemy/Phrasea/Controller/Prod/Basket.php
	lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiExceptionHandlerSubscriber.php
	lib/Alchemy/Phrasea/Core/Provider/RegistrationServiceProvider.php
	lib/Alchemy/Phrasea/Core/Version.php
	lib/classes/API/V1/adapter.php
	lib/classes/API/V1/result.php
	lib/classes/module/console/schedulerStart.php
	lib/classes/module/console/schedulerState.php
	lib/classes/module/console/schedulerStop.php
	lib/classes/module/console/taskrun.php
	lib/classes/set/export.php
	lib/conf.d/_GV_template.inc
	lib/conf.d/configuration.yml
	templates/web/admin/setup.html.twig
	templates/web/admin/tasks/list.html.twig
	templates/web/api/auth/end_user_authorization.html.twig
	templates/web/prod/actions/Feedback/list.html.twig
	templates/web/prod/actions/publish/publish.html.twig
	templates/web/prod/upload/upload.html.twig
	tests/classes/api/v1/api_v1_adapterTest.php
	tests/classes/api/v1/api_v1_resultTest.php
  • Loading branch information
nlegoff committed Aug 11, 2014
2 parents 8994232 + 2619033 commit 2899f15
Show file tree
Hide file tree
Showing 2,067 changed files with 123,662 additions and 67 deletions.
12 changes: 9 additions & 3 deletions README.md
Expand Up @@ -14,15 +14,21 @@ Phraseanet 3.9 - Digital Asset Management application

https://docs.phraseanet.com/

#Installation
#Installation :

You **must** not download the source from GitHub, but download a packaged version here :

https://sourceforge.net/projects/phraseanet/files/
https://www.phraseanet.com/download/

And follow the install steps described at https://docs.phraseanet.com/Admin/

#License
#Developement :

For development purpose Phraseanet is shipped with ready to use development environments using vagrant.

See https://docs.phraseanet.com/Devel/

#License :

Phraseanet is licensed under GPL-v3 license.

Expand Down
242 changes: 242 additions & 0 deletions Vagrantfile
@@ -0,0 +1,242 @@
require 'yaml'

root = File.dirname(File.expand_path(__FILE__))

Vagrant.configure("2") do |config|
Dir.glob(root+"/vagrant/vms/**/puphpet/config.yaml").each do|f|
dir = File.dirname(File.expand_path(f)+"/..")
base_path = dir[0..-21]
configValues = YAML.load_file(f)
data = configValues['vagrantfile-local']

config.vm.define "vm-#{data['name']}" do |node|
node.vm.box = "#{data['vm']['box']}"
node.vm.box_url = "#{data['vm']['box_url']}"

if data['vm']['hostname'].to_s.strip.length != 0
node.vm.hostname = "#{data['vm']['hostname']}"
end

node.vm.provider :virtualbox do |vb|
vb.name = "#{data['name']}"
end

if data['vm']['network']['private_network'].to_s != ''
node.vm.network "private_network", ip: "#{data['vm']['network']['private_network']}"
end

data['vm']['network']['forwarded_port'].each do |i, port|

if port['guest'] != '' && port['host'] != ''
node.vm.network :forwarded_port, guest: port['guest'].to_i, host: port['host'].to_i
end
end

if Vagrant.has_plugin?('vagrant-hostsupdater')
hosts = Array.new()

if !configValues['apache']['install'].nil? &&
configValues['apache']['install'].to_i == 1 &&
configValues['apache']['vhosts'].is_a?(Hash)
configValues['apache']['vhosts'].each do |i, vhost|
hosts.push(vhost['servername'])

if vhost['serveraliases'].is_a?(Array)
vhost['serveraliases'].each do |vhost_alias|
hosts.push(vhost_alias)
end
end
end
elsif !configValues['nginx']['install'].nil? &&
configValues['nginx']['install'].to_i == 1 &&
configValues['nginx']['vhosts'].is_a?(Hash)
configValues['nginx']['vhosts'].each do |i, vhost|
hosts.push(vhost['server_name'])

if vhost['server_aliases'].is_a?(Array)
vhost['server_aliases'].each do |x, vhost_alias|
hosts.push(vhost_alias)
end
end
end
end

if hosts.any?
contents = File.open("#{dir}/puphpet/shell/hostsupdater-notice.txt", 'r'){ |file| file.read }
puts "\n\033[34m#{contents}\033[0m\n"

if node.vm.hostname.to_s.strip.length == 0
node.vm.hostname = 'puphpet-dev-machine'
end

node.hostsupdater.aliases = hosts
end
end

data['vm']['synced_folder'].each do |i, folder|
if folder['source'] == ''
folder['source'] = root
end
if folder['source'] != '' && folder['target'] != ''
if folder['sync_type'] == 'nfs'
node.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", type: "nfs"
elsif folder['sync_type'] == 'smb'
node.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}", type: "smb"
elsif folder['sync_type'] == 'rsync'
rsync_args = !folder['rsync']['args'].nil? ? folder['rsync']['args'] : ["--verbose", "--archive", "--delete", "-z"]
rsync_auto = !folder['rsync']['auto'].nil? ? folder['rsync']['auto'] : true
rsync_exclude = !folder['rsync']['exclude'].nil? ? folder['rsync']['exclude'] : [".vagrant/"]

node.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}",
rsync__args: rsync_args, rsync__exclude: rsync_exclude, rsync__auto: rsync_auto, type: "rsync"
else
node.vm.synced_folder "#{folder['source']}", "#{folder['target']}", id: "#{i}",
group: 'www-data', owner: 'www-data', mount_options: ["dmode=775", "fmode=764"]
end
end
end

node.vm.usable_port_range = (10200..10500)

if data['vm']['chosen_provider'].empty? || data['vm']['chosen_provider'] == "virtualbox"
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox'

node.vm.provider :virtualbox do |virtualbox|
data['vm']['provider']['virtualbox']['modifyvm'].each do |key, value|
if key == "memory"
next
end

if key == "natdnshostresolver1"
value = value ? "on" : "off"
end

virtualbox.customize ["modifyvm", :id, "--#{key}", "#{value}"]
end

virtualbox.customize ["modifyvm", :id, "--memory", "#{data['vm']['memory']}"]

if data['vm']['hostname'].to_s.strip.length != 0
virtualbox.customize ["modifyvm", :id, "--name", node.vm.hostname]
end
end
end

if data['vm']['chosen_provider'] == "vmware_fusion" || data['vm']['chosen_provider'] == "vmware_workstation"
ENV['VAGRANT_DEFAULT_PROVIDER'] = (data['vm']['chosen_provider'] == "vmware_fusion") ? "vmware_fusion" : "vmware_workstation"

node.vm.provider "vmware_fusion" do |v|
data['vm']['provider']['vmware'].each do |key, value|
if key == "memsize"
next
end

v.vmx["#{key}"] = "#{value}"
end

v.vmx["memsize"] = "#{data['vm']['memory']}"

if data['vm']['hostname'].to_s.strip.length != 0
v.vmx["displayName"] = node.vm.hostname
end
end
end

if data['vm']['chosen_provider'] == "parallels"
ENV['VAGRANT_DEFAULT_PROVIDER'] = "parallels"

node.vm.provider "parallels" do |v|
data['vm']['provider']['parallels'].each do |key, value|
if key == "memsize"
next
end

v.customize ["set", :id, "--#{key}", "#{value}"]
end

v.memory = "#{data['vm']['memory']}"

if data['vm']['hostname'].to_s.strip.length != 0
v.name = node.vm.hostname
end
end
end

ssh_username = !data['ssh']['username'].nil? ? data['ssh']['username'] : "vagrant"

node.vm.provision "shell" do |s|
s.path = "#{base_path}/puphpet/shell/initial-setup.sh"
s.args = "/vagrant/vagrant/vms/#{data['name']}/puphpet"
end

node.vm.provision "shell" do |kg|
kg.path = "#{base_path}/puphpet/shell/ssh-keygen.sh"
kg.args = "#{ssh_username}"
end

node.vm.provision :shell, :path => "#{base_path}/puphpet/shell/update-puppet.sh"

node.vm.provision :puppet do |puppet|
puppet.facter = {
"ssh_username" => "#{ssh_username}",
"provisioner_type" => ENV['VAGRANT_DEFAULT_PROVIDER'],
"vm_target_key" => 'vagrantfile-local',
}
puppet.manifests_path = "#{data['vm']['provision']['puppet']['manifests_path']}"
puppet.manifest_file = "#{data['vm']['provision']['puppet']['manifest_file']}"
puppet.module_path = "#{data['vm']['provision']['puppet']['module_path']}"

if !data['vm']['provision']['puppet']['options'].empty?
puppet.options = data['vm']['provision']['puppet']['options']
end
end

node.vm.provision :shell do |s|
s.path = "#{base_path}/puphpet/shell/execute-files.sh"
s.args = ["exec-once", "exec-always"]
end

node.vm.provision :shell, run: "always" do |s|
s.path = "#{base_path}/puphpet/shell/execute-files.sh"
s.args = ["startup-once", "startup-always"]
end

node.vm.provision :shell, :path => "#{base_path}/puphpet/shell/important-notices.sh"

if File.file?("#{dir}/puphpet/files/dot/ssh/id_rsa")
node.ssh.private_key_path = [
"#{dir}/puphpet/files/dot/ssh/id_rsa",
"#{dir}/puphpet/files/dot/ssh/insecure_private_key"
]
end

if !data['ssh']['host'].nil?
node.ssh.host = "#{data['ssh']['host']}"
end
if !data['ssh']['port'].nil?
node.ssh.port = "#{data['ssh']['port']}"
end
if !data['ssh']['username'].nil?
node.ssh.username = "#{data['ssh']['username']}"
end
if !data['ssh']['guest_port'].nil?
node.ssh.guest_port = data['ssh']['guest_port']
end
if !data['ssh']['shell'].nil?
node.ssh.shell = "#{data['ssh']['shell']}"
end
if !data['ssh']['keep_alive'].nil?
node.ssh.keep_alive = data['ssh']['keep_alive']
end
if !data['ssh']['forward_agent'].nil?
node.ssh.forward_agent = data['ssh']['forward_agent']
end
if !data['ssh']['forward_x11'].nil?
node.ssh.forward_x11 = data['ssh']['forward_x11']
end
if !data['vagrant']['host'].nil?
node.vagrant.host = data['vagrant']['host'].gsub(":", "").intern
end
end
end
end
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -80,7 +80,8 @@
"twig/extensions" : "~1.0",
"vierbergenlars/php-semver" : "~2.1",
"zend/gdata" : "~1.12.1",
"doctrine/migrations" : "1.0.x-dev@dev"
"doctrine/migrations" : "1.0.x-dev@dev",
willdurand/negotiation" : "~1.3"
},
"require-dev": {
"phpunit/phpunit" : "~3.7",
Expand Down
53 changes: 52 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/configuration.sample.yml
Expand Up @@ -31,6 +31,7 @@ main:
options: []
task-manager:
status: started
enabled: true
logger:
max-files: 10
enabled: true
Expand Down
3 changes: 3 additions & 0 deletions lib/Alchemy/Phrasea/Application.php
Expand Up @@ -83,6 +83,7 @@
use Alchemy\Phrasea\Core\Provider\CacheConnectionServiceProvider;
use Alchemy\Phrasea\Core\Provider\ConfigurationServiceProvider;
use Alchemy\Phrasea\Core\Provider\ConfigurationTesterServiceProvider;
use Alchemy\Phrasea\Core\Provider\ContentNegotiationServiceProvider;
use Alchemy\Phrasea\Core\Provider\CSVServiceProvider;
use Alchemy\Phrasea\Core\Provider\ConvertersServiceProvider;
use Alchemy\Phrasea\Core\Provider\FileServeServiceProvider;
Expand Down Expand Up @@ -374,6 +375,7 @@ public function __construct($environment = self::ENV_PROD)
$this->register(new ManipulatorServiceProvider());
$this->register(new PluginServiceProvider());
$this->register(new PhraseaEventServiceProvider());
$this->register(new ContentNegotiationServiceProvider());

$this['phraseanet.exception_handler'] = $this->share(function ($app) {
$handler = PhraseaExceptionHandler::register($app['debug']);
Expand Down Expand Up @@ -470,6 +472,7 @@ public function __construct($environment = self::ENV_PROD)
$dispatcher->addListener(KernelEvents::RESPONSE, [$app, 'addUTF8Charset'], -128);
$dispatcher->addSubscriber($app['phraseanet.logout-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.locale-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.content-negotiation-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.maintenance-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.cookie-disabler-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.session-manager-subscriber']);
Expand Down

0 comments on commit 2899f15

Please sign in to comment.