Skip to content

Commit

Permalink
Update to install homestead and bring in files and ensure services st…
Browse files Browse the repository at this point in the history
…art.
  • Loading branch information
tdondich committed Oct 30, 2018
1 parent ce117c9 commit 578f72d
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 30 deletions.
5 changes: 5 additions & 0 deletions Homestead.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ folders:
-
map: '.'
to: /home/vagrant/processmaker
# Uncomment and modify the following if you want to
# link a local directory for package development
# -
# map: '../bpm-plugins'
# to: /home/vagrant/bpm-plugins
sites:
-
map: bpm4.local.processmaker.com
Expand Down
25 changes: 12 additions & 13 deletions ProcessMaker/Console/Commands/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,32 @@ class Install extends Command
private $env;

/**
* Create a new command instance.
* The encryption key we will use for for fresh install and any encryption during install
*/
private $key;

/**
* Installs a fresh copy of ProcessMaker BPM
*
* @return void
* @return mixed If the command succeeds, true
*/
public function __construct()
public function handle()
{
parent::__construct();
// Setup our initial encryption key and set our running laravel app key to it
$this->key = 'base64:'.base64_encode(Encrypter::generateKey($this->laravel['config']['app.cipher']));
config(['app.key' => $this->key]);

// Our initial .env values
$this->env = [
'APP_DEBUG' => 'FALSE',
'APP_NAME' => 'ProcessMaker',
'APP_ENV' => 'production',
'APP_KEY' => 'base64:'.base64_encode(Encrypter::generateKey($this->laravel['config']['app.cipher'])),
'APP_KEY' => $this->key,
'BROADCAST_DRIVER' => 'redis',
'BROADCASTER_KEY' => '21a795019957dde6bcd96142e05d4b10'
];

}

