• Stars
    star
    129
  • Rank 279,262 (Top 6 %)
  • Language
    PHP
  • Created about 11 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A revolutionary cloud accounting platform designed for small and medium businesses.

BeansBooks


Notice

Beansbooks is available "as is" and will no longer be maintained. We would like to thank everyone who has used and contributed to Beansbooks.


Getting Started

This guide will walk you through getting a local instance of BeansBooks running. This is useful for development and testing, but should not be followed strictly for running a live environment. In order to get started, you'll need the following:

  • Apache 2
  • PHP 5 >= 5.3. PHP 7 will not work
  • MySQL 5+
  • Git Client

On Ubuntu, you can run the following to get up to speed:

sudo apt-get update  
sudo apt-get install apache2 php5 libapache2-mod-php5 php5-cli php5-mysql php5-mcrypt php5-gd mysql-server mysql-client git  

Once you've installed all of the prerequesites, create a directory where you want the source to reside, then download the code from git into that directory. The following will create a directory called 'source' within your home directory and install BeansBooks there.

cd ~
mkdir source
cd source
git clone --recursive https://github.com/system76/beansbooks.git
cd beansbooks

Copy the example.htaccess file to .htaccess within your working directory

cp example.htaccess .htaccess

If you are not planning on hosting with SSL, then we need to comment out two lines in the .htaccess file. Open the file for editing:

nano .htaccess

Look for the following two lines:

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Add a # character before them:

#RewriteCond %{HTTPS} !=on
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Additionally, you'll need to update the permissions on two directories before proceeding:

chmod 770 -R application/logs
chmod 770 -R application/cache

And create a configuration file:

touch application/classes/beans/config.php
chmod 660 application/classes/beans/config.php

Finally, your web user ( presumably, www-data ) will require access to the owner of your application directory. Presuming you've setup BeansBooks to run locally, it's easiest to add www-data to your user group.

sudo usermod -a -G `whoami` www-data

If you'd like a more secure solution, you should create a user specifically for BeansBooks and install everything within a sub-folder of the home directory for that user. In that case, you could want to replace `whoami` in the above solution with the name of the user you created.

You should now have everything you need to run BeansBooks locally. Next, we'll configure and setup several dependencies to enable your application to run.

Configuring Packages

Before configuring BeansBooks itself, we need to setup the environment to run it. We're going to quickly setup a local MySQL database, Apache Virtual Host, and create the correct permissions on our code.

MySQL

When setting up the packages in "Getting Started" above, you should have been prompted to create a root password for MySQL. You'll need this for the next set of steps. Run the following to connect to MySQL - you should provide the password that you created earlier when prompted.

mysql -h localhost -u root -p

Next - enter the following lines one by one. Please note - this sets the password for your database user to "beansdb" and should probably be changed. Go ahead and replace "beansdb" with a strong password.

CREATE USER 'beans'@'localhost' IDENTIFIED BY  'beansdb';  
GRANT USAGE ON * . * TO  'beans'@'localhost' IDENTIFIED BY  'beansdb' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;  
CREATE DATABASE IF NOT EXISTS  `beans` CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON `beans`.* TO 'beans'@'localhost';
exit  

Great! Now you've setup your database and user. Please make a note of the username ( beans ) and password you set above.

Apache

First things first, enable Mod_Rewrite:

sudo a2enmod rewrite

Now we're going to setup Apache to serve BeansBooks locally. In order to determine where are going to set our document root, we need to run the following in a terminal:

pwd

Whatever the output of that is - make a note of it. It will be the "document root" for your virtual host.

We're going to setup our instance of BeansBooks to be found at http://beansbooks/ - this is convenient as it will neither interfere with an actual domain, and can be configured fairly easily. Go ahead and run the following command:

sudo nano /etc/apache2/sites-available/beansbooks.conf

That will open a text editor for a new virtual host configuration - go ahead and copy and paste the following into the file. Make sure to replace PWDHERE with the result of running "pwd" above - it will probably looking something like /home/yourusername/source/beansbooks and should be inserted without any trailing / .

TIP: To paste into the editor that you've opened, use Control + Shift + "v"

<VirtualHost *:80>
    ServerName beansbooks 
    ServerAlias beansbooks 

    DocumentRoot PWDHERE            
    <Directory PWDHERE>
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

If you're using Apache 2.4 or newer you should use the following instead.

