Setup
(Note: Every step is important. Don't skip one unless it's marked optional or you know why you're skipping it.)
- Install dependencies:
-
Linux packages:
- the CPython C headers and development libraries
- the MySQL C headers and development libraries
gcc
-
bind
v9 (the Berkeley Internet Name Daemon) -
pip
(the Python package manager) - a few other packages (FIXME)
On Fedora:
-
sudo yum install python-devel openldap-devel cyrus-sasl-devel openssl-devel python-pip community-mysql sudo yum install community-mysql-devel community-mysql-server MySQL-python gcc rubygems bind sudo systemctl start mysqld ```
On Debian:
```
sudo apt-get install python-dev libldap2-dev libsasl2-dev libssl-dev rubygems libmysqlclient-dev python-pip sudo service mysqld start ```
- Ruby gems (***FIXME: this should go in a Gemfile***):
- `sass` (***FIXME: pin version***)
With the `gem` program installed:
```none
sudo gem install sass ```
-
Install Cyder (see "Per-instance setup" below).
-
Read the Maintain migration docs. The easiest setup is to use the
maintain
database ondb.nws.oregonstate.edu
and a localmaintain_sb
database (shared among all Cyder instances on your machine). SetOTHER_DATABASES['maintain']
andOTHER_DATABASES['maintain_sb']
appropriately. -
Run the following command in the instance you just installed to copy and sanitize data from Maintain's database into
maintain_sb
:
./manage.py maintain_migrate -q ```
-
Clone the repo:
git clone 'git@github.com:OSU-Net/cyder.git' cd cyder ```
-
(optional but recommended) Set up a virtualenv:
virtualenv .env ```
Do `source .env/bin/activate` now and every time you run your shell.
-
Install submodules and other dependencies:
git submodule update --init --recursive pip install -r requirements/dev.txt ```
-
Configure Cyder:
cp cyder/settings/local.py-dist cyder/settings/local.py
sed -i "s|SASS_BIN = '[^']*'|SASS_BIN = 'which sass
'|" cyder/settings/local.py
```
Then set the `OTHER_DATABASES` settings appropriately. See [the Maintain migration docs](https://github.com/OSU-Net/cyder/wiki/Overview:-Migration) for details.
-
Enter Cyder database settings into
cyder/settings/local.py
inDATABASES['default']
. (You don't need to create the database in this step.) -
Run
bin/recreate_database.sh
to create the database and load initial data. -
Run
./manage.py maintain_migrate -t
to migrate data frommaintain_sb
to Cyder. -
Copy the files
dns-header
anddns-footer
from Maintain to your machine and pass the file names to./manage.py tiny_migrate $header $footer
. -
(optional) Install a PEP8 linter as a git pre-commit hook:
pip install git+git://github.com/jbalogh/check.git cp requirements/.pre-commit .git/hooks/pre-commit ```