/**
* Installs a fresh copy of ProcessMaker BPM
*
* @return mixed If the command succeeds, true
*/
public function handle()
{
// Configure the filesystem to be local
config(['filesystems.disks.install' => [
'driver' => 'local',
Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,33 @@

ProcessMaker is an open source, workflow management software suite, which includes tools to automate your workflow, design forms, create documents, assign roles and users, create routing rules, and map an individual process quickly and easily. It's relatively lightweight and doesn't require any kind of installation on the client computer. This file describes the requirements and installation steps for the server.

### Contributing
### Development

#### System Requirements
You can develop ProcessMaker as well as ProcessMaker packages locally. In order to do so, you must have the following:
- [Virtualbox 5.2](https://www.virtualbox.org/) or above
- [Vagrant 2.2.0](https://www.vagrantup.com/) or above
- [PHP 7.2.0](https://php.net) or above
- Windows users can install [XAMPP](https://www.apachefriends.org/index.html)
- [Composer](https://getcomposer.org/)
- [Node.js 10.13.0](https://nodejs.org/en/) or above

##### Steps for Development Installation
- Clone the repository into a directory
- Perform `composer install` to install required libraries. If you are on windows, you may need to run `composer install --ignore-platform-reqs` due to Horizon requiring the pcntl extension. You can safely ignore this as the application runs in the virtual machine which has the appropriate extensions installed.
- Perform `npm
- Modify your local `/etc/hosts` file to point `bpm4.local.processmaker.com` to `192.168.10.10`. On Windows, this file is located at `C:\Windows\System32\Drivers\etc\hosts`.
- Execute `vagrant up` in the project directory to bring up the laravel homestead virtual machine
- Execute `vagrant ssh` to ssh into the newly created virtual machine
- Execute `php artisan bpm:install` in `/home/vagrant/processmaker` to start the ProcessMaker Installation
- Specify `localhost` as your local database server
- Specify `3306` as your local database port
- Specify `workflow` as your local database name
- Specify `homestead` as your local database username
- Specify `secret` as your local database password
- Specify `https://bpm4.local.processmaker.com` as your application url
- Visit `https://bpm4.local.processmaker.com` in your browser to access the application
- Login with the username of `admin` and password of `admin`

When developing, make sure to turn on debugging in your `.env` so you can see the actual error instead of the Whoops page.

Expand Down
26 changes: 26 additions & 0 deletions after.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,29 @@
# If you have user-specific configurations you would like
# to apply, you may also create user-customizations.sh,
# which will be run after this script.

# Install docker, which we use to run scripts
sudo apt-get -y \
-o Dpkg::Options::="--force-confdef" \
-o pkg::Options::="--force-confold" \
install docker.io

# Start the docker service and ensure it runs at startup
sudo systemctl start docker
sudo systemctl enable docker

# Add vagrant to our docker group so that our webapp (which runs under vagrant user) can create docker containers
sudo usermod -a -G docker vagrant

# Restart PHP, to ensure that it picks up the new group membership
sudo service php7.2-fpm restart

# Install echo server which will help run socket.io locally
sudo npm install -g laravel-echo-server

# Copy over appropriate supervisor files to start echo server and horizon
sudo cp /home/vagrant/processmaker/homestead/etc/supervisor/conf.d/* /etc/supervisor/conf.d/

# Reload supervisor to ensure starting echo server and horizon
sudo service supervisor stop
sudo service supervisor start
10 changes: 10 additions & 0 deletions homestead/etc/supervisor/conf.d/processmaker-echo-server.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[program:processmaker-echo-server]
process_name=%(program_name)s_%(process_num)02d
command=node /home/vagrant/processmaker/node_modules/laravel-echo-server/bin/server.js start
directory=/home/vagrant/processmaker
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile=/home/vagrant/processmaker/storage/logs/echo-server.log
9 changes: 9 additions & 0 deletions homestead/etc/supervisor/conf.d/processmaker-horizon.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[program:processmaker-horizon]
process_name=%(program_name)s_%(process_num)02d
command=php /home/vagrant/processmaker/artisan horizon
autostart=true
autorestart=true
user=vagrant
numprocs=1
redirect_stderr=true
stdout_logfile=/home/vagrant/processmaker/storage/logs/horizon-supervisor.log
26 changes: 11 additions & 15 deletions laravel-echo-server.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
{
"authHost": "https://bpm4.processmaker.local",
"authHost": "http://localhost",
"authEndpoint": "/broadcasting/auth",
"clients": [
{
"appId": "0fd1f7a0ce0d527c",
"key": "21a795019957dde6bcd96142e05d4b10"
}
],
"clients": [],
"database": "redis",
"databaseConfig": {
"redis": {
"host": "127.0.0.1",
"port": "REDISPORT"
},
"redis": {},
"sqlite": {
"databasePath": "/database/laravel-echo-server.sqlite"
}
},
"devMode": true,
"host": null,
"port": "ECHOPORT",
"port": "6001",
"protocol": "https",
"socketio": {},
"sslCertPath": "/etc/ssl/certs/nginx-selfsigned.crt",
"sslKeyPath": "/etc/ssl/nginx-selfsigned.key",
"sslCertPath": "/etc/nginx/ssl/bpm4.local.processmaker.com.crt",
"sslKeyPath": "/etc/nginx/ssl/bpm4.local.processmaker.com.key",
"sslCertChainPath": "",
"sslPassphrase": "",
"subscribers": {
"http": true,
"redis": true
},
"apiOriginAllow": {
"allowCors": false,
"allowOrigin": "",
"allowMethods": "",
"allowHeaders": ""
}
}
}
2 changes: 1 addition & 1 deletion resources/views/processes/scripts/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
})
.then(response => {
ProcessMaker.alert('{{__('Script successfully added')}}', 'success')
window.location = "/processes/scripts/" + response.data.id
window.location = "/processes/scripts/" + response.data.id + "/edit"
})
.catch(error => {
if (error.response.status === 422) {
Expand Down

0 comments on commit 578f72d

Please sign in to comment.