<VirtualHost *:80>
    ServerName beansbooks 
    ServerAlias beansbooks 

    DocumentRoot PWDHERE            
    <Directory PWDHERE>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

After pasting in and editing the above code, hit Control + "x" to exit. If it prompts you to save your changes, hit "y". Then run the following to disable the default virtual host, enable the beansbooks.conf virtual host and reload the Apache configuration.

sudo a2dissite 000-default
sudo a2ensite beansbooks.conf
sudo service apache2 reload

Then we need to add an entry to your hosts file to be able to load the local instance of beans.

sudo sh -c "echo '127.0.0.1 beansbooks' >> /etc/hosts"

Installation

At this point you should be able to navigate to http://beansbooks/ to finish the installation process. If you would prefer to run the installation and initial database setup from the command line please do as follows:

Manually Configure BeansBooks

Copy example.config.php to config.php in application/classes/beans/ and fill in the appropriate information.

cd application/classes/beans/
cp example.config.php config.php
chmod 660 config.php
nano config.php

It's important that your config file is not world-readable. The keys that encrypt your data, in addition to your database and email credentials, should be secure.

There are quite a few values that should be changed in the file, however it's mostly self explanatory. For starters, every place that you see "INSERT_STRONG_KEY" should have a unique, long ( at least 128 characters ), string of random characters. You can generate random data from here: https://www.grc.com/passwords.htm

Also note that you should enter the MySQL username and password you setup above under the "database" section.

Lastly, email support is optional - though it enables quite a few useful features when communication with customers and vendors. If you have an SMTP email provider, you should enter the correct information in the "email" section.

Once you've saved the config.php file, it's time to manually run the installation process.

cd ~/source/beansbooks
php index.php --uri=/install/manual --name="Your Name" --password="password" --email="[email protected]" --accounts="full"

SSL Support

If you would like to serve your instance of BeansBooks over SSL, you just need to add SSL support to your web server:

sudo a2enmod ssl

Then go ahead and edit your virtual host to support SSL connections:

sudo nano /etc/apache2/sites-available/beansbooks.conf

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerName beansbooks
        ServerAlias beansbooks
        
        DocumentRoot PWDHERE            
        <Directory PWDHERE>
            Options FollowSymLinks
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>

        SSLEngine on

        SSLCertificateFile /path/to/ssl/mydomain.com.crt
        SSLCertificateKeyFile /path/to/ssl/mydomain.com.unlocked.key

        <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
        </FilesMatch>

        BrowserMatch "MSIE [2-6]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
        BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
    </VirtualHost>
</IfModule>

Note - if you adjusted your VirtualHost above for Apache 2.4, you should do so here as well.

When you're done making changes, make sure to restart Apache.

Troubleshooting

MCrypt

If PHP / Apache complain that you're missing mcrypt support, or that an algorithm isn't available - you likely need to manually enable the mcrypt module:

sudo php5enmod mcrypt

Make sure to restart Apache afterwards and it should be resolved.

More Repositories

1

launch

System76 Launch Configurable Keyboard
Shell
1,376
star
2

firmware-open

System76 Open Firmware
C
946
star
3

virgo

System76 Virgo Laptop Project
Python
431
star
4

thelio

Thelio Desktop by System76
426
star
5

ec

System76 Open Source Embedded Controller
C
317
star
6

docs

System76 support documentation site
Vue
302
star
7

firmware-update

System76 Firmware Update Utility
Rust
200
star
8

coreboot

Fork of coreboot repo
C
161
star
9

thelio-io

Master repository for Thelio Io board
Rust
81
star
10

beebee

URL shortener for http://s76.co
Elixir
58
star
11

thelio-io-hardware

KiCad electrical design of Thelio Io board
Python
54
star
12

tech-docs

System76 Technical Documentation
CSS
50
star
13

laptop-suggestions

Repo to collect laptop design suggestions and feedback as issues.
41
star
14

windows-drivers

Windows Drivers for System76 Open Firmware Machines
40
star
15

certification

System76 Certification Tools
Rust
29
star
16

pop-vue

Vue components designed to look like Pop!_OS
JavaScript
26
star
17

cuda

Packaging for NVIDIA's CUDA Toolkit
CMake
21
star
18

ecflash

Flashing and querying with System76 Embedded Controllers
Rust
20
star
19

coreboot-collector

Utility for collecting valuable information for coreboot
Rust
19
star
20

recognizer

