mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
Added some new rake tasks to make it easier to update databases from the Tracks 1.03 version to that required for Tracks 1.04.
Documents updated, and the installation instructions are now in an HTML file: installtion.html in the root of the distribution. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@195 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
6b09ffa0a8
commit
7a97de9c52
13 changed files with 318 additions and 420 deletions
|
|
@ -1,9 +0,0 @@
|
|||
The main README file is in tracks/doc/README_FOR_APP, and the change log in tracks/doc/CHANGELOG.
|
||||
|
||||
** IMPORTANT **
|
||||
|
||||
Before you do anything else, you need to copy the following file and rename the copy:
|
||||
|
||||
tracks/config/database.yml.tmpl -> tracks/config/database.yml
|
||||
|
||||
You need to put your settings into database.yml. Just leave the .tmpl versions as they are. I'm sorry to impose this extra step, but it's important for the subversion repository not to have your super-seekrit MySQL database user name and password checked in to the repository for all to see!
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
CREATE TABLE `contexts` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`position` int(11) NOT NULL default '0',
|
||||
`hide` tinyint(1) default '0',
|
||||
`user_id` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
CREATE TABLE `notes` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL default '0',
|
||||
`project_id` int(11) NOT NULL default '0',
|
||||
`body` text,
|
||||
`created_at` datetime default '0000-00-00 00:00:00',
|
||||
`updated_at` datetime default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
CREATE TABLE `projects` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`position` int(11) NOT NULL default '0',
|
||||
`done` tinyint(1) default '0',
|
||||
`user_id` int(11) NOT NULL default '0',
|
||||
`description` text,
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
CREATE TABLE `schema_info` (
|
||||
`version` int(11) default NULL
|
||||
) TYPE=MyISAM;
|
||||
|
||||
CREATE TABLE `todos` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`context_id` int(11) NOT NULL default '0',
|
||||
`project_id` int(11) default NULL,
|
||||
`description` varchar(255) NOT NULL default '',
|
||||
`notes` text,
|
||||
`done` tinyint(1) NOT NULL default '0',
|
||||
`created_at` datetime default NULL,
|
||||
`due` date default NULL,
|
||||
`completed` datetime default NULL,
|
||||
`user_id` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
CREATE TABLE `users` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`login` varchar(80) NOT NULL default '',
|
||||
`password` varchar(40) NOT NULL default '',
|
||||
`word` varchar(255) default NULL,
|
||||
`is_admin` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
|
|
@ -5,26 +5,26 @@
|
|||
ActiveRecord::Schema.define(:version => 7) do
|
||||
|
||||
create_table "contexts", :force => true do |t|
|
||||
t.column "name", :string, :default => "", :null => false
|
||||
t.column "position", :integer, :default => 0, :null => false
|
||||
t.column "name", :string, :null => false
|
||||
t.column "position", :integer, :null => false
|
||||
t.column "hide", :boolean, :default => false
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "user_id", :integer, :default => 1
|
||||
end
|
||||
|
||||
create_table "notes", :force => true do |t|
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "project_id", :integer, :default => 0, :null => false
|
||||
t.column "user_id", :integer, :null => false
|
||||
t.column "project_id", :integer, :null => false
|
||||
t.column "body", :text
|
||||
t.column "created_at", :datetime
|
||||
t.column "updated_at", :datetime
|
||||
end
|
||||
|
||||
create_table "projects", :force => true do |t|
|
||||
t.column "name", :string, :default => "", :null => false
|
||||
t.column "position", :integer, :default => 0, :null => false
|
||||
t.column "name", :string, :null => false
|
||||
t.column "position", :integer, :null => false
|
||||
t.column "done", :boolean, :default => false
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "description", :text
|
||||
t.column "user_id", :integer, :default => 1
|
||||
t.column "description", :text, :default => ""
|
||||
end
|
||||
|
||||
create_table "sessions", :force => true do |t|
|
||||
|
|
@ -36,20 +36,20 @@ ActiveRecord::Schema.define(:version => 7) do
|
|||
add_index "sessions", ["session_id"], :name => "sessions_session_id_index"
|
||||
|
||||
create_table "todos", :force => true do |t|
|
||||
t.column "context_id", :integer, :default => 0, :null => false
|
||||
t.column "context_id", :integer, :null => false
|
||||
t.column "project_id", :integer
|
||||
t.column "description", :string, :default => "", :null => false
|
||||
t.column "description", :string, :null => false
|
||||
t.column "notes", :text
|
||||
t.column "done", :boolean, :default => false, :null => false
|
||||
t.column "created_at", :datetime
|
||||
t.column "due", :date
|
||||
t.column "completed", :datetime
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "user_id", :integer, :default => 1
|
||||
end
|
||||
|
||||
create_table "users", :force => true do |t|
|
||||
t.column "login", :string, :limit => 80, :default => "", :null => false
|
||||
t.column "password", :string, :limit => 40, :default => "", :null => false
|
||||
t.column "login", :string, :limit => 80, :null => false
|
||||
t.column "password", :string, :limit => 40, :null => false
|
||||
t.column "word", :string
|
||||
t.column "is_admin", :boolean, :default => false, :null => false
|
||||
t.column "preferences", :text
|
||||
|
|
|
|||
BIN
tracks/db/tracks-104.db
Normal file
BIN
tracks/db/tracks-104.db
Normal file
Binary file not shown.
|
|
@ -1,82 +0,0 @@
|
|||
-- NB: This schema should be redundant, and is just included for reference. If you are
|
||||
-- using MySQL, you can just issue the following commands at your command prompt to create
|
||||
-- the tables in the database you've specified in db/database.yml:
|
||||
--
|
||||
-- cd /PATH/TO/TRACKS
|
||||
-- rake migrate
|
||||
|
||||
-- Dump of table contexts
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `contexts` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`position` int(11) NOT NULL default '0',
|
||||
`hide` tinyint(1) default '0',
|
||||
`user_id` int(11) NOT NULL default '1',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
-- Dump of table projects
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `projects` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`position` int(11) NOT NULL default '0',
|
||||
`done` tinyint(1) default '0',
|
||||
`user_id` int(11) NOT NULL default '1',
|
||||
`description` varchar(255) default '',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
-- Dump of table schema_info
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `schema_info` (
|
||||
`version` int(11) default NULL
|
||||
) TYPE=MyISAM;
|
||||
|
||||
-- Dump of table todos
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `todos` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`context_id` int(11) NOT NULL default '0',
|
||||
`project_id` int(11) default NULL,
|
||||
`description` varchar(255) NOT NULL default '',
|
||||
`notes` text,
|
||||
`done` tinyint(1) NOT NULL default '0',
|
||||
`created_at` datetime default NULL,
|
||||
`due` date default NULL,
|
||||
`completed` datetime default NULL,
|
||||
`user_id` int(11) NOT NULL default '1',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
-- Dump of table users
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `users` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`login` varchar(80) NOT NULL default '',
|
||||
`password` varchar(40) NOT NULL default '',
|
||||
`word` varchar(255) default NULL,
|
||||
`is_admin` tinyint(1) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
-- Dump of table notes
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE `notes` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`user_id` int(11) NOT NULL default '1',
|
||||
`project_id` int(11) NOT NULL default '0',
|
||||
`body` text,
|
||||
`created_at` datetime default '0000-00-00 00:00:00',
|
||||
`updated_at` datetime default '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`id`)
|
||||
) TYPE=InnoDB;
|
||||
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
-- NB: This schema should be redundant, and is just included for reference. If you are
|
||||
-- using Postgresql, you can just issue the following commands at your command prompt to create
|
||||
-- the tables in the database you've specified in db/database.yml:
|
||||
--
|
||||
-- cd /PATH/TO/TRACKS
|
||||
-- rake migrate
|
||||
|
||||
\connect tracks;
|
||||
|
||||
drop table contexts;
|
||||
create table contexts (
|
||||
id serial not null,
|
||||
name varchar(255) not null default '',
|
||||
hide int not null default 0,
|
||||
position int not null,
|
||||
user_id int not null default 1,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
-- Set the sequence to the proper value
|
||||
select setval('contexts_id_seq', (select max(id) from contexts));
|
||||
|
||||
|
||||
drop table projects;
|
||||
create table projects (
|
||||
id serial not null,
|
||||
name varchar(255) not null default '',
|
||||
position int not null,
|
||||
done int not null default 0,
|
||||
user_id int not null default 1,
|
||||
description varchar(255) default '',
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
-- Set the sequence to the proper value
|
||||
select setval('projects_id_seq', (select max(id) from projects));
|
||||
|
||||
create table schema_info (
|
||||
version int default null
|
||||
);
|
||||
|
||||
drop table todos;
|
||||
create table todos (
|
||||
id serial not null,
|
||||
context_id int not null default 0,
|
||||
description varchar(100) not null default '',
|
||||
notes text,
|
||||
done int not null default 0,
|
||||
created_at timestamp not null default now(),
|
||||
due date default null,
|
||||
completed timestamp default null,
|
||||
project_id int default null,
|
||||
user_id int not null default 1,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
-- Set the sequence to the proper value
|
||||
select setval('todos_id_seq', (select max(id) from todos));
|
||||
|
||||
drop table users;
|
||||
create table users (
|
||||
id serial not null,
|
||||
login varchar(80) default null,
|
||||
password varchar(40) default null,
|
||||
word varchar(255) default null,
|
||||
is_admin int not null default 0,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
-- Set the sequence to the proper value
|
||||
select setval('users_id_seq', (select max(id) from users));
|
||||
|
||||
create table notes (
|
||||
id serial not null,
|
||||
project_id int not null default 0,
|
||||
body text,
|
||||
created_at timestamp default null,
|
||||
updated_at timestamp default null,
|
||||
user_id int not null default 1,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
-- Set the sequence to the proper value
|
||||
select setval('notes_id_seq', (select max(id) from notes));
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
-- SQLite dump
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
-- Dump of table contexts
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE 'contexts' (
|
||||
'id' INTEGER PRIMARY KEY,
|
||||
'name' varchar(255) NOT NULL default '',
|
||||
'hide' tinyint(4) NOT NULL default '0',
|
||||
'position' int NOT NULL,
|
||||
'user_id' int NOT NULL default '1'
|
||||
) ;
|
||||
|
||||
|
||||
|
||||
-- Dump of table projects
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE 'projects' (
|
||||
'id' INTEGER PRIMARY KEY,
|
||||
'name' varchar(255) NOT NULL default '',
|
||||
'position' int NOT NULL,
|
||||
'done' tinyint(4) NOT NULL default '0',
|
||||
'description' varchar(255) default '',
|
||||
'user_id' int NOT NULL default '1'
|
||||
) ;
|
||||
|
||||
-- Dump of table schema_info
|
||||
|
||||
CREATE TABLE 'schema_info' (
|
||||
'version' INTEGER default NULL
|
||||
) ;
|
||||
|
||||
-- Dump of table todos
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE 'todos' (
|
||||
'id' INTEGER PRIMARY KEY,
|
||||
'context_id' int(11) NOT NULL default '0',
|
||||
'description' varchar(100) NOT NULL default '',
|
||||
'notes' text,
|
||||
'done' tinyint(4) NOT NULL default '0',
|
||||
'created_at' datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
'due' date default NULL,
|
||||
'completed' datetime default NULL,
|
||||
'project_id' int(11) default NULL,
|
||||
'user_id' int NOT NULL default '1'
|
||||
) ;
|
||||
|
||||
|
||||
|
||||
-- Dump of table users
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE 'users' (
|
||||
'id' INTEGER PRIMARY KEY,
|
||||
'login' varchar(80) default NULL,
|
||||
'password' varchar(40) default NULL,
|
||||
'word' varchar(255) default NULL,
|
||||
'is_admin' tinyint(4) NOT NULL default '0'
|
||||
) ;
|
||||
|
||||
-- Dump of table notes
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
CREATE TABLE 'notes' (
|
||||
'id' INTEGER PRIMARY KEY,
|
||||
'project_id' int(11) NOT NULL default '0',
|
||||
'body' text,
|
||||
'created_at' datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
'updated_at' datetime default '0000-00-00 00:00:00',
|
||||
'user_id' int NOT NULL default '1'
|
||||
) ;
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ INSERT INTO projects (id,name,position,description,done,user_id) VALUES (3,'Evic
|
|||
-- Dump of table schema_info
|
||||
-- ------------------------------------------------------------
|
||||
|
||||
INSERT INTO schema_info (version) VALUES (4);
|
||||
INSERT INTO schema_info (version) VALUES (7);
|
||||
|
||||
|
||||
-- Dump of table todos
|
||||
|
|
@ -1,143 +1,148 @@
|
|||
= Tracks: a GTD web application, built with Ruby on Rails
|
||||
# Tracks: a GTD web application, built with Ruby on Rails
|
||||
|
||||
* Homepage: http://www.rousette.org.uk/projects/
|
||||
* Trac (for bug reports): http://dev.rousette.org.uk/report/6
|
||||
* Wiki (more info on installation): http://dev.rousette.org.uk/wiki
|
||||
* Author: bsag (http://www.rousette.org.uk/)
|
||||
* Contributors: Nicholas Lee, Lolindrath, Jim Ray, Arnaud Limbourg, Timothy Martens, Luke Melia, John Leonard (for great installation tutorials on Windows XP)
|
||||
* Version: 1.04
|
||||
* Copyright: (cc) 2004-2006 rousette.org.uk
|
||||
* License: GNU GPL
|
||||
|
||||
Trac (for bug reports and feature requests): http://dev.rousette.org.uk/report/6
|
||||
While fully usable for everyday use, Tracks is still a work in progress. Make sure that you take sensible precautions and back up all your data frequently. Full changenotes can be found in `tracks/doc/CHANGENOTES.txt`. Full API documentation can be found at `tracks/doc/app/index.html`, once you have run `rake appdoc`
|
||||
|
||||
Wiki (deprecated - please use Trac): http://www.rousette.org.uk/projects/wiki/
|
||||
**IF THIS CRASHES YOUR MACHINE AND LOSES YOUR DATA, IT'S NOT MY FAULT!**
|
||||
|
||||
While fully usable for everyday use, Tracks is still a work in progress. Make sure that you take sensible precautions and back up all your data frequently. Full changenotes can be found in tracks/doc/CHANGENOTES.txt. Full API documentation can be found at tracks/doc/app/index.html.
|
||||
## Installation
|
||||
|
||||
<b>IF THIS CRASHES YOUR MACHINE AND LOSES YOUR DATA, IT'S NOT MY FAULT!</b>
|
||||
Before you start, you need to make sure that you have Ruby 1.8.2 installed. Rails 1.0 and RedCloth are now included in the vendor directory of the distribution, so you don't need to install them yourself. You also need some kind of database. MySQL is probably the most popular, but it's also easy to use PostgreSQL or SQLite/SQLite3. Note that upgrading via the `rake migrate` command is quite a bit more tricky currently with SQLite and SQLite3. If you have Mac OS X Tiger, you already have Ruby 1.8.2 and SQLite3 installed, so all you need to do after installing Rails and Redcloth is to install the sqlite3-ruby gem (1.1.0). If you're using MySQL, you might want to install the native MySQL bindings to improve performance:
|
||||
|
||||
== Installation (for trunk version <b>only</b>)
|
||||
sudo gem install mysql
|
||||
|
||||
On Mac OS X, you need the following:
|
||||
|
||||
Before you start, you need to make sure that you have Ruby 1.8.2 installed. Rails 1.0 and RedCloth are now included in the vendor directory of the distribution, so you don't need to install them yourself. You also need some kind of database. MySQL is probably the most popular, but it's also easy to use PostgreSQL or SQLite/SQLite3. If you have Mac OS X Tiger, you already have Ruby 1.8.2 and SQLite3 installed, so all you need to do after installing Rails and Redcloth is to install the sqlite3-ruby gem (1.1.0). See http://dev.rousette.org.uk/wiki/Tracks/Install for more details on installing all the necessary components on all the supported platforms.
|
||||
sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
|
||||
|
||||
See the [wiki](http://dev.rousette.org.uk/wiki/Tracks/Install) for more details on installing all the necessary components on all the supported platforms.
|
||||
|
||||
=== New users
|
||||
### New installations
|
||||
|
||||
==== MySQL
|
||||
#### MySQL
|
||||
|
||||
In the following, I'm assuming that you're using MySQL and the built-in WEBrick server. See the sections below for addtional instructions on using other databases and servers.
|
||||
In the following, I'm assuming that you're using MySQL and the built-in WEBrick server. See the sections below for additional instructions on using other databases and servers.
|
||||
|
||||
* Unzip tracks_1_04.zip somewhere in your home folder ( e.g. /Users/yourusername/Sites).
|
||||
* Make a database for which you have full access rights. e.g. assuming that you are using MySQL, and that you want to call your database tracks, at the command line:
|
||||
* Unzip `tracks_1_04.zip` somewhere in your home folder ( e.g. `/Users/yourusername/Sites`).
|
||||
* Make a database for which you have full access rights. e.g. assuming that you want to call your database `tracks-104`, at the command line:
|
||||
<pre>
|
||||
<code>
|
||||
mysql -uroot -p
|
||||
mysql> CREATE DATABASE tracks-104;
|
||||
mysql> GRANT ALL PRIVILEGES ON tracks-104.* TO yourmysqluser@localhost \
|
||||
IDENTIFIED BY 'password-goes-here' WITH GRANT OPTION;
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<tt>mysql -uroot -p</tt>
|
||||
|
||||
<tt>mysql> CREATE DATABASE tracks;</tt>
|
||||
|
||||
<tt>mysql> GRANT ALL PRIVILEGES ON tracks.* TO yourmysqluser@localhost IDENTIFIED BY 'password-goes-here' WITH GRANT OPTION;</tt>
|
||||
|
||||
* Copy the file <tt>config/database.yml.tmpl</tt> to <tt>config/database.yml</tt>.
|
||||
* Open the <tt>tracks/config/database.yml</tt> file, and enter your username and password details for the database you just set up. If you're running in production mode, you only really need to set up the entry under 'production'. <b>NB</b>: If you do set up the entry for 'test', make sure that you specify a different database, or when you run tests, they will overwrite your data. <b>NB:</b> It's very important that you don't use TABS in any of the .yml files. Just use spaces to indent.
|
||||
* Run 'rake setup_tracks', which will copy all the files and directories with *.tmpl extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:
|
||||
|
||||
<tt>cd /PATHTO/TRACKS</tt>
|
||||
<tt>rake setup_tracks</tt>
|
||||
* Open the file <tt>config/environment.rb</tt> and look at the last line which should read:
|
||||
|
||||
<tt>SALT = "change-me"</tt>
|
||||
|
||||
Change the word change-me to something else of your choosing. This string will be used as a 'salt' to encrypt your password and make it a bit more secure.
|
||||
* Copy the file `config/database.yml.tmpl` to `config/database.yml`.
|
||||
* Open the `tracks/config/database.yml` file, and enter your username and password details for the database you just set up under the 'production' and 'development' sections. **NB**: If you do set up the entry for 'test', make sure that you specify a different database, or when you run tests, they will overwrite your data. It's very important that you don't use TABS in any of the `*.yml` files. Just use spaces to indent.
|
||||
* Run `rake setup_tracks`, which will copy all the files and directories with `*.tmpl` extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:
|
||||
<pre>
|
||||
<code>
|
||||
cd /PATHTO/TRACKS
|
||||
rake setup_tracks
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
* Open the file `config/environment.rb` and look at the last line which should read: `SALT = "change-me"`. Change the word change-me to something else of your choosing. This string will be used as a 'salt' to encrypt your password and make it a bit more secure.
|
||||
* Run 'rake migrate', which will create the necessary tables in your database, including some required contents:
|
||||
<pre>
|
||||
<code>
|
||||
cd /PATHTO/TRACKS
|
||||
rake migrate
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<tt>cd /PATHTO/TRACKS</tt>
|
||||
<tt>rake migrate</tt>
|
||||
|
||||
If you find that 'rake migrate' doesn't work for you, you can use the command <tt>rake db_schema_import</tt> which will do the same thing.
|
||||
|
||||
* Check the shebang lines of the public/dispatch.* files and all the files in the script directory. They are set to <tt>#!/usr/bin/env ruby</tt> by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
<tt>ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*</tt>
|
||||
* Run the following command at your command line (<b>Important:</b> If you already have an application running on WEBrick (Tracks or anything else), make sure that you stop the server, or run Tracks on a different port using the <tt>--port</tt> option):
|
||||
<tt>cd /PATHTO/TRACKS</tt>
|
||||
<tt>ruby script/server -e production</tt>
|
||||
|
||||
* In a browser, go to <tt>http://0.0.0.0:3000/signup</tt>. This will allow you to choose a username and password for the admin user. Thereafter, anyone else trying to access <tt>/signup</tt> will get a message that they are not allowed to sign up, and are given your email address to contact for permission. When you are logged in as the admin user, you can visit <tt>/signup</tt> to sign up additional users (who will not be able to view any of your next actions, contexts, projects or notes, but can set up their own separate tasks), and visit <tt>/login</tt> to login yourself.
|
||||
* Add some contexts at <tt>http://0.0.0.0:3000/contexts</tt> and projects at <tt>http://0.0.0.0:3000/projects</tt> and then you're ready to add all your next actions.
|
||||
* You can set various preferences by visiting <tt>http://0.0.0.0:3000/user/preferences</tt>. These are stored on a per-user basis in the database.
|
||||
* If you find that 'rake migrate' doesn't work for you (there have been reports of it not working well with the MySQL distributed with InstantRails on Windows), you can use the command `rake db_schema_import` which will do the same thing.
|
||||
* (Optional step) If you want to import some example next actions, projects and contexts, use the command `rake load_fixtures`. This will import data into your database, including two users: an admin user with the login 'admin' and password 'abracadabra', and a normal user 'jane' with password 'sesame'.
|
||||
* Check the shebang lines of the `public/dispatch.*` files and all the files in the script directory. They are set to `#!/usr/bin/env ruby` by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
`ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*`
|
||||
* Run the following command at your command line (**Important:** If you already have an application running on WEBrick (Tracks or anything else), make sure that you stop the server, or run Tracks on a different port using the `--port` option):
|
||||
<pre>
|
||||
<code>
|
||||
cd /PATHTO/TRACKS
|
||||
ruby script/server -e production
|
||||
</code>
|
||||
</pre>
|
||||
* In a browser (if you haven't loaded the example data), go to `http://0.0.0.0:3000/signup`. This will allow you to choose a username and password for the admin user. Thereafter, anyone else trying to access `/signup` will get a message that they are not allowed to sign up, and are given your email address to contact for permission. When you are logged in as the admin user, you can visit `/signup` to sign up additional users (who will not be able to view any of your next actions, contexts, projects or notes, but can set up their own separate tasks), and visit `/login` to login yourself.
|
||||
* Add some contexts at `http://0.0.0.0:3000/contexts` (you must do this before adding any next actions) and projects at `http://0.0.0.0:3000/projects` and then you're ready to add all your next actions.
|
||||
* You can set various preferences by visiting `http://0.0.0.0:3000/user/preferences`. These are stored on a per-user basis in the database.
|
||||
* Have fun!
|
||||
|
||||
==== SQLite/SQLite3
|
||||
#### SQLite/SQLite3
|
||||
|
||||
The instructions are the same as those for MySQL above, except that you don't need to create the database first before running 'rake migrate'. All you need to do is to give the file name of the database you'd like to create in database.yml. e.g.
|
||||
<tt>adapter: sqlite3</tt>
|
||||
<tt>database: /Users/YOURUSERNAME/Sites/tracks/db/tracks_104.db</tt>
|
||||
Then cd into the db directory and run rake migrate. This should create the database for you, and populate it with the correct tables. If you find that 'rake migrate' doesn't work for you, you can use the command <tt>rake db_schema_import</tt> which will do the same thing.
|
||||
The instructions are the same as those for MySQL above, except that I have provided an SQLite3 database, pre-loaded with the correct schema (`db/tracks-104.db`). All you need to do is to insert that filename in database.yml. e.g.:
|
||||
|
||||
=== Upgrading from Tracks 1.03
|
||||
adapter: sqlite3
|
||||
database: /Users/YOURUSERNAME/Sites/tracks/db/tracks-104.db
|
||||
|
||||
==== MySQL or Postgresql
|
||||
### Upgrading from Tracks 1.03
|
||||
|
||||
#### MySQL or Postgresql
|
||||
|
||||
* For safety, rename your current Tracks directory to 'tracks-old' or something similar.
|
||||
* The 'rake migrate' script should be able to update your database tables with the contents in place, but it's very important to make a MySQL dump of both the contents and tables before you go any further. KEEP THIS BACKUP IN A SAFE PLACE IN CASE YOU HAVE TO REVERT TO IT.
|
||||
* Before you do anything else, <b>BACK UP YOUR DATABASE</b> (tables and content). Then make a separate export of the contents only (assuming that you want to move your data to the new version.)
|
||||
* Run 'rake setup_tracks', which will copy all the files and directories with *.tmpl extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:
|
||||
* Before you do anything else, **BACK UP YOUR DATABASE** (tables and content) and keep the SQL dumps somewhere safe so that you can recreate the old database if necesary.
|
||||
* Run `rake setup_tracks`, which will copy all the files and directories with `*.tmpl` extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:
|
||||
|
||||
<tt>cd /PATHTO/TRACKS</tt>
|
||||
<tt>rake setup_tracks</tt>
|
||||
* Open the file <tt>config/environment.rb</tt> and look at the last line which should read:
|
||||
cd /PATHTO/TRACKS
|
||||
rake setup_tracks
|
||||
|
||||
* Open the file `config/environment.rb` and look at the last line which should read: `SALT = "change-me"`. Change the word change-me to something else of your choosing. This string will be used as a 'salt' to encrypt your password and make it a bit more secure.
|
||||
* In `database.yml` insert your old database name, user and password under the 'development' section.
|
||||
* Run the command `rake extract_fixtures` inside the Tracks directory. This will populate the `db/exported_fixtures` directory with `*.yml` files corresponding to the contexts, projects and todos table from the contents of your old database.
|
||||
* Open `db/exported_fixtures/todos.yml` and search for the lines starting `created:` and replace with `created_at:`.
|
||||
* Create a new MySQL database (named tracks-104, for example).
|
||||
* In `database.yml` insert this new database name, user and password under the 'development' section.
|
||||
* Run the command `rake db_schema_import` inside the Tracks directory. This should import the upgraded schema for 1.04 into your new database.
|
||||
* Run the command `rake load_exported_fixtures` which will import the contents of your old database from the fixtures files in `db/exported_fixtures`.
|
||||
* Check the shebang lines of the `public/dispatch.*` files and all the files in the script directory. They are set to `#!/usr/bin/env ruby` by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
`ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*`
|
||||
* From here, follow the remaining steps for new users above to start the server. Since your users table was deliberately not imported, you'll have to re-create your users via `/signup`. Signup is now at `http://0.0.0.0:3000/signup`, and login at `http://0.0.0.0:3000/login`.
|
||||
|
||||
<tt>SALT = "change-me"</tt>
|
||||
|
||||
Change the word change-me to something else of your choosing. This string will be used as a 'salt' to encrypt your password and make it a bit more secure.
|
||||
* If you are using MySQL or Postgresql, you can use the rake migrate task to update your tables. At your command line:
|
||||
|
||||
<tt>cd /PATHTO/TRACKS</tt>
|
||||
<tt>rake migrate</tt>
|
||||
|
||||
* If this process reports errors that you can't fix, you'll need to adapt the instructions for manually loading the schema, given below for SQLite (schemas are also provided for MySQL and Postgresql).
|
||||
* Check that the contents of your database look sensible. In particular, check that the 'user_id' field in the todos, contexts and projects tables have the value of '1' (i.e. they are owned by your admin user, who should have an id of 1).
|
||||
* Check the shebang lines of the public/dispatch.* files and all the files in the script directory. They are set to <tt>#!/usr/bin/env ruby</tt> by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
<tt>ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*</tt>
|
||||
* From here, follow the remaining steps for new users above to start the server. You might find that your previous username and password doesn't work, in which case you'll have to go into your database, delete all the users, and then re-create your users via <tt>/signup</tt>. Signup is now at <tt>http://0.0.0.0:3000/signup</tt>, and login at <tt>http://0.0.0.0:3000/login</tt>.
|
||||
|
||||
==== SQLite or SQLite3
|
||||
#### SQLite or SQLite3
|
||||
|
||||
* For safety, rename your current Tracks directory to 'tracks-old' or something similar (making sure that you keep your old database safe), create a new directory for the new version.
|
||||
* Copy (NOT MOVE!) your old database into the new tracks/db directory.
|
||||
* <b>Make sure that you check <tt>settings.yml.tmpl</tt> for new info</b>, and add any new fields to your <tt>settings.yml</tt> file. Some new settings have been added in the past couple of versions, and not having the correct settings is a common cause of errors.
|
||||
* Run 'rake setup_tracks', which will copy all the files and directories with *.tmpl extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:
|
||||
* Run `rake setup_tracks`, which will copy all the files and directories with `*.tmpl` extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:
|
||||
|
||||
<tt>cd /PATHTO/TRACKS</tt>
|
||||
<tt>rake setup_tracks</tt>
|
||||
* Open the file <tt>config/environment.rb</tt> and look at the last line which should read:
|
||||
cd /PATHTO/TRACKS
|
||||
rake setup_tracks
|
||||
|
||||
* Open the file `config/environment.rb` and look at the last line which should read: `SALT = "change-me"`. Change the word change-me to something else of your choosing. This string will be used as a 'salt' to encrypt your password and make it a bit more secure.
|
||||
* In `database.yml` insert your old database name, user and password under the 'development' section.
|
||||
* Run the command `rake extract_fixtures` inside the Tracks directory. This will populate the `db/exported_fixtures` directory with `*.yml` files corresponding to the contexts, projects and todos table from the contents of your old database.
|
||||
* Open `db/exported_fixtures/todos.yml` and search for the lines starting `created:` and replace with `created_at:`, and `done: "0"` with `done: "f"` and `done: "1"` with `done: "t"`. You need to replace the similar 'done' lines in `projects.yml`, and in `contexts.yml` replace `hide: "0"` with `hide: "f"` and `hide: "1"` with `hide: "t"`.
|
||||
* In `database.yml` insert the name of the provided `tracks-104.db` the 'development' section.
|
||||
* Run the command `rake load_exported_fixtures` which will import the contents of your old database from the fixtures files in `db/exported_fixtures`.
|
||||
* Check the shebang lines of the `public/dispatch.*` files and all the files in the script directory. They are set to `#!/usr/bin/env ruby` by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
`ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*`
|
||||
* From here, follow the remaining steps for new users above to start the server. Since your users table was deliberately not imported, you'll have to re-create your users via `/signup`. Signup is now at `http://0.0.0.0:3000/signup`, and login at `http://0.0.0.0:3000/login`.
|
||||
|
||||
<tt>SALT = "change-me"</tt>
|
||||
## Other servers
|
||||
|
||||
Change the word change-me to something else of your choosing. This string will be used as a 'salt' to encrypt your password and make it a bit more secure.
|
||||
* The rake task <tt>upgrade_sqlite_db.rake</tt> (in <tt>tracks/lib/tasks</tt>) will help you to upgrade your database before running 'rake migrate' to make the appropriate changes to the tables. In lines 4-6 of that file, you'll find some variables (old_db, new_db and cmd) that you'll need to change appropriately for your setup. old_db is the filename of your old version 1.03 database, new_db is the filename you'd like to give to the new database, and cmd is sqlite or sqlite3 depending on which verison you're using.
|
||||
* Save the file after making the changes, then - in the root of your tracks directory - issue the command <tt>rake upgrade_sqlite_db</tt>. You should get a message that your new db has been created, and some temporary files created.
|
||||
You need to check the new database to make sure that it has sensible contents. In particular, check that the 'user_id' field in the todos, contexts and projects tables have the value of '1' (i.e. they are owned by your admin user, who should have an id of 1).
|
||||
* Edit <tt>config/database.yml</tt> with the name of your new database file.
|
||||
* Run 'rake migrate'. This should update the tables to the new format.
|
||||
* Check that the path to Ruby is correct in the <tt>tracks/public/dispatch.*</tt> files, and also <tt>/script/server</tt>. The default (<tt>#!/usr/bin/ruby</tt>) is fine for Mac OS X Tiger, but if you've installed Ruby yourself in <tt>/usr/local/bin</tt>, you'll need to change it.
|
||||
* From here, follow the remaining steps for new users above to start the server. Don't forget that if you've deleted your users table, you'll need to re-create your users via <tt>/signup</tt>. Signup is now at <tt>http://0.0.0.0:3000/signup</tt>, and login at <tt>http://0.0.0.0:3000/login</tt>.
|
||||
WEBrick is the easiest server to get working to test out Tracks, and will be fine if you have Tracks installed on your own machine. One nice feature in Rails 0.13.1 is that WEBrick runs by default on the IP address 0.0.0.0, which means that you can access it via 127.0.0.1 when you are on the same machine, or via the external IP address of the machine running Tracks, so long as you can access the network of that machine from your current location. However, it is possible to use other servers, and the new re-writing rules of Rails 0.13.1 ('Routes' in `environment/routes.rb`) mean that very little configuration is needed. With Rails 1.0, if you have lighttpd installed, running `script/server` starts lighttpd instead of WEBrick, creating the appropriate lighttpd.conf file automatically.
|
||||
|
||||
== Other servers
|
||||
### Apache
|
||||
|
||||
WEBrick is the easiest server to get working to test out Tracks, and will be fine if you have Tracks installed on your own machine. One nice feature in Rails 0.13.1 is that WEBrick runs by default on the IP address 0.0.0.0, which means that you can access it via 127.0.0.1 when you are on the same machine, or via the external IP address of the machine running Tracks, so long as you can access the network of that machine from your current location. However, it is possible to use other servers, and the new re-writing rules of Rails 0.13.1 ('Routes' in <tt>environment/routes.rb</tt>) mean that very little configuration is needed. With Rails 1.0, if you have lighttpd installed, running <tt>script/server</tt> starts lighttpd instead of WEBrick, creating the appropriate lighttpd.conf file automatically.
|
||||
See the file `tracks/README_RAILS` for an example of an Apache conf. The file `tracks/public/.htaccess` contains the necessary re-write rules to call `dispatch.cgi` or `dispatch.fcgi`. All other rules are handled by `routes.rb`
|
||||
|
||||
=== Apache
|
||||
### Lighttpd
|
||||
|
||||
See the file tracks/README_RAILS for an example of an Apache conf. The file tracks/public/.htaccess contains the necessary re-write rules to call dispatch.cgi or dispatch.fcgi. All other rules are handled by routes.rb
|
||||
|
||||
=== Lighttpd
|
||||
|
||||
Again, see tracks/README_RAILS for a working example of a lighttpd.conf file. Note that you'll want to change the line:
|
||||
"bin-environment" => ( "RAILS_ENV" => "development"
|
||||
|
||||
to
|
||||
"bin-environment" => ( "RAILS_ENV" => "production"
|
||||
Again, see `tracks/README_RAILS` for a working example of a lighttpd.conf file. Note that you'll want to change the line: ``"bin-environment" => ( "RAILS_ENV" => "development"` to `"bin-environment" => ( "RAILS_ENV" => "production"`.
|
||||
|
||||
|
||||
== Contacting me
|
||||
## Contacting me
|
||||
|
||||
I'd love any suggestions you have for improvements, bug-fixes etc. Email me at: butshesagirl@rousette.org.uk
|
||||
|
||||
You can also leave bug reports, feature requests, and comments at: http://dev.rousette.org.uk/report/6
|
||||
You can also leave bug reports, feature requests, and comments at: http://dev.rousette.org.uk/report/6
|
||||
|
||||
Subscribe to the tracks-discuss mailing list [here](http://lists.rousette.org.uk/mailman/listinfo/tracks-discuss) or by sending an email to tracks-discuss-join@lists.rousette.org.uk.
|
||||
174
tracks/installation.html
Normal file
174
tracks/installation.html
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
<h1 id="tracks_a_gtd_web_application_built_with_ruby_on_rails">Tracks: a GTD web application, built with Ruby on Rails</h1>
|
||||
|
||||
<ul>
|
||||
<li><a href="http://www.rousette.org.uk/projects/">Homepage</a></li>
|
||||
<li><a href="http://dev.rousette.org.uk/report/6">Trac (for bug reports)</a></li>
|
||||
<li><a href ="http://dev.rousette.org.uk/wiki">Wiki</a> (more info on installation)</li>
|
||||
<li>Author: <a href="http://www.rousette.org.uk/">bsag</a></li>
|
||||
<li>Contributors: Nicholas Lee, Lolindrath, Jim Ray, Arnaud Limbourg, Timothy Martens, Luke Melia, John Leonard (for great installation tutorials on Windows XP)</li>
|
||||
<li>Version: 1.04</li>
|
||||
<li>Copyright: (cc) 2004-2006 rousette.org.uk</li>
|
||||
<li>License: GNU GPL</li>
|
||||
</ul>
|
||||
|
||||
<p>While fully usable for everyday use, Tracks is still a work in progress. Make sure that you take sensible precautions and back up all your data frequently. Full changenotes can be found in <code>tracks/doc/CHANGENOTES.txt</code>. Full API documentation can be found at <code>tracks/doc/app/index.html</code>, once you have run <code>rake appdoc</code></p>
|
||||
|
||||
<p><strong>IF THIS CRASHES YOUR MACHINE AND LOSES YOUR DATA, IT'S NOT MY FAULT!</strong></p>
|
||||
|
||||
<h2 id="installation">Installation</h2>
|
||||
|
||||
<p>Before you start, you need to make sure that you have Ruby 1.8.2 installed. Rails 1.0 and RedCloth are now included in the vendor directory of the distribution, so you don't need to install them yourself. You also need some kind of database. MySQL is probably the most popular, but it's also easy to use PostgreSQL or SQLite/SQLite3. Note that upgrading via the <code>rake migrate</code> command is quite a bit more tricky currently with SQLite and SQLite3. If you have Mac OS X Tiger, you already have Ruby 1.8.2 and SQLite3 installed, so all you need to do after installing Rails and Redcloth is to install the sqlite3-ruby gem (1.1.0). If you're using MySQL, you might want to install the native MySQL bindings to improve performance:</p>
|
||||
|
||||
<pre><code>sudo gem install mysql
|
||||
</code></pre>
|
||||
|
||||
<p>On Mac OS X, you need the following:</p>
|
||||
|
||||
<pre><code>sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
|
||||
</code></pre>
|
||||
|
||||
<p>See the <a href="http://dev.rousette.org.uk/wiki/Tracks/Install">wiki</a> for more details on installing all the necessary components on all the supported platforms.</p>
|
||||
|
||||
<h3 id="new_installations">New installations</h3>
|
||||
|
||||
<h4 id="mysql">MySQL</h4>
|
||||
|
||||
<p>In the following, I'm assuming that you're using MySQL and the built-in WEBrick server. See the sections below for additional instructions on using other databases and servers.</p>
|
||||
|
||||
<ul>
|
||||
<li>Unzip <code>tracks_1_04.zip</code> somewhere in your home folder ( e.g. <code>/Users/yourusername/Sites</code>).</li>
|
||||
<li>Make a database for which you have full access rights. e.g. assuming that you want to call your database <code>tracks-104</code>, at the command line:</li>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
mysql -uroot -p
|
||||
mysql> CREATE DATABASE tracks-104;
|
||||
mysql> GRANT ALL PRIVILEGES ON tracks-104.* TO yourmysqluser@localhost \
|
||||
IDENTIFIED BY 'password-goes-here' WITH GRANT OPTION;
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>Copy the file <code>config/database.yml.tmpl</code> to <code>config/database.yml</code>.</li>
|
||||
<li>Open the <code>tracks/config/database.yml</code> file, and enter your username and password details for the database you just set up under the 'production' and 'development' sections. <strong>NB</strong>: If you do set up the entry for 'test', make sure that you specify a different database, or when you run tests, they will overwrite your data. It's very important that you don't use TABS in any of the <code>*.yml</code> files. Just use spaces to indent.</li>
|
||||
<li>Run <code>rake setup_tracks</code>, which will copy all the files and directories with <code>*.tmpl</code> extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:</li>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
cd /PATHTO/TRACKS
|
||||
rake setup_tracks
|
||||
</code>
|
||||
</pre>
|
||||
<li>Open the file <code>config/environment.rb</code> and look at the last line which should read: <code>SALT = "change-me"</code>. Change the word change-me to something else of your choosing. This string will be used as a 'salt' to encrypt your password and make it a bit more secure.</li>
|
||||
<li>Run 'rake migrate', which will create the necessary tables in your database, including some required contents:</li>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
cd /PATHTO/TRACKS
|
||||
rake migrate
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>If you find that 'rake migrate' doesn't work for you (there have been reports of it not working well with the MySQL distributed with InstantRails on Windows), you can use the command <code>rake db_schema_import</code> which will do the same thing.</li>
|
||||
<li>(Optional step) If you want to import some example next actions, projects and contexts, use the command <code>rake load_fixtures</code>. This will import data into your database, including two users: an admin user with the login 'admin' and password 'abracadabra', and a normal user 'jane' with password 'sesame'.</li>
|
||||
<li>Check the shebang lines of the <code>public/dispatch.*</code> files and all the files in the script directory. They are set to <code>#!/usr/bin/env ruby</code> by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
<code>ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*</code></li>
|
||||
<li>Run the following command at your command line (<strong>Important:</strong> If you already have an application running on WEBrick (Tracks or anything else), make sure that you stop the server, or run Tracks on a different port using the <code>--port</code> option):</li>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
cd /PATHTO/TRACKS
|
||||
ruby script/server -e production
|
||||
</code>
|
||||
</pre>
|
||||
|
||||
<li>In a browser (if you haven't loaded the example data), go to <code>http://0.0.0.0:3000/signup</code>. This will allow you to choose a username and password for the admin user. Thereafter, anyone else trying to access <code>/signup</code> will get a message that they are not allowed to sign up, and are given your email address to contact for permission. When you are logged in as the admin user, you can visit <code>/signup</code> to sign up additional users (who will not be able to view any of your next actions, contexts, projects or notes, but can set up their own separate tasks), and visit <code>/login</code> to login yourself.</li>
|
||||
<li>Add some contexts at <code>http://0.0.0.0:3000/contexts</code> (you must do this before adding any next actions) and projects at <code>http://0.0.0.0:3000/projects</code> and then you're ready to add all your next actions.</li>
|
||||
<li>You can set various preferences by visiting <code>http://0.0.0.0:3000/user/preferences</code>. These are stored on a per-user basis in the database.</li>
|
||||
<li>Have fun!</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="sqlite_sqlite3">SQLite/SQLite3</h4>
|
||||
|
||||
<p>The instructions are the same as those for MySQL above, except that I have provided an SQLite3 database, pre-loaded with the correct schema (<code>db/tracks-104.db</code>). All you need to do is to insert that filename in database.yml. e.g.:</p>
|
||||
|
||||
<pre><code>adapter: sqlite3
|
||||
database: /Users/YOURUSERNAME/Sites/tracks/db/tracks-104.db
|
||||
</code></pre>
|
||||
|
||||
<h3 id="upgrading_from_tracks_103">Upgrading from Tracks 1.03</h3>
|
||||
|
||||
<h4 id="mysql_or_postgresql">MySQL or Postgresql</h4>
|
||||
|
||||
<ul>
|
||||
<li>For safety, rename your current Tracks directory to 'tracks-old' or something similar.</li>
|
||||
<li>Before you do anything else, <strong>BACK UP YOUR DATABASE</strong> (tables and content) and keep the SQL dumps somewhere safe so that you can recreate the old database if necesary.</li>
|
||||
<li>Run <code>rake setup_tracks</code>, which will copy all the files and directories with <code>*.tmpl</code> extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:</li>
|
||||
<pre>
|
||||
<code>
|
||||
cd /PATHTO/TRACKS
|
||||
rake setup_tracks
|
||||
</code>
|
||||
</pre>
|
||||
<li>Open the file <code>config/environment.rb</code> and look at the last line which should read: <code>SALT = "change-me"</code>. Change the word change-me to something else of your choosing. This string will be used as a 'salt' to encrypt your password and make it a bit more secure.</li>
|
||||
<li>In <code>database.yml</code> insert your old database name, user and password under the 'development' section.</li>
|
||||
<li>Run the command <code>rake extract_fixtures</code> inside the Tracks directory. This will populate the <code>db/exported_fixtures</code> directory with <code>*.yml</code> files corresponding to the contexts, projects and todos table from the contents of your old database.</li>
|
||||
<li>Open <code>db/exported_fixtures/todos.yml</code> and search for the lines starting <code>created:</code> and replace with <code>created_at:</code>.</li>
|
||||
<li>Create a new MySQL database (named tracks-104, for example).</li>
|
||||
<li>In <code>database.yml</code> insert this new database name, user and password under the 'development' section.</li>
|
||||
<li>Run the command <code>rake db_schema_import</code> inside the Tracks directory. This should import the upgraded schema for 1.04 into your new database.</li>
|
||||
<li>Run the command <code>rake load_exported_fixtures</code> which will import the contents of your old database from the fixtures files in <code>db/exported_fixtures</code>.</li>
|
||||
<li>Check the shebang lines of the <code>public/dispatch.*</code> files and all the files in the script directory. They are set to <code>#!/usr/bin/env ruby</code> by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
<code>ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*</code></li>
|
||||
<li>From here, follow the remaining steps for new users above to start the server. Since your users table was deliberately not imported, you'll have to re-create your users via <code>/signup</code>. Signup is now at <code>http://0.0.0.0:3000/signup</code>, and login at <code>http://0.0.0.0:3000/login</code>.</li>
|
||||
</ul>
|
||||
|
||||
<h4 id="sqlite_or_sqlite3">SQLite or SQLite3</h4>
|
||||
|
||||
<ul>
|
||||
<li>For safety, rename your current Tracks directory to 'tracks-old' or something similar (making sure that you keep your old database safe), create a new directory for the new version.</li>
|
||||
<li>Copy (NOT MOVE!) your old database into the new tracks/db directory.</li>
|
||||
<li>Run <code>rake setup_tracks</code>, which will copy all the files and directories with <code>*.tmpl</code> extensions and removes the extension. It ignores any files or directories that you've already converted, so it's safe to run it when you're upgrading:</li>
|
||||
|
||||
<pre>
|
||||
<code>
|
||||
cd /PATHTO/TRACKS
|
||||
rake setup_tracks
|
||||
</code>
|
||||
</pre>
|
||||
<li>Open the file <code>config/environment.rb</code> and look at the last line which should read: <code>SALT = "change-me"</code>. Change the word change-me to something else of your choosing. This string will be used as a 'salt' to encrypt your password and make it a bit more secure.</li>
|
||||
<li>In <code>database.yml</code> insert your old database name, user and password under the 'development' section.</li>
|
||||
<li>Run the command <code>rake extract_fixtures</code> inside the Tracks directory. This will populate the <code>db/exported_fixtures</code> directory with <code>*.yml</code> files corresponding to the contexts, projects and todos table from the contents of your old database.</li>
|
||||
<li>Open <code>db/exported_fixtures/todos.yml</code> and search for the lines starting <code>created:</code> and replace with <code>created_at:</code>, and <code>done: "0"</code> with <code>done: "f"</code> and <code>done: "1"</code> with <code>done: "t"</code>. You need to replace the similar 'done' lines in <code>projects.yml</code>, and in <code>contexts.yml</code> replace <code>hide: "0"</code> with <code>hide: "f"</code> and <code>hide: "1"</code> with <code>hide: "t"</code>.</li>
|
||||
<li>In <code>database.yml</code> insert the name of the provided <code>tracks-104.db</code> the 'development' section.</li>
|
||||
<li>Run the command <code>rake load_exported_fixtures</code> which will import the contents of your old database from the fixtures files in <code>db/exported_fixtures</code>.</li>
|
||||
<li>Check the shebang lines of the <code>public/dispatch.*</code> files and all the files in the script directory. They are set to <code>#!/usr/bin/env ruby</code> by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
<code>ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*</code></li>
|
||||
<li>From here, follow the remaining steps for new users above to start the server. Since your users table was deliberately not imported, you'll have to re-create your users via <code>/signup</code>. Signup is now at <code>http://0.0.0.0:3000/signup</code>, and login at <code>http://0.0.0.0:3000/login</code>.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="other_servers">Other servers</h2>
|
||||
|
||||
<p>WEBrick is the easiest server to get working to test out Tracks, and will be fine if you have Tracks installed on your own machine. One nice feature in Rails 0.13.1 is that WEBrick runs by default on the IP address 0.0.0.0, which means that you can access it via 127.0.0.1 when you are on the same machine, or via the external IP address of the machine running Tracks, so long as you can access the network of that machine from your current location. However, it is possible to use other servers, and the new re-writing rules of Rails 0.13.1 ('Routes' in <code>environment/routes.rb</code>) mean that very little configuration is needed. With Rails 1.0, if you have lighttpd installed, running <code>script/server</code> starts lighttpd instead of WEBrick, creating the appropriate lighttpd.conf file automatically.</p>
|
||||
|
||||
<h3 id="apache">Apache</h3>
|
||||
|
||||
<p>See the file <code>tracks/README_RAILS</code> for an example of an Apache conf. The file <code>tracks/public/.htaccess</code> contains the necessary re-write rules to call <code>dispatch.cgi</code> or <code>dispatch.fcgi</code>. All other rules are handled by <code>routes.rb</code></p>
|
||||
|
||||
<h3 id="lighttpd">Lighttpd</h3>
|
||||
|
||||
<p>Again, see <code>tracks/README_RAILS</code> for a working example of a lighttpd.conf file. Note that you'll want to change the line: </p>
|
||||
<pre>
|
||||
<code>"bin-environment" => ( "RAILS_ENV" => "development"</code>
|
||||
</pre>
|
||||
to:
|
||||
<pre>
|
||||
<code>"bin-environment" => ( "RAILS_ENV" => "production"</code>.
|
||||
</pre>
|
||||
|
||||
<h2 id="contacting_me">Contacting me</h2>
|
||||
|
||||
<p>I'd love any suggestions you have for improvements, bug-fixes etc. Email me at: butshesagirl@rousette.org.uk</p>
|
||||
|
||||
<p>You can also leave bug reports, feature requests, and comments at: http://dev.rousette.org.uk/report/6</p>
|
||||
|
||||
<p>Subscribe to the tracks-discuss mailing list <a href="http://lists.rousette.org.uk/mailman/listinfo/tracks-discuss">here</a> or by sending an email to tracks-discuss-join@lists.rousette.org.uk.</p>
|
||||
17
tracks/lib/tasks/extract_fixtures.rake
Normal file
17
tracks/lib/tasks/extract_fixtures.rake
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
desc ' Create YAML test fixtures from data in an existing database.
|
||||
Defaults to development database. Set RAILS_ENV to override (taken from Rails Recipes book).'
|
||||
task :extract_fixtures => :environment do
|
||||
sql = "SELECT * FROM %s"
|
||||
skip_tables = ["schema_info", "sessions", "users"]
|
||||
ActiveRecord::Base.establish_connection
|
||||
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
|
||||
i = "000"
|
||||
File.open("#{RAILS_ROOT}/db/exported_fixtures/#{table_name}.yml", 'w' ) do |file|
|
||||
data = ActiveRecord::Base.connection.select_all(sql % table_name)
|
||||
file.write data.inject({}) { |hash, record|
|
||||
hash["#{table_name}_#{i.succ!}"] = record
|
||||
hash
|
||||
}.to_yaml
|
||||
end
|
||||
end
|
||||
end
|
||||
8
tracks/lib/tasks/load_exported_fixtures.rake
Normal file
8
tracks/lib/tasks/load_exported_fixtures.rake
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
desc "Load exported fixtures (in db/exported_fixtures) into the current environment's database"
|
||||
task :load_exported_fixtures => :environment do
|
||||
require 'active_record/fixtures'
|
||||
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
|
||||
Dir.glob(File.join(RAILS_ROOT, 'db', 'exported_fixtures', '*.{yml,csv}')).each do |fixture_file|
|
||||
Fixtures.create_fixtures('db/exported_fixtures', File.basename(fixture_file, '.*'))
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue