├── .gitignore
├── .gitmodules
├── .travis.yml
├── .travis.yml.old
├── .trigger-travis-tests
├── Dockerfile
├── LICENCE.md
├── Puppetfile
├── README.md
├── Vagrantfile
├── config
├── backup_install.sh
├── backup_output.sh
├── backup_params.sh
├── backup_pre.sh
├── ootb_install.sh
├── ootb_output.sh
├── ootb_params.sh
└── ootb_pre.sh
├── docs
├── apt-cacher-ng.md
├── other-install.md
├── sharepoint.md
└── ssl.md
├── files
├── alfresco-mmt.jar
├── catalina.properties
├── clean_tomcat.sh
├── clean_tomcat_webapps.sh
├── db-schema-context.xml
├── ffmpeg_buildubuntu.sh
├── iptables.sh
├── jar-to-amp.sh
├── limitconvert.sh
├── limits.conf
├── server.xml
├── solr4config.xml
├── solrconfig.xml
├── sysctl.conf
├── tomcat-users.xml
├── webscripts
│ └── create-site
│ │ ├── create-site.get.desc.xml
│ │ ├── create-site.get.html.ftl
│ │ └── create-site.get.js
├── xvfb-init
└── xvfb-run
├── install.sh
├── install
├── customise-go.sh
├── docker-build.sh
├── docker-run.sh
├── hiera.yaml
├── inc-puppet.sh
├── modules-for-vagrant.sh
├── setup-for-puppetmaster.sh
├── setup-for-standalone.sh
├── setup-for-vagrant.sh
├── tophead.sh
├── vagrant-apply-backup.sh
└── wait-for-alfresco-ready.sh
├── lib
└── puppet
│ └── parser
│ └── functions
│ └── calc_ntlm_hash.rb
├── manifests
├── addons.pp
├── addons
│ ├── aaar.pp
│ ├── filebrowser.pp
│ ├── googledocs.pp
│ ├── jsconsole.pp
│ ├── monitorix.pp
│ ├── ootbbeetheme.pp
│ ├── ootbfrontpage.pp
│ ├── reset_password.pp
│ ├── rm.pp
│ ├── uploader_plus.pp
│ └── webscripts.pp
├── aptcache.pp
├── backup.pp
├── config.pp
├── download_file.pp
├── ensure_packages.pp
├── init.pp
├── install.pp
├── install
│ ├── alfresco_ce.pp
│ ├── iptables.pp
│ ├── jdk.pp
│ ├── mysql.pp
│ ├── postfix.pp
│ ├── proxy.pp
│ └── solr.pp
├── nightly.pp
├── packages.pp
├── params.pp
├── safe_download.pp
├── service.pp
├── tests.pp
└── urls.pp
├── metadata.json
├── setup-backup.sh
└── templates
├── admin-passwd-update.sql.erb
├── alfresco-bart.properties.erb
├── alfresco-bart.sh.erb
├── alfresco-global.properties.erb
├── apply_amps.sh.erb
├── default-tomcat.erb
├── makeimagemagicklink.sh.erb
├── monitorix.conf.erb
├── scripts
└── replacefiles.py.erb
├── share-config-custom.xml.erb
├── solr.xml.erb
├── solr4.xml.erb
├── solr4core-archive.properties.erb
├── solr4core-workspace.properties.erb
├── solrcore-archive.properties.erb
├── solrcore-workspace.properties.erb
├── test.sh.erb
├── tests-config.yml.erb
├── tests
└── login.js.erb
├── tomcat-init-centos.erb
├── tomcat-init.erb
├── tomcat-systemd-centos.erb
└── tomcat-systemd-ubuntu.erb
/.gitignore:
--------------------------------------------------------------------------------
1 | config/ootb_answers.sh
2 | config/backup_answers.sh
3 | test.pp
4 | go.pp
5 | do_backup.pp
6 | .*.swp
7 | */.*.swp
8 | .IS*
9 | modules/
10 | .librarian/
11 | .rnd
12 | .tmp/
13 | Puppetfile.lock
14 | puppetlabs-release-trusty.deb
15 |
16 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "bashconf"]
2 | path = bashconf
3 | url = https://github.com/marsbard/bashconf.git
4 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | env:
2 | global:
3 | - TESTSRC=digcat
4 | - TIMEWAIT=240
5 | - MAXWAITS=10
6 | matrix:
7 | - ALFVER=4.2.f
8 | - ALFVER=5.0.x
9 | - ALFVER=NIGHTLY
10 |
11 | before_install:
12 | - hostname
13 | - install/tophead.sh
14 | - sudo apt-get -yqq update
15 | - sudo apt-get -fyq install
16 | - "export DISPLAY=:99.0"
17 | # - "sh -e /etc/init.d/xvfb start"
18 | # - sudo dd if=/dev/zero of=/swapfile bs=1M count=2048
19 | #- #sudo chmod 600 /swapfile
20 | # - sudo mkswap /swapfile
21 | # - sudo swapon /swapfile
22 |
23 |
24 | install:
25 | - wget http://apt.puppetlabs.com/puppetlabs-release-trusty.deb
26 | - sudo dpkg -i puppetlabs-release-trusty.deb
27 | - sudo apt-get update
28 | - sudo apt-get install git puppet -y
29 |
30 | before_script:
31 | - mkdir -p modules/alfresco
32 | - mv files lib manifests templates modules/alfresco
33 | - ./install/modules-for-vagrant.sh
34 |
35 | script:
36 | - install/tophead.sh
37 | - install/customise-go.sh alfresco_version=$ALFVER domain_name=localhost
38 | - sudo puppet apply --modulepath=modules go.pp
39 | - sudo install/wait-for-alfresco-ready.sh https://localhost/share $TIMEWAIT $MAXWAITS /opt/alfresco/tomcat/logs/catalina.out
40 | - cd
41 | - echo Using $TESTSRC tests
42 | - git clone https://github.com/${TESTSRC}/alfresco-tests.git
43 | - cd alfresco-tests
44 | - sudo ./install.sh
45 | - echo -e "=================\noutput all catalina log\n==================="
46 | - cat /opt/alfresco/tomcat/logs/catalina.out
47 |
48 | notifications:
49 | irc:
50 | - "chat.freenode.net#orderofthebee"
51 |
52 |
53 |
--------------------------------------------------------------------------------
/.travis.yml.old:
--------------------------------------------------------------------------------
1 | #cache: apt
2 | env: WAIT=12
3 |
4 |
5 | before_install:
6 | - sudo apt-get -yqq update #< Suggested by the Travis CI doc
7 | - sudo apt-get -fyq install #< Fixes inconsistency of packages installed previously
8 | - "export DISPLAY=:99.0"
9 | - "sh -e /etc/init.d/xvfb start"
10 |
11 | install:
12 | # - sudo apt-get -yq install puppet #< Build Dependencies
13 | - wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
14 | - sudo dpkg -i puppetlabs-release-precise.deb
15 | - sudo apt-get update
16 | - sudo apt-get install puppet -y
17 | # downloading libre office in the puppet build sometimes times travis out
18 | # due to lack of output, so preload it here
19 | - sudo mkdir -p /opt/downloads
20 | - sudo wget http://downloadarchive.documentfoundation.org/libreoffice/old/4.2.7.2/deb/x86_64/LibreOffice_4.2.7.2_Linux_x86-64_deb.tar.gz -O /opt/downloads/LibreOffice_4.2.7.2_Linux_x86-64_deb.tar.gz
21 | - sudo wget http://dl.alfresco.com/release/community/4.2.f-build-00012/alfresco-community-4.2.f.zip -O /opt/downloads/alfresco-community-4.2.f.zip
22 | - sudo wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.55/bin/apache-tomcat-7.0.55.tar.gz -O /opt/downloads/apache-tomcat-7.0.55.tar.gz
23 |
24 | before_script:
25 | - mkdir -p modules/alfresco
26 | - mv files lib manifests templates modules/alfresco
27 | - ./install/modules-for-vagrant.sh
28 |
29 | script:
30 | - sudo puppet apply --debug --verbose --modulepath=modules go.pp
31 | - echo Waiting for $(( $WAIT * 10 )) seconds before running tests
32 | #- sleep 100 # will that be long enough? - actually do it the funky way below:
33 | - COUNTER=$(( $WAIT + 1)); for i in `seq 1 $WAIT`; do echo -n "$(( $COUNTER - $i))... "; sleep 10; done; echo
34 | # this will install the testing dependencies
35 | # - sudo puppet apply --debug --verbose --modulepath=modules test.pp
36 | # and now run the tests: (BUT NOW THEY ARE RUN FROM test.pp) - ACTUALLY you need
37 | # them to run here too so they can trigger a failure to travis if necessary
38 | # - cd /opt/alfresco/tests/alfresco-tests
39 | # - xvfb-run python test_swsdp.py
40 | # - xvfb-run python test_cmis.py
41 | # - xvfb-run python test_ftp.py
42 |
43 | notifications:
44 | email:
45 | - marsbard.alfresco.puppet@gmail.com
46 | irc:
47 | channels:
48 | - "irc.freenode.org#orderofthebee"
49 | on_success: change
50 | on_failure: change
51 | use_notice: true
52 |
--------------------------------------------------------------------------------
/.trigger-travis-tests:
--------------------------------------------------------------------------------
1 | now
2 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:16.04
2 |
3 | ENV DEBIAN_FRONTEND noninteractive
4 | ENV uid 1000
5 | ENV gid 1000
6 |
7 | # TODO check if PUPPET_URL can include $PUPPET_PACKAGE so DRY
8 | ENV PUPPET_PACKAGE puppetlabs-release-pc1-xenial.deb
9 | ENV PUPPET_URL http://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
10 |
11 | ENV SHELL bash
12 |
13 | RUN apt-get update && apt-get install --no-install-recommends -y wget git ca-certificates
14 |
15 | RUN wget --no-check-certificate $PUPPET_URL
16 | RUN dpkg -i $PUPPET_PACKAGE
17 |
18 |
19 | #RUN git -c http.sslVerify=false clone http://github.com/marsbard/puppet-alfresco.git
20 | RUN git clone http://github.com/marsbard/puppet-alfresco.git
21 |
22 | WORKDIR puppet-alfresco
23 |
24 |
25 |
26 | ENTRYPOINT ./install.sh
27 |
--------------------------------------------------------------------------------
/LICENCE.md:
--------------------------------------------------------------------------------
1 | MIT License (MIT)
2 |
3 | The MIT License (MIT)
4 |
5 | Copyright (c) 2015 Order Of The Bee
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 |
25 |
--------------------------------------------------------------------------------
/Puppetfile:
--------------------------------------------------------------------------------
1 | forge "https://forgeapi.puppetlabs.com"
2 |
3 | mod "puppetlabs/mysql"
4 |
5 | mod "puppetlabs/apache"
6 |
7 | mod "puppetlabs/concat"
8 |
9 | mod "puppetlabs/stdlib"
10 |
11 | mod "puppetlabs/apt", "2.2.1"
12 |
13 | mod "puppetlabs/vcsrepo"
14 |
15 | mod "spantree/java8"
16 |
17 | mod "stankevich/python"
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Order of the Bee "Honeycomb" edition of Alfresco
2 |
3 | #### New as of February 2017
4 | * Fixed for xenial
5 | * Converted to systemd
6 |
7 | #### New in 1.1
8 | * ImageMagick paths updated on each run
9 | * Now using Librarian-puppet to manage puppet modules
10 | * Monitoring with monitorix on port 8088
11 |
12 | #### Features
13 | * Standalone build with repo, share, mysql and solr on one server. Remote mysql supported now, remote solr and pentaho next version
14 | * Choose from version 4.2.f, latest 5.0.x or NIGHTLY
15 | * Installation supported on Ubuntu and CentOS.
16 | * Puppet based, so makes idempotent changes and if interrupted can pick up where it left off
17 | * Simple bash based configuration
18 | * Built in BART backup - run `./setup_backup.sh` after install to configure.
19 | * Reverse proxy and firewall preconfigured, offloading SSL to apache and forwarding real ports (for ftp, for example) to unprivileged ones managed by repo
20 | * Can specify tomcat home and alfresco base, useful for putting `alf_data/` on shared storage
21 | * Built in postfix mail server set up to deliver alfresco mails to the internet
22 | * Supports using your own SSL certificates and if not supplied will generate a self signed certificate
23 | * Custom Order of the Bee theme
24 |
25 | #### Included addons
26 | A small list for now but soon to be growing
27 | * Google docs integration
28 | * [Javascript console](https://addons.alfresco.com/addons/javascript-console)
29 | * [Reset password](https://addons.alfresco.com/addons/reset-password-dialog)
30 | * [Alfresco Records Management](https://www.alfresco.com/products/records-management)
31 | * [Uploader Plus](https://addons.alfresco.com/addons/uploader-plus)
32 |
33 |
34 | #### Getting started
35 |
36 | First make sure that `git` is installed on your machine. Now run the following commands:
37 |
38 | ```
39 | git clone https://github.com/marsbard/puppet-alfresco.git alfresco
40 | cd alfresco
41 | ./install.sh
42 | ```
43 |
44 | You will see an installer like this (there are a few more parameters in it these days, but it's pretty much the same):
45 |
46 | __ __ __ __ __ __ __ __ __ __
47 | __/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__
48 | / \__ ORDER OF THE BEE / \__/ \__/ \__/ \__/ \__/ \__/ \
49 | \__/ \__/ \__/ \__/ \ Alfresco (TM) Honeycomb Edition \__/
50 | \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/ \__/
51 |
52 | Installer parameters
53 | --------------------
54 | Idx Param Value
55 |
56 | [1] domain_name
57 | [2] initial_admin_pass admin
58 | [3] mail_from_default admin@localhost
59 | [4] alfresco_base_dir /opt/alfresco
60 | [5] tomcat_home /opt/alfresco/tomcat
61 | [6] alfresco_version 4.2.f
62 | [7] download_path /opt/downloads
63 | [8] db_root_password alfresco
64 | [9] db_user alfresco
65 | [10] db_pass alfresco
66 | [11] db_name alfresco
67 | [12] db_host localhost
68 | [13] db_port 3306
69 | [14] mem_xmx 32G
70 | [15] mem_xxmaxpermsize 256m
71 |
72 | Please choose an index number to edit, I to install, or Q to quit
73 | ->
74 |
75 |
76 | If you choose a parameter you will see a short help message, and the current default value will be shown prior to your entry prompt, pressing enter without typing anything will accept the previous value, whether it is a default or a previous answer, as your current answer:
77 |
78 | Please choose an index number to edit, I to install, or Q to quit
79 | -> 2
80 | Parameter: mail_from_default
81 | Default mail address to use in the 'From' field of sent mails
82 | [admin@localhost]:
83 |
84 | Edit any parameters you would like to change. If you select "Q" then any parameters you have changed will be saved before quitting, likewise changes are saved before doing the install. Actually selecting the install option will download puppet if necessary and then proceed to apply the puppet configuration to bring the system up to a running alfresco instance.
85 |
86 | If you choose something other than 'localhost' for "db_host" then no mysql server will be installed on the local machine and in this case you must have already created the database on the remote server and configured remote permissions correctly.
87 |
88 |
89 |
90 |
91 | #### Backing up with BART
92 |
93 | To configure backup, run this command `sudo ./setup-backup.sh`
94 |
95 | You will see a similar configurator to the main one, but this just configures backups.
96 |
97 | ```
98 | Idx Param Value
99 |
100 | [1] alfresco_base_dir /opt/alfresco
101 | [2] backuptype scp
102 | [3] backup_at_hour 2
103 | [4] backup_at_min 23
104 | [5] duplicity_password password
105 | [6] fulldays 30D
106 | [7] backup_policies_enabled true
107 | [8] clean_time 12M
108 | [9] maxfull 6
109 | [10] volume_size 25
110 | [11] duplicity_log_verbosity 4
111 | [12] scp_server backupserver
112 | [13] scp_user backupuser
113 | [14] scp_folder /home/backups
114 |
115 | Please choose an index number to edit, A to apply configuration, or Q to quit
116 | ->
117 | ```
118 | The parameter names you see here mostly match the names in the BART script itself so if you want clarification about anything just check in that file, you'll
119 | find it in `/opt/alfresco/scripts` in the default install, or elsewhere if you changed `alfresco_base_dir`.
120 |
121 | Note you should not change `alfresco_base_dir` in this menu since it is picked up automatically from the previous configuration.
122 |
123 | All the backup methods offered by BART are supported, for `backuptype` you can use any of 'scp', 's3', 'local', or 'ftp' and the menu will change to show relevant configuration.
124 |
125 |
126 | #### SSL Configuration
127 |
128 | See [this document](docs/ssl.md)
129 |
130 |
131 | #### Supporting sharepoint
132 |
133 | A note about [sharepoint support](docs/sharepoint.md) - tl;dr? use `https:///spp` as the endpoint in Microsoft Office.
134 |
135 |
136 | #### Other installation methods
137 |
138 | There were a couple of other installation methods. For historical reasons [they are recorded here](docs/other-install.md)
139 |
140 |
--------------------------------------------------------------------------------
/Vagrantfile:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5 | VAGRANTFILE_API_VERSION = "2"
6 |
7 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
8 |
9 | # http://www.miniwebtool.com/mac-address-generator/
10 | config.vm.network "public_network", :mac => 'B8B2253CFD00'
11 |
12 | config.vm.provider "virtualbox" do |v|
13 | v.memory = 2500
14 | v.cpus = 2
15 | end
16 |
17 | # config.vm.box = "ubuntu/trusty64"
18 | config.vm.box = "puppetlabs/centos-6.6-64-puppet"
19 |
20 | if Vagrant.has_plugin?("vagrant-vbguest")
21 | config.vbguest.auto_update = true
22 | end
23 |
24 | config.vm.network :forwarded_port, guest: 8443, host: 8443
25 |
26 | config.vm.provision :shell do |shell|
27 | shell.inline = "OS=`cat /etc/issue | head -n1 | cut -f1 -d' '`; if [ \"$OS\" == \"Debian\" -o \"$OS\" == \"Ubuntu\" ]; then apt-get update; else yum -y update; fi; cd /vagrant; config/ootb_install.sh"
28 | end
29 |
30 | config.vm.provision :puppet do |puppet|
31 | puppet.manifests_path = "."
32 | puppet.manifest_file = "go.pp"
33 | puppet.module_path = ["modules"]
34 | end
35 |
36 | end
37 |
--------------------------------------------------------------------------------
/config/backup_install.sh:
--------------------------------------------------------------------------------
1 |
2 |
3 | cd "`dirname $0`"/..
4 |
5 | if [ -f .IS_VAGRANT ]
6 | then
7 | vagrant ssh "/vagrant/install/vagrant-apply-backup.sh"
8 | else
9 | puppet apply --modulepath=modules do_backup.pp
10 | fi
11 |
12 | # TODO this really needs to be done by bashconf
13 | exit
14 |
--------------------------------------------------------------------------------
/config/backup_output.sh:
--------------------------------------------------------------------------------
1 | OUTFILE='do_backup.pp'
2 |
3 |
4 | function write_output {
5 | alfresco_base_dir=`get_param alfresco_base_dir`
6 | backup_at_hour=`get_param backup_at_hour`
7 | backup_at_min=`get_param backup_at_min`
8 | duplicity_password=`get_param duplicity_password`
9 | fulldays=`get_param fulldays`
10 | backup_policies_enabled=`get_param backup_policies_enabled`
11 | clean_time=`get_param clean_time`
12 | maxfull=`get_param maxfull`
13 | volume_size=`get_param volume_size`
14 | duplicity_log_verbosity=`get_param duplicity_log_verbosity`
15 | local_backup_folder=`get_param local_backup_folder`
16 | backuptype=`get_param backuptype`
17 | local_backup_folder=`get_param local_backup_folder`
18 | aws_access_key_id=`get_param aws_access_key_id`
19 | aws_secret_access_key=`get_param aws_secret_access_key`
20 | s3filesyslocation=`get_param s3filesyslocation`
21 | ftp_server=`get_param ftp_server`
22 | ftp_user=`get_param ftp_user`
23 | ftp_password=`get_param ftp_password`
24 | ftp_folder=`get_param ftp_folder`
25 | ftp_port=`get_param ftp_port`
26 | ftps_enable=`get_param ftps_enable`
27 | scp_server=`get_param scp_server`
28 | scp_user=`get_param scp_user`
29 | scp_folder=`get_param scp_folder`
30 |
31 | echo -e "${GREEN}Writing puppet file ${BLUE}${OUTFILE}${WHITE}"
32 | cat > ${OUTFILE} < '${alfresco_base_dir}',
35 | backup_at_hour => '${backup_at_hour}',
36 | backup_at_min => '${backup_at_min}',
37 | duplicity_password => '${duplicity_password}',
38 | fulldays => '${fulldays}',
39 | backup_policies_enabled => '${backup_policies_enabled}',
40 | clean_time => '${clean_time}',
41 | maxfull => '${maxfull}',
42 | volume_size => '${volume_size}',
43 | duplicity_log_verbosity => '${duplicity_log_verbosity}',
44 | backuptype => '${backuptype}',
45 | local_backup_folder => '${local_backup_folder}',
46 | aws_access_key_id => '${aws_access_key_id}',
47 | aws_secret_access_key => '${aws_secret_access_key}',
48 | s3filesyslocation => '${s3filesyslocation}',
49 | ftp_server => '${ftp_server}',
50 | ftp_user => '${ftp_user}',
51 | ftp_password => '${ftp_password}',
52 | ftp_folder => '${ftp_folder}',
53 | ftp_port => '${ftp_port}',
54 | ftps_enable => '${ftps_enable}',
55 | scp_server => '${scp_server}',
56 | scp_user => '${scp_user}',
57 | scp_folder => '${scp_folder}',
58 | }
59 | EOF
60 | sleep 1
61 | }
62 |
63 |
64 | write_output
65 |
66 |
--------------------------------------------------------------------------------
/config/backup_params.sh:
--------------------------------------------------------------------------------
1 |
2 | IDX=0
3 | params[$IDX]="alfresco_base_dir"
4 | descr[$IDX]="Where is alfresco installed. This should already have been set by the initial setup"
5 | required[$IDX]=1
6 |
7 |
8 | IDX=$(( $IDX + 1 ))
9 | params[$IDX]="backuptype"
10 | descr[$IDX]="Type of backup. Choose one of the options and then configure the appropriate settings."
11 | default[$IDX]="local"
12 | required[$IDX]=1
13 | choices[$IDX]="s3|ftp|scp|local"
14 |
15 |
16 | IDX=$(( $IDX + 1 ))
17 | params[$IDX]="backup_at_hour"
18 | descr[$IDX]="Hour of the day (0-24) at which time we should run the backup."
19 | default[$IDX]=2
20 | required[$IDX]=1
21 |
22 | IDX=$(( $IDX + 1 ))
23 | params[$IDX]="backup_at_min"
24 | descr[$IDX]="Minute of the hour (0-59) at which time we should run the backup. If you leave it blank a random minute is selected. TODO: CHECKTHIS"
25 | default[$IDX]=""
26 | required[$IDX]=1
27 |
28 | IDX=$(( $IDX + 1 ))
29 | params[$IDX]="duplicity_password"
30 | descr[$IDX]="Password with which to protect the duplicity backup files."
31 | default[$IDX]=""
32 | required[$IDX]=0
33 |
34 | IDX=$(( $IDX + 1 ))
35 | params[$IDX]="local_backup_folder"
36 | descr[$IDX]="Local backup folder. If you are using this you have probably mounted a remote backup folder locally."
37 | default[$IDX]="/mnt/backup"
38 | required[$IDX]=1
39 | onlyif[$IDX]="backuptype=local"
40 |
41 | IDX=$(( $IDX + 1 ))
42 | params[$IDX]="fulldays"
43 | descr[$IDX]="Number of days between full backups. (If no backup is found then a full backup is done)."
44 | default[$IDX]="30D"
45 | required[$IDX]=1
46 |
47 | IDX=$(( $IDX + 1 ))
48 | params[$IDX]="backup_policies_enabled"
49 | descr[$IDX]="Backup policies to apply all backups collections (retention and cleanup)"
50 | default[$IDX]="true"
51 | required[$IDX]=1
52 | choices[$IDX]="true|false"
53 |
54 | IDX=$(( $IDX + 1 ))
55 | params[$IDX]="clean_time"
56 | descr[$IDX]="Remove backups older than this (or backup retention period) TODO: Clarify this description"
57 | default[$IDX]="12M"
58 | required[$IDX]=1
59 |
60 | IDX=$(( $IDX + 1 ))
61 | params[$IDX]="maxfull"
62 | descr[$IDX]="After MAXFULL counter, all incrementals will be deleted and all full will be kept until CLEAN_TIME applies"
63 | default[$IDX]="6"
64 | required[$IDX]=1
65 |
66 | IDX=$(( $IDX + 1 ))
67 | params[$IDX]="volume_size"
68 | descr[$IDX]="If you want to keep full backups of last 12 months but only with incremental\nin last 6 months you must set CLEAN_TIME=12M and MAXFULL=6.\nVolume size in MB, default is 25MB per backup volume, consider reduce or increase it\nif you are doing tape backup (if a backup takes up 60MB you will get 3 volumes, 25+25+10)"
69 | default[$IDX]="25"
70 | required[$IDX]=1
71 |
72 | IDX=$(( $IDX + 1 ))
73 | params[$IDX]="duplicity_log_verbosity"
74 | descr[$IDX]="Duplicity log verbosity 0 Error, 2 Warning, 4 Notice, 8 Info, 9 Debug (noisiest)\n0 recommended for production"
75 | default[$IDX]="4"
76 | required[$IDX]=1
77 |
78 | IDX=$(( $IDX + 1 ))
79 | params[$IDX]="aws_access_key_id"
80 | descr[$IDX]="Amazon Web Services - Access Key ID"
81 | default[$IDX]=""
82 | required[$IDX]=1
83 | onlyif[$IDX]="backuptype=s3"
84 |
85 | IDX=$(( $IDX + 1 ))
86 | params[$IDX]="aws_secret_access_key"
87 | descr[$IDX]="Amazon Web Services - Secret Access Key"
88 | default[$IDX]=""
89 | required[$IDX]=1
90 | onlyif[$IDX]="backuptype=s3"
91 |
92 | IDX=$(( $IDX + 1 ))
93 | params[$IDX]="s3filesyslocation"
94 | descr[$IDX]="S3 File system location - upper case bucket name is not allowed"
95 | default[$IDX]="s3+http://your-bucket-name"
96 | required[$IDX]=1
97 | onlyif[$IDX]="backuptype=s3"
98 |
99 | IDX=$(( $IDX + 1 ))
100 | params[$IDX]="ftp_server"
101 | descr[$IDX]="Address of FTP server"
102 | default[$IDX]=""
103 | required[$IDX]=1
104 | onlyif[$IDX]="backuptype=ftp"
105 |
106 | IDX=$(( $IDX + 1 ))
107 | params[$IDX]="ftp_user"
108 | descr[$IDX]="User to log in as on remote FTP server"
109 | default[$IDX]=""
110 | required[$IDX]=1
111 | onlyif[$IDX]="backuptype=ftp"
112 |
113 | IDX=$(( $IDX + 1 ))
114 | params[$IDX]="ftp_password"
115 | descr[$IDX]="Password of FTP user"
116 | default[$IDX]=""
117 | required[$IDX]=1
118 | onlyif[$IDX]="backuptype=ftp"
119 |
120 | IDX=$(( $IDX + 1 ))
121 | params[$IDX]="ftp_port"
122 | descr[$IDX]="Port of FTP server"
123 | default[$IDX]="21"
124 | required[$IDX]=0
125 | onlyif[$IDX]="backuptype=ftp"
126 |
127 | IDX=$(( $IDX + 1 ))
128 | params[$IDX]="ftps_enable"
129 | descr[$IDX]="Should we use FTPS to communicate with the FTP server?"
130 | default[$IDX]="false"
131 | required[$IDX]=0
132 | onlyif[$IDX]="backuptype=ftp"
133 | choices[$IDX]="true|false"
134 |
135 | IDX=$(( $IDX + 1 ))
136 | params[$IDX]="scp_server"
137 | descr[$IDX]="Address of machine which is the SCP target"
138 | default[$IDX]=""
139 | required[$IDX]=1
140 | onlyif[$IDX]="backuptype=scp"
141 |
142 | IDX=$(( $IDX + 1 ))
143 | params[$IDX]="scp_user"
144 | descr[$IDX]="User to connect as. Your public key should be in the ~/.ssh/authorized_keys file on the server."
145 | default[$IDX]=""
146 | required[$IDX]=1
147 | onlyif[$IDX]="backuptype=scp"
148 |
149 | IDX=$(( $IDX + 1 ))
150 | params[$IDX]="scp_folder"
151 | descr[$IDX]="Path on remote server to store the backups at."
152 | default[$IDX]=""
153 | required[$IDX]=1
154 | onlyif[$IDX]="backuptype=scp"
155 |
156 |
--------------------------------------------------------------------------------
/config/backup_pre.sh:
--------------------------------------------------------------------------------
1 | #INSTALL_LETTER=
2 | #PROMPT="Please choose an index number to edit, or Q to quit"
3 |
4 | alfresco_base_dir=`cat go.pp | grep alfresco_base_dir | cut -f2 -d\'`
5 | echo "alfresco_base_dir=$alfresco_base_dir" >> config/backup_answers.sh
6 |
7 |
8 |
9 | INSTALL_LETTER=A
10 | PROMPT="Please choose an index number to edit, A to apply configuration, or Q to quit"
11 |
--------------------------------------------------------------------------------
/config/ootb_install.sh:
--------------------------------------------------------------------------------
1 |
2 | source install/inc-puppet.sh
3 |
4 | ERR=$?
5 | if [ $ERR != 0 ]
6 | then
7 | return 1
8 | fi
9 |
10 | if [ "`which puppet`" = "" ]
11 | then
12 | install_puppet
13 | fi
14 |
15 | # install external modules
16 |
17 | gem install librarian-puppet
18 | /usr/local/bin/librarian-puppet install --verbose
19 |
20 | # ensure that our module is in the right place
21 | if [ ! -d modules/alfresco ]
22 | then
23 | mkdir modules/alfresco -p
24 | for d in lib files manifests templates
25 | do
26 | ln -s ${PWD}/${d} ${PWD}/modules/alfresco/${d}
27 | done
28 | fi
29 |
30 | puppet apply --modulepath=modules go.pp --hiera_config=install/hiera.yaml
31 |
32 | if [ $? != 0 ]; then exit 99; fi
33 |
34 | echo
35 | echo Completed, please allow some time for alfresco to start
36 | echo You may tail the logs at ${tomcat_home}/logs/catalina.out
37 | echo
38 | echo Note that you can reapply the puppet configuration from this directory with:
39 | echo " sudo puppet apply --modulepath=modules go.pp"
40 | echo
41 | #echo You can also run the tests with:
42 | #echo " puppet apply --modulepath=modules test.pp"
43 | #echo
44 |
45 | # TODO this should be fixed in bashconf but here for now to expedite
46 | exit
47 |
--------------------------------------------------------------------------------
/config/ootb_output.sh:
--------------------------------------------------------------------------------
1 |
2 | function write_output {
3 |
4 | domain_name=`get_param domain_name`
5 | initial_admin_pass=`get_param initial_admin_pass`
6 | mail_from_default=`get_param mail_from_default`
7 | alfresco_base_dir=`get_param alfresco_base_dir`
8 | tomcat_home=`get_param tomcat_home`
9 | alfresco_version=`get_param alfresco_version`
10 | download_path=`get_param download_path`
11 | db_root_password=`get_param db_root_password`
12 | db_user=`get_param db_user`
13 | db_pass=`get_param db_pass`
14 | db_name=`get_param db_name`
15 | db_host=`get_param db_host`
16 | db_port=`get_param db_port`
17 | mem_xmx=`get_param mem_xmx`
18 | mem_xxmaxpermsize=`get_param mem_xxmaxpermsize`
19 | ssl_cert_path=`get_param ssl_cert_path`
20 |
21 | echo -e "${GREEN}Writing puppet file ${BLUE}go.pp${WHITE}"
22 | cat > go.pp < '${domain_name}',
25 | initial_admin_pass => '${initial_admin_pass}',
26 | mail_from_default => '${mail_from_default}',
27 | alfresco_base_dir => '${alfresco_base_dir}',
28 | tomcat_home => '${tomcat_home}',
29 | alfresco_version => '${alfresco_version}',
30 | download_path => '${download_path}',
31 | db_root_password => '${db_root_password}',
32 | db_user => '${db_user}',
33 | db_pass => '${db_pass}',
34 | db_name => '${db_name}',
35 | db_host => '${db_host}',
36 | db_port => '${db_port}',
37 | mem_xmx => '${mem_xmx}',
38 | mem_xxmaxpermsize => '${mem_xxmaxpermsize}',
39 | ssl_cert_path => '${ssl_cert_path}',
40 | }
41 | EOF
42 | echo -e "${GREEN}Writing puppet file ${BLUE}test.pp${WHITE}"
43 | cat > test.pp < 10,
46 | domain_name => '${domain_name}',
47 | initial_admin_pass => '${initial_admin_pass}',
48 | mail_from_default => '${mail_from_default}',
49 | alfresco_base_dir => '${alfresco_base_dir}',
50 | tomcat_home => '${tomcat_home}',
51 | alfresco_version => '${alfresco_version}',
52 | download_path => '${download_path}',
53 | db_root_password => '${db_root_password}',
54 | db_user => '${db_user}',
55 | db_pass => '${db_pass}',
56 | db_name => '${db_name}',
57 | db_host => '${db_host}',
58 | db_port => '${db_port}',
59 | mem_xmx => '${mem_xmx}',
60 | mem_xxmaxpermsize => '${mem_xxmaxpermsize}',
61 | }
62 | EOF
63 | sleep 1
64 | }
65 |
66 | write_output
67 |
68 |
69 |
--------------------------------------------------------------------------------
/config/ootb_params.sh:
--------------------------------------------------------------------------------
1 |
2 | IDX=0
3 | params[$IDX]="domain_name"
4 | descr[$IDX]="Domain name at which the installation will be resolved, e.g. test.orderofthebee.org. This domain name should be resolvable to this machine. For testing, 'localhost' might work."
5 | default[$IDX]=""
6 | required[$IDX]=1
7 |
8 | IDX=$(( $IDX + 1 ))
9 | params[$IDX]="ssl_cert_path"
10 | descr[$IDX]="Path to SSL certificates. If left blank self-signed certificates will be generated.\nIf a value is passed in it may be a path on the filesystem (e.g. /vagrant/certs for a \nVagrant build) or if the path starts 'http' then a download attempt will be made. In \nboth cases you must provide files .key and n.cert. \nSee https://github.com/marsbard/puppet-alfresco/blob/master/docs/ssl.md for details"
11 | default[$IDX]=""
12 |
13 | IDX=$(( $IDX + 1 ))
14 | params[$IDX]="initial_admin_pass"
15 | descr[$IDX]="Admin password for very first run of repo. After first run you can change it from inside the app"
16 | default[$IDX]="admin"
17 |
18 | IDX=$(( $IDX + 1 ))
19 | params[$IDX]="mail_from_default"
20 | descr[$IDX]="Default mail address to use in the 'From' field of sent mails"
21 | default[$IDX]="admin@localhost"
22 |
23 | IDX=$(( $IDX + 1 ))
24 | params[$IDX]="mail_host"
25 | descr[$IDX]="Address of mail server which will accept mails from us. Leave this as 'localhost' and postfix will be installed locally"
26 | default[$IDX]="localhost"
27 |
28 | IDX=$(( $IDX + 1 ))
29 | params[$IDX]="mail_port"
30 | descr[$IDX]="Mail server port. Leave at '25' for localhost."
31 | default[$IDX]="25"
32 |
33 |
34 | IDX=$(( $IDX + 1 ))
35 | params[$IDX]="alfresco_base_dir"
36 | descr[$IDX]="Where alfresco base folder should go, i.e. location of alf_data"
37 | default[$IDX]="/opt/alfresco"
38 |
39 |
40 | IDX=$(( $IDX + 1 ))
41 | params[$IDX]="tomcat_home"
42 | descr[$IDX]="Where to install tomcat"
43 | default[$IDX]="/opt/alfresco/tomcat"
44 |
45 |
46 | IDX=$(( $IDX + 1 ))
47 | params[$IDX]="alfresco_version"
48 | descr[$IDX]="Alfresco version to install. Choices '4.2.f', '5.0.x' and 'NIGHTLY' are supported"
49 | default[$IDX]="5.0.x"
50 | choices[$IDX]="4.2.f|5.0.x|NIGHTLY"
51 |
52 |
53 | IDX=$(( $IDX + 1 ))
54 | params[$IDX]="download_path"
55 | descr[$IDX]="Where to store downloaded files"
56 | default[$IDX]="/opt/downloads"
57 |
58 |
59 | IDX=$(( $IDX + 1 ))
60 | params[$IDX]="db_root_password"
61 | descr[$IDX]="Password to use for root user when installing Mysql"
62 | default[$IDX]="alfresco"
63 |
64 |
65 | IDX=$(( $IDX + 1 ))
66 | params[$IDX]="db_user"
67 | descr[$IDX]="Database user"
68 | default[$IDX]="alfresco"
69 |
70 |
71 | IDX=$(( $IDX + 1 ))
72 | params[$IDX]="db_pass"
73 | descr[$IDX]="Database password"
74 | default[$IDX]="alfresco"
75 |
76 |
77 | IDX=$(( $IDX + 1 ))
78 | params[$IDX]="db_name"
79 | descr[$IDX]="Database name"
80 | default[$IDX]="alfresco"
81 |
82 |
83 | IDX=$(( $IDX + 1 ))
84 | params[$IDX]="db_host"
85 | descr[$IDX]="Database host. Not really useful yet. In future, if this is localhost then the DB will be installed locally, if anything else then no local DB server is installed"
86 | default[$IDX]="localhost"
87 |
88 |
89 | IDX=$(( $IDX + 1 ))
90 | params[$IDX]="db_port"
91 | descr[$IDX]="Database port"
92 | default[$IDX]="3306"
93 |
94 |
95 | IDX=$(( $IDX + 1 ))
96 | params[$IDX]="mem_xmx"
97 | descr[$IDX]="Setting to pass as '-Xmx' for JAVA_OPTS. You cannot use decimal fractions, e.g. if you want 7.5G use 7500M instead"
98 | default[$IDX]="3600M"
99 |
100 |
101 | IDX=$(( $IDX + 1 ))
102 | params[$IDX]="mem_xxmaxpermsize"
103 | descr[$IDX]="Setting to pass as '-XX:MaxPermSize' in JAVA_OPTS"
104 | default[$IDX]="256m"
105 |
106 |
107 | #IDX=$(( $IDX + 1 ))
108 | #params[$IDX]="solr_host"
109 | #descr[$IDX]="Location to install solr. If this is other than localhost we will try to ssh to the @ to install solr there"
110 | #default[$IDX]="localhost"
111 |
112 | #IDX=$(( $IDX + 1 ))
113 | #params[$IDX]="solr_user"
114 | #descr[$IDX]="User on the solr server to install solr as. This will be the account that solr runs under."
115 | #default[$IDX]=""
116 | #required[$IDX]=1
117 | #onlyif[$IDX]="solr_host!=localhost"
118 |
119 |
120 |
--------------------------------------------------------------------------------
/config/ootb_pre.sh:
--------------------------------------------------------------------------------
1 |
2 | # install dependencies here
3 | # remember to take into account which OS we are on
4 |
5 |
6 | export BANNER="${YELLOW} __ __ __ __ __ __ __ __ __ __\n\
7 | __/ \\__/ \\__/ \\__/ \\__/ \\__/ \\__/ \\__/ \\__/ \\__/ \\__\n\
8 | / \\__ ${BLUE}ORDER OF THE BEE${YELLOW} / \\__/ \\__/ \\__/ \\__/ \\__/ \\__/ \\ \n\
9 | \\__/ \\__/ \\__/ \\__/ \\ ${BLUE}Alfresco (TM) Honeycomb Edition${YELLOW} \\__/\n\
10 | \\__/ \\__/ \\__/ \\__/ \\__/ \\__/ \\__/ \\__/ \\__/ \\__/ ${WHITE} "
11 |
12 | PROMPT="${WHITE}Please choose an index number to edit, I to install, or Q to quit\n\
13 | (if using Vagrant, choose Q not I and run 'vagrant up')"
14 |
--------------------------------------------------------------------------------
/docs/apt-cacher-ng.md:
--------------------------------------------------------------------------------
1 | ## How to set up apt-cacher-ng to speed up repeated testing
2 |
3 | On some Debian or Ubuntu host, install the '__apt-cacher-ng__' package.
4 |
5 | In your go.pp file, or in your puppetmaster configuration depending on how you are using the module, add the parameter
6 |
7 | apt_cache_host => 'server_name_or_ip',
8 |
9 | If you have changed the port on which apt-cacher-ng listens you may also use the optional
10 |
11 | apt_cache_port => 1234,
12 |
13 | It uses the puppetlabs-apt module, you need to either install it in your puppetmaster:
14 |
15 | puppet module install puppetlabs-apt
16 |
17 | Or if you are using Vagrant, into your local modules folder
18 |
19 | puppet module install puppetlabs-apt --target-dir=modules
20 |
21 | It is worth tailing the logs in __/var/log/apt-cacher-ng/__ to make sure that the .deb packages are in fact being requested from there. The configuration for the proxy is in __/etc/apt/apt.conf.d/01proxy__
22 |
23 |
24 | Note that you also have the option of overriding some of the other large downloads by editing __manifests/urls.pp__ and making the urls point to local copies.
25 |
26 |
--------------------------------------------------------------------------------
/docs/other-install.md:
--------------------------------------------------------------------------------
1 |
2 | ## Other install methods ##
3 |
4 | This is here for historical reasons, the main build method now is just the standalone.
5 |
6 | #### Use it as a puppet module
7 |
8 | If you do not have a puppetmaster server, please ignore this section and check out [the standalone installer](#standalone)
9 |
10 | It can also be used as a puppet module, for example if you have a puppet master
11 | you can do:
12 |
13 | ```
14 | cd /etc/puppet/modules
15 | git clone https://github.com/marsbard/puppet-alfresco.git alfresco
16 | cd alfresco
17 | install/setup-for-puppetmaster.sh
18 | ```
19 |
20 | to make the module available for use in your puppet scripts.
21 |
22 | Here is an example of a minimal puppet script to install alfresco:
23 |
24 | class { 'alfresco':
25 | domain_name => 'marsbard.com',
26 | }
27 |
28 | The domain_name value should be resolvable to the machine we're working on.
29 |
30 | Here's a more complete example, showing the default values (domain_name has no default). See the output of install.sh (go.pp) for the latest configuration:
31 |
32 | class { 'alfresco':
33 | domain_name => 'marsbard.com',
34 | mail_from_default => 'admin@localhost',
35 | alfresco_base_dir => '/opt/alfresco',
36 | tomcat_home => '/opt/alfresco/tomcat',
37 | alfresco_version => '4.2.f',
38 | download_path => '/opt/downloads',
39 | db_root_password => 'alfresco',
40 | db_user => 'alfresco',
41 | db_pass => 'alfresco',
42 | db_name => 'alfresco',
43 | db_host => 'localhost',
44 | db_port => '3306',
45 | }
46 |
47 |
48 | Note that currently the only supported values for "alfresco_version" are "4.2.f", "5.0.x", and "NIGHTLY".
49 |
50 | If you choose something other than 'localhost' for "db_host" then no mysql server will be installed on the local machine and in this case you must have already created the database on the remote server and configured remote permissions correctly.
51 |
52 | #### Run under Vagrant
53 |
54 | It's useful to run the script under Vagrant sometimes for testing purposes.
55 |
56 | To set up a Vagrant environment:
57 |
58 | ```
59 | git clone https://github.com/marsbard/puppet-alfresco.git alfresco
60 | cd alfresco
61 | install/setup-for-vagrant.sh
62 | ```
63 |
64 | You need to run './install.sh' once and quit out of it in order to save the 'go.pp' initial puppet script.
65 | While in the installer you must set the domain_name parameter and that domain name should be resolvable on the network to the machine you are installing upon.
66 | (Admittedly this is a bit 'chicken and egg', the best thing is to register the MAC address of the VM with your DHCP server once the VM is running - to help with this I have included a static MAC address in the network config, otherwise Vagrant/Virtualbox gives you a new MAC address each time which is kind of annoying).
67 |
68 | ./install.sh # Choose Q after setting parameters
69 | vagrant up
70 |
71 | It is a good idea to set download_path to be under /vagrant as then you will only need to download Libre Office etc. once, and subsequently after doing "vagrant destroy" they will still be available. Since Libre Office takes a long time to download this is a good idea.
72 |
73 | If you choose something other than 'localhost' for "db_host" then no mysql server will be installed on the local machine and in this case you must have already created the database on the remote server and configured remote permissions correctly.
74 |
75 | The network starts as bridged ("public network") and it will ask you which interface you want to bridge to at startup.
76 |
77 | If you need to interrupt provisioning for some reason, when you restart it, "vagrant reload --provision" is probably your best option, it reboots the machine and then restarts provisioning. If you just restart, Vagrant thinks you've done with provisioning.
78 |
--------------------------------------------------------------------------------
/docs/sharepoint.md:
--------------------------------------------------------------------------------
1 | ## Sharepoint support ##
2 |
3 | Because we are trying to do an 'all in one' build reverse-proxied through
4 | apache, we cannot map `/alfresco` on the proxy both to the sharepoint
5 | protocol server on port 7070 as well as the usual `/alfresco` served up
6 | by tomcat.
7 |
8 | Accordingly we have mapped the `http://:7070/alfresco` route
9 | to `https:///spp`, and it is the latter form which you should
10 | use from Microsoft Office.
11 |
12 | With the latest Office version (2013) you may access the SPP service on
13 | your alfresco box by typing a URL such as described above into an 'Open'
14 | dialog to browse available files on the server or into a 'Save' dialog to
15 | browse to a save location. You could also use a URL like
16 | `https://
2 |
3 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-RepoTables.sql
16 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-LockTables.sql
17 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-ContentTables.sql
18 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-PropertyValueTables.sql
19 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-AuditTables.sql
20 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-ActivityTables.sql
21 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-UsageTables.sql
22 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-SubscriptionTables.sql
23 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-TenantTables.sql
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoCreate-AvmTables.sql
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoPostCreate-JBPM-Extra.sql
42 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoPostCreate-JBPM-FK-indexes.sql
43 | classpath:alfresco/dbscripts/create/${db.script.dialect}/AlfrescoPostCreate-JBPM-varinst-indexes.sql
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
--------------------------------------------------------------------------------
/files/ffmpeg_buildubuntu.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Fetch Sources
4 |
5 | mkdir -p /usr/local/src
6 | cd /usr/local/src
7 |
8 | git clone --depth 1 https://github.com/l-smash/l-smash
9 | git clone --depth 1 git://git.videolan.org/x264.git
10 | hg clone https://bitbucket.org/multicoreware/x265
11 | git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
12 | git clone --depth 1 https://chromium.googlesource.com/webm/libvpx
13 | git clone --depth 1 git://source.ffmpeg.org/ffmpeg
14 | git clone https://git.xiph.org/opus.git
15 | git clone --depth 1 https://github.com/mulx/aacgain.git
16 |
17 | # Build L-SMASH
18 |
19 | cd /usr/local/src/l-smash
20 | ./configure
21 | make -j $(nproc)
22 | make install
23 |
24 | # Build libx264
25 |
26 | cd /usr/local/src/x264
27 | ./configure --enable-static
28 | make -j 8
29 | make install
30 |
31 | # Build libx265
32 |
33 | cd /usr/local/src/x265/build/linux
34 | cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr ../../source
35 | make -j 8
36 | make install
37 |
38 | # Build libfdk-aac
39 |
40 | cd /usr/local/src/fdk-aac
41 | autoreconf -fiv
42 | ./configure --disable-shared
43 | make -j 8
44 | make install
45 |
46 | # Build libvpx
47 |
48 | cd /usr/local/src/libvpx
49 | ./configure --disable-examples
50 | make -j 8
51 | make install
52 |
53 | # Build libopus
54 |
55 | cd /usr/local/src/opus
56 | ./autogen.sh
57 | ./configure --disable-shared
58 | make -j 8
59 | make install
60 |
61 | # Build ffmpeg.
62 |
63 | cd /usr/local/src/ffmpeg
64 | ./configure --extra-libs="-ldl" --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
65 | make -j 8
66 | make install
67 |
68 | # Build aacgain
69 |
70 | cd /usr/local/src/aacgain/mp4v2
71 | ./configure && make -k -j 8 # some commands fail but build succeeds
72 | cd /usr/local/src/aacgain/faad2
73 | ./configure && make -k -j 8 # some commands fail but build succeeds
74 | cd /usr/local/src/aacgain
75 | ./configure && make -j 8 && make install
76 |
77 | ln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg
78 | # Remove all tmpfile
79 |
80 | rm -rf /usr/local/src
81 |
--------------------------------------------------------------------------------
/files/iptables.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # -------
3 | # Script to set up iptables for Alfresco use
4 | #
5 | # Copyright 2013 Loftux AB, Peter Löen
6 |
7 | ### BEGIN INIT INFO
8 | # Provides: vpnagentd_init
9 | # Required-Start: $remote_fs $syslog
10 | # Required-Stop: $remote_fs $syslog
11 | # Default-Start: 2 3 4 5
12 | # Default-Stop: 0 1 6
13 | # Short-Description: Start iptables rules at boot time
14 | ### END INIT INFO
15 |
16 |
17 | # Change to public ip-adress on alfresco server
18 | export IPADDRESS=`hostname -I`
19 |
20 | # redirect FROM TO PROTOCOL
21 | # setup port redirect using iptables
22 | redirect() {
23 | echo "Redirecting port $1 to $2 ($3)"
24 | iptables -t nat -A PREROUTING -p $3 --dport $1 -j REDIRECT --to-ports $2
25 | iptables -t nat -A OUTPUT -d localhost -p $3 --dport $1 -j REDIRECT --to-ports $2
26 | # Add all your local ip adresses here that you need port forwarding for
27 | for ip in $IPADDRESS
28 | do
29 | iptables -t nat -A OUTPUT -d $ip -p $3 --dport $1 -j REDIRECT --to-ports $2
30 | done
31 | }
32 |
33 | block() {
34 | echo "Blocking port $1"
35 | iptables -A INPUT -p tcp --dport $1 -s localhost -j ACCEPT
36 | for ip in $IPADDRESS
37 | do
38 | iptables -A INPUT -p tcp --dport $1 -s $ip -j ACCEPT
39 | done
40 | iptables -A INPUT -p tcp --dport $1 -j REJECT
41 | }
42 |
43 | # setup iptables for redirection of CIFS and FTP
44 | setup_iptables () {
45 |
46 | echo "1" >/proc/sys/net/ipv4/ip_forward
47 |
48 | # Clear NATing tables
49 | clear_iptables
50 |
51 | # FTP NATing
52 | redirect 21 2021 tcp
53 |
54 | # CIFS NATing
55 | redirect 445 1445 tcp
56 | redirect 139 1139 tcp
57 | redirect 137 1137 udp
58 | redirect 138 1138 udp
59 |
60 | # IMAP NATing
61 | redirect 143 8143 tcp
62 | redirect 143 8143 udp
63 |
64 | # Forward http
65 | #redirect 80 8080 tcp
66 |
67 |
68 | # mysql
69 | #block 3306
70 | # soffice
71 | #block 8100
72 | # tomcat
73 | #block 7070
74 | #block 2021
75 | #block 8089
76 | block 8080
77 | }
78 |
79 | clear_iptables() {
80 | iptables -F
81 | iptables -X
82 | iptables -t nat -F
83 | iptables -t nat -X
84 | iptables -t mangle -F
85 | iptables -t mangle -X
86 | iptables -P INPUT ACCEPT
87 | iptables -P FORWARD ACCEPT
88 | iptables -P OUTPUT ACCEPT
89 | }
90 |
91 | remove_iptables () {
92 |
93 | echo "0" >/proc/sys/net/ipv4/ip_forward
94 | # Clear NATing tables
95 | clear_iptables
96 |
97 | }
98 | # start, debug, stop, and status functions
99 | start() {
100 | echo "Setting up iptables for Alfresco"
101 | setup_iptables
102 | }
103 |
104 | stop() {
105 | echo "Removing iptables"
106 | remove_iptables
107 |
108 | }
109 |
110 | case "$1" in
111 | start)
112 | start
113 | ;;
114 | stop)
115 | stop
116 | ;;
117 | restart)
118 | stop
119 | start
120 | ;;
121 | *)
122 | echo "Usage: $0 {start|stop|restart}"
123 | exit 1
124 | esac
125 |
126 | exit $RETVAL
127 |
--------------------------------------------------------------------------------
/files/jar-to-amp.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | JAR=$1
4 | ID=$2
5 | ALIASES=$3
6 | VERSION=$4
7 | AMPNAME=$5
8 | TITLE=$6*
9 |
10 | cd /tmp
11 | DIR=$$.create-amp.tmp
12 | mkdir $DIR
13 | cd $DIR
14 | mkdir lib
15 | cp $JAR lib
16 | cat > module.properties <
2 |
18 |
22 |
23 |
24 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
39 |
40 |
43 |
48 |
49 |
50 |
55 |
56 |
57 |
58 |
62 |
63 |
64 |
71 |
84 |
85 |
91 |
95 |
96 |
100 |
101 |
102 |
105 |
106 |
107 |
112 |
113 |
116 |
117 |
118 |
121 |
124 |
125 |
127 |
128 |
132 |
134 |
135 |
136 |
138 |
139 |
141 |
144 |
145 |
148 |
153 |
154 |
155 |
156 |
157 |
--------------------------------------------------------------------------------
/files/sysctl.conf:
--------------------------------------------------------------------------------
1 |
2 | net.core.somaxconn = 65535
3 | net.ipv4.tcp_max_syn_backlog = 65535
4 | net.ipv4.ip_local_port_range = 2048 64512
5 | net.ipv4.tcp_tw_recycle = 1
6 | net.ipv4.tcp_tw_reuse = 1
7 | net.ipv4.tcp_fin_timeout = 10
8 |
--------------------------------------------------------------------------------
/files/tomcat-users.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
24 |
29 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/files/webscripts/create-site/create-site.get.desc.xml:
--------------------------------------------------------------------------------
1 |
2 | Create Site
3 | Utility script to create a site
4 | /modules/create-site
5 | OrderOfTheBee
6 | admin
7 |
8 |
--------------------------------------------------------------------------------
/files/webscripts/create-site/create-site.get.html.ftl:
--------------------------------------------------------------------------------
1 | <#list activityLog as log>
2 | ${log}
3 | #list>
4 |
--------------------------------------------------------------------------------
/files/webscripts/create-site/create-site.get.js:
--------------------------------------------------------------------------------
1 | var activityLog = [];
2 | function main() {
3 | siteService.createSite(args.preset, args.url, args.title, args.description, args.visibility);
4 |
5 | activityLog.push("Created site with preset '" + args.preset + "', site '" + args.url + "'");
6 | model.activityLog = activityLog;
7 | }
8 | main();
9 |
--------------------------------------------------------------------------------
/files/xvfb-init:
--------------------------------------------------------------------------------
1 | XVFB=/usr/bin/Xvfb
2 | XVFBARGS=":99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset"
3 | PIDFILE=/var/run/xvfb.pid
4 | case "$1" in
5 | start)
6 | echo -n "Starting virtual X frame buffer: Xvfb"
7 | start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile --background --exec $XVFB -- $XVFBARGS
8 | echo "."
9 | ;;
10 | stop)
11 | echo -n "Stopping virtual X frame buffer: Xvfb"
12 | start-stop-daemon --stop --quiet --pidfile $PIDFILE
13 | echo "."
14 | ;;
15 | restart)
16 | $0 stop
17 | $0 start
18 | ;;
19 | *)
20 | echo "Usage: /etc/init.d/xvfb {start|stop|restart}"
21 | exit 1
22 | esac
23 |
24 | exit 0
25 |
--------------------------------------------------------------------------------
/files/xvfb-run:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 | # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 | #
5 | # T2 SDE: package/.../xorg-server/xvfb-run.sh
6 | # Copyright (C) 2005 The T2 SDE Project
7 | # Copyright (C) XXXX - 2005 Debian
8 | #
9 | # More information can be found in the files COPYING and README.
10 | #
11 | # This program is free software; you can redistribute it and/or modify
12 | # it under the terms of the GNU General Public License as published by
13 | # the Free Software Foundation; version 2 of the License. A copy of the
14 | # GNU General Public License can be found in the file COPYING.
15 | # --- T2-COPYRIGHT-NOTE-END ---
16 |
17 | # $Id: xvfb-run 2166 2005-01-27 07:54:19Z branden $
18 | # from: http://necrotic.deadbeast.net/xsf/XFree86/trunk/debian/local/xvfb-run
19 |
20 | # This script starts an instance of Xvfb, the "fake" X server, runs a command
21 | # with that server available, and kills the X server when done. The return
22 | # value of the command becomes the return value of this script.
23 | #
24 | # If anyone is using this to build a Debian package, make sure the package
25 | # Build-Depends on xvfb, xbase-clients, and xfonts-base.
26 |
27 | set -e
28 |
29 | PROGNAME=xvfb-run
30 | SERVERNUM=99
31 | AUTHFILE=
32 | ERRORFILE=/dev/null
33 | STARTWAIT=3
34 | XVFBARGS="-screen 0 640x480x8"
35 | LISTENTCP="-nolisten tcp"
36 | XAUTHPROTO=.
37 |
38 | # Query the terminal to establish a default number of columns to use for
39 | # displaying messages to the user. This is used only as a fallback in the event
40 | # the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while the
41 | # script is running, and this cannot, only being calculated once.)
42 | DEFCOLUMNS=$(stty size 2>/dev/null | awk '{print $2}') || true
43 | if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" >/dev/null 2>&1; then
44 | DEFCOLUMNS=80
45 | fi
46 |
47 | # Display a message, wrapping lines at the terminal width.
48 | message () {
49 | echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS}
50 | }
51 |
52 | # Display an error message.
53 | error () {
54 | message "error: $*" >&2
55 | }
56 |
57 | # Display a usage message.
58 | usage () {
59 | if [ -n "$*" ]; then
60 | message "usage error: $*"
61 | fi
62 | cat <&2
138 | exit 2
139 | fi
140 |
141 | if ! which xauth >/dev/null; then
142 | error "xauth command not found"
143 | exit 3
144 | fi
145 |
146 | # If the user did not specify an X authorization file to use, set up a temporary
147 | # directory to house one.
148 | if [ -z "$AUTHFILE" ]; then
149 | XVFB_RUN_TMPDIR="${TMPDIR:-/tmp}/$PROGNAME.$$"
150 | if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then
151 | error "temporary directory $XVFB_RUN_TMPDIR already exists"
152 | exit 4
153 | fi
154 | AUTHFILE=$(mktemp -p "$XVFB_RUN_TMPDIR" Xauthority.XXXXXXXXXXXXXXX)
155 | fi
156 |
157 | # Start Xvfb.
158 | MCOOKIE=$(mcookie)
159 | XAUTHORITY=$AUTHFILE xauth add ":$SERVERNUM" "$XAUTHPROTO" "$MCOOKIE" \
160 | >"$ERRORFILE" 2>&1
161 | XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >"$ERRORFILE" \
162 | 2>&1 &
163 | XVFBPID=$!
164 | sleep "$STARTWAIT"
165 |
166 | # Start the command and save its exit status.
167 | set +e
168 | DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
169 | RETVAL=$?
170 | set -e
171 |
172 | # Kill Xvfb now that the command has exited.
173 | kill $XVFBPID
174 |
175 | # Clean up.
176 | XAUTHORITY=$AUTHFILE xauth remove ":$SERVERNUM" >"$ERRORFILE" 2>&1
177 | if [ -n "$XVFB_RUN_TMPDIR" ]; then
178 | if ! rm -r "$XVFB_RUN_TMPDIR"; then
179 | error "problem while cleaning up temporary directory"
180 | exit 5
181 | fi
182 | fi
183 |
184 | # Return the executed command's exit status.
185 | exit $RETVAL
186 |
187 | # vim:set ai et sts=4 sw=4 tw=80:
188 |
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd "`dirname $0`"
4 |
5 | if [ $UID != 0 -a $EUID != 0 ]
6 | then
7 | echo You must be root to run the installer
8 | exit
9 | fi
10 |
11 | # Whatever the contents of $CONF we expect to see at least a
12 | # ${CONF}_params.sh and a ${CONF}_output.sh
13 | #
14 | # We may also optionally find ${CONF}_pre.sh and ${CONF}_install.sh
15 | # and if we find them we run them before and after
16 |
17 | # bootstrap bashconf
18 | git submodule init
19 | git submodule update
20 |
21 |
22 | export CONF=config/ootb
23 | source bashconf/bashconf.sh
24 |
--------------------------------------------------------------------------------
/install/customise-go.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # This file exists to support travis build which makes it difficult
4 | # to create this file directly due to strange escaping issues,
5 | # however it may find other automation uses
6 |
7 | echo "class { 'alfresco':" > go.pp
8 |
9 | while (( "$#" ))
10 | do
11 |
12 | # should be in the format of puppet_fact=value
13 | OVERRIDE=$1
14 | FACT=`echo $OVERRIDE | cut -f1 -d=`
15 | VALUE=`echo $OVERRIDE | cut -f2 -d=`
16 |
17 | echo " ${FACT} => '${VALUE}'," >> go.pp
18 |
19 | shift
20 | done
21 |
22 | echo "}" >> go.pp
23 |
--------------------------------------------------------------------------------
/install/docker-build.sh:
--------------------------------------------------------------------------------
1 | cd `dirname "$0"`/..
2 | docker build -t puppet-alfresco-build .
3 |
--------------------------------------------------------------------------------
/install/docker-run.sh:
--------------------------------------------------------------------------------
1 | cd `dirname "$0"`/..
2 | docker run -ti puppet-alfresco-build
3 |
--------------------------------------------------------------------------------
/install/hiera.yaml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/marsbard/puppet-alfresco/019d3ec5c7306856109bc0494bd7bca326ead785/install/hiera.yaml
--------------------------------------------------------------------------------
/install/inc-puppet.sh:
--------------------------------------------------------------------------------
1 |
2 | function install_puppet {
3 | echo Installing puppet
4 | if [ -f /etc/redhat-release ]
5 | then
6 | #EL_MAJ_VER=`head -n1 /etc/redhat-release | cut -f4 -d\ | cut -f1 -d.`
7 | #EL_MAJ_VER=`uname -rv | cut -f2 -d.`
8 | EL_MAJ_VER=`rpm -qa \*-release | grep -Ei "oracle|redhat|centos" | cut -d"-" -f3`
9 | rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-${EL_MAJ_VER}.noarch.rpm
10 | yum install -y puppet
11 | fi
12 |
13 | if [ -f /etc/debian_version ]
14 | then
15 | apt-get update
16 | apt-get install apt-utils -y
17 |
18 | export DEBIAN_FRONTEND=noninteractive
19 | wget http://apt.puppetlabs.com/puppetlabs-release-trusty.deb
20 | apt-get install puppet -y
21 |
22 | fi
23 | }
24 |
--------------------------------------------------------------------------------
/install/modules-for-vagrant.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #gem install librarian-puppet
4 | #cd ..
5 | #librarian-puppet install --verbose
6 |
7 | #exit 0
8 |
9 | MODULES="puppetlabs-mysql puppetlabs-stdlib stankevich-python puppetlabs-apache puppetlabs-apt\
10 | puppetlabs-concat spantree/java8 puppetlabs-vcsrepo"
11 |
12 | OS=`head -n1 /etc/issue | cut -f1 -d\ `
13 |
14 | if [ -e "/etc/redhat-release" ]
15 | then
16 | MODULES="$MODULES stahnma-epel"
17 | fi
18 |
19 | if [ ! -x `which puppet` ]
20 | then
21 | echo Puppet executable not found
22 | exit 99
23 | fi
24 |
25 |
26 |
27 | mkdir -p modules
28 | for mod in $MODULES
29 | do
30 | TRY=0
31 | while [ $TRY -lt 3 ]
32 | do
33 | # https://github.com/marsbard/puppet-alfresco/issues/63
34 | if [ "$mod" = "puppetlabs-concat" ]
35 | then
36 | puppet module install --version 1.2.2 --force $mod --target-dir=modules
37 | else
38 | puppet module install --force $mod --target-dir=modules
39 | fi
40 | if [ $? = 0 ]; then TRY=3; else
41 | if [ $TRY -lt 3 ]
42 | then
43 | echo Transient failure, retrying
44 | else
45 | echo Failed to install $mod
46 | exit 99
47 | fi
48 | fi
49 | TRY=$(( TRY++ ))
50 | done
51 | done
52 |
--------------------------------------------------------------------------------
/install/setup-for-puppetmaster.sh:
--------------------------------------------------------------------------------
1 |
2 | cd "`dirname $0`"/..
3 |
4 | if [ -f .IS_VAGRANT ]
5 | then
6 | echo Sorry, this has been set up for vagrant. 'rm .IS_VAGRANT' to change. YMMV.
7 | fi
8 |
9 | if [ -f .IS_STANDALONE ]
10 | then
11 | echo Sorry, this has been set up for standalone. 'rm .IS_STANDALONE' to change. YMMV.
12 | fi
13 |
14 | if [ ! -f .IS_PUPPETMASTER ]
15 | then
16 |
17 | touch .IS_PUPPETMASTER
18 |
19 | git submodule init
20 | git submodule update
21 |
22 | else
23 | echo This has previously been set up for puppetmaster. 'rm .IS_PUPPETMASTER' to change. YMMV.
24 | fi
25 |
--------------------------------------------------------------------------------
/install/setup-for-standalone.sh:
--------------------------------------------------------------------------------
1 |
2 | cd "`dirname $0`"/..
3 |
4 | if [ -f .IS_VAGRANT ]
5 | then
6 | echo Sorry, this has been set up for vagrant "(.IS_VAGRANT)"
7 | fi
8 |
9 | if [ -f .IS_PUPPETMASTER ]
10 | then
11 | echo Sorry, this has been set up for puppetmaster "(.IS_PUPPETMASTER)"
12 | fi
13 |
14 | if [ ! -f .IS_STANDALONE ]
15 | then
16 |
17 | touch .IS_STANDALONE
18 |
19 | git submodule init
20 | git submodule update
21 |
22 | if [ ! -d modules -a ! -d modules/alfresco ]
23 | then
24 | mkdir modules/alfresco -p
25 | for d in lib files manifests templates
26 | do
27 | ln -s ${PWD}/${d} ${PWD}/modules/alfresco/${d}
28 | done
29 | fi
30 |
31 |
32 | echo Now run: sudo ./install.sh
33 |
34 | else
35 | echo Already set up as standalone "(.IS_STANDALONE)"
36 | fi
37 |
--------------------------------------------------------------------------------
/install/setup-for-vagrant.sh:
--------------------------------------------------------------------------------
1 |
2 | cd "`dirname $0`"/..
3 |
4 | DIRS="lib files manifests templates"
5 |
6 | if [ -f .IS_STANDALONE ]
7 | then
8 | echo Sorry, this has been set up for standalone
9 | fi
10 |
11 | if [ -f .IS_PUPPETMASTER ]
12 | then
13 | echo Sorry, this has bene set up for puppetmaster
14 | fi
15 |
16 | if [ ! -f .IS_VAGRANT ]
17 | then
18 |
19 | touch .IS_VAGRANT
20 |
21 | git submodule init
22 | git submodule update
23 |
24 | if [ ! -d modules -a ! -d modules/alfresco ]
25 | then
26 | mkdir modules/alfresco -p
27 | for d in $DIRS
28 | do
29 | cp -r ${PWD}/${d} ${PWD}/modules/alfresco/${d}
30 | done
31 | fi
32 |
33 | ## set up a hook to make sure the copied folders are kept up to
34 | ## date
35 | # cat > .git/hooks/pre-commit <&1 | awk '/^ HTTP/{print $2}' | tail -n 1`
69 | echo "$COUNT - $RES"
70 | if [ "$RES" == "" ]; then RES=999; fi
71 | if [ "$RES" -le 299 ]
72 | then
73 | READY=true
74 | else
75 | echo "Response was $RES, waiting $TIMEWAIT secs, showing current top status and last alfresco log tail"
76 | echo "---8<---"
77 | banner "ps ax | grep alf"
78 | ps ax | grep alf
79 | banner "top | head"
80 | `dirname "$0"`/tophead.sh
81 | #iostat No iostat inside openvz container
82 | banner mpstat
83 | mpstat
84 | banner beancounters
85 | sudo cat /proc/user_beancounters
86 | banner Tail of $LOGTOTAIL
87 | tail $LOGTOTAIL
88 | NEWLASTLOGLINE=`tail -n1 $LOGTOTAIL`
89 | if [ "$NEWLASTLOGLINE" == "$LASTLOGLINE" ]
90 | then
91 | banner Job looks stuck, restarting
92 | #TOMCATPID=`service tomcat status 2>&1 | awk 'NF>1{print $NF}'`
93 | #echo TOMCATPID=$TOMCATPID
94 | #sudo kill -9 $TOMCATPID
95 | #killall -9 mysqld
96 | #sudo service mysql start
97 | #killall -9 java
98 | #sudo /etc/init.d/tomcat start
99 | #sleep 30
100 | #sudo reboot
101 | banner reboot
102 | sudo reboot
103 | sleep 30
104 | fi
105 | LASTLOGLINE=$NEWLASTLOGLINE
106 | banner Examining killed processes
107 | sudo dmesg | egrep -i 'killed process'
108 | if [ "`dmesg | egrep -i 'killed process'`" != "" ]
109 | then
110 | banner "OOM Killer got me, restarting"
111 | sudo reboot
112 | sleep 30
113 | fi
114 | echo "---8<---"
115 | banner "[ `date` ] Sleeping for $TIMEWAIT seconds"
116 | sleep $TIMEWAIT
117 | fi
118 | done
119 |
120 |
--------------------------------------------------------------------------------
/lib/puppet/parser/functions/calc_ntlm_hash.rb:
--------------------------------------------------------------------------------
1 | require 'shellwords'
2 |
3 | module Puppet::Parser::Functions
4 | newfunction(:calc_ntlm_hash, :type => :rvalue ) do |args|
5 | admin_pass = args[0]
6 |
7 | # WHAT WE WANT TO DO:
8 | # In shell it is this:
9 | # PASSWD_HASH=`iconv -f ASCII -t UTF-16LE <(printf "${PASSWD}") | openssl dgst -md4 | cut -f2 -d\ `
10 |
11 | command = Shellwords.escape(' iconv -f ASCII -t UTF-16LE <(printf "' << admin_pass << '") | openssl dgst -md4 | cut -f2 -d\ ')
12 |
13 | hash = `bash -c #{command}`
14 |
15 | return hash
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/manifests/addons.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons inherits alfresco {
2 |
3 | include alfresco::addons::rm
4 | include alfresco::addons::jsconsole
5 |
6 | # TODO work out the wrapping up of jar into amp correctly
7 | #class { 'alfresco::addons::webscripts':
8 | #}
9 |
10 | #class { 'alfresco::addons::filebrowser':
11 | #}
12 |
13 | class { 'alfresco::addons::ootbfrontpage':}
14 |
15 | class { 'alfresco::addons::monitorix': }
16 |
17 | class { 'alfresco::addons::ootbbeetheme':
18 | notify => Exec['apply-addons'],
19 | }
20 |
21 | # TODO this should be optional based on a parameter
22 | #class { 'alfresco::addons::aaar':
23 | # notify => Exec['apply-addons'],
24 | #}
25 |
26 | class { 'alfresco::addons::uploader_plus':
27 | notify => Exec['apply-addons'],
28 | }
29 |
30 | class { 'alfresco::addons::googledocs':
31 | notify => Exec['apply-addons'],
32 | }
33 |
34 | class { 'alfresco::addons::reset_password':
35 | # it's a jar so just notify alfresco, not apply addons
36 | notify => Service['alfresco-start'],
37 | }
38 |
39 | exec { "apply-addons":
40 | require => [
41 | File["${alfresco_base_dir}/bin/apply_amps.sh"],
42 | File["${alfresco_base_dir}/bin/alfresco-mmt.jar"],
43 | ],
44 | path => "/bin:/usr/bin",
45 | command => "${alfresco_base_dir}/bin/apply_amps.sh",
46 | onlyif => "test ! -f ${tomcat_home}/webapps/alfresco*.bak",
47 | user => 'tomcat',
48 | notify => Service['alfresco-start'],
49 | }
50 |
51 | file { "${alfresco_base_dir}/bin/apply_amps.sh":
52 | ensure => present,
53 | mode => "0755",
54 | content => template("alfresco/apply_amps.sh.erb"),
55 | require => File["${alfresco_base_dir}/bin"],
56 | owner => 'tomcat',
57 | }
58 |
59 | file { "${alfresco_base_dir}/bin/clean_tomcat.sh":
60 | ensure => present,
61 | mode => '0755',
62 | #source => "${download_path}/alfresco/bin/clean_tomcat.sh",
63 | source => 'puppet:///modules/alfresco/clean_tomcat.sh',
64 | require => File["${alfresco_base_dir}/bin"],
65 | owner => 'tomcat',
66 | }
67 |
68 | file { "${alfresco_base_dir}/bin/makeimagemagicklink.sh":
69 | ensure => present,
70 | mode => '0755',
71 | content => template('alfresco/makeimagemagicklink.sh.erb'),
72 | require => File["${alfresco_base_dir}/bin"],
73 | owner => 'tomcat',
74 | notify => Service['tomcat'],
75 | }
76 |
77 | exec { "check_imagemagicklink":
78 | command => '/bin/true',
79 | onlyif => "/usr/bin/test -e ${alfresco_base_dir}/ImageMagickCoders",
80 | }
81 |
82 | exec { "makeimagemagicklink":
83 | path => "/bin:/usr/bin",
84 | command => "${alfresco_base_dir}/bin/makeimagemagicklink.sh",
85 | creates => "${alfresco_base_dir}/ImageMagickCoders/",
86 | notify => Service['tomcat'],
87 | require => Exec["check_imagemagicklink"],
88 | }
89 |
90 |
91 | file { "${alfresco_base_dir}/bin/alfresco-mmt.jar":
92 | ensure => present,
93 | mode => '0755',
94 | #source => "${download_path}/alfresco/bin/alfresco-mmt.jar",
95 | source => 'puppet:///modules/alfresco/alfresco-mmt.jar',
96 | require => File["${alfresco_base_dir}/bin"],
97 | owner => 'tomcat',
98 | }
99 |
100 | #exec { "fix-war-permissions":
101 | # path => "/bin:/usr/bin",
102 | # command => "chown tomcat ${tomcat_home}/webapps/*.war; chmod a+r ${tomcat_home}/webapps/*.war",
103 | # onlyif => [
104 | # "test -f ${tomcat_home}/webapps/alfresco.war && ls -l ${tomcat_home}/webapps/alfresco.war | xargs | cut -f3 -d\ | grep tomcat",
105 | # "test -f ${tomcat_home}/webapps/share.war && ls -l ${tomcat_home}/webapps/share.war | xargs | cut -f3 -d\ | grep tomcat",
106 | # "test -r ${tomcat_home}/webapps/alfresco.war",
107 | # "test -r ${tomcat_home}/webapps/share.war",
108 | # ]
109 | #}
110 |
111 | # exec { "unpack-alfresco-war":
112 | # require => [
113 | # Exec["${tomcat_home}/webapps/alfresco.war"],
114 | # Exec['apply-addons'],
115 | # ],
116 | # path => "/bin:/usr/bin",
117 | # command => "unzip -o -d ${tomcat_home}/webapps/alfresco ${tomcat_home}/webapps/alfresco.war && chown -R tomcat ${tomcat_home}/webapps/alfresco",
118 | # creates => "${tomcat_home}/webapps/alfresco/",
119 | # notify => Service['tomcat'],
120 | # }
121 | #
122 | # exec { "unpack-share-war":
123 | # require => [
124 | # Exec["${tomcat_home}/webapps/share.war"],
125 | # Exec['apply-addons'],
126 | # ],
127 | # path => "/bin:/usr/bin",
128 | # command => "unzip -o -d ${tomcat_home}/webapps/share ${tomcat_home}/webapps/share.war && chown -R tomcat ${tomcat_home}/webapps/share",
129 | # creates => "${tomcat_home}/webapps/share/",
130 | # notify => Service['tomcat'],
131 | # }
132 |
133 | }
134 |
--------------------------------------------------------------------------------
/manifests/addons/aaar.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::aaar inherits alfresco::addons {
2 |
3 | $aaarbase = "https://github.com/fcorti/alfresco-audit-analysis-reporting/releases/download/v4.1"
4 |
5 | case($alfresco_version){
6 | '4.2.f': {
7 | $aaarrepofile = "AAAR-Alfresco-CE-v4.2-Repository-v1.2.amp"
8 | $aaarsharefile = "AAAR-Alfresco-CE-v4.2-Share-v1.2.amp"
9 | }
10 | '5.0.x': {
11 | $aaarrepofile = "AAAR-Alfresco-CE-v5.0.d-Repository-v1.2.amp"
12 | $aaarsharefile = "AAAR-Alfresco-CE-v5.0.d-Share-v1.2.amp"
13 | }
14 | '5.1.x': {
15 | $aaarrepofile = "AAAR-Alfresco-CE-v5.1-Repository-v1.2.amp"
16 | $aaarsharefile = "AAAR-Alfresco-CE-v5.1-Share-v1.2.amp"
17 | }
18 | 'NIGHTLY': {
19 | $aaarrepofile = "AAAR-Alfresco-CE-v5.1-Repository-v1.2.amp"
20 | $aaarsharefile = "AAAR-Alfresco-CE-v5.1-Share-v1.2.amp"
21 | }
22 | }
23 | $aaarshareurl = "${aaarbase}/${aaarsharefile}"
24 | $aaarrepourl = "${aaarbase}/${aaarrepofile}"
25 |
26 |
27 | alfresco::safe_download { 'aaar-repo':
28 | url => $aaarrepourl,
29 | filename => $aaarrepofile,
30 | download_path => "${alfresco_base_dir}/amps",
31 | }
32 |
33 | alfresco::safe_download { 'aaar-share':
34 | url => $aaarshareurl,
35 | filename => $aaarsharefile,
36 | download_path => "${alfresco_base_dir}/amps_share",
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/manifests/addons/filebrowser.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::filebrowser inherits alfresco::addons {
2 |
3 | vcsrepo { "/var/www/${domain_name}":
4 | ensure => present,
5 | provider => git,
6 | source => 'https://github.com/joni2back/angular-filemanager.git',
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/manifests/addons/googledocs.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::googledocs inherits alfresco::addons {
2 | case($alfresco_version){
3 | '4.2.f': {
4 | $gdrepofile = "alfresco-googledocs-repo-2.0.7-18com.amp"
5 | $gdrepourl = "http://dl.alfresco.com/release/community/4.2.f-build-00012/${gdrepofile}"
6 | $gdsharefile = "alfresco-googledocs-share-2.0.7-18com.amp"
7 | $gdshareurl = "http://dl.alfresco.com/release/community/4.2.f-build-00012/${gdsharefile}"
8 |
9 | # ... and do nothing with them, googledocs no longer compatible with 4.2.f
10 |
11 | }
12 | '5.0.x','NIGHTLY': {
13 | $gdrepofile = "alfresco-googledocs-repo-3.0.0.amp"
14 | $gdrepourl = "https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/integrations/alfresco-googledocs-repo/3.0.0/${gdrepofile}"
15 | $gdsharefile = "alfresco-googledocs-share-3.0.0.amp"
16 | $gdshareurl = "https://artifacts.alfresco.com/nexus/service/local/repositories/releases/content/org/alfresco/integrations/alfresco-googledocs-share/3.0.0/${gdsharefile}"
17 |
18 | alfresco::safe_download { 'googledocs-repo':
19 | url => $gdrepourl,
20 | filename => $gdrepofile,
21 | download_path => "${alfresco_base_dir}/amps",
22 | }
23 |
24 | alfresco::safe_download { 'googledocs-share':
25 | url => $gdshareurl,
26 | filename => $gdsharefile,
27 | download_path => "${alfresco_base_dir}/amps_share",
28 | }
29 |
30 |
31 | }
32 |
33 |
34 |
35 | }
36 |
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/manifests/addons/jsconsole.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::jsconsole inherits alfresco::addons {
2 |
3 | $jsconsolebase = "https://github.com/share-extras/js-console/releases/download/v0.6.0-rc1"
4 |
5 | case($alfresco_version){
6 | '4.2.f': {
7 | $jsconsolerepofile = "javascript-console-repo-0.6.0.amp"
8 | $jsconsolesharefile = "javascript-console-share-0.6.0.amp"
9 | }
10 | '5.0.x': {
11 | $jsconsolerepofile = "javascript-console-repo-0.6.0.amp"
12 | $jsconsolesharefile = "javascript-console-share-0.6.0.amp"
13 | }
14 | '5.1.x': {
15 | $jsconsolerepofile = "javascript-console-repo-0.6.0.amp"
16 | $jsconsolesharefile = "javascript-console-share-0.6.0.amp"
17 | }
18 | 'NIGHTLY': {
19 | $jsconsolerepofile = "javascript-console-repo-0.6.0.amp"
20 | $jsconsolesharefile = "javascript-console-share-0.6.0.amp"
21 | }
22 | }
23 |
24 | $jsconsoleshareurl = "${jsconsolebase}/${jsconsolesharefile}"
25 | $jsconsolerepourl = "${jsconsolebase}/${jsconsolerepofile}"
26 |
27 | alfresco::safe_download { 'jsconsole-repo':
28 | url => $jsconsolerepourl,
29 | filename => $jsconsolerepofile,
30 | download_path => "${alfresco_base_dir}/amps",
31 | }
32 |
33 | alfresco::safe_download { 'jsconsole-share':
34 | url => $jsconsoleshareurl,
35 | filename => $jsconsolesharefile,
36 | download_path => "${alfresco_base_dir}/amps_share",
37 | }
38 |
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/manifests/addons/monitorix.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::monitorix inherits alfresco::addons {
2 | if ( $osfamily == "Debian" ) {
3 | # deb http://apt.izzysoft.de/ubuntu generic universe
4 |
5 | # this ends up adding 'trusty' to the source for some reason
6 | #apt::source { 'izzysoft':
7 | # location => 'http://apt.izzysoft.de/ubuntu',
8 | # repos => 'generic universe',
9 | # before => Package['monitorix'],
10 | #}
11 |
12 | file { '/tmp':
13 | ensure => directory,
14 | } ->
15 | alfresco::safe_download { 'izzysoft gpg key':
16 | url => 'http://apt.izzysoft.de/izzysoft.asc',
17 | filename => 'izzysoft.asc',
18 | download_path => '/tmp',
19 | } ->
20 | exec { '/usr/bin/apt-key add /tmp/izzysoft.asc':
21 | } ->
22 | file { '/etc/apt/sources.list.d/izzysoft.list':
23 | ensure => present,
24 | content => "deb http://apt.izzysoft.de/ubuntu generic universe",
25 | } ->
26 | exec { '/usr/bin/apt-get update':
27 | before => Package['monitorix'],
28 | }
29 |
30 | }
31 |
32 | if ( $osfamily == "RedHat" ) {
33 | yumrepo { 'izzysoft':
34 | baseurl => 'http://apt.izzysoft.de/redhat',
35 | gpgkey => 'http://apt.izzysoft.de/izzysoft.asc',
36 | before => Package['monitorix'],
37 | }
38 | }
39 |
40 | package { 'monitorix':
41 | ensure => installed,
42 | } ->
43 | file { '/etc/monitorix/monitorix.conf':
44 | content => template('alfresco/monitorix.conf.erb'),
45 | ensure => present,
46 | } ~>
47 | service {'monitorix':
48 | ensure => running,
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/manifests/addons/ootbbeetheme.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::ootbbeetheme inherits alfresco::addons {
2 |
3 | alfresco::safe_download { 'addons::ootbbeetheme-share':
4 | url => 'https://github.com/digcat/honeycomb-beeTheme/releases/download/1.0.0/alfrescoThemes_beeTheme.amp',
5 | filename => 'alfrescoThemes_beeTheme.amp',
6 | download_path => "${alfresco_base_dir}/amps_share",
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/manifests/addons/ootbfrontpage.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::ootbfrontpage inherits alfresco::addons {
2 |
3 | vcsrepo { "/var/www/${domain_name}":
4 | ensure => present,
5 | provider => git,
6 | source => 'https://github.com/digcat/honeycomb-frontpage.git',
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/manifests/addons/reset_password.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::reset_password inherits alfresco::addons {
2 |
3 | alfresco::safe_download { 'addons::reset-password':
4 | url => "https://github.com/share-extras/reset-password-dialog/releases/download/v2.1.0/reset-password-dialog-2.1.0.jar",
5 | filename => "reset-password-dialog-2.1.0.jar",
6 | download_path => "${tomcat_home}/shared/lib",
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/manifests/addons/rm.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::rm inherits alfresco::addons {
2 |
3 | case($alfresco_version){
4 | '4.2.f': {
5 | $recmanpath = 'http://download2.polytechnic.edu.na/pub4/sourceforge/a/al/alfresco/Alfresco%204.2.f%20Community'
6 | $recmanfile = 'alfresco-rm-2.1.a-621.zip'
7 | $recmanrepo = 'alfresco-rm-2.1.0-621.amp'
8 | $recmanshare = 'alfresco-rm-share-2.1.0-621.amp'
9 |
10 | # MC assuming that this is the correct creates for 4.2.f, certainly isn't for 5.0.x
11 | $recmancreates = "${download_path}/rm/README.txt"
12 | }
13 | '5.0.x','NIGHTLY':{
14 | $recmanpath = 'http://dl.alfresco.com/release/community/5.0.d-build-00002'
15 | $recmanfile = 'alfresco-rm-2.3.c.zip'
16 | $recmanrepo = 'alfresco-rm-server-2.3.c.amp'
17 | $recmanshare = 'alfresco-rm-share-2.3.c.amp'
18 | $recmancreates = "${download_path}/rm/${recmanrepo}"
19 | }
20 | default: {
21 | fail("Unsupported version ${alfresco_version}")
22 | }
23 | }
24 | $filename_rm = $recmanfile
25 | $url_rm = "${recmanpath}/${filename_rm}"
26 | #$rm_repo = $repofilename
27 | #$rm_share = $sharefilename
28 |
29 | alfresco::safe_download { 'addons::rm':
30 | url => $url_rm,
31 | filename => $filename_rm,
32 | download_path => $download_path,
33 | }
34 |
35 | exec { "unpack-rm":
36 | user => 'tomcat',
37 | creates => "${recmancreates}",
38 | cwd => "${download_path}/rm",
39 | command => "unzip -o ${download_path}/${filename_rm}",
40 | require => [
41 | File["${download_path}/rm"],
42 | Alfresco::Safe_download['addons::rm'],
43 | Package["unzip"],
44 | ],
45 | path => "/usr/bin",
46 | }
47 |
48 |
49 | file { "${download_path}/rm":
50 | ensure => directory,
51 | before => Exec["unpack-rm"],
52 | owner => 'tomcat',
53 | }
54 |
55 | file { "${alfresco_base_dir}/amps/${recmanrepo}":
56 | source => "${download_path}/rm/${recmanrepo}",
57 | ensure => present,
58 | require => [
59 | Exec["unpack-rm"],
60 | ],
61 | notify => Exec["apply-addons"],
62 | owner => 'tomcat',
63 | }
64 |
65 | file { "${alfresco_base_dir}/amps_share/${recmanshare}":
66 | source => "${download_path}/rm/${recmanshare}",
67 | ensure => present,
68 | require => [
69 | Exec["unpack-rm"],
70 | ],
71 | notify => Exec["apply-addons"],
72 | owner => 'tomcat',
73 | }
74 |
75 |
76 | }
77 |
78 |
--------------------------------------------------------------------------------
/manifests/addons/uploader_plus.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::uploader_plus inherits alfresco::addons {
2 |
3 | alfresco::safe_download { 'addons::uploader_plus-repo':
4 | url => 'https://github.com/softwareloop/uploader-plus/releases/download/v1.2/uploader-plus-repo-1.2.amp',
5 | filename => 'uploader-plus-repo-1.2.amp',
6 | download_path => "${alfresco_base_dir}/amps",
7 | }
8 |
9 | alfresco::safe_download { 'addons::uploader_plus-share':
10 | url => 'https://github.com/softwareloop/uploader-plus/releases/download/v1.2/uploader-plus-surf-1.2.amp',
11 | filename => 'uploader-plus-surf-1.2.amp',
12 | download_path => "${alfresco_base_dir}/amps_share",
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/manifests/addons/webscripts.pp:
--------------------------------------------------------------------------------
1 | class alfresco::addons::webscripts inherits alfresco::addons {
2 |
3 | $createsite_files = [
4 | 'create-site.get.desc.xml',
5 | 'create-site.get.html.ftl',
6 | 'create-site.get.js',
7 | ]
8 |
9 |
10 | file { ["${download_path}/webscripts",
11 | "${download_path}/webscripts/alfresco",
12 | "${download_path}/webscripts/alfresco/extension",
13 | "${download_path}/webscripts/alfresco/extension/templates",
14 | "${download_path}/webscripts/alfresco/extension/templates/webscripts",
15 | "${download_path}/webscripts/alfresco/extension/templates/webscripts/org",
16 | "${download_path}/webscripts/alfresco/extension/templates/webscripts/org/orderofthebee",
17 | "${download_path}/webscripts/alfresco/extension/templates/webscripts/org/orderofthebee/create-site",
18 | ] :
19 | ensure => directory,
20 | }
21 |
22 | file { "${alfresco_base_dir}/bin/jar-to-amp.sh":
23 | mode => '0775',
24 | source => "puppet:///modules/alfresco/jar-to-amp.sh",
25 | ensure => present,
26 | }
27 |
28 | define webscript-copy (
29 | $file=$title,
30 | $qual
31 | ) {
32 | file {"${alfresco::download_path}/webscripts/alfresco/extension/templates/webscripts/${qual}/${file}":
33 | ensure => file,
34 | owner => tomcat,
35 | group => tomcat,
36 | mode => '0644',
37 | source => "puppet:///modules/alfresco/webscripts/create-site/${file}",
38 | }
39 | }
40 |
41 | webscript-copy { $createsite_files:
42 | qual => "org/orderofthebee/create-site",
43 | }
44 |
45 |
46 | exec { "pack-createsite-jar":
47 | cwd => "${download_path}/webscripts",
48 | command => "zip -r create-site.jar alfresco/extension/templates/webscripts/org/orderofthebee/create-site",
49 | path => "/usr/bin",
50 | creates => "${download_path}/webscripts/create-site.jar",
51 | require => Webscript-copy[$createsite_files],
52 | }
53 |
54 | exec { "jar-to-amp-createsite":
55 | command => "${alfresco_base_dir}/bin/jar-to-amp.sh '${download_path}/webscript/create-site.jar' org.orderofthebee.webscripts.create-site create-site 0.1 '${alfresco_base_dir}/amps/create-site-0.1.amp' 'script to create a site'",
56 | creates => "${alfresco_base_dir}/amps/create-site-0.1.amp",
57 | require => Exec['pack-createsite-jar'],
58 | before => Exec['apply-addons'],
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/manifests/aptcache.pp:
--------------------------------------------------------------------------------
1 | class alfresco::aptcache inherits alfresco {
2 |
3 | if $apt_cache_host != '' {
4 |
5 | #Configure apt to use apt-cacher-ng
6 | class {'apt':
7 | proxy_host => $apt_cache_host,
8 | proxy_port => $apt_cache_port,
9 | }
10 |
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/manifests/backup.pp:
--------------------------------------------------------------------------------
1 | class alfresco::backup (
2 | $alfresco_base_dir,
3 | $backup_at_hour = 2,
4 | $backup_at_min = fqdn_rand(59),
5 | $duplicity_password = '',
6 | $fulldays = '30D',
7 | $backup_policies_enabled = 'true',
8 | $clean_time = '12M',
9 | $maxfull = 6,
10 | $volume_size = 25,
11 | $duplicity_log_verbosity = 4,
12 | $backuptype = 'local', # s3, ftp, scp, local
13 | $local_backup_folder = '/mnt/backup',
14 | $aws_access_key_id = '',
15 | $aws_secret_access_key = '',
16 | $s3filesyslocation = 's3+http://your-bucket-name',
17 | $ftp_server = '',
18 | $ftp_user = '',
19 | $ftp_password = '',
20 | $ftp_folder = '',
21 | $ftp_port = 21,
22 | $ftps_enable = 'false',
23 | $scp_server = '',
24 | $scp_user = '',
25 | $scp_folder = '',
26 | ) {
27 |
28 |
29 | # TODO is there a safer way to make a password without using generate()
30 | # yes - pass it in from above - but leave the example here for now
31 | #$duplicity_password = generate("tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1")
32 |
33 |
34 | $pkgs = [ 'duplicity', 'gzip', 'lftp' ]
35 | package { $pkgs:
36 | ensure => present,
37 | }
38 |
39 | file { "${alfresco_base_dir}/scripts/alfresco-bart.sh":
40 | ensure => present,
41 | content => template('alfresco/alfresco-bart.sh.erb'),
42 | mode => '0755',
43 | } ->
44 | file { "${alfresco_base_dir}/scripts/alfresco-bart.properties":
45 | ensure => present,
46 | content => template('alfresco/alfresco-bart.properties.erb'),
47 | }
48 |
49 | cron { alfresco-bart:
50 | command => "${alfresco_base_dir}/scripts/alfresco-bart.sh backup",
51 | user => tomcat,
52 | hour => $backup_at_hour,
53 | minute => $backup_at_min,
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/manifests/config.pp:
--------------------------------------------------------------------------------
1 | class alfresco::config inherits alfresco {
2 |
3 | case $::osfamily {
4 | 'RedHat': {
5 | $init_template = "alfresco/tomcat-systemd-centos.erb"
6 | }
7 | 'Debian': {
8 | $init_template = "alfresco/tomcat-systemd-ubuntu.erb"
9 | }
10 | }
11 |
12 | file { "/etc/systemd":
13 | ensure => directory,
14 | } ->
15 | file { "/etc/systemd/system":
16 | ensure => directory,
17 | } ->
18 | file { "/etc/systemd/system/tomcat.service":
19 | ensure => present,
20 | content => template($init_template),
21 | before => Service["alfresco-start"],
22 | }
23 |
24 | if($osfamily == "Debian") {
25 | # tomcat memory set in here TODO: what TODO for Centos?
26 | file { "/etc/default/tomcat":
27 | require => Exec["copy tomcat to ${tomcat_home}"],
28 | content => template("alfresco/default-tomcat.erb")
29 | }
30 | }
31 |
32 | file { "${tomcat_home}/shared/classes/alfresco-global.properties":
33 | require => File["${tomcat_home}/shared/classes"],
34 | content => template("alfresco/alfresco-global.properties.erb"),
35 | ensure => present,
36 | owner => 'tomcat',
37 | }
38 |
39 | file { "${tomcat_home}/shared/classes/alfresco/web-extension/share-config-custom.xml":
40 | require => File["${tomcat_home}/shared/classes/alfresco/web-extension"],
41 | ensure => present,
42 | owner => 'tomcat',
43 | content => template('alfresco/share-config-custom.xml.erb'),
44 | }
45 |
46 | #file { "/etc/init.d/tomcat":
47 | # ensure => present,
48 | # content => template($init_template),
49 | # mode => "0755",
50 | # owner => 'tomcat',
51 | #}
52 |
53 | file { "${tomcat_home}/conf/server.xml":
54 | ensure => present,
55 | source => 'puppet:///modules/alfresco/server.xml',
56 | owner => 'tomcat',
57 | }
58 |
59 | file { "${tomcat_home}/conf/catalina.properties":
60 | ensure => present,
61 | source => 'puppet:///modules/alfresco/catalina.properties',
62 | owner => 'tomcat',
63 | }
64 |
65 |
66 | file { "${tomcat_home}/conf/tomcat-users.xml":
67 | ensure => present,
68 | require => Exec['unpack-tomcat'],
69 | source => 'puppet:///modules/alfresco/tomcat-users.xml',
70 | owner => 'tomcat',
71 | }
72 |
73 | # admin password
74 |
75 | #exec { "set-admin-password":
76 | # command => "${alfresco_base_dir}/bin/update-admin-passwd.sh ${admin_pass} ${db_name} ${db_user} ${db_pass} && touch ${alfresco_base_dir}/.puppet_set_admin_passwd",
77 | # path => "/bin:/usr/bin",
78 | # creates => "${alfresco_base_dir}/.puppet_set_admin_passwd",
79 | # require => Exec["unzip-alfresco_ce"],
80 | #}
81 |
82 |
83 |
84 | # # patch file to update admin password
85 | # file { "${tomcat_home}/webapps/alfresco/WEB-INF/classes/alfresco/dbscripts/upgrade/4.2/org.hibernate.dialect.MySQLInnoDBDialect/admin-passwd-update.sql":
86 | # content => template("alfresco/admin-passwd-update.sql.erb"),
87 | # ensure => present,
88 | # require => Exec["unzip-alfresco_ce"],
89 | # }
90 |
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/manifests/download_file.pp:
--------------------------------------------------------------------------------
1 | # http://projects.puppetlabs.com/projects/1/wiki/Download_File_Recipe_Patterns
2 | define alfresco::download_file(
3 | $site="",
4 | $cwd="",
5 | $creates="",
6 | $require="",
7 | $user="") {
8 |
9 | alfresco::safe_download { $name:
10 | url => "${site}/${name}",
11 | filename => $name,
12 | user => $user,
13 | download_path => $cwd,
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/manifests/ensure_packages.pp:
--------------------------------------------------------------------------------
1 | define alfresco::ensure_packages ($ensure = "present") {
2 | if defined(Package[$title]) {}
3 | else {
4 | package { $title : ensure => $ensure, }
5 | }
6 | }
7 |
8 |
--------------------------------------------------------------------------------
/manifests/init.pp:
--------------------------------------------------------------------------------
1 | # == Class: alfresco
2 | #
3 | # A class to install Alfresco CE
4 | #
5 | # === Parameters
6 | #
7 | # [*domain_name*]
8 | # Domain name at which the installation will be resolved, e.g.
9 | # 'test.orderofthebee.org'
10 | #
11 | # [*alfresco_base_dir*]
12 | # Where alfresco base folder is, i.e. location of alf_data. Defaults
13 | # to '/opt/alfresco'
14 | #
15 | # [*tomcat_home*]
16 | # Where to install tomcat. Defaults to '/opt/alfresco/tomcat'
17 | #
18 | # [*mail_from_default*]
19 | # Default mail address to use in the 'From' field of sent mails
20 | #
21 | # [*alfresco_version*]
22 | # '4.2.f', '5.0.x', or 'NIGHTLY'
23 | #
24 | # [*download_path*]
25 | # Where to store downloaded files. Defaults to '/opt/downloads'
26 | #
27 | # [*db_root_password*]
28 | # Root password to use when setting up mysql
29 | #
30 | # [*db_user*]
31 | # Database user. Defaults to 'alfresco'
32 | #
33 | # [*db_pass*]
34 | # Password for database user. Defaults to 'alfresco'
35 | #
36 | # [*db_name*]
37 | # Name of database. Defaults to 'alfresco'
38 | #
39 | # [*db_host*]
40 | # Hostname of database. Not really useful yet. In future, if this
41 | # is localhost then the DB will be installed locally, if anything
42 | # else then no local DB server is installed
43 | #
44 | # [*db_port*]
45 | # Port of DB server. Default to 3306.
46 | #
47 | # [*mail_host*]
48 | # Address of mail server who will accept mail from us. If left as
49 | # 'localhost' then postfix will be installed locally
50 | #
51 | # [*mem_xmx*]
52 | # Equivalent to the -Xmx switch
53 | #
54 | # [*mem_xxmaxpermsize*]
55 | # Equivalent to the -XX:MaxPermSize switch
56 | #
57 | #
58 | #
59 | # === Examples
60 | #
61 | # class { 'alfresco':
62 | # domain_name => "test.orderofthebee.org",
63 | # mail_from_default => "admin@test.orderofthebee.org",
64 | # }
65 | #
66 | # === Authors
67 | #
68 | # Author Name
69 | #
70 | # === Copyright
71 | #
72 | # Copyright 2011 Your name here, unless otherwise noted.
73 | #
74 |
75 | class alfresco (
76 | $domain_name = $alfresco::params::domain_name,
77 | $initial_admin_pass = $alfresco::params::initial_admin_pass,
78 | $mail_from_default = $alfresco::params::mail_from_default,
79 | $alfresco_base_dir = $alfresco::params::alfresco_base_dir,
80 | $tomcat_home = $alfresco::params::tomcat_home,
81 | $alfresco_version = $alfresco::params::alfresco_version,
82 | $download_path = $alfresco::params::download_path,
83 | $db_root_password = $alfresco::params::db_root_password ,
84 | $db_user = $alfresco::params::db_user,
85 | $db_pass = $alfresco::params::db_pass,
86 | $db_name = $alfresco::params::db_name,
87 | $db_host = $alfresco::params::db_host,
88 | $db_port = 3306,
89 | $mail_host = 'localhost',
90 | $mail_port = 25,
91 | $mem_xmx = "32G",
92 | $mem_xxmaxpermsize = "512m",
93 | $delay_before_tests = 1,
94 | $apt_cache_host = '',
95 | $apt_cache_port = 3142,
96 | $ssl_cert_path = '',
97 | $java_version = 8,
98 | $enable_proxy = true
99 | ) inherits alfresco::params {
100 |
101 | include alfresco::urls
102 |
103 | $admin_pass_hash = calc_ntlm_hash($initial_admin_pass)
104 |
105 | notice("alfresco_version = ${alfresco_version}")
106 |
107 | # add JAVA_OPTS with memory settings - TODO this won't work for CentOS
108 | $java_opts = "-Xmx${mem_xmx} -Xms${mem_xmx} -XX:MaxPermSize=${mem_xxmaxpermsize} -server"
109 |
110 | # at some point I'll use these for a non-allinone version. For now pre-empting
111 | # the change where I can but do not try editing these, please.
112 | $repo_host = $domain_name
113 | $share_host = $domain_name
114 | $solr_host = $domain_name
115 |
116 |
117 | case($alfresco_version){
118 | '4.2.f': {
119 | $alfresco_ce_url = $alfresco::urls::alfresco_ce_url
120 | $indexer = 'solr'
121 | $cmis_url = '/alfresco/s/cmis'
122 | }
123 | '5.0.x', 'NIGHTLY': {
124 | $indexer = 'solr4'
125 | $cmis_url = '/alfresco/cmisatom'
126 | }
127 | default: {
128 | fail("Unsupported version ${alfresco_version}")
129 | }
130 | }
131 |
132 |
133 |
134 | case $::osfamily {
135 | 'RedHat': {
136 | $loffice_dl="${alfresco::urls::loffice_dl_red}"
137 | $loffice_name="${alfresco::urls::loffice_name_red}"
138 | #$img_coders = "/usr/lib64/ImageMagick-6.7.8/modules-Q16/coders"
139 | }
140 | 'Debian': {
141 | $loffice_dl="${alfresco::urls::loffice_dl_deb}"
142 | $loffice_name="${alfresco::urls::loffice_name_deb}"
143 | #$img_coders = "/usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders"
144 | }
145 | default:{
146 | fail("Unsupported osfamily $osfamily")
147 | }
148 | }
149 | $lo_install_loc = "/opt/libreoffice4.2"
150 |
151 | $keystorebase = "http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/repository/config/alfresco/keystore"
152 |
153 | $alfresco_db_name = $db_name
154 | $alfresco_db_user = $db_user
155 | $alfresco_db_pass = $db_pass
156 | $alfresco_db_host = $db_host
157 | $alfresco_db_port = $db_port
158 |
159 |
160 | $alfresco_unpacked = "${download_path}/alfresco"
161 | $alfresco_war_loc = "${alfresco_unpacked}/web-server/webapps"
162 |
163 |
164 |
165 | # write a config file for BART, will also make the templated files refer to these:
166 | file { "${alfresco_base_dir}/scripts":
167 | ensure => directory,
168 | require => File[$alfresco_base_dir],
169 | } ->
170 | file { "${alfresco_base_dir}/scripts/bart.conf":
171 | ensure => present,
172 | content => "ALF_BASE_DIR=${alfresco_base_dir}\nINDEXER=${indexer}\nDB_NAME=${db_name}\nDB_PASS=${db_pass}\nDB_HOST=${db_host}\nDB_USER=${db_user}\n"
173 | }
174 |
175 |
176 | file { "/opt":
177 | ensure => directory,
178 | }
179 |
180 |
181 | #http://askubuntu.com/a/519783/33804
182 | if($osfamily == 'Debian'){
183 | exec{ "reinstall-bsdutils":
184 | command => "apt-get -y --reinstall install bsdutils",
185 | path => "/bin:/usr/bin:/sbin:/usr/sbin",
186 | creates => "/usr/bin/logger", # <-- this is what is missing on some ubuntu installs
187 | }
188 | }
189 |
190 | # on centos - no suitable provider for cron
191 | if($osfamily == 'RedHat'){
192 | package { 'cronie':
193 | ensure => installed,
194 | before => Class['alfresco::install'],
195 | }
196 | }
197 |
198 |
199 | # for some reason packages are being applied out of order, so bind them to a run stage:
200 | stage { 'deps':
201 | before => Stage['main'],
202 | }
203 | class { 'alfresco::packages':
204 | stage => 'deps',
205 | }
206 | stage { 'aptcache':
207 | before => Stage['deps'],
208 | }
209 | class { 'alfresco::aptcache':
210 | stage => 'aptcache',
211 | }
212 | stage { 'nightly':
213 | before => Stage['main'],
214 | }
215 | class { 'alfresco::nightly':
216 | }
217 |
218 | anchor { 'alfresco::begin': } ->
219 | class { 'alfresco::install': } ->
220 | class { 'alfresco::install::solr': } ->
221 | class { 'alfresco::addons': } ->
222 | class { 'alfresco::config':
223 | notify => Class['alfresco::service'],
224 | } ->
225 | class { 'alfresco::service': } ->
226 | anchor { 'alfresco::end': }
227 |
228 | }
229 |
--------------------------------------------------------------------------------
/manifests/install/alfresco_ce.pp:
--------------------------------------------------------------------------------
1 | class alfresco::install::alfresco_ce inherits alfresco::install {
2 |
3 | case ($alfresco_version){
4 | '4.2.f', '4.2.x': {
5 |
6 | alfresco::safe_download { 'alfresco_ce':
7 | url => "${alfresco::urls::alfresco_ce_url}",
8 | filename => "${alfresco::urls::alfresco_ce_filename}",
9 | download_path => $download_path,
10 | }
11 |
12 | file { "${download_path}/alfresco":
13 | ensure => directory,
14 | owner => 'tomcat',
15 | }
16 |
17 | exec { "unpack-alfresco_ce":
18 | user => 'tomcat',
19 | command => "unzip -o ${download_path}/${alfresco::urls::alfresco_ce_filename} -d ${download_path}/alfresco",
20 | path => "/usr/bin",
21 | require => [
22 | Alfresco::Safe_download['alfresco_ce'],
23 | Exec["copy tomcat to ${tomcat_home}"],
24 | Package["unzip"],
25 | File["${download_path}/alfresco"],
26 | ],
27 | creates => "${download_path}/alfresco/README.txt",
28 | }
29 |
30 |
31 | # the war files
32 | exec { "${tomcat_home}/webapps/alfresco.war":
33 | user => 'tomcat',
34 | command => "cp ${alfresco_war_loc}/alfresco.war ${tomcat_home}/webapps/alfresco.war",
35 | require => Exec["unpack-alfresco_ce"],
36 | creates => "${tomcat_home}/webapps/alfresco.war",
37 | path => '/bin:/usr/bin',
38 | notify => Service['alfresco-start']
39 | }
40 | exec { "${tomcat_home}/webapps/share.war":
41 | user => 'tomcat',
42 | command => "cp ${alfresco_war_loc}/share.war ${tomcat_home}/webapps/share.war",
43 | creates => "${tomcat_home}/webapps/share.war",
44 | path => '/bin:/usr/bin',
45 | notify => Service['alfresco-start'],
46 | require => [
47 | File["${alfresco_base_dir}/amps"],
48 | Exec["unpack-alfresco_ce"],
49 | ]
50 | }
51 | alfresco::safe_download { 'alfresco.war':
52 | url => "${alfresco::urls::alfresco_war_42x}",
53 | filename => "alfresco.war",
54 | download_path => "${tomcat_home}/webapps/",
55 | }
56 | alfresco::safe_download { 'share.war':
57 | url => "${alfresco::urls::share_war_42x}",
58 | filename => "share.war",
59 | download_path => "${tomcat_home}/webapps/",
60 | }
61 | file { "${tomcat_home}/webapps":
62 | ensure => directory,
63 | require => File["${tomcat_home}"],
64 | owner => 'tomcat',
65 | }
66 |
67 | alfresco::safe_download { 'spp':
68 | url => "${alfresco::urls::spp_v4}",
69 | filename => "${alfresco::urls::spp_v4_zipname}",
70 | download_path => $download_path,
71 | }
72 |
73 | exec { 'unpack-spp':
74 | user => 'tomcat',
75 | command => "/usr/bin/unzip ${download_path}/${alfresco::urls::spp_v4_zipname}",
76 | cwd => "${alfresco_base_dir}/amps",
77 | creates => "${alfresco_base_dir}/amps/${alfresco::urls::spp_v4_name}",
78 | require => [ File[$download_path], Alfresco::Safe_download['spp'], ],
79 | }
80 |
81 |
82 | exec { "unpack-alfresco-war":
83 | user => 'tomcat',
84 | require => [
85 | Alfresco::Safe_download["alfresco.war"],
86 | Exec['apply-addons'],
87 | ],
88 | before => Service['alfresco-start'],
89 | path => "/bin:/usr/bin",
90 | command => "unzip -o -d ${tomcat_home}/webapps/alfresco ${tomcat_home}/webapps/alfresco.war && chown -R tomcat ${tomcat_home}/webapps/alfresco",
91 | creates => "${tomcat_home}/webapps/alfresco/",
92 | }
93 |
94 | exec { "unpack-share-war":
95 | user => 'tomcat',
96 | require => [
97 | Alfresco::Safe_download["share.war"],
98 | Exec['apply-addons'],
99 | ],
100 | before => Service['alfresco-start'],
101 | path => "/bin:/usr/bin",
102 | command => "unzip -o -d ${tomcat_home}/webapps/share ${tomcat_home}/webapps/share.war && chown -R tomcat ${tomcat_home}/webapps/share",
103 | creates => "${tomcat_home}/webapps/share/",
104 | }
105 |
106 |
107 |
108 | }
109 | '5.0.c', '5.0.x': {
110 |
111 | alfresco::safe_download { 'alfresco.war':
112 | url => "${alfresco::urls::alfresco_war_50x}",
113 | filename => "alfresco.war",
114 | download_path => "${tomcat_home}/webapps/",
115 | }
116 | alfresco::safe_download { 'share.war':
117 | url => "${alfresco::urls::share_war_50x}",
118 | filename => "share.war",
119 | download_path => "${tomcat_home}/webapps/",
120 | }
121 |
122 | file { "${tomcat_home}/webapps":
123 | ensure => directory,
124 | require => File["${tomcat_home}"],
125 | owner => 'tomcat',
126 | }
127 |
128 | alfresco::safe_download { 'spp-amp':
129 | url => "${alfresco::urls::spp_amp_v5}",
130 | filename => "${alfresco::urls::spp_amp_v5_name}",
131 | download_path => "${alfresco_base_dir}/amps",
132 | }
133 |
134 |
135 | exec { "unpack-alfresco-war":
136 | user => 'tomcat',
137 | require => [
138 | Alfresco::Safe_download["alfresco.war"],
139 | Exec['apply-addons'],
140 | ],
141 | before => Service['alfresco-start'],
142 | path => "/bin:/usr/bin",
143 | command => "unzip -o -d ${tomcat_home}/webapps/alfresco ${tomcat_home}/webapps/alfresco.war && chown -R tomcat ${tomcat_home}/webapps/alfresco",
144 | creates => "${tomcat_home}/webapps/alfresco/",
145 | }
146 |
147 | exec { "unpack-share-war":
148 | user => 'tomcat',
149 | require => [
150 | Alfresco::Safe_download["share.war"],
151 | Exec['apply-addons'],
152 | ],
153 | before => Service['alfresco-start'],
154 | path => "/bin:/usr/bin",
155 | command => "unzip -o -d ${tomcat_home}/webapps/share ${tomcat_home}/webapps/share.war && chown -R tomcat ${tomcat_home}/webapps/share",
156 | creates => "${tomcat_home}/webapps/share/",
157 | }
158 |
159 | }
160 | 'NIGHTLY': {
161 |
162 | # moved to nightly.pp
163 |
164 | }
165 |
166 |
167 |
168 |
169 |
170 | }
171 |
172 | }
173 |
--------------------------------------------------------------------------------
/manifests/install/iptables.pp:
--------------------------------------------------------------------------------
1 | class alfresco::install::iptables inherits alfresco {
2 |
3 |
4 | file { "/etc/init.d/iptables":
5 | source => 'puppet:///modules/alfresco/iptables.sh',
6 | ensure => present,
7 | mode => '0755',
8 | owner => 'tomcat',
9 | }
10 |
11 | file { "/etc/rc2.d/S10_iptables":
12 | ensure => 'link',
13 | target => '/etc/init.d/iptables',
14 | require => File['/etc/init.d/iptables'],
15 | }
16 |
17 | # should probably do this with a service clause but
18 | # this script doesn't provide status so only limited use
19 | # let's restart and hope that if not already running it's not a failure
20 | exec { '/etc/init.d/iptables restart':
21 | require => File['/etc/init.d/iptables'],
22 | unless => '/sbin/iptables -nL -t nat | grep "tcp dpt:21 redir ports 2021"',
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/manifests/install/jdk.pp:
--------------------------------------------------------------------------------
1 | class alfresco::install::jdk inherits alfresco {
2 |
3 | $java_version = 8
4 |
5 | case $::osfamily {
6 |
7 | 'Debian': {
8 |
9 | $java_release = '8u45-b14-1'
10 | $java_base_url = 'http://mirrors.kernel.org/ubuntu/pool/universe/o/openjdk-8'
11 |
12 | if $java_version == 8 {
13 | # packages not yet in trusty
14 | # get the vivid ones
15 |
16 | alfresco::safe_download { 'openjdk-8-jre-headless':
17 | url => "${java_base_url}/openjdk-8-jre-headless_${java_release}_amd64.deb",
18 | filename => "openjdk-8-jre-headless_${java_release}_amd64.deb",
19 | download_path => $download_path,
20 | } -> exec {'gdebi-jre-headless':
21 | command => "/usr/bin/gdebi -n ${download_path}/openjdk-8-jre-headless_${java_release}_amd64.deb",
22 | } ->
23 | alfresco::safe_download { 'openjdk-8-jre':
24 | url => "${java_base_url}/openjdk-8-jre_${java_release}_amd64.deb",
25 | filename => "openjdk-8-jre_${java_release}_amd64.deb",
26 | download_path => $download_path,
27 | } -> exec {'gdebi-jre':
28 | command => "/usr/bin/gdebi -n ${download_path}/openjdk-8-jre_${java_release}_amd64.deb",
29 | } ->
30 | alfresco::safe_download { 'openjdk-8-jdk':
31 | url => "${java_base_url}/openjdk-8-jdk_${java_release}_amd64.deb",
32 | filename => "openjdk-8-jdk_${java_release}_amd64.deb",
33 | download_path => $download_path,
34 | } -> exec {'gdebi-jdk':
35 | command => "/usr/bin/gdebi -n ${download_path}/openjdk-8-jdk_${java_release}_amd64.deb",
36 | }
37 |
38 |
39 | } else {
40 | $jpackage="openjdk-7-jdk"
41 | alfresco::ensure_packages { "$jpackage": }
42 | }
43 | }
44 | 'RedHat': {
45 | if $java_version == 8 {
46 | $jpackage="java-1.8.0-openjdk"
47 | } else {
48 | $jpackage="java-1.7.0-openjdk"
49 | }
50 | package { $jpackage:
51 | ensure => installed,
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/manifests/install/mysql.pp:
--------------------------------------------------------------------------------
1 | class alfresco::install::mysql inherits alfresco {
2 |
3 | if $db_host == 'localhost' {
4 | class { '::mysql::server':
5 | root_password => $db_root_password,
6 | # remove_default_accounts=> true,
7 | service_enabled => true,
8 | override_options => {
9 | 'mysqld' => {
10 | 'max_connections' => 300,
11 | # 'innodb_buffer_pool_size' => '4GB',
12 | # 'innodb_log_buffer_size' => 50331648,
13 | # 'innodb_log_file_size' => '1GB',
14 |
15 | # Barracuda file system is not available in CentOS 6 mysql and we weren't
16 | # using it for anything yet anyway
17 | # 'innodb_file_format' => 'Barracuda',
18 | }
19 | }
20 | # } ->
21 | # exec { 'remove-initial-logfiles':
22 | # # have to remove old logfiles so that mysql regenerates them
23 | # # otherwise it fails on reboot
24 | # command => '/etc/init.d/mysql stop && /bin/rm /var/lib/mysql/ib_logfile* && /etc/init.d/mysql start && sleep 10 && /usr/bin/touch /var/lib/mysql/reset_logs.ootb.flag',
25 | # creates => '/var/lib/mysql/reset_logs.ootb.flag',
26 | }
27 |
28 | mysql::db { "$alfresco_db_name":
29 | user => "${alfresco_db_user}",
30 | password => "${alfresco_db_pass}",
31 | host => "${alfresco_db_host}",
32 | grant => ['ALL'],
33 | }
34 | }
35 |
36 | class { '::mysql::bindings':
37 | java_enable => 1,
38 | }
39 |
40 | alfresco::safe_download { 'mysql-connector':
41 | url => "${alfresco::urls::mysql_connector_url}",
42 | filename => "${alfresco::urls::mysql_connector_file}",
43 | download_path => $download_path,
44 | }
45 |
46 | exec { "unpack-mysql-connector":
47 | user => 'tomcat',
48 |
49 | # Hmm was this before
50 | # command => "tar xzvf ${alfresco::urls::mysql_connector_file}",
51 | # now it's an echo? guess we download a file that doesn't need unpacking, anwyay, weird
52 | command => "echo ${alfresco::urls::mysql_connector_file}",
53 | cwd => $download_path,
54 | path => "/bin",
55 | require => Alfresco::Safe_download["mysql-connector"],
56 | creates => "${download_path}/${alfresco::urls::mysql_connector_name}",
57 | }
58 |
59 | exec { "copy-mysql-connector":
60 | user => 'tomcat',
61 | # was: command => "cp ${download_path}/${alfresco::urls::mysql_connector_name}/${alfresco::urls::mysql_connector_name}-bin.jar ${tomcat_home}/shared/lib/",
62 | command => "cp ${download_path}/${alfresco::urls::mysql_connector_name}.jar ${tomcat_home}/shared/lib/",
63 | path => "/bin:/usr/bin",
64 | require => [
65 | Exec["unpack-mysql-connector"],
66 | File["${tomcat_home}/shared/lib"],
67 | ],
68 | creates => "${tomcat_home}/shared/lib/${alfresco::urls::mysql_connector_name}.jar",
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/manifests/install/postfix.pp:
--------------------------------------------------------------------------------
1 | class alfresco::install::postfix inherits alfresco {
2 |
3 | if ( $mail_host == 'localhost') {
4 |
5 | package { 'postfix':
6 | ensure => latest,
7 | }
8 |
9 | } else {
10 |
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/manifests/install/proxy.pp:
--------------------------------------------------------------------------------
1 | class alfresco::install::proxy inherits alfresco {
2 |
3 |
4 | # apparently the issue is caused by concat 2.0.0 - testing with earlier concat
5 | # to see if it fixes
6 |
7 | # couldn't see how to fix this: https://github.com/marsbard/puppet-alfresco/issues/63
8 | # so instead detect if apache has been installed before re-running the config
9 | # neat hack from https://ask.puppetlabs.com/question/5849/check-if-file-exists-on-client/?answer=14571#post-id-14571
10 | #$apache_installed = inline_template("<% if File.exist?('/etc/apache2/sites-enabled/10-honeycomb_80.conf') -%>true<% end -%>")
11 |
12 | #if ( $enable_proxy ) and ( ! $apache_installed ) {
13 |
14 | if $enable_proxy {
15 |
16 | class { 'apache':
17 | default_mods => false,
18 | default_confd_files => false,
19 | mpm_module => 'prefork',
20 | }
21 |
22 | class { 'apache::mod::proxy': } ->
23 | class { 'apache::mod::proxy_ajp': }
24 |
25 | class { 'apache::mod::php': }
26 |
27 | apache::mod { 'rewrite': }
28 |
29 | file { '/etc/ssl':
30 | ensure => directory,
31 | }
32 |
33 | if $ssl_cert_path == '' {
34 | # we need to generate self signed certs
35 |
36 | # http://unix.stackexchange.com/a/104305/100985
37 | exec { 'one-step-self-sign':
38 | command => "openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj '/C=US/ST=Denial/L=Springfield/O=Dis/CN=${domain_name}' -keyout /etc/ssl/${domain_name}.key -out /etc/ssl/${domain_name}.cert",
39 | path => '/usr/bin',
40 | require => File['/etc/ssl'],
41 | creates => "/etc/ssl/${domain_name}.key",
42 | } ~> Service['httpd']
43 |
44 |
45 | } elsif $ssl_cert_path =~ /^http/ {
46 | # we need to download the certs
47 | # do it in two stages as the vhost will require a File resource
48 | # rather than an exec
49 |
50 | alfresco::safe_download { 'proxy::key':
51 | url => "${ssl_cert_path}/${domain_name}.key",
52 | filename => "${domain_name}.key",
53 | download_path => $download_path,
54 | }
55 |
56 | alfresco::safe_download { 'proxy::cert':
57 | url => "${ssl_cert_path}/${domain_name}.cert",
58 | filename => "${domain_name}.cert",
59 | download_path => $download_path,
60 | }
61 |
62 | file { "downloaded: /etc/ssl/${domain_name}.cert":
63 | path => "/etc/ssl/${domain_name}.cert",
64 | source => "${download_path}/${domain_name}.cert",
65 | ensure => present,
66 | require => [
67 | Alfresco::Safe_download["proxy::cert"],
68 | File['/etc/ssl'],
69 | ],
70 | }
71 |
72 | file { "downloaded: /etc/ssl/${domain_name}.key":
73 | path => "/etc/ssl/${domain_name}.key",
74 | source => "${download_path}/${domain_name}.key",
75 | ensure => present,
76 | require => [
77 | Alfresco::Safe_download["proxy::key"],
78 | File['/etc/ssl'],
79 | ],
80 | }
81 |
82 | } else {
83 | # the certs are on the filesystem somewhere
84 |
85 | file { "/etc/ssl/${domain_name}.key":
86 | path => "/etc/ssl/${domain_name}.key",
87 | source => "${ssl_cert_path}/${domain_name}.key",
88 | ensure => present,
89 | require => File["/etc/ssl"],
90 | }
91 |
92 | file { "/etc/ssl/${domain_name}.cert":
93 | path => "/etc/ssl/${domain_name}.cert",
94 | source => "${ssl_cert_path}/${domain_name}.cert",
95 | ensure => present,
96 | require => File["/etc/ssl"],
97 | }
98 | }
99 |
100 |
101 | # TODO webdav config here http://serverfault.com/a/472541
102 |
103 | apache::vhost { $domain_name :
104 | ssl => true,
105 | port => 443,
106 | docroot => "/var/www/${domain_name}", # must have a docroot for puppetlabs apache
107 | ssl_cert => "/etc/ssl/${domain_name}.cert",
108 | ssl_key => "/etc/ssl/${domain_name}.key",
109 | proxy_pass => [
110 | { 'path' => '/share', 'url' => "ajp://127.0.0.1:8009/share" },
111 | { 'path' => '/solr4', 'url' => "ajp://127.0.0.1:8009/solr4" },
112 | { 'path' => '/alfresco', 'url' => "ajp://127.0.0.1:8009/alfresco" },
113 | { 'path' => '/spp', 'url' => 'http://127.0.0.1:7070/alfresco' },
114 | ],
115 | error_documents => [
116 | { 'error_code' => '503', 'document' => '/errdocs/503.html' },
117 | { 'error_code' => '407', 'document' => '/errdocs/503.html' },
118 | { 'error_code' => '500', 'document' => '/errdocs/503.html' },
119 | ],
120 | ssl_cipher => 'ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS',
121 | ssl_protocol => 'all -SSLv2 -SSLv3',
122 | ssl_honorcipherorder => 'On',
123 | #redirect_source => [ '/', ],
124 | #edirect_dest => [ '/share', ],
125 | #redirectmatch_regexp => '^/((?!fileserver).)*$',
126 | #redirectmatch_dest => "/share/$1",
127 |
128 | } ->
129 |
130 | apache::vhost { "${domain_name}_80":
131 | default_vhost => true,
132 | ssl => false,
133 | port => 80,
134 | docroot => "/var/www/${domain_name}",
135 | redirect_source => '/',
136 | redirect_dest => "https://${domain_name}/",
137 | redirect_status => permanent,
138 | }
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/manifests/install/solr.pp:
--------------------------------------------------------------------------------
1 | class alfresco::install::solr inherits alfresco {
2 |
3 | case ($alfresco_version) {
4 | '4.2.f': {
5 |
6 | alfresco::safe_download { 'solr':
7 | url => "${alfresco::urls::solr_dl}",
8 | filename => 'solr.zip',
9 | download_path => $download_path,
10 | }
11 |
12 | exec { "unpack-solr":
13 | user => 'tomcat',
14 | command => "unzip ${download_path}/solr.zip -d solr/",
15 | cwd => $alfresco_base_dir,
16 | path => '/usr/bin',
17 | creates => "${alfresco_base_dir}/solr/solr.xml",
18 | require => [
19 | Alfresco::Safe_download["solr"],
20 | ],
21 | }
22 |
23 | file { "${alfresco_base_dir}/solr/alf_data":
24 | ensure => absent,
25 | force => true,
26 | require => Exec["unpack-alfresco_ce"],
27 | before => Service["alfresco-start"],
28 | owner => 'tomcat',
29 | }
30 |
31 |
32 | file { "${alfresco_base_dir}/solr/workspace-SpacesStore/conf/solrcore.properties":
33 | require => Exec['unpack-solr'],
34 | content => template('alfresco/solrcore-workspace.properties.erb'),
35 | ensure => present,
36 | owner => 'tomcat',
37 | }
38 |
39 |
40 | file { "${alfresco_base_dir}/solr/archive-SpacesStore/conf/solrcore.properties":
41 | require => Exec['unpack-solr'],
42 | content => template('alfresco/solrcore-archive.properties.erb'),
43 | ensure => present,
44 | owner => 'tomcat',
45 | }
46 |
47 | file { "${tomcat_home}/conf/Catalina/localhost/solr.xml":
48 | content => template('alfresco/solr.xml.erb'),
49 | ensure => present,
50 | owner => 'tomcat',
51 | }
52 |
53 |
54 |
55 | file { "${alfresco_base_dir}/solr/archive-SpacesStore/conf/solrconfig.xml":
56 | require => Exec['unpack-solr'],
57 | source => 'puppet:///modules/alfresco/solrconfig.xml',
58 | ensure => 'present',
59 | owner => 'tomcat',
60 | }
61 |
62 | file { "${alfresco_base_dir}/solr/workspace-SpacesStore/conf/solrconfig.xml":
63 | require => Exec['unpack-solr'],
64 | source => 'puppet:///modules/alfresco/solrconfig.xml',
65 | ensure => 'present',
66 | owner => 'tomcat',
67 | }
68 |
69 |
70 |
71 |
72 | }
73 |
74 |
75 | '5.0.c', '5.0.x', 'NIGHTLY': {
76 |
77 | alfresco::safe_download { 'solr-war':
78 | url => "${alfresco::urls::solr_war_dl}",
79 | filename => "solr4.war",
80 | download_path => "${tomcat_home}/webapps",
81 | }
82 |
83 | file { "${alfresco_base_dir}/solr4":
84 | ensure => directory,
85 | require => File[$alfresco_base_dir],
86 | owner => 'tomcat',
87 | }
88 | file { "${alfresco_base_dir}/alf_data/solr4":
89 | ensure => directory,
90 | require => File[$alfresco_base_dir],
91 | owner => 'tomcat',
92 | }
93 |
94 | alfresco::safe_download { 'solr-cfg':
95 | url => "${alfresco::urls::solr_cfg_dl}",
96 | filename => 'solrconfig.zip',
97 | download_path => $download_path,
98 | }
99 |
100 | exec { "unpack-solr-cfg":
101 | user => 'tomcat',
102 | command => "unzip -o ${download_path}/solrconfig.zip",
103 | cwd => "${alfresco_base_dir}/solr4",
104 | path => '/usr/bin',
105 | creates => "${alfresco_base_dir}/solr4/context.xml",
106 | require => Alfresco::Safe_download['solr-cfg'],
107 | notify => Service['alfresco-start'],
108 | }
109 |
110 | file { "${alfresco_base_dir}/solr4/archive-SpacesStore/conf/solrconfig.xml":
111 | require => Exec['unpack-solr-cfg'],
112 | source => 'puppet:///modules/alfresco/solr4config.xml',
113 | ensure => 'present',
114 | owner => 'tomcat',
115 | }
116 |
117 | file { "${alfresco_base_dir}/solr4/workspace-SpacesStore/conf/solrconfig.xml":
118 | require => Exec['unpack-solr-cfg'],
119 | source => 'puppet:///modules/alfresco/solr4config.xml',
120 | ensure => 'present',
121 | owner => 'tomcat',
122 | }
123 |
124 | file { "${tomcat_home}/conf/Catalina/localhost/solr4.xml":
125 | content => template('alfresco/solr4.xml.erb'),
126 | ensure => present,
127 | require => Exec['unpack-solr-cfg'],
128 | owner => 'tomcat',
129 | }
130 |
131 | file { "${alfresco_base_dir}/solr4/workspace-SpacesStore/conf/solrcore.properties":
132 | ensure => present,
133 | content => template('alfresco/solr4core-workspace.properties.erb'),
134 | require => Exec['unpack-solr-cfg'],
135 | before => Service['alfresco-start'],
136 | owner => 'tomcat',
137 | }
138 |
139 | file { "${alfresco_base_dir}/solr4/archive-SpacesStore/conf/solrcore.properties":
140 | ensure => present,
141 | content => template('alfresco/solr4core-archive.properties.erb'),
142 | require => Exec['unpack-solr-cfg'],
143 | before => Service['alfresco-start'],
144 | owner => 'tomcat',
145 | }
146 |
147 | }
148 |
149 |
150 |
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/manifests/nightly.pp:
--------------------------------------------------------------------------------
1 | class alfresco::nightly inherits alfresco{
2 |
3 | case $alfresco_version {
4 | 'NIGHTLY': {
5 |
6 | alfresco::safe_download { 'nightly':
7 | url => "${alfresco::urls::nightly}",
8 | filename => "${alfresco::urls::nightly_filename}",
9 | download_path => $download_path,
10 | }
11 |
12 | exec { 'unpack-nightly':
13 | user => 'tomcat',
14 | require => [
15 | Alfresco::Safe_download['nightly'],
16 | #File[$alfresco_base_dir],
17 | ],
18 | command => "unzip ${download_path}/${alfresco::urls::nightly_filename} ${download_path}/${alfresco::urls::nightly_name}",
19 | path => '/usr/bin',
20 | creates => "${download_path}/${alfresco::urls::nightly_name}/README.txt",
21 | cwd => $download_path,
22 | }
23 |
24 | exec { 'copy-nightly':
25 | user => 'tomcat',
26 | require => [
27 | File[$alfresco_base_dir],
28 | Exec['unpack-nightly'],
29 | ],
30 | command => "/bin/cp -r ${download_path}/${alfresco::urls::nightly_name}/* $alfresco_base_dir",
31 | creates => "${alfresco_base_dir}/README.txt",
32 | }
33 |
34 | exec { 'rename-web-server-folder':
35 | user => 'tomcat',
36 | require => Exec['copy-nightly'],
37 | # "mv -n" to ensure that this isn't getting applied out of order
38 | command => "mv -n ${alfresco_base_dir}/web-server ${alfresco_base_dir}/tomcat",
39 | path => '/bin',
40 | before => Exec['unpack-tomcat'],
41 | creates => "${alfresco_base_dir}/tomcat/webapps",
42 | }
43 |
44 | exec { "${tomcat_home}/webapps/alfresco.war":
45 | user => 'tomcat',
46 | command => "touch /tmp/fake.get.alfresco.war",
47 | path => '/bin:/usr/bin',
48 | creates => "/tmp/fake.get.alfresco.war",
49 | }
50 |
51 | exec { "${tomcat_home}/webapps/share.war":
52 | user => 'tomcat',
53 | command => "touch /tmp/fake.get.share.war",
54 | path => '/bin:/usr/bin',
55 | creates => "/tmp/fake.get.share.war",
56 | }
57 | }
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/manifests/packages.pp:
--------------------------------------------------------------------------------
1 | class alfresco::packages inherits alfresco {
2 |
3 | case $::osfamily {
4 | 'RedHat': {
5 |
6 | exec { "get-repoforge":
7 | command => "yum install -y http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el${operatingsystemmajrelease}.rf.x86_64.rpm",
8 | path => "/bin:/usr/bin",
9 | creates => "/etc/yum.repos.d/rpmforge.repo",
10 | }
11 |
12 | # TODO no idea if this is actually effective
13 | exec { "guard-against-prev-broken":
14 | #command => "yum clean all; yum clean headers; yum complete-transaction",
15 | command => "yum clean all; yum clean headers",
16 | path => "/bin:/usr/bin",
17 | }
18 |
19 | class { 'epel':
20 | }
21 |
22 | Exec['guard-against-prev-broken'] -> Class['epel'] -> Exec["get-repoforge"] -> Package <| |>
23 |
24 |
25 | $packages = [
26 | "wget",
27 | "git",
28 | "zip",
29 | "unzip",
30 | "curl",
31 | "ghostscript",
32 | "haveged",
33 | "perl-Image-ExifTool",
34 | "ruby-devel",
35 | ]
36 |
37 | $rmpackages = [
38 | ]
39 | }
40 |
41 | 'Debian': {
42 |
43 | if $java_version == 8 {
44 | $jpackage=""
45 | # auto accept oracle license: http://askubuntu.com/a/190674/33804
46 |
47 | class { 'apt': } ->
48 | apt::ppa { 'ppa:webupd8team/java': } ->
49 | # https://gist.github.com/tfnico/6d2b57642d21ebaa7574
50 | # update the apt keystore
51 | exec { 'apt-key-update':
52 | unless => "update-alternatives --list java|grep java-8-oracle 2>/dev/null",
53 | command => 'apt-key update',
54 | path => ['/usr/bin/','/bin/'],
55 | } ->
56 | # update apt sources
57 | exec { 'apt-update for oracle':
58 | unless => "update-alternatives --list java|grep java-8-oracle 2>/dev/null",
59 | command => 'apt-get update',
60 | path => ['/usr/bin/','/bin/'],
61 | } ->
62 | # set license acceptance with debconf
63 | exec { 'accept-java-license':
64 | unless => "update-alternatives --list java|grep java-8-oracle 2>/dev/null",
65 | command => 'echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections',
66 | path => ['/usr/bin/','/bin/'],
67 | } ~>
68 | # finally install the package
69 | # oracle-java6-installer and oracle-java7-installer also available from the ppa
70 | package { 'oracle-java8-installer':
71 | ensure => present,
72 | }
73 |
74 | } else {
75 | $jpackage="openjdk-7-jdk"
76 | alfresco::ensure_packages { "$jpackage": }
77 | }
78 |
79 |
80 | $packages = [
81 | "gdebi-core",
82 | "git",
83 | "unzip",
84 | "zip",
85 | "curl",
86 | "fonts-liberation",
87 | "fonts-droid-fallback",
88 | "imagemagick",
89 | "ghostscript",
90 | "libjpeg62",
91 | "libpng3",
92 | "haveged",
93 | "sudo",
94 | "libxinerama1",
95 | "libimage-exiftool-perl",
96 | ]
97 | $rmpackages = [
98 | "plymouth",
99 | "openjdk-6-jdk",
100 | "openjdk-6-jre-lib",
101 | ]
102 | exec { "apt-update":
103 | command => "/usr/bin/apt-get update",
104 | schedule => "nightly",
105 | }
106 |
107 | }
108 | default:{
109 | fail("Unsupported osfamily $osfamily")
110 | }
111 | }
112 |
113 | schedule { 'nightly':
114 | period => daily,
115 | range => "2 - 4",
116 | }
117 |
118 |
119 | alfresco::ensure_packages { $rmpackages:
120 | ensure => "absent",
121 | } ->
122 | alfresco::ensure_packages{ $packages:
123 | ensure => "installed",
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/manifests/params.pp:
--------------------------------------------------------------------------------
1 | # Class: alfresco::params
2 | #
3 | #
4 | class alfresco::params {
5 |
6 | $domain_name = 'localhost'
7 |
8 | $initial_admin_pass = 'admin'
9 |
10 | $mail_from_default = 'admin@localhost'
11 |
12 | $alfresco_base_dir = "/opt/alfresco"
13 | $tomcat_home = "/opt/alfresco/tomcat"
14 |
15 | $alfresco_version = "4.2.f"
16 |
17 | $download_path = "/opt/downloads"
18 |
19 | $db_root_password = "alfresco"
20 | $db_user = "alfresco"
21 | $db_pass = "alfresco"
22 | $db_name = "alfresco"
23 | $db_host = "localhost"
24 | }
25 |
--------------------------------------------------------------------------------
/manifests/safe_download.pp:
--------------------------------------------------------------------------------
1 | define alfresco::safe_download (
2 | $url, # complete url to download the file from
3 | $filename, # the filename of the download package
4 | $download_path, # where to put the file
5 | $user = 'tomcat',
6 | $timeout = 0,
7 | ) {
8 | exec { "safe-clean-any-old-${title}":
9 | command => "/bin/rm -f ${download_path}/tmp__${filename}",
10 | creates => "${download_path}/${filename}",
11 | require => File[$download_path],
12 | user => $user,
13 | timeout => $timeout,
14 | } ->
15 | exec { "safe-retrieve-${title}":
16 | command => "/usr/bin/wget ${url} -O ${download_path}/tmp__${filename}",
17 | creates => "${download_path}/${filename}",
18 | user => $user,
19 | timeout => $timeout,
20 | } ->
21 | exec { "safe-move-${title}":
22 | command => "/bin/mv ${download_path}/tmp__${filename} ${download_path}/${filename}",
23 | creates => "${download_path}/${filename}",
24 | user => $user,
25 | timeout => $timeout,
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/manifests/service.pp:
--------------------------------------------------------------------------------
1 | class alfresco::service inherits alfresco {
2 |
3 |
4 | service { 'alfresco-start':
5 | name => 'tomcat',
6 | ensure => running,
7 | enable => true,
8 | subscribe => [
9 | File["${tomcat_home}/shared/classes/alfresco-global.properties"],
10 | Exec["unpack-alfresco-war"],
11 | Exec["unpack-share-war"],
12 | ],
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/manifests/tests.pp:
--------------------------------------------------------------------------------
1 | class alfresco::tests inherits alfresco {
2 |
3 | # this list of tests should match what is checked out of github:
4 | $tests = [
5 | 'test_imap.py', 'test_cmis.py', 'test_search.py',
6 | 'test_ftp.py', 'test_spp.py', 'test_swsdp.py'
7 | ]
8 |
9 |
10 | $delay_before = $delay_before_tests
11 |
12 |
13 | # default wait is 3s, we may need a bit more
14 | $xvfb = "xvfb-run -a -e /dev/stdout --wait=9"
15 |
16 | case $::osfamily {
17 | 'RedHat': {
18 |
19 | $packages = [
20 | 'xorg-x11-server-Xvfb',
21 | 'python',
22 | 'python-pip',
23 | 'python-setuptools',
24 | 'python-yaml',
25 | 'firefox',
26 | 'dejavu-sans-fonts',
27 | 'dejavu-sans-mono-fonts',
28 | 'dejavu-serif-fonts',
29 | 'liberation-mono-fonts',
30 | 'liberation-sans-fonts',
31 | 'liberation-serif-fonts',
32 | ]
33 |
34 |
35 | file { "/usr/bin/xvfb-run":
36 | source => 'puppet:///modules/alfresco/xvfb-run',
37 | mode => '0755',
38 | ensure => present,
39 | }
40 |
41 | }
42 | 'Debian': {
43 |
44 | $packages = [
45 | 'python',
46 | 'python-pip',
47 | 'python-setuptools',
48 | 'xvfb', 'x11-xkb-utils',
49 | 'xfonts-100dpi', 'xfonts-75dpi',
50 | 'xfonts-scalable',
51 | 'xfonts-cyrillic',
52 | 'x11-apps',
53 | 'python-yaml',
54 | 'firefox',
55 | ]
56 | }
57 | }
58 |
59 | package { $packages :
60 | ensure => latest,
61 | }
62 |
63 | # python::pip { 'cmislib':
64 | # #ensure => '0.5',
65 | # ensure => latest,
66 | # owner => 'root',
67 | # pkgname => 'configure',
68 | # require => Package['python-pip'],
69 | # }
70 |
71 | exec { "install-cmislib":
72 | command => "easy_install cmislib",
73 | path => '/usr/bin',
74 | creates => '/usr/local/lib/python2.7/dist-packages/cmislib-0.5.1-py2.7.egg',
75 | }
76 |
77 | python::pip { 'configure':
78 | owner => 'root',
79 | pkgname => 'configure',
80 | require => Package['python-pip'],
81 | }
82 |
83 | python::pip { 'configuration':
84 | owner => 'root',
85 | pkgname => 'configuration',
86 | require => Package['python-pip'],
87 | }
88 |
89 | python::pip { 'selenium':
90 | owner => 'root',
91 | pkgname => 'selenium',
92 | require => Package['python-pip'],
93 | }
94 |
95 | define runtests (
96 | $base_dir = ''
97 | ){
98 | exec { $title:
99 | command => "python ${title}",
100 | cwd => "${base_dir}/tests",
101 | path => '/bin:/usr/bin',
102 | }
103 | }
104 |
105 | vcsrepo { "${alfresco_base_dir}/tests":
106 | ensure => latest,
107 | provider => git,
108 | source => 'git://github.com/digcat/alfresco-tests.git',
109 | revision => 'master',
110 | } ->
111 | file { "${alfresco_base_dir}/tests/config.yml":
112 | content => template('alfresco/tests-config.yml.erb'),
113 | ensure => present,
114 | require => Vcsrepo["${alfresco_base_dir}/tests"],
115 | } ->
116 | exec { "delay-${delay_before}-before-tests":
117 | user => 'tomcat',
118 | command => "/bin/sleep ${delay_before}",
119 | } ->
120 | runtests { $tests:
121 | base_dir => $alfresco_base_dir,
122 | }
123 |
124 |
125 |
126 | }
127 |
--------------------------------------------------------------------------------
/manifests/urls.pp:
--------------------------------------------------------------------------------
1 | class alfresco::urls {
2 |
3 | $v50x = '5.0.d'
4 | $v42x = '4.2.f'
5 |
6 | $nightly = 'http://dev.alfresco.com/downloads/nightly/dist/alfresco-community-distribution-SNAPSHOT-LATEST.zip'
7 | $nightly_name = 'alfresco-community-distribution'
8 | $nightly_filename = 'alfresco-community-distribution-SNAPSHOT-LATEST.zip'
9 |
10 |
11 |
12 | # v4 wars
13 | $alfresco_ce_filename = 'alfresco-community-4.2.f.zip'
14 | $alfresco_ce_url = "http://dl.alfresco.com/release/community/4.2.f-build-00012/${alfresco_ce_filename}"
15 | $alfresco_war_42x = "https://artifacts.alfresco.com/nexus/service/local/repo_groups/public/content/org/alfresco/alfresco/${v42x}/alfresco-${v42x}.war"
16 | $share_war_42x = "https://artifacts.alfresco.com/nexus/service/local/repo_groups/public/content/org/alfresco/share/${v42x}/share-${v42x}.war"
17 |
18 | $alfresco_war_50x = "https://artifacts.alfresco.com/nexus/service/local/repo_groups/public/content/org/alfresco/alfresco/${v50x}/alfresco-${v50x}.war"
19 | $share_war_50x = "https://artifacts.alfresco.com/nexus/service/local/repo_groups/public/content/org/alfresco/share/${v50x}/share-${v50x}.war"
20 |
21 |
22 | $solr_war_file = "alfresco-solr4-${v50x}-ssl.war"
23 | $solr_war_dl = "https://artifacts.alfresco.com/nexus/service/local/repo_groups/public/content/org/alfresco/alfresco-solr4/${v50x}/$solr_war_file"
24 |
25 | $solr_cfg_file = "alfresco-solr4-${v50x}-config-ssl.zip"
26 | $solr_cfg_dl = "https://artifacts.alfresco.com/nexus/service/local/repo_groups/public/content/org/alfresco/alfresco-solr4/${v50x}/$solr_cfg_file"
27 |
28 |
29 | $spp_v4 = "http://dl.alfresco.com/release/community/4.2.f-build-00012/alfresco-community-spp-4.2.f.zip"
30 | $spp_v4_zipname = "alfresco-community-spp-4.2.f.zip"
31 | $spp_v4_name = "alfresco-community-spp-4.2.f.amp"
32 |
33 | $spp_amp_v5 = "https://artifacts.alfresco.com/nexus/service/local/repo_groups/public/content/org/alfresco/alfresco-spp/${v50x}/alfresco-spp-${v50x}.amp"
34 | $spp_amp_v5_name = "alfresco-spp-${v50x}.amp"
35 |
36 |
37 | $loffice_name_deb = 'LibreOffice_4.2.7.2_Linux_x86-64_deb'
38 | $loffice_dl_deb = "http://downloadarchive.documentfoundation.org/libreoffice/old/4.2.7.2/deb/x86_64/${loffice_name_deb}.tar.gz"
39 |
40 | $loffice_name_red = 'LibreOffice_4.2.7.2_Linux_x86-64_rpm'
41 | $loffice_dl_red = "http://downloadarchive.documentfoundation.org/libreoffice/old/4.2.7.2/rpm/x86_64/${loffice_name_red}.tar.gz"
42 |
43 | $swftools_src_name = 'swftools-2013-04-09-1007'
44 | $swftools_src_url = "http://www.swftools.org/${swftools_src_name}.tar.gz"
45 |
46 | $name_tomcat = 'apache-tomcat-7.0.55'
47 | $filename_tomcat = "${name_tomcat}.tar.gz"
48 | $url_tomcat = "http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.55/bin/${filename_tomcat}"
49 |
50 | #$mysql_connector_name = 'mysql-connector-java-5.1.34'
51 | #$mysql_connector_file = "${mysql_connector_name}.tar.gz"
52 | #$mysql_connector_url = "http://dev.mysql.com/get/Downloads/Connector-J/${mysql_connector_file}"
53 |
54 | $mysql_root = 'https://repo1.maven.org'
55 | $mysql_location = 'maven2/mysql/mysql-connector-java/5.1.36'
56 | $mysql_connector_name = 'mysql-connector-java-5.1.36'
57 | $mysql_connector_file = "${mysql_connector_name}.jar"
58 | $mysql_connector_url = "${mysql_root}/${mysql_location}/${mysql_connector_file}"
59 |
60 | $solr_dl_file = 'alfresco-community-solr-4.2.f.zip'
61 | $solr_dl = "http://dl.alfresco.com/release/community/4.2.f-build-00012/${solr_dl_file}"
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/metadata.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "marsbard-alfresco",
3 | "version": "0.1.0",
4 | "author": "marsbard",
5 | "summary": "A module to install a standalone alfresco server with mysql",
6 | "license": "unlicensed",
7 | "source": "http://github.com/marsbard/puppet-alfresco",
8 | "dependencies": [
9 | { "name": "puppetlabs/stdlib" },
10 | { "name": "puppetlabs/mysql" }
11 | ]
12 |
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/setup-backup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd "`dirname $0`"
4 |
5 | if [ "$EUID" != "0" ]
6 | then
7 | echo This script must be run as root
8 | exit
9 | fi
10 |
11 | # hmm this is going to a bit convoluted
12 |
13 |
14 | CONF=config/backup bashconf/bashconf.sh
15 |
--------------------------------------------------------------------------------
/templates/admin-passwd-update.sql.erb:
--------------------------------------------------------------------------------
1 | --
2 | -- Title: Update admin password from puppet
3 | -- Database: MySQL
4 | -- Author: Martin Cosgrave (marsbard)
5 | --
6 |
7 | UPDATE
8 | alf_node_properties anp
9 | INNER JOIN (
10 | SELECT anp1.node_id, anp1.qname_id, anp1.string_value FROM alf_node_properties anp1 INNER JOIN alf_qname aq1 ON aq1.id = anp1.qname_id INNER JOIN alf_node_properties anp2 ON anp2.node_id = anp1.node_id INNER JOIN alf_qname aq2 ON aq2.id = anp2.qname_id WHERE aq1.local_name = 'password' AND aq2.local_name = 'username' AND anp2.string_value = 'admin'
11 | ) AS anp3 ON anp.node_id = anp3.node_id AND anp.qname_id = anp3.qname_id
12 | SET anp.string_value = '<%= @admin_pass_hash %>'
13 |
14 | --
15 | -- Record script finish
16 | --
17 |
18 | DELETE FROM alf_applied_patch WHERE id = 'patch.db-V4.2-admin-passwd-update';
19 | INSERT INTO alf_applied_patch
20 | (id, description, fixes_from_schema, fixes_to_schema, applied_to_schema, target_schema, applied_on_date, applied_to_server, was_executed, succeeded, report)
21 | VALUES
22 | (
23 | 'patch.db-V4.2-admin-passwd-update', 'Updated admin password from OOTB puppet install',
24 | 0, 6031, -1, 6032, null, 'UNKNOWN', ${TRUE}, ${TRUE}, 'Script completed'
25 | );
26 |
27 |
--------------------------------------------------------------------------------
/templates/alfresco-bart.properties.erb:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2013 Toni de la Fuente.
2 | #
3 | # This program is free software: you can redistribute it and/or modify it under
4 | # the terms of the Apache License as published by the Apache Foundation.
5 | #
6 | # This program is distributed in the hope that it will be useful, but WITHOUT
7 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8 | # FOR A PARTICULAR PURPOSE.
9 | #
10 | # Most recent information about this tool is available in:
11 | # http://blyx.com/alfresco-bart
12 | #
13 | # Latest code available at:
14 | # http://blyx.com/alfresco-bart
15 | #
16 | #
17 | #########################################################################################
18 | # alfresco-bart: ALFRESCO BACKUP AND RECOVERY TOOL
19 | # Version 0.2
20 | #########################################################################################
21 | # ACTION REQUIRED:
22 | # this file should contains passwords, please, set this file as read only
23 | # for root (chmod 400 alfresco-bart.properties)
24 | # Copy this file in you ALFRESCO_INSTALLATION_PATH/scripts.
25 | #########################################################################################
26 |
27 |
28 | ## Logging
29 | # Log configuration
30 | LOG_DATE_FILES=`date +%F`
31 | LOG_DATE_LOG=`date +%F-%X`
32 | # Directory to left all Alfresco BART tasks logs with reports.
33 | ALFBRT_LOG_DIR=/opt/alfresco/scripts
34 | ALFBRT_LOG_FILE=${ALFBRT_LOG_DIR}/alfresco-bart-${LOG_DATE_FILES}.log
35 |
36 | ## Duplicity Setup ##
37 | # If yes, please make sure you specify either PASSPHRASE, see INSTALL file.
38 | ENCRYPTION_ENABLED=true
39 | PASSPHRASE=<%= @duplicity_password %>
40 | DUPLICITYBIN=`which duplicity`
41 | GZIP=`which gzip`
42 |
43 | ## Backup policies
44 | # Number of days of every full backup (if not backup found it does a full)
45 | FULLDAYS=<%= @fulldays %>
46 | # Backup policies to apply all backups collections (retention and cleanup)
47 | BACKUP_POLICIES_ENABLED=<%= @backup_policies_enabled %>
48 | # Number of moths to remove all backups older than or backup retention period
49 | CLEAN_TIME=<%= @clean_time %>
50 | # After MAXFULL counter, all incrementals will be deleted and all full will be kept until CLEAN_TIME applies,
51 | MAXFULL=<%= @maxfull %>
52 | # If you want to keep full backups of last 12 months but only with incremental in last 6 months
53 | # you must set CLEAN_TIME=12M and MAXFULL=6
54 | # Volume size in MB, default is 25MB per backup volume, consider reduce or increase it if you
55 | # are doing tape backup (if a backup takes 60MB you will get 3 volumes, 25+25+10)
56 | VOLUME_SIZE=<%= @volume_size %>
57 |
58 | # Alfresco root installation path. It has to be a real directory not a symlink
59 | ALF_INSTALLATION_DIR=$ALF_BASE_DIR
60 |
61 | # Alfresco alf_data path
62 | ALF_DIRROOT=${ALF_INSTALLATION_DIR}/alf_data
63 |
64 | # Duplicity log vervosity 0 Error, 2 Warning, 4 Notice, 8 Info, 9 Debug (noisiest)
65 | # 0 recommended for production
66 | DUPLICITY_LOG_VERBOSITY=<%= @duplicity_log_verbosity %>
67 | BART_LOG_TAG=[BART-Loglevel$DUPLICITY_LOG_VERBOSITY]
68 | GLOBAL_DUPLICITY_PARMS="-v${DUPLICITY_LOG_VERBOSITY} --volsize=${VOLUME_SIZE} --log-file=${ALFBRT_LOG_FILE} --full-if-older-than ${FULLDAYS} --asynchronous-upload"
69 |
70 |
71 | ## Indexes Configuration
72 | BACKUP_INDEX_ENABLED=true
73 | # Alfresco index type, use solr or lucene
74 | INDEXTYPE=solr
75 | # If Solr is selected, all Solr installation and config files will be included in your backup
76 | INDEXES_DIR=${ALF_DIRROOT}/${INDEXER}
77 | # If Lucene change to ${ALF_DIRROOT}/lucene
78 | # SOLR or Lucene backup location
79 | INDEXES_BACKUP_DIR=${ALF_DIRROOT}/solrBackup
80 | # If lucene add the apropiate location like ${ALF_DIRROOT}/backup-lucene-indexes
81 | # If solr, please go to Alfresco Share Admin Console - Search Solr and set "Backups to
82 | # keep to 1" in both Main and Archive
83 | # Other that do a backup of the "backed up" indexes, to easy restore of your Solr
84 | # indexes is recommendable to backup all configuration files but the live files,
85 | # To enable Solr installation and configuration backup set next property
86 |
87 | ## DB Configuration ##
88 | BACKUP_DB_ENABLED=true
89 | # use mysql, postgresql or oracle
90 | DBTYPE=mysql
91 | LOCAL_BACKUP_DB_DIR=${ALF_DIRROOT}/alfresco-db-backup
92 | # if you are using the bundle posgresql db, with next value it will include pg live files
93 | # for easy restore. For remote, different or external db leave it as is.
94 | LOCAL_DB_DIR=${ALF_DIRROOT}/postgresql
95 | DATE_FILE=`date +%Y-%m-%d_%H%M%S`
96 |
97 | # Global DB parameters
98 | DBNAME=$DB_NAME
99 | DBUSER=$DB_USER
100 | DBPASS=$DB_PASS
101 | DBHOST=$DB_HOST
102 |
103 | # MySQL - Alfresco DB Configuration
104 | MYSQL_BINDIR=/usr/bin
105 | MYSQLDUMP_BIN=mysqldump
106 |
107 | # PostgreSQL - Alfresco DB Configuration
108 | PGSQL_BINDIR=${ALF_INSTALLATION_DIR}/postgresql/bin
109 | PGSQLDUMP_BIN=pg_dump
110 | # Add PGUSER and PGPASSWORD if required for your installation and you are not doing
111 | # running BART as root.
112 | PGUSER=
113 | PGPASSWORD=${DBPASS}
114 | # If you found problems to dump your Postgres DB try creating a file .pgpass with
115 | # content "::::alfresco" without quotes, while alfresco is the password of your alfresco db
116 | PGPASSFILE=${ALF_DIRROOT}/.pgpass
117 |
118 | # Oracle - Alfresco DB Configuration
119 | ORACLE_BINDIR=
120 | ORASQLDUMP_BIN=exp
121 |
122 | ## ContentStore Configuration
123 | BACKUP_CONTENTSTORE_ENABLED=true
124 | ALF_CONTENTSTORE=${ALF_DIRROOT}/contentstore
125 | # To exclude contentstore.deleted leave next value empty
126 | ALF_CONTENSTORE_DELETED=
127 | ALF_CACHED_CONTENTSTORE=
128 | ALF_CONTENTSTORE2=
129 | ALF_CONTENTSTORE3=
130 | ALF_CONTENTSTORE4=
131 | ALF_CONTENTSTORE5=
132 |
133 | ## Alfresco configuration and application files backup
134 | # This backup includes deployments and configuration files excludes
135 | # the ContentStore, Indexes and DB as above
136 | BACKUP_FILES_ENABLED=true
137 |
138 | ## Backup type ##
139 | # use s3, ftp, scp, local
140 | BACKUPTYPE=<%= @backuptype %>
141 |
142 | ## LOCAL backup destination folder ##
143 | # absolute path starting with /
144 | LOCAL_BACKUP_FOLDER=<%= @local_backup_folder %>
145 |
146 | ## Amazon S3 information ##
147 | AWS_ACCESS_KEY_ID=<%= @aws_access_key_id %>
148 | AWS_SECRET_ACCESS_KEY=<% @aws_secret_access_key %>
149 | # Upper case bucket name is not allow
150 | S3FILESYSLOCATION="<%= @s3filesyslocation %>"
151 | S3OPTIONS="--s3-use-new-style --s3-use-rrs"
152 | S3_EUROPEAN_BUCKET=false # not used yet
153 |
154 | ## FTP Information ##
155 | FTP_SERVER=<%= @ftp_server %>
156 | FTP_USER=<%= @ftp_user %>
157 | FTP_PASSWORD=<%= @ftp_password %>
158 | FTP_FOLDER=<%= @ftp_folder %>
159 | FTP_PORT=<%= @ftp_port %>
160 | FTPS_ENABLE=<%= @ftps_enable %>
161 |
162 | ## SCP Information ##
163 | # SSH shared keys required
164 | SCP_SERVER=<%= @scp_server %>
165 | SCP_USER=<%= @scp_user %>
166 | SCP_FOLDER=<%= @scp_folder %>
167 |
168 | ## Backup temp folder definition ##
169 | TEMPFOLDERNAME="alfresco-backup-`date +%F-%s`"
170 |
171 | ## Recovery configuration
172 | ENABLE_SINGLE_FILE_RECOVERY=false
173 |
174 | # Temporary DB for recovery and get the phisical path of a single content.
175 | REC_DBTYPE=mysql
176 |
177 | # Recovery database must be already created but EMPTY! Alfresco-BART will recover your
178 | # backup database and find the files for you, after this task the recovery database
179 | # tables will be deleted.
180 |
181 |
182 | # MySQL - Recovery DB Configuration ##
183 | REC_MYDBNAME=${DB_NAME}_rec
184 | REC_MYUSER=${DB_USER}
185 | REC_MYPASS=${DB_PASS}
186 | REC_MYHOST=localhost
187 | REC_MYSQL_BIN=/usr/bin/mysql
188 | REC_MYSQLDUMP_BIN=/usr/bin/mysqldump
189 |
190 | # PgSQL - Recovery DB Configuration ##
191 | REC_PGDBNAME=alfresco_rec
192 | REC_PGUSER=alfresco
193 | REC_PGPASS=alfresco
194 | REC_PGHOST=localhost
195 | REC_PGSQL_BIN=/opt/alfresco/postgresql/bin/psql
196 | REC_PGSQLDUMP_BIN=/opt/alfresco/postgresql/bin/pg_dump
197 |
198 | # Oracle - Recovery DB Configuration ##
199 | REC_ORADBNAME=alfresco_rec
200 | REC_ORAUSER=alfresco
201 | REC_ORAPASS=alfresco
202 | REC_ORAHOST=localhost
203 | REC_ORASQL_BIN=
204 | REC_ORASQLDUMP_BIN=exp
205 |
--------------------------------------------------------------------------------
/templates/alfresco-global.properties.erb:
--------------------------------------------------------------------------------
1 | ###############################
2 | ## Common Alfresco Properties #
3 | ###############################
4 |
5 | # on the very first repo start, this is evaluated to create the
6 | # initial admin password. No use changing it after that, it is
7 | # not used again
8 | alfresco_user_store.adminpassword=<%= @admin_pass_hash %>
9 |
10 | solr.solrConnectTimeout=500000
11 |
12 | #aaar.pentaho.protocol=http
13 | #aaar.pentaho.host=localhost
14 | #aaar.pentaho.port=8080
15 | #aaar.pentaho.context=pentaho
16 |
17 | # Alfresco Audit service
18 | #audit.enabled=true
19 | #audit.alfresco-access.enabled=true
20 |
21 | #
22 | # File locations
23 | #-------------
24 | dir.root=<%= @alfresco_base_dir %>/alf_data
25 | dir.contentstore=${dir.root}/contentstore
26 | dir.contentstore.deleted=${dir.root}/contentstore.deleted
27 | dir.cachedcontent=${dir.root}/cachedcontent
28 | dir.auditcontentstore=${dir.root}/audit.contentstore
29 | dir.keystore=${dir.root}/keystore
30 | dir.indexes=${dir.root}/lucene-indexes
31 | dir.indexes.backup=${dir.root}/backup-lucene-indexes
32 | solr.backup.alfresco.remoteBackupLocation=${dir.root}/backupsolr
33 | solr.backup.archive.remoteBackupLocation=${dir.root}/backupsolr
34 |
35 | #
36 | # Database
37 | #-------------
38 | db.username=<%= @alfresco_db_user %>
39 | db.password=<%= @alfresco_db_pass %>
40 | db.name=<%= @alfresco_db_name %>
41 | db.host=<%= @alfresco_db_host %>
42 | db.port=<%= @alfresco_db_port %>
43 | db.driver=com.mysql.jdbc.Driver
44 | db.url=jdbc:mysql://${db.host}:${db.port}/${db.name}?useUnicode=yes&characterEncoding=UTF-8&autoReconnect=true
45 |
46 |
47 | #db.driver=org.postgresql.Driver
48 | #db.port=5432
49 | #db.url=jdbc:postgresql://${db.host}:${db.port}/${db.name}
50 | db.pool.initial=10
51 | db.pool.max=275
52 | #mysql only
53 | db.pool.validate.query=select 1
54 |
55 | #
56 | # System paramaters
57 | #-------------
58 | alfresco.context=alfresco
59 | alfresco.host=<%= @repo_host %>
60 | alfresco.port=8080
61 | alfresco.protocol=http
62 | #
63 | share.context=share
64 | share.host=<%= @share_host %>
65 | share.port=443
66 | share.protocol=https
67 |
68 | site.public.group=GROUP_EVERYONE
69 |
70 | #Performance
71 | system.usages.enabled=false
72 |
73 | #
74 | # External locations
75 | #-------------
76 |
77 | #jodconverter.officeHome=<%= @lo_install_loc %>
78 | #jodconverter.portNumbers=8100
79 | #jodconverter.enabled=true
80 |
81 | # attempt to stop it trying to use JodConverter, nothing seems to work
82 | content.transformer.JodConverter.priority=1
83 |
84 |
85 | ooo.exe=<%= @lo_install_loc %>/program/soffice
86 | ooo.enabled=true
87 | ooo.port=8100
88 | swf.exe=/usr/local/bin/pdf2swf
89 | img.exe=<%= @alfresco_base_dir %>/bin/limitconvert.sh
90 | #img.exe=/usr/bin/convert
91 |
92 | img.gslib=/usr/share/ghostscript/current/lib
93 | img.coders=<%= @alfresco_base_dir %>/ImageMagickCoders
94 |
95 | #
96 | # Index
97 | #-------------
98 | #index.subsystem.name=lucene
99 | index.recovery.mode=AUTO
100 | index.subsystem.name=<%= @indexer %>
101 | solr.host=localhost
102 | solr.port=8080
103 | solr.port.ssl=8443
104 | #Effectively turn off solr backup
105 | solr.backup.alfresco.cronExpression=0 0 2 * * ? 2099
106 | solr.backup.archive.cronExpression=0 0 4 * * ? 2099
107 |
108 |
109 | #
110 | # mc 20150212
111 | # sharepoint vti
112 | # ------------------
113 | vti.server.port = 7070
114 | vti.server.protocol=http
115 | vti.server.url.path.prefix=/alfresco
116 | vti.server.external.host=<%= @domain_name %>
117 | vti.server.external.port=443
118 | vti.server.external.protocol=https
119 | vti.server.external.contextPath=/spp
120 |
121 |
122 | #
123 | # Workflow engine
124 | #-------------
125 | system.workflow.engine.jbpm.definitions.visible=false
126 | system.workflow.engine.activiti.definitions.visible=true
127 | system.workflow.engine.jbpm.enabled=false
128 | system.workflow.engine.activiti.enabled=true
129 |
130 | #
131 | # Activties Feed and Subscriptions
132 | #-------------
133 | activities.feed.notifier.repeatIntervalMins=1440
134 | activities.feed.notifier.enabled=false
135 | activities.feed.max.size=100
136 | activities.feed.max.ageMins=44640
137 | # Enables the subscription service
138 | subscriptions.enabled=true
139 |
140 | #
141 | # Email
142 | #-------------
143 | # Outbound Email Configuration
144 | mail.host=<%= @mail_host %>
145 | mail.port=<%= @mail_port %>
146 | mail.username=anonymous
147 | mail.password=
148 | mail.encoding=UTF-8
149 | mail.from.default=<%= @mail_from_default %>
150 | mail.protocol=smtp
151 | # Additional Java Mail properties for SMTP protocol
152 | mail.smtp.auth=false
153 | mail.smtp.debug=false
154 | mail.smtp.timeout=5000
155 | mail.smtp.starttls.enable=false
156 | # Additional Java Mail properties for SMTPS protocol
157 | mail.smtps.auth=false
158 | mail.smtps.starttls.enable=false
159 | #use these properties to send test message during start of subsystem
160 | mail.testmessage.send=false
161 | mail.testmessage.to=
162 | mail.testmessage.subject=Outbound SMTP
163 | mail.testmessage.text=The Outbound SMTP email subsystem is working.
164 |
165 | ##IMAP
166 | #imap.server.enabled=true
167 | #imap.server.port=143
168 | #imap.server.host=localhost
169 |
170 | #
171 | # File Servers
172 | #-------------
173 | # WebDAV initialization properties
174 | system.webdav.servlet.enabled=true
175 | system.webdav.rootPath=${protocols.rootPath}
176 |
177 | cifs.enabled=false
178 | filesystem.avm.enabled=false
179 | cifs.tcpipSMB.port=1445
180 | cifs.netBIOSSMB.sessionPort=1139
181 | cifs.netBIOSSMB.namePort=1137
182 | cifs.netBIOSSMB.datagramPort=1138
183 |
184 | ftp.enabled=true
185 | ftp.port=2021
186 |
187 | #
188 | # The default authentication chain
189 | # To configure external authentication subsystems see:
190 | # http://wiki.alfresco.com/wiki/Alfresco_Authentication_Subsystems
191 | #-------------
192 | #authentication.chain=alfrescoNtlm1:alfrescoNtlm
193 |
194 |
--------------------------------------------------------------------------------
/templates/apply_amps.sh.erb:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | # -------
6 | # Script for apply AMPs to installed WAR
7 | #
8 | #
9 | # OOTB modified - moved to an erb template to pick up parameterised base directory, and hardcoded
10 | # CATALINA_HOME, also removed the interactive parts
11 | # -------
12 | cd $(dirname $0)
13 | export SCRIPTPATH=$(pwd)
14 | #OOTB
15 | #export ALF_HOME=${SCRIPTPATH%/*}
16 | #export CATALINA_HOME=$ALF_HOME/tomcat
17 | export ALF_HOME=<%= @alfresco_base_dir %>
18 | export CATALINA_HOME=<%= @tomcat_home %>
19 |
20 | #. $ALF_HOME/scripts/setenv.sh
21 | #echo "This script will apply all the AMPs in amps and amps_share to the alfresco.war and share.war files in $CATALINA_HOME/webapps"
22 | #echo "Press control-c to stop this script . . ."
23 | #echo "Press any other key to continue . . ."
24 | #read RESP
25 | java -jar $ALF_HOME/bin/alfresco-mmt.jar install $ALF_HOME/amps $CATALINA_HOME/webapps/alfresco.war -directory $*
26 | java -jar $ALF_HOME/bin/alfresco-mmt.jar list $CATALINA_HOME/webapps/alfresco.war
27 | java -jar $ALF_HOME/bin/alfresco-mmt.jar install $ALF_HOME/amps_share $CATALINA_HOME/webapps/share.war -directory $*
28 | java -jar $ALF_HOME/bin/alfresco-mmt.jar list $CATALINA_HOME/webapps/share.war
29 | #echo "About to clean out $ALF_HOME/tomcat/webapps/alfresco and share directories and temporary files..."
30 | #echo "Press control-c to stop this script . . ."
31 | #echo "Press any other key to continue . . ."
32 | #read DUMMY
33 | #
34 | rm -rf $CATALINA_HOME/webapps/alfresco
35 | rm -rf $CATALINA_HOME/webapps/share
36 | . $ALF_HOME/bin/clean_tomcat.sh
37 |
38 |
39 |
--------------------------------------------------------------------------------
/templates/default-tomcat.erb:
--------------------------------------------------------------------------------
1 | # Run Tomcat as this user ID. Not setting this or leaving it blank will use the
2 | # default of tomcat.
3 | tomcat_USER=tomcat
4 |
5 | # Run Tomcat as this group ID. Not setting this or leaving it blank will use
6 | # the default of tomcat.
7 | tomcat_GROUP=tomcat
8 |
9 | # The home directory of the Java development kit (JDK). You need at least
10 | # JDK version 1.5. If JAVA_HOME is not set, some common directories for
11 | # OpenJDK, the Sun JDK, and various J2SE 1.5 versions are tried.
12 | #JAVA_HOME=/usr/lib/jvm/openjdk-6-jdk
13 |
14 | # You may pass JVM startup parameters to Java here. If unset, the default
15 | # options will be: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC
16 | #
17 | # Use "-XX:+UseConcMarkSweepGC" to enable the CMS garbage collector (improved
18 | # response time). If you use that option and you run Tomcat on a machine with
19 | # exactly one CPU chip that contains one or two cores, you should also add
20 | # the "-XX:+CMSIncrementalMode" option.
21 | JAVA_OPTS="-Djava.awt.headless=true <%= @java_opts %> -XX:+UseConcMarkSweepGC"
22 |
23 | # To enable remote debugging uncomment the following line.
24 | # You will then be able to use a java debugger on port 8000.
25 | #JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
26 |
27 | # Java compiler to use for translating JavaServer Pages (JSPs). You can use all
28 | # compilers that are accepted by Ant's build.compiler property.
29 | #JSP_COMPILER=javac
30 |
31 | # Use the Java security manager? (yes/no, default: no)
32 | #tomcat_SECURITY=no
33 |
34 | # Number of days to keep logfiles in /var/log/tomcat. Default is 14 days.
35 | #LOGFILE_DAYS=14
36 | # Whether to compress logfiles older than today's
37 | #LOGFILE_COMPRESS=1
38 |
39 | # Location of the JVM temporary directory
40 | # WARNING: This directory will be destroyed and recreated at every startup !
41 | #JVM_TMP=/tmp/tomcat-temp
42 |
43 | # If you run Tomcat on port numbers that are all higher than 1023, then you
44 | # do not need authbind. It is used for binding Tomcat to lower port numbers.
45 | # NOTE: authbind works only with IPv4. Do not enable it when using IPv6.
46 | # (yes/no, default: no)
47 | #AUTHBIND=no
48 |
--------------------------------------------------------------------------------
/templates/makeimagemagicklink.sh.erb:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | IMAGEMAGICK=`sudo find /usr -name jpeg.so | grep coders | sed "s/\/jpeg.so$//"`
4 | echo ${IMAGEMAGICK}
5 | DESTLINK="<%= @alfresco_base_dir %>/ImageMagickCoders"
6 |
7 | #if test -e "/opt/alfresco/ImageMagickCoders"; then
8 | # ln -sfn ${IMAGEMAGICK} ${DESTLINK}
9 | #else
10 | # ln -s ${IMAGEMAGICK} ${DESTLINK}
11 | #fi;
12 |
13 |
14 | rm -f ${DESTLINK}
15 | ln -s ${IMAGEMAGICK} ${DESTLINK}
16 |
--------------------------------------------------------------------------------
/templates/scripts/replacefiles.py.erb:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | import os, shutil
4 |
5 | def copyFile(src, dest):
6 | try:
7 | shutil.copy(src, dest)
8 | # eg. src and dest are the same file
9 | except shutil.Error as e:
10 | print('Error: %s' % e)
11 | # eg. source or destination doesn't exist
12 | except IOError as e:
13 | print('Error: %s' % e.strerror)
14 |
15 | sourcefavicon = "<%= @tomcat_home %>/webapps/share/themes/beeTheme/images/favicon.ico"
16 | replacefavicon = ["<%= @tomcat_home %>/webapps/ROOT/favicon.ico",
17 | "<%= @tomcat_home %>/webapps/alfresco/favicon.ico",
18 | "<%= @tomcat_home %>/webapps/alfresco/images/logo/AlfrescoLogo16.ico",
19 | "<%= @tomcat_home %>/webapps/share/favicon.ico",
20 | "<%= @tomcat_home %>/webapps/solr4/favicon.ico",
21 | "<%= @tomcat_home %>/webapps/solr4/img/favicon.ico"]
22 |
23 | for favicon in replacefavicon:
24 | copyFile( sourcefavicon, favicon )
25 | fd = os.open(favicon,os.O_RDONLY)
26 | os.fchown( fd, 501, 501)
27 | os.close(fd)
28 |
29 | sourcelogo = "<%= @tomcat_home %>/webapps/share/themes/beeTheme/images/alfresco-share-logo.png"
30 | replacelogo = ["<%= @tomcat_home %>/webapps/share/components/images/alfresco-share-logo.png"]
31 |
32 | for logo in replacelogo:
33 | copyFile( sourcelogo, logo )
34 | fd = os.open(logo,os.O_RDONLY)
35 | os.fchown( fd, 501, 501)
36 | os.close(fd)
37 |
38 |
39 |
--------------------------------------------------------------------------------
/templates/share-config-custom.xml.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | false
8 |
10 | false
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | production
19 |
20 |
21 |
22 |
23 |
24 |
25 | Alfresco-CSRFToken
26 | https?:\/\/<%= @share_host %>\/.*
27 | https?:\/\/<%= @share_host %>.*
28 |
29 |
30 |
31 |
32 |
33 |
34 | alfresco-noauth
35 | Alfresco - unauthenticated access
36 | Access to Alfresco Repository WebScripts that do not require authentication
37 | alfresco
38 | http://<%= @repo_host %>:8080/alfresco/s
39 | none
40 |
41 |
42 |
43 | alfresco
44 | Alfresco - user access
45 | Access to Alfresco Repository WebScripts that require user authentication
46 | alfresco
47 | http://<%= @repo_host %>:8080/alfresco/s
48 | user
49 |
50 |
51 |
52 | alfresco-feed
53 | Alfresco Feed
54 | Alfresco Feed - supports basic HTTP authentication via the EndPointProxyServlet
55 | http
56 | http://<%= @repo_host %>:8080/alfresco/s
57 | true
58 | user
59 |
60 |
61 |
62 | activiti-admin
63 | Activiti Admin UI - user access
64 | Access to Activiti Admin UI, that requires user authentication
65 | activiti-admin-connector
66 | http://<%= @repo_host %>:8080/alfresco/activiti-admin
67 | user
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/templates/solr.xml.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/templates/solr4.xml.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/templates/solr4core-archive.properties.erb:
--------------------------------------------------------------------------------
1 | #
2 | # solrcore.properties - used in solrconfig.xml
3 | #
4 | # data is in ${data.dir.root}/${data.dir.store}
5 |
6 | data.dir.root=<%= @alfresco_base_dir %>/solr4
7 | data.dir.store=archive/SpacesStore
8 | enable.alfresco.tracking=true
9 | cache.alfresco.size=100
10 | max.field.length=2147483647
11 |
12 |
13 | #
14 | # Properties loaded during alfresco tracking
15 | #
16 |
17 | alfresco.host=localhost
18 | alfresco.port=8080
19 | alfresco.port.ssl=8443
20 | alfresco.baseUrl=/alfresco
21 | alfresco.cron=0/15 * * * * ? *
22 | alfresco.stores=archive://SpacesStore
23 | alfresco.lag=1000
24 | alfresco.hole.retention=3600000
25 | alfresco.batch.count=2000
26 |
27 | # encryption
28 |
29 | # none, https
30 | alfresco.secureComms=https
31 |
32 | # ssl
33 | alfresco.encryption.ssl.keystore.type=JCEKS
34 | alfresco.encryption.ssl.keystore.provider=
35 | alfresco.encryption.ssl.keystore.location=ssl.repo.client.keystore
36 | alfresco.encryption.ssl.keystore.passwordFileLocation=ssl-keystore-passwords.properties
37 | alfresco.encryption.ssl.truststore.type=JCEKS
38 | alfresco.encryption.ssl.truststore.provider=
39 | alfresco.encryption.ssl.truststore.location=ssl.repo.client.truststore
40 | alfresco.encryption.ssl.truststore.passwordFileLocation=ssl-truststore-passwords.properties
41 |
42 | ## Tracking
43 |
44 | alfresco.enableMultiThreadedTracking=true
45 | alfresco.corePoolSize=3
46 | alfresco.maximumPoolSize=-1
47 | alfresco.keepAliveTime=120
48 | alfresco.threadPriority=5
49 | alfresco.threadDaemon=true
50 | alfresco.workQueueSize=-1
51 |
52 | # HTTP Client
53 |
54 | alfresco.maxTotalConnections=40
55 | alfresco.maxHostConnections=40
56 | alfresco.socketTimeout=60000
57 |
58 | # SOLR caching
59 |
60 | solr.filterCache.size=64
61 | solr.filterCache.initialSize=64
62 | solr.queryResultCache.size=1024
63 | solr.queryResultCache.initialSize=1024
64 | solr.documentCache.size=64
65 | solr.documentCache.initialSize=64
66 | solr.queryResultMaxDocsCached=2000
67 |
68 | solr.authorityCache.size=64
69 | solr.authorityCache.initialSize=64
70 | solr.pathCache.size=64
71 | solr.pathCache.initialSize=64
72 |
73 | # SOLR
74 |
75 | solr.maxBooleanClauses=10000
76 |
77 | #
78 | # TODO
79 | #
80 | # cross language support
81 | # locale expansion
82 | # logging check report ....
83 | #
84 | #
85 |
--------------------------------------------------------------------------------
/templates/solr4core-workspace.properties.erb:
--------------------------------------------------------------------------------
1 | #
2 | # solrcore.properties - used in solrconfig.xml
3 | #
4 | # data is in ${data.dir.root}/${data.dir.store}
5 |
6 | data.dir.root=<%= @alfresco_base_dir %>/solr4
7 | data.dir.store=workspace/SpacesStore
8 | enable.alfresco.tracking=true
9 | cache.alfresco.size=100
10 | max.field.length=2147483647
11 |
12 |
13 | #
14 | # Properties loaded during alfresco tracking
15 | #
16 |
17 | alfresco.host=localhost
18 | alfresco.port=8080
19 | alfresco.port.ssl=8443
20 | alfresco.baseUrl=/alfresco
21 | alfresco.cron=0/15 * * * * ? *
22 | alfresco.stores=workspace://SpacesStore
23 | #alfresco.index.transformContent=false
24 | #alfresco.ignore.datatype.1=d:content
25 | alfresco.lag=1000
26 | alfresco.hole.retention=3600000
27 | # alfresco.hole.check.after is not used yet
28 | # It will reduce the hole checking load
29 | alfresco.hole.check.after=300000
30 | alfresco.batch.count=2000
31 |
32 | # encryption
33 |
34 | # none, https
35 | alfresco.secureComms=https
36 |
37 | # ssl
38 | alfresco.encryption.ssl.keystore.type=JCEKS
39 | alfresco.encryption.ssl.keystore.provider=
40 | alfresco.encryption.ssl.keystore.location=ssl.repo.client.keystore
41 | alfresco.encryption.ssl.keystore.passwordFileLocation=ssl-keystore-passwords.properties
42 | alfresco.encryption.ssl.truststore.type=JCEKS
43 | alfresco.encryption.ssl.truststore.provider=
44 | alfresco.encryption.ssl.truststore.location=ssl.repo.client.truststore
45 | alfresco.encryption.ssl.truststore.passwordFileLocation=ssl-truststore-passwords.properties
46 |
47 | # Tracking
48 |
49 | alfresco.enableMultiThreadedTracking=true
50 | alfresco.corePoolSize=3
51 | alfresco.maximumPoolSize=-1
52 | alfresco.keepAliveTime=120
53 | alfresco.threadPriority=5
54 | alfresco.threadDaemon=true
55 | alfresco.workQueueSize=-1
56 |
57 | # HTTP Client
58 |
59 | alfresco.maxTotalConnections=40
60 | alfresco.maxHostConnections=40
61 | alfresco.socketTimeout=60000
62 |
63 | # SOLR caching
64 |
65 | solr.filterCache.size=64
66 | solr.filterCache.initialSize=64
67 | solr.queryResultCache.size=1024
68 | solr.queryResultCache.initialSize=1024
69 | solr.documentCache.size=64
70 | solr.documentCache.initialSize=64
71 | solr.queryResultMaxDocsCached=2000
72 |
73 | solr.authorityCache.size=64
74 | solr.authorityCache.initialSize=64
75 | solr.pathCache.size=64
76 | solr.pathCache.initialSize=64
77 |
78 | solr.readerToAclIdsCache.size=64
79 | solr.readerToAclIdsCache.initialSize=64
80 |
81 | # SOLR
82 |
83 | solr.maxBooleanClauses=10000
84 |
85 | # Batch fetch
86 |
87 | alfresco.transactionDocsBatchSize=100
88 | alfresco.changeSetAclsBatchSize=100
89 | alfresco.aclBatchSize=10
90 |
91 | # Warming
92 |
93 | solr.filterCache.autowarmCount=128
94 | solr.authorityCache.autowarmCount=0
95 | solr.pathCache.autowarmCount=128
96 |
97 | solr.queryResultWindowSize=200
98 |
99 |
100 | #
101 | # TODO
102 | #
103 | # cross language support
104 | # locale expansion
105 | # logging check report ....
106 | #
107 | #
108 |
109 |
110 | alfresco.doPermissionChecks=true
111 |
--------------------------------------------------------------------------------
/templates/solrcore-archive.properties.erb:
--------------------------------------------------------------------------------
1 | #
2 | # solrcore.properties - used in solrconfig.xml
3 | #
4 | # data is in ${data.dir.root}/${data.dir.store}
5 |
6 | data.dir.root=<%= @alfresco_base_dir %>/alf_data/solr
7 | data.dir.store=archive/SpacesStore
8 | enable.alfresco.tracking=true
9 | cache.alfresco.size=100
10 | max.field.length=2147483647
11 |
12 |
13 | #
14 | # Properties loaded during alfresco tracking
15 | #
16 |
17 | alfresco.host=<%= @repo_host %>
18 | alfresco.port=8080
19 | alfresco.port.ssl=8443
20 | alfresco.baseUrl=/alfresco
21 | alfresco.cron=0/15 * * * * ? *
22 | alfresco.stores=archive://SpacesStore
23 | alfresco.lag=1000
24 | alfresco.hole.retention=3600000
25 | alfresco.batch.count=2000
26 |
27 | # encryption
28 |
29 | # none, https
30 | alfresco.secureComms=https
31 |
32 | # ssl
33 | alfresco.encryption.ssl.keystore.type=JCEKS
34 | alfresco.encryption.ssl.keystore.provider=
35 | alfresco.encryption.ssl.keystore.location=ssl.repo.client.keystore
36 | alfresco.encryption.ssl.keystore.passwordFileLocation=ssl-keystore-passwords.properties
37 | alfresco.encryption.ssl.truststore.type=JCEKS
38 | alfresco.encryption.ssl.truststore.provider=
39 | alfresco.encryption.ssl.truststore.location=ssl.repo.client.truststore
40 | alfresco.encryption.ssl.truststore.passwordFileLocation=ssl-truststore-passwords.properties
41 |
42 | ## Tracking
43 |
44 | alfresco.enableMultiThreadedTracking=true
45 | alfresco.corePoolSize=3
46 | alfresco.maximumPoolSize=-1
47 | alfresco.keepAliveTime=120
48 | alfresco.threadPriority=5
49 | alfresco.threadDaemon=true
50 | alfresco.workQueueSize=-1
51 |
52 | # HTTP Client
53 |
54 | alfresco.maxTotalConnections=40
55 | alfresco.maxHostConnections=40
56 |
57 |
58 | #alfresco.socketTimeout=60000
59 | alfresco.socketTimeout=600000
60 |
61 | # SOLR caching
62 |
63 | solr.filterCache.size=64
64 | solr.filterCache.initialSize=64
65 | solr.queryResultCache.size=2000
66 | solr.queryResultCache.initialSize=2000
67 | solr.documentCache.size=64
68 | solr.documentCache.initialSize=64
69 | solr.queryResultMaxDocsCached=2000
70 |
71 | solr.authorityCache.size=64
72 | solr.authorityCache.initialSize=64
73 | solr.pathCache.size=64
74 | solr.pathCache.initialSize=64
75 |
76 | # SOLR
77 |
78 | solr.maxBooleanClauses=10000
79 |
80 | #
81 | # TODO
82 | #
83 | # cross language support
84 | # locale expansion
85 | # logging check report ....
86 | #
87 | #
88 |
--------------------------------------------------------------------------------
/templates/solrcore-workspace.properties.erb:
--------------------------------------------------------------------------------
1 | #
2 | # solrcore.properties - used in solrconfig.xml
3 | #
4 | # data is in ${data.dir.root}/${data.dir.store}
5 |
6 | data.dir.root=<%= @alfresco_base_dir %>/alf_data/solr
7 | data.dir.store=workspace/SpacesStore
8 | enable.alfresco.tracking=true
9 | cache.alfresco.size=100
10 | max.field.length=2147483647
11 |
12 |
13 | #
14 | # Properties loaded during alfresco tracking
15 | #
16 |
17 | alfresco.host=<%= @repo_host %>
18 | alfresco.port=8080
19 | alfresco.port.ssl=8443
20 | alfresco.baseUrl=/alfresco
21 | alfresco.cron=0/15 * * * * ? *
22 | alfresco.stores=workspace://SpacesStore
23 | #alfresco.index.transformContent=false
24 | #alfresco.ignore.datatype.1=d:content
25 | alfresco.lag=1000
26 | alfresco.hole.retention=3600000
27 | # alfresco.hole.check.after is not used yet
28 | # It will reduce the hole checking load
29 | alfresco.hole.check.after=300000
30 | alfresco.batch.count=2000
31 |
32 | # encryption
33 |
34 | # none, https
35 | alfresco.secureComms=https
36 |
37 | # ssl
38 | alfresco.encryption.ssl.keystore.type=JCEKS
39 | alfresco.encryption.ssl.keystore.provider=
40 | alfresco.encryption.ssl.keystore.location=ssl.repo.client.keystore
41 | alfresco.encryption.ssl.keystore.passwordFileLocation=ssl-keystore-passwords.properties
42 | alfresco.encryption.ssl.truststore.type=JCEKS
43 | alfresco.encryption.ssl.truststore.provider=
44 | alfresco.encryption.ssl.truststore.location=ssl.repo.client.truststore
45 | alfresco.encryption.ssl.truststore.passwordFileLocation=ssl-truststore-passwords.properties
46 |
47 | # Tracking
48 |
49 | alfresco.enableMultiThreadedTracking=true
50 | alfresco.corePoolSize=3
51 | alfresco.maximumPoolSize=-1
52 | alfresco.keepAliveTime=120
53 | alfresco.threadPriority=5
54 | alfresco.threadDaemon=true
55 | alfresco.workQueueSize=-1
56 |
57 | # HTTP Client
58 |
59 | alfresco.maxTotalConnections=40
60 | alfresco.maxHostConnections=40
61 |
62 | #alfresco.socketTimeout=60000
63 | alfresco.socketTimeout=600000
64 |
65 | # SOLR caching
66 |
67 | solr.filterCache.size=64
68 | solr.filterCache.initialSize=64
69 | solr.queryResultCache.size=1024
70 | solr.queryResultCache.initialSize=1024
71 | solr.documentCache.size=64
72 | solr.documentCache.initialSize=64
73 | solr.queryResultMaxDocsCached=2000
74 |
75 | solr.authorityCache.size=64
76 | solr.authorityCache.initialSize=64
77 | solr.pathCache.size=64
78 | solr.pathCache.initialSize=64
79 |
80 | solr.readerToAclIdsCache.size=64
81 | solr.readerToAclIdsCache.initialSize=64
82 |
83 | # SOLR
84 |
85 | solr.maxBooleanClauses=10000
86 |
87 | # Batch fetch
88 |
89 | alfresco.transactionDocsBatchSize=100
90 | alfresco.changeSetAclsBatchSize=100
91 | alfresco.aclBatchSize=10
92 |
93 | # Warming
94 |
95 | solr.filterCache.autowarmCount=128
96 | solr.authorityCache.autowarmCount=0
97 | solr.pathCache.autowarmCount=128
98 |
99 | solr.queryResultWindowSize=200
100 |
101 |
102 | #
103 | # TODO
104 | #
105 | # cross language support
106 | # locale expansion
107 | # logging check report ....
108 | #
109 | #
110 |
111 |
112 | alfresco.doPermissionChecks=true
113 |
--------------------------------------------------------------------------------
/templates/test.sh.erb:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | TESTDIR=<%= @testdir %>
4 | export USERNAME=admin
5 | export PASSWORD=<%= @initial_admin_pass %>
6 | export DOMAIN_NAME=<%= @domain_name %>
7 |
8 |
9 | set -e
10 | for file in ${TESTDIR}/*
11 | do
12 | phantomjs --ignore-ssl-errors=true $file
13 | done
14 |
--------------------------------------------------------------------------------
/templates/tests-config.yml.erb:
--------------------------------------------------------------------------------
1 | user: admin
2 | passwd: <%= @initial_admin_pass %>
3 | url: http://<%= @domain_name %>:8080
4 | browser: firefox
5 | cmisurl: <%= @cmis_url %>
6 | ftpurl: <%= @domain_name %>
7 | ftpport: 2021
8 | ftpsrc: /Alfresco/Sites/swsdp/documentLibrary/Presentations
9 | ftpsrcfile: Project Overview.ppt
10 |
11 |
--------------------------------------------------------------------------------
/templates/tests/login.js.erb:
--------------------------------------------------------------------------------
1 |
2 | var page = require('webpage').create(),
3 | srv ="https://<%= @domain_name %>:8443/share/page/dologin",
4 | data = "username=admin&password=<%= @initial_admin_pass %>";
5 |
6 | page.open(srv, 'post', data, function(status){
7 | if(status !== 'success'){
8 | throw new Error('login POST was unsuccessful');
9 | phantom.exit(1);
10 | } else {
11 | console.log(page.content);
12 | }
13 | phantom.exit();
14 |
15 | });
16 |
17 |
--------------------------------------------------------------------------------
/templates/tomcat-init-centos.erb:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # description: Tomcat Start Stop Restart
3 | # processname: tomcat
4 | # chkconfig: 234 20 80
5 | JAVA_HOME=/usr/lib/jvm/jre
6 | export JAVA_HOME
7 | PATH=$JAVA_HOME/bin:$PATH
8 | export PATH
9 | CATALINA_HOME="<%= @tomcat_home %>"
10 |
11 | JAVA_OPTS="<%= @java_opts %>"
12 | export JAVA_OPTS
13 |
14 | function kill_tomcat {
15 | kill -9 `ps ax | grep tomcat | grep java | cut -c1-5`
16 | }
17 |
18 | case $1 in
19 | start)
20 | # MC OOTB 20141010 - restarting doesn't work unless tomcat
21 | # temp dirs are cleared down, copied this from clean_tomcat.sh
22 | rm -rf $CATALINA_HOME/temp/Alfresco $CATALINA_HOME/work/Catalina/localhost/alfresco
23 | rm -rf $CATALINA_HOME/work/Catalina/localhost/share
24 | rm -rf $CATALINA_HOME/work/Catalina/localhost/awe
25 | rm -rf $CATALINA_HOME/work/Catalina/localhost/wcmqs
26 |
27 | cd $CATALINA_HOME
28 |
29 | su tomcat -c "sh $CATALINA_HOME/bin/startup.sh"
30 | ;;
31 | stop)
32 | su tomcat -c "sh $CATALINA_HOME/bin/shutdown.sh"
33 | kill_tomcat
34 | ;;
35 | restart)
36 | su tomcat -c "sh $CATALINA_HOME/bin/shutdown.sh"
37 | kill_tomcat
38 | su tomcat -c "sh $CATALINA_HOME/bin/startup.sh"
39 | ;;
40 | esac
41 | exit 0
42 |
43 |
--------------------------------------------------------------------------------
/templates/tomcat-init.erb:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # /etc/init.d/tomcat -- startup script for the Tomcat 6 servlet engine
4 | #
5 | # Written by Miquel van Smoorenburg .
6 | # Modified for Debian GNU/Linux by Ian Murdock .
7 | # Modified for Tomcat by Stefan Gybas .
8 | # Modified for Tomcat6 by Thierry Carrez .
9 | # Modified for tomcat by Ernesto Hernandez-Novich .
10 | # Additional improvements by Jason Brittain .
11 | #
12 | ### BEGIN INIT INFO
13 | # Provides: tomcat
14 | # Required-Start: $local_fs $remote_fs $network
15 | # Required-Stop: $local_fs $remote_fs $network
16 | # Should-Start: $named
17 | # Should-Stop: $named
18 | # Default-Start: 2 3 4 5
19 | # Default-Stop: 0 1 6
20 | # Short-Description: Start Tomcat.
21 | # Description: Start the Tomcat servlet engine.
22 | ### END INIT INFO
23 |
24 | set -e
25 |
26 | PATH=/bin:/usr/bin:/sbin:/usr/sbin
27 | NAME=tomcat
28 | DESC="Tomcat servlet engine"
29 | DEFAULT=/etc/default/$NAME
30 | JVM_TMP=/tmp/tomcat-$NAME-tmp
31 |
32 | if [ `id -u` -ne 0 ]; then
33 | echo "You need root privileges to run this script"
34 | exit 1
35 | fi
36 |
37 | # Make sure tomcat is started with system locale
38 | if [ -r /etc/default/locale ]; then
39 | . /etc/default/locale
40 | export LANG
41 | fi
42 |
43 | . /lib/lsb/init-functions
44 |
45 | if [ -r /etc/default/rcS ]; then
46 | . /etc/default/rcS
47 | fi
48 |
49 |
50 | # The following variables can be overwritten in $DEFAULT
51 |
52 | # Run Tomcat 7 as this user ID and group ID
53 | tomcat_USER=tomcat
54 | tomcat_GROUP=tomcat
55 |
56 | # this is a work-around until there is a suitable runtime replacement
57 | # for dpkg-architecture for arch:all packages
58 | # this function sets the variable OPENJDKS
59 | find_openjdks()
60 | {
61 | for jvmdir in /usr/lib/jvm/java-8-openjdk-*
62 | do
63 | if [ -d "${jvmdir}" -a "${jvmdir}" != "/usr/lib/jvm/java-8-openjdk-common" ]
64 | then
65 | OPENJDKS=$jvmdir
66 | fi
67 | done
68 | for jvmdir in /usr/lib/jvm/java-7-openjdk-*
69 | do
70 | if [ -d "${jvmdir}" -a "${jvmdir}" != "/usr/lib/jvm/java-7-openjdk-common" ]
71 | then
72 | OPENJDKS=$jvmdir
73 | fi
74 | done
75 | for jvmdir in /usr/lib/jvm/java-6-openjdk-*
76 | do
77 | if [ -d "${jvmdir}" -a "${jvmdir}" != "/usr/lib/jvm/java-6-openjdk-common" ]
78 | then
79 | OPENJDKS="${OPENJDKS} ${jvmdir}"
80 | fi
81 | done
82 | }
83 |
84 | OPENJDKS=""
85 | find_openjdks
86 | # The first existing directory is used for JAVA_HOME (if JAVA_HOME is not
87 | # defined in $DEFAULT)
88 | JDK_DIRS="/usr/lib/jvm/default-java ${OPENJDKS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle /usr/lib/jvm/java-8-oracle"
89 |
90 | # Look for the right JVM to use
91 | for jdir in $JDK_DIRS; do
92 | if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then
93 | JAVA_HOME="$jdir"
94 | fi
95 | done
96 | export JAVA_HOME
97 |
98 | # Directory where the Tomcat 6 binary distribution resides
99 | #CATALINA_HOME=/usr/share/$NAME
100 | CATALINA_HOME=<%= @tomcat_home %>
101 |
102 | # Directory for per-instance configuration files and webapps
103 | #CATALINA_BASE=/var/lib/$NAME
104 | CATALINA_BASE=$CATALINA_HOME
105 |
106 | # Use the Java security manager? (yes/no)
107 | tomcat_SECURITY=no
108 |
109 | # Default Java options
110 | # Set java.awt.headless=true if JAVA_OPTS is not set so the
111 | # Xalan XSL transformer can work without X11 display on JDK 1.4+
112 | # It also looks like the default heap size of 64M is not enough for most cases
113 | # so the maximum heap size is set to 128M
114 | if [ -z "$JAVA_OPTS" ]; then
115 | JAVA_OPTS="-Djava.awt.headless=true -Xmx128M"
116 | fi
117 |
118 | # End of variables that can be overwritten in $DEFAULT
119 |
120 | # overwrite settings from default file
121 | if [ -f "$DEFAULT" ]; then
122 | . "$DEFAULT"
123 | fi
124 |
125 | if [ ! -f "$CATALINA_HOME/bin/bootstrap.jar" ]; then
126 | log_failure_msg "$NAME is not installed"
127 | exit 1
128 | fi
129 |
130 | POLICY_CACHE="$CATALINA_BASE/work/catalina.policy"
131 |
132 | if [ -z "$CATALINA_TMPDIR" ]; then
133 | CATALINA_TMPDIR="$JVM_TMP"
134 | fi
135 |
136 | # Set the JSP compiler if set in the tomcat.default file
137 | if [ -n "$JSP_COMPILER" ]; then
138 | JAVA_OPTS="$JAVA_OPTS -Dbuild.compiler=\"$JSP_COMPILER\""
139 | fi
140 |
141 | SECURITY=""
142 | if [ "$tomcat_SECURITY" = "yes" ]; then
143 | SECURITY="-security"
144 | fi
145 |
146 | # Define other required variables
147 | CATALINA_PID="/var/run/$NAME.pid"
148 | CATALINA_SH="$CATALINA_HOME/bin/catalina.sh"
149 |
150 | # Look for Java Secure Sockets Extension (JSSE) JARs
151 | if [ -z "${JSSE_HOME}" -a -r "${JAVA_HOME}/jre/lib/jsse.jar" ]; then
152 | JSSE_HOME="${JAVA_HOME}/jre/"
153 | fi
154 |
155 | catalina_sh() {
156 | # Escape any double quotes in the value of JAVA_OPTS
157 | JAVA_OPTS="$(echo $JAVA_OPTS | sed 's/\"/\\\"/g')"
158 |
159 | AUTHBIND_COMMAND=""
160 | if [ "$AUTHBIND" = "yes" -a "$1" = "start" ]; then
161 | AUTHBIND_COMMAND="/usr/bin/authbind --deep /bin/bash -c "
162 | fi
163 |
164 | # Define the command to run Tomcat's catalina.sh as a daemon
165 | # set -a tells sh to export assigned variables to spawned shells.
166 | TOMCAT_SH="set -a; JAVA_HOME=\"$JAVA_HOME\"; source \"$DEFAULT\"; \
167 | CATALINA_HOME=\"$CATALINA_HOME\"; \
168 | CATALINA_BASE=\"$CATALINA_BASE\"; \
169 | JAVA_OPTS=\"$JAVA_OPTS\"; \
170 | CATALINA_PID=\"$CATALINA_PID\"; \
171 | CATALINA_TMPDIR=\"$CATALINA_TMPDIR\"; \
172 | LANG=\"$LANG\"; JSSE_HOME=\"$JSSE_HOME\"; \
173 | cd \"$CATALINA_BASE\"; \
174 | \"$CATALINA_SH\" $@"
175 |
176 | if [ "$AUTHBIND" = "yes" -a "$1" = "start" ]; then
177 | TOMCAT_SH="'$TOMCAT_SH'"
178 | fi
179 |
180 | # Run the catalina.sh script as a daemon
181 | set +e
182 | touch "$CATALINA_PID" "$CATALINA_BASE"/logs/catalina.out
183 | chown $tomcat_USER "$CATALINA_PID" "$CATALINA_BASE"/logs/catalina.out
184 | start-stop-daemon --start -b -u "$tomcat_USER" -g "$tomcat_GROUP" \
185 | -c "$tomcat_USER" -d "$CATALINA_TMPDIR" -p "$CATALINA_PID" \
186 | -x /bin/bash -- -c "$AUTHBIND_COMMAND $TOMCAT_SH"
187 | status="$?"
188 | set +a -e
189 | return $status
190 | }
191 |
192 | case "$1" in
193 | start)
194 | if [ -z "$JAVA_HOME" ]; then
195 | log_failure_msg "no JDK or JRE found - please set JAVA_HOME"
196 | exit 1
197 | fi
198 |
199 | if [ ! -d "$CATALINA_BASE/conf" ]; then
200 | log_failure_msg "invalid CATALINA_BASE: $CATALINA_BASE"
201 | exit 1
202 | fi
203 |
204 | log_daemon_msg "Starting $DESC" "$NAME"
205 | if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \
206 | --user $tomcat_USER --exec "$JAVA_HOME/bin/java" \
207 | >/dev/null; then
208 |
209 |
210 | # MC OOTB 20140905 this clause is causing me problems, removing
211 | # unless I find a need for it
212 | # # Regenerate POLICY_CACHE file
213 | # umask 022
214 | # echo "// AUTO-GENERATED FILE from /etc/tomcat/policy.d/" \
215 | # > "$POLICY_CACHE"
216 | # echo "" >> "$POLICY_CACHE"
217 | # cat $CATALINA_BASE/conf/policy.d/*.policy \
218 | # >> "$POLICY_CACHE"
219 | #
220 |
221 | # MC OOTB 20141010 - restarting doesn't work unless tomcat
222 | # temp dirs are cleared down, copied this from clean_tomcat.sh
223 | rm -rf $CATALINA_BASE/temp/Alfresco $CATALINA_BASE/work/Catalina/localhost/alfresco
224 | rm -rf $CATALINA_BASE/work/Catalina/localhost/share
225 | rm -rf $CATALINA_BASE/work/Catalina/localhost/awe
226 | rm -rf $CATALINA_BASE/work/Catalina/localhost/wcmqs
227 |
228 | # Remove / recreate JVM_TMP directory
229 | rm -rf "$JVM_TMP"
230 | mkdir -p "$JVM_TMP" || {
231 | log_failure_msg "could not create JVM temporary directory"
232 | exit 1
233 | }
234 | chown $tomcat_USER "$JVM_TMP"
235 |
236 | catalina_sh start $SECURITY
237 | sleep 5
238 | if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \
239 | --user $tomcat_USER --exec "$JAVA_HOME/bin/java" \
240 | >/dev/null; then
241 | if [ -f "$CATALINA_PID" ]; then
242 | rm -f "$CATALINA_PID"
243 | fi
244 | log_end_msg 1
245 | else
246 | log_end_msg 0
247 | fi
248 | else
249 | log_progress_msg "(already running)"
250 | log_end_msg 0
251 | fi
252 | ;;
253 | stop)
254 | log_daemon_msg "Stopping $DESC" "$NAME"
255 |
256 | set +e
257 | if [ -f "$CATALINA_PID" ]; then
258 | start-stop-daemon --stop --pidfile "$CATALINA_PID" \
259 | --user "$tomcat_USER" \
260 | --retry=TERM/20/KILL/5 >/dev/null
261 | if [ $? -eq 1 ]; then
262 | log_progress_msg "$DESC is not running but pid file exists, cleaning up"
263 | elif [ $? -eq 3 ]; then
264 | PID="`cat $CATALINA_PID`"
265 | log_failure_msg "Failed to stop $NAME (pid $PID)"
266 | exit 1
267 | fi
268 | rm -f "$CATALINA_PID"
269 | rm -rf "$JVM_TMP"
270 | else
271 | log_progress_msg "(not running)"
272 | fi
273 | log_end_msg 0
274 | set -e
275 | ;;
276 | status)
277 | set +e
278 | start-stop-daemon --test --start --pidfile "$CATALINA_PID" \
279 | --user $tomcat_USER --exec "$JAVA_HOME/bin/java" \
280 | >/dev/null 2>&1
281 | if [ "$?" = "0" ]; then
282 |
283 | if [ -f "$CATALINA_PID" ]; then
284 | log_success_msg "$DESC is not running, but pid file exists."
285 | exit 1
286 | else
287 | log_success_msg "$DESC is not running."
288 | exit 3
289 | fi
290 | else
291 | log_success_msg "$DESC is running with pid `cat $CATALINA_PID`"
292 | fi
293 | set -e
294 | ;;
295 | restart|force-reload)
296 | if [ -f "$CATALINA_PID" ]; then
297 | $0 stop
298 | sleep 1
299 | fi
300 | $0 start
301 | ;;
302 | try-restart)
303 | if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \
304 | --user $tomcat_USER --exec "$JAVA_HOME/bin/java" \
305 | >/dev/null; then
306 | $0 start
307 | fi
308 | ;;
309 | *)
310 | log_success_msg "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
311 | exit 1
312 | ;;
313 | esac
314 |
315 | exit 0
316 |
--------------------------------------------------------------------------------
/templates/tomcat-systemd-centos.erb:
--------------------------------------------------------------------------------
1 | # Systemd unit file for tomcat
2 | [Unit]
3 | Description=Apache Tomcat Web Application Container
4 | After=syslog.target network.target
5 |
6 | [Service]
7 | Type=forking
8 |
9 | Environment=JAVA_HOME=/usr/lib/jvm/jre
10 | Environment=CATALINA_PID=<%= @tomcat_home %>/temp/tomcat.pid
11 | Environment=CATALINA_HOME=<%= @tomcat_home %>
12 | Environment=CATALINA_BASE=<%= @tomcat_home %>
13 | Environment='CATALINA_OPTS= -server -XX:+UseParallelGC'
14 | Environment='JAVA_OPTS=<%= @java_opts %> -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
15 |
16 | ExecStart=<%= @tomcat_home %>/bin/startup.sh
17 | ExecStop=/bin/kill -15 $MAINPID
18 |
19 | User=tomcat
20 | Group=tomcat
21 |
22 | [Install]
23 | WantedBy=multi-user.target
24 |
--------------------------------------------------------------------------------
/templates/tomcat-systemd-ubuntu.erb:
--------------------------------------------------------------------------------
1 | # Systemd unit file for tomcat
2 | [Unit]
3 | Description=Apache Tomcat Web Application Container
4 | After=syslog.target network.target
5 |
6 | [Service]
7 | Type=forking
8 |
9 | Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre
10 | Environment=CATALINA_PID=<%= @tomcat_home %>/temp/tomcat.pid
11 | Environment=CATALINA_HOME=<%= @tomcat_home %>
12 | Environment=CATALINA_BASE=<%= @tomcat_home %>
13 | Environment='CATALINA_OPTS= -server -XX:+UseParallelGC'
14 | Environment='JAVA_OPTS=<%= @java_opts %> -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
15 |
16 | ExecStart=<%= @tomcat_home %>/bin/startup.sh
17 | ExecStop=/bin/kill -15 $MAINPID
18 |
19 | User=tomcat
20 | Group=tomcat
21 |
22 | [Install]
23 | WantedBy=multi-user.target
24 |
--------------------------------------------------------------------------------