Note: There are known issues with running VirtualBox on Apple Silicon. Use the Docker option instead.
The application may be installed within a Vagrant VM that is running on Scientific Linux 7. The VM is provisioned using the same Ansible playbook used in production.
- Install VirtualBox.
- Clone the repository.
git clone https://github.com/ucb-rit/coldfront.git cd coldfront - Prevent Git from detecting changes to file permissions.
git config core.fileMode false - Checkout the desired branch (probably
develop). - Install vagrant-vbguest.
vagrant plugin install vagrant-vbguest - Create a
main.ymlfile in the top-level of the repository. This is a file of variables used by Ansible to configure the system.cp bootstrap/ansible/main.copyme main.yml - Generate a key to be used as the
SECRET_KEYfor Django.# This produces two lines: condense them into one. openssl rand -base64 64 - In
main.yml, uncomment everything under the dev_settings section, and customize the following variables with your own values.django_secret_key: secret_key_from_previous_step chmod_tasks: true # Can be false when a Windows FS is mounted db_admin_passwd: root redis_passwd: root - Provision the VM. This should run the Ansible playbook. Expect this to take a few minutes on the first run.
vagrant up - SSH into the VM.
vagrant ssh
- On the host machine, navigate to
http://localhost:8880, where the application should be served.
-
Once the VM has been provisioned the first time, starting and accessing it can be done with:
vagrant up vagrant ssh -
To stop the VM, run:
vagrant halt -
To re-provision the VM, run:
vagrant provision
-
The application is served via Apache, so any changes to the application (excluding changes to templates) are not applied until Apache is restarted, which can be done with:
sudo systemctl restart httpd -
The Ansible playbook can be run manually as follows.
cd /vagrant/coldfront_app/coldfront # Assert that there is a properly-configured main.yml in the current directory. ansible-playbook bootstrap/ansible/playbook.yml- Note that to skip initial provisioning tasks you can use the
--tags commonor--skip-tags provisioningarguments toansible-playbook. - Alternatively, you can set
provisioning_taskstoFalseinmain.yml
- Note that to skip initial provisioning tasks you can use the
-
Any custom Django settings can be applied by modifying
dev_settings.py. Note that running the Ansible playbook will overwrite these.
- By default, emails are configured to be sent via SMTP on port 1025. If no such server is running on that port, many operations will fail. To start a server, start a separate SSH session (
vagrant ssh), and run the below. All emails will be outputted here for inspection.python -m smtpd -n -c DebuggingServer localhost:1025