A authentication and user service
Elixir
19
star
21

firmware-desktop

Desktop Firmware
18
star
22

firmware-setup

Firmware Setup
Rust
18
star
23

thelio-io-windows

WIP Windows driver for System76 Thelio Io
Rust
17
star
24

intel-spi

Library for accessing Intel PCH SPI
Rust
13
star
25

warehouse

A microservice to encapsulate our inventory management functionality
Elixir
13
star
26

romulan

Rust library for parsing a number of firmware images
Rust
12
star
27

brand

12
star
28

thelio-io-firmware

Firmware for Thelio Io board
C
12
star
29

lxd-rs

A Rust library for controlling LXD
Rust
10
star
30

kicad-allegro

Converter from Allegro to KiCad, and Allegro extract viewer
Rust
9
star
31

bottle

Protobuf messages in a bottle
9
star
32

pihsm

Raspberry Pi Hardware Security Module
Python
9
star
33

ecsim

Simulate System76 EC with area8051 emulator
Rust
9
star
34

ecspy

System76 EC Debugger
Rust
9
star
35

firmware-smmstore

Rust EFI application for compacting coreboot SMMSTORE
Rust
8
star
36

takehome_web_be

Take home project used during our interview process for backend developer roles.
Elixir
7
star
37

GuyTuxMask

3-D and 2-D files of the Guy Tux mask
6
star
38

markdown

System76 markdown parsing for the web
JavaScript
6
star
39

system76-benchmarks

Collection of benchmarking tools developed by System76
Python
6
star
40

design

System76 styles and design related web assets
Vue
6
star
41

code-of-conduct

Code of Conduct for the System76 open source community
5
star
42

js-api

JavaScript fetch wrapper for Elixir Phoenix APIs
JavaScript
5
star
43

nuxt-appsignal

Appsignal integration with Nuxt
JavaScript
5
star
44

zendesk-app

The System76 zendesk app
Vue
5
star
45

eslint-config

System76 standard eslint linting configuration
JavaScript
5
star
46

policy

Elixir
5
star
47

assembly

An assembly management microservice
Elixir
5
star
48

thelio-io-output

Output files for Thelio Io board - from thelio-io-hardware and thelio-io-firmware
5
star
49

firmware-sign

Firmware signing/verifying process
Python
5
star
50

state_fair

State machine system for Elixir applications
Elixir
4
star
51

help_desk

A microservice for System76's Zendesk integration
Elixir
3
star
52

elixir-mcrypt

Elixir NIF wrapper around libmcrypt
Elixir
3
star
53

thelio-pwrbtn

Thelio power button PCB
Python
3
star
54

apobtool

AMD APOB debug tool
Rust
3
star
55

copy_cat

A template repository for new queue based services
Elixir
3
star
56

blog

Official System76 blog
Vue
3
star
57

smmstore

Utility for reading coreboot SMMSTORE
Rust
2
star
58

docker

A collection of docker images used at System76
Shell
2
star
59

unleash-potential

Unleash Your Potential with this awesome command line art!
Python
2
star
60

softwarefreedom_card

2
star
61

easy_post

Elixir API client for EasyPost
Elixir
2
star
62

bullhorn

A notification microservice for System76's platform
Elixir
2
star
63

smart-amp

TI Smart Amp configuration dumper and loader
C
1
star
64

launchpad

Launch Keyboard Selma Tester control application
Python
1
star
65

system76-ee

Scripts for System76 Electrical Engineering
Julia
1
star
66

ground_control

A real-time dashboard of @system76 deployments.
Elixir
1
star
67

shig

Style & Human Interface Guidelines
1
star
68

usb_ids

System76 USB ID allocation
1
star
69

thelio-prelaunch

Thelio prelaunch website
HTML
1
star
70

gop-policy

Implementation of Platform GOP Policy for Intel GOP Driver
Rust
1
star
71

roguebots

HTML
1
star
72

keyboard-layout

Rust crate to generate DXF output from keyboard-layout-editor.com data
Rust
1
star
73

logripper

Pull logs from an S3 bucket into a local database
Elixir
1
star
74

tweetflood

A twitter API client to for tweetstorm promotions
Elixir
1
star
75

s76_stripe

An Elixir API client for Stripe
Elixir
1
star
76

libpci-sys

Rust bindings for libpci
Rust
1
star
77

renovate-config

System76 presets for Renovate
1
star