Application for managing a company.
- Time tracking.
- Fetching times from trackers like bugzilla or tracs.
- Generating time reports (for employees, clients, owners).
- Managing employee's arrival/leave time.
- Managing employee's absences/leaves.
Development under Ubuntu
Created: May 2013
Updated: September 2013
Versions: Intranet 3.0.8; Ubuntu 13.04; PostgreSQL 9.1; Python 2.7.4
- Install and configure PostgreSQL, Memcached. #
- Fork and clone Intranet with git. #
- Install Intranet's system dependencies. #
- Run Intranet's buildout. #
- Configure Intranet. #
- Launch of. #
Intranet's development assumes that database server is on the same machine as the application.
Installation:
user~$ sudo apt-get install postgresql-9.1
After installation, database server is up. First step is to login as newly created user in ubuntu named postgres
(it's PostgreSQL super user):
user~$ sudo su postgres
Now connect to PostgreSQL server. Create user with password. Then create database:
- connection is via non-TCP/IP.
- you can change user-name and you should change password.
postgres~$ psql
postgres=# CREATE ROLE intranet2 WITH LOGIN PASSWORD 'password';
postgres=# CREATE DATABASE intranetdb WITH OWNER intranet2;
To logout press CTRL+D
twice.
Now test your newly created user and database:
user~$ psql -d intranetdb -h localhost -U intranet2 -W
Password for user intranet2: password
If you dumping already existing DB, please login as postgres and:
postgres~$ psql intranetdb < /tmp/intranet.sql
Remember to migrate DB into proper version. This SQLs can be found in db_migrations
.
user~$ sudo apt-get install memcached
First fork Intranet to your GitHub account. Then if you have configured github's SSH keys, you can simply do:
cd ~/
mkdir intranet
cd intranet
git init
git clone [email protected]:"user"/intranet.git
Intranet source code lie down on your hard drive with path ~/intranet/intranet
.
Intranet is written under Python 2.7. On Ubuntu you should have 2.7 pre-installed. Type python -V
to version checking.
First install python-dev:
user~$ sudo apt-get install python-dev
Install PIL JPEG and ZLIB system dependencies.
user~$ sudo apt-get install libjpeg62 libjpeg62-dev zlib1g-dev
Them symlink them according to your professor architecture
"32-bit"
user~$ sudo ln -s /usr/lib/i386-linux-gnu/libz.so /usr/lib/libz.so
user~$ sudo ln -s /usr/lib/i386-linux-gnu/libjpeg.so /usr/lib/libjpeg.so
"64-bit"
user~$ sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/libz.so
user~$ sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/libjpeg.so
In section 4#, after PIL installation table like this should occurs
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform darwin 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
Install OpenSSL development package. That way you get header files .h
, their are required by pyOpenSSL installation.
sudo apt-get install libssl-dev
Install:
user~$ sudo apt-get install libpq-dev
Install 2 packages. It also needs libssl-dev
, but it is installed earlier.
user~$ sudo apt-get install libldap2-dev libsasl2-dev
Build-essential is a package which contains stuff needed for building software (make, gcc, ...).
user~$ sudo apt-get install build-essential
python bootstrap.py -d
-d
Use Distribute rather than Setuptools
./bin/buildout -vNc devel.cfg
-v
Lookup configuration file with specified distribution versions.-N
Default mode always tries to get newest versions. Turn off with -N or buildout newest option set to false.-c
After this option specify a configuration file.
Download configuration file name it config.ini and put in intranet\intranet
.
- There are 7 lines with
/home/<user>
to edit with your username. - Modify line starts with
sqlalchemy.url =
with your data. - Replace <generate_this> in lines starts
CRON_SECRET_KEY
andDATASTORE_SYMMETRIC_PASSWORD
with this command outputs - Replace
example.com
domain with your company domain.
user~$ head -c 64 /dev/urandom | base64 -w 0
After making configuration file get into ~/intranet/intranet/
- Initialize database
./bin/script config.ini init_db
- Compile
*.less
and minimize*.js
files
cd js
npm install
bower install
grunt dev
- Run development server
./bin/run config.ini
I'll just leave this here http://localhost:5000/
###
# app configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/environment.html
###
[app:main]
use = egg:intranet3
# reloading is not working because we are using twisted !
pyramid.reload_templates = false
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en
pyramid.includes =
pyramid_debugtoolbar
pyramid_tm
pyramid_beaker
pyramid_jinja2
pyramid_exclog
pyramid.autoroute.root_module = intranet3.views
sqlalchemy.url = postgresql://<intranet2>:<password>@localhost:5432/<intranetdb>
sqlalchemy.pool_size = 20
sqlalchemy.pool_timeout = 60
sqlalchemy.pool_recycle = 3600
jinja2.extensions = jinja2.ext.with_
jinja2.directories = intranet3:templates
jinja2.filters =
slugify = intranet3.utils.filters.slugify
parse_user_email = intranet3.utils.filters.parse_user_email
parse_datetime_to_miliseconds = intranet3.utils.filters.parse_datetime_to_miliseconds
timedelta_to_minutes = intranet3.utils.filters.timedelta_to_minutes
comma_number = intranet3.utils.filters.comma_number
format_time = intranet3.utils.filters.format_time
venusian.ignore = intranet3.loader
session.type = file
session.url = 127.0.0.1:11211
session.lock_dir = /home/<user>/intranet/intranet/var/beaker/sessions/data
session.data_dir = /home/<user>/intranet/intranet/var/beaker/sessions/lock
session.secret = /AqcOMcps/3NEE7oEOayDn53A25iEFFl
session.cookie_on_exception = true
session.auto = True
DEBUG = True
CRON_DISABLE = True
CRON_URL = http://localhost:5000
CRON_SECRET_KEY = <generate_this>
MEMCACHE_URI = 127.0.0.1:11211
REPEATER_FILE = /home/<user>/intranet/intranet/var/repeater.pickle
FRONTEND_PREFIX = http://localhost:5000
DATASTORE_SYMMETRIC_PASSWORD = <generate_this>
AVATAR_PATH = /home/<user>/intranet/intranet/var/thumbs/
SESSION_KEY = s0ecret
# gogole credentials for localhost:5000 !
GOOGLE_CLIENT_ID = 317757513490-7jdrej7gk02l97va89vbfi10qbg78qet.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET = wVhyUuQjKH6xgYlM4RcTymaR
GOOGLE_DEVELOPERS_KEY = AIzaSyCuzRrhRTNYmppML9EIxbCVCKXWc6HhUXU
MANAGER_EMAIL = [email protected]
COMPANY_DOMAIN = example.com
COMPANY_MAILING_LIST = [email protected]
ACCOUNTANT_EMAIL = [email protected]
# ldap or google
AUTH_TYPE = google
# By default, the toolbar only appears for clients from IP addresses
# '127.0.0.1' and '::1'.
# debugtoolbar.hosts = 127.0.0.1 ::1
###
# wsgi server configuration
###
[server:main]
use = egg:waitress#main
host = 127.0.0.1
port = 5000
###
# logging configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
###
[loggers]
keys = root, intranet3, twisted, sql
[handlers]
keys = console, mainfile, twistedfile, sqlfile, intranet3file
[formatters]
keys = generic
[formatter_generic]
format = %(asctime)s %(levelname)s [%(name)s] %(message)s
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = DEBUG
formatter = generic
[handler_twistedfile]
class = handlers.TimedRotatingFileHandler
args = (os.path.join(r'/home/<user>/intranet/intranet', 'var', 'log', 'twisted.log'), 'MIDNIGHT')
level = DEBUG
formatter = generic
[handler_intranet3file]
class = handlers.TimedRotatingFileHandler
args = (os.path.join(r'/home/<user>/intranet/intranet', 'var', 'log', 'intranet.log'), 'MIDNIGHT')
level = WARN
formatter = generic
[handler_sqlfile]
class = handlers.TimedRotatingFileHandler
args = (os.path.join(r'/home/<user>/intranet/intranet', 'var', 'log', 'sqlalchemy.log'), 'MIDNIGHT')
level = DEBUG
formatter = generic
[handler_mainfile]
class = handlers.TimedRotatingFileHandler
args = (os.path.join(r'/home/<user>/intranet/intranet', 'var', 'log', 'main.log'), 'MIDNIGHT')
level = DEBUG
formatter = generic
[logger_root]
level = WARN
handlers = console
[logger_twisted]
level = WARN
handlers = console
qualname = twisted
propagate = 0
[logger_sql]
level = WARN
handlers = console
qualname = sqlalchemy
propagate = 0
[logger_intranet3]
level = DEBUG
handlers = console
qualname = intranet3
propagate = 0