Project

General

Profile

« Previous | Next » 

Revision 64c0004e

Added by Sjon Hortensius over 10 years ago

Updated readme with development instructions

View differences:

README.md
3 3

  
4 4
We are migrating pfSense to Bootstrap. You can help! Please respect these code-guidelines:
5 5

  
6
* use tabs (tabstop=4) for indenting (except the license-header which contains 3 lines that are indented with "\t   ")
6
* use tabs (tabstop=4) for indenting (except the license-header which contains 3 lines that are indented with "\t<SP><SP><SP>")
7 7
* no trailing whitespace
8 8
* limited echoing of HTML from php, please use proper templating syntax instead (eg. foreach/endforeach)
9 9
* limited attributes on elements; _no style attributes_
......
13 13

  
14 14
If you feel adventurous you can sometimes rewrite some PHP & javascript code as well; but try to keep this to a minimum.
15 15

  
16
# Development setup
17

  
18
We suggest you setup a development enviroment for testing your changes. This can be done with either Virtualbox or Qemu. 
19

  
20
## Qemu
21

  
22
Use libvirt to setup a FreeBSD-10 machine with 2 NICs. Boot the latest pfSense.iso and install it. I've attached both NICs to the virbr0 that libvirt offers by default. One interface can be used as WAN (where pfSense will use dhcp and should get a NATted ip on your local network), the other as a LAN interface with a fixed IP address.
23

  
24
## Virtualbox
25

  
26
..
27

  
28
## Post install tasks
29

  
30
Disable the dhcp server (on the LAN interface) of your pfSense install and you're good to go. Start the ssh-daemon, login and setup public-key authentication (for the root user). Execute `pkg install rsync` and create a script to upload your changes from your development environment to your pfSense install:
31

  
32
```bash
33
#!/bin/sh
34

  
35
rsync -xav --delete `dirname $0`/usr/local/www/ root@192.168.122.100:/usr/local/www/
36
rsync -xav --delete `dirname $0`/etc/inc/ root@192.168.122.100:/etc/inc/
37
```
38

  
16 39
# Cleaner
17 40

  
18 41
Before diving into a template, clean it with the supplied cleaner (`clean.sh`). This script tries to remove most of the unnecessary element attributes and does a bunch of other replaces which have to be done in every template.
......
47 70
				</div>
48 71
			</div>
49 72
			<div class="form-group">
50
                <label for="second-input" class="col-sm-2 control-label">Second label</label>
51
                <div class="col-sm-10">
52
                    <input class="form-control" id="second-input" />
53
                    <span class="help-block">What's this all about?</span>
54
                </div>
73
				<label for="second-input" class="col-sm-2 control-label">Second label</label>
74
				<div class="col-sm-10">
75
					<input class="form-control" id="second-input" />
76
					<span class="help-block">What's this all about?</span>
77
				</div>
55 78
			</div>
56 79
			<div class="form-group">
57
                <label for="second-input" class="col-sm-2 control-label">Checkbox</label>
58
                <div class="col-sm-10 checkbox">
59
                	<label>
60
                    	<input type="checkbox" id="checkbox" /> Checkbox description
61
                    </label>	
62
                </div>
80
				<label for="second-input" class="col-sm-2 control-label">Checkbox</label>
81
				<div class="col-sm-10 checkbox">
82
					<label>
83
						<input type="checkbox" id="checkbox" /> Checkbox description
84
					</label>
85
				</div>
63 86
			</div>
64 87

  
65 88
			<!-- And more form-groups -->

Also available in: Unified diff