Menu

Tree [521b8c] master /
 History

HTTPS access


File Date Author Commit
 extra 2022-01-03 R.K. Owen R.K. Owen [0f7fe6] Add a couple helpful SQL scripts to help with d...
 .gitignore 2021-12-17 R.K. Owen R.K. Owen [257a97] Use env.vars for passing the DB URL and the cry...
 .htaccess 2022-01-20 R.K. Owen R.K. Owen [14e4e6] Enable or disable the creation of new users thr...
 3x5.css 2022-02-25 R.K. Owen R.K. Owen [15f615] Have encrypted cards be outlined in red for eas...
 3x5.js 2022-09-18 R.K. Owen, Ph.D R.K. Owen, Ph.D [e3a064] Put JS FrameSize definition at top before its u...
 3x5.sql 2022-01-23 R.K. Owen R.K. Owen [b77436] Don't update moddate on batch encrypt/decrypt.
 3x5.xsl 2022-01-29 R.K. Owen R.K. Owen [aa9e6f] Collapse the left menu panel on click, reopen i...
 3x5_db.inc 2022-01-24 R.K. Owen R.K. Owen [122a70] Took care of a couple of undefined variables.
 3x5_help.sql 2022-02-23 R.K. Owen R.K. Owen [861764] Added a pop-up calendar widget for entering YYY...
 MAP 2022-02-25 R.K. Owen R.K. Owen [15f615] Have encrypted cards be outlined in red for eas...
 README 2022-02-23 R.K. Owen R.K. Owen [861764] Added a pop-up calendar widget for entering YYY...
 back.gif 2020-05-08 R.K. Owen R.K. Owen [74bce5] Reworking the cvs2git conversion, removing the ...
 batches.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 cardbatches.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 cards.inc 2022-01-29 R.K. Owen R.K. Owen [aa9e6f] Collapse the left menu panel on click, reopen i...
 common.inc 2022-10-26 R.K. Owen R.K. Owen [35ace1] Fixed batch name updater.
 composer.json 2021-12-17 R.K. Owen R.K. Owen [7695dc] Comment out php_flag, etc options and add compo...
 create_update_user.inc 2021-12-29 R.K. Owen R.K. Owen [504eda] Fixed the update project user info. The extra ...
 create_user.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 crypt_admin.php 2022-01-21 R.K. Owen R.K. Owen [c8d59e] Fixed the input of the encryption hint.
 crypt_batch.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 crypt_user.php 2022-01-21 R.K. Owen R.K. Owen [cd4ac9] Added a "button" for viewing/hiding the passwor...
 csv_cards.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 db_connect.inc 2022-01-20 R.K. Owen R.K. Owen [14e4e6] Enable or disable the creation of new users thr...
 del_batch.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 index.php 2022-01-29 R.K. Owen R.K. Owen [aa9e6f] Collapse the left menu panel on click, reopen i...
 indexB.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 indexH.php 2022-01-29 R.K. Owen R.K. Owen [aa9e6f] Collapse the left menu panel on click, reopen i...
 indexM.php 2022-01-29 R.K. Owen R.K. Owen [aa9e6f] Collapse the left menu panel on click, reopen i...
 indexT.php 2022-01-24 R.K. Owen R.K. Owen [5e83fb] Added "search help" page.
 javascript.inc 2020-05-08 R.K. Owen R.K. Owen [74bce5] Reworking the cvs2git conversion, removing the ...
 list_batches.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 login_user.php 2022-01-21 R.K. Owen R.K. Owen [cd4ac9] Added a "button" for viewing/hiding the passwor...
 logout_user.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 many_batch.inc 2021-12-18 R.K. Owen R.K. Owen [b05f7b] Replaced the deprecated each/list with foreach.
 mkmap 2022-02-25 R.K. Owen R.K. Owen [15f615] Have encrypted cards be outlined in red for eas...
 new_batch.php 2022-10-26 R.K. Owen, Ph.D R.K. Owen, Ph.D [521b8c] Minor change.
 office-calendar-icon.png 2022-02-23 R.K. Owen R.K. Owen [861764] Added a pop-up calendar widget for entering YYY...
 one_batch.inc 2022-01-14 R.K. Owen R.K. Owen [f90ec7] Now allow batch encryption/decryption along wit...
 phpinfo.php 2022-01-20 R.K. Owen R.K. Owen [14e4e6] Enable or disable the creation of new users thr...
 rko_db.inc 2022-01-20 R.K. Owen R.K. Owen [14e4e6] Enable or disable the creation of new users thr...
 search_batches.php 2022-10-18 R.K. Owen R.K. Owen [d1d78c] Fixed spelling error with "modification".
 search_help.php 2022-01-24 R.K. Owen R.K. Owen [122a70] Took care of a couple of undefined variables.
 sel_batches.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 session.inc 2021-12-30 R.K. Owen R.K. Owen [6bc76e] First attempt to collect some common data in a ...
 update_user.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 user.inc 2021-12-31 R.K. Owen R.K. Owen [a609f0] Added direct $user boolean whether encoding or ...
 user_role.php 2022-01-14 R.K. Owen R.K. Owen [7fa55d] None of the script files need +x permission.
 view.inc 2022-02-25 R.K. Owen R.K. Owen [15f615] Have encrypted cards be outlined in red for eas...
 view_cards.php 2022-02-23 R.K. Owen R.K. Owen [861764] Added a pop-up calendar widget for entering YYY...
 xcards.php 2021-12-18 R.K. Owen R.K. Owen [b05f7b] Replaced the deprecated each/list with foreach.

Read Me

This document gives some of the relevant details related to the 3x5 card
project.

Project Name:
3x5 Cards

Purpose:
The 3x5 Cards project provides an intuitive web interface to a
database.  The metaphor is the 3"x5" index card.
Each card has a number, a title, and the contents of the card itself.
The cards can be arranged by either the number or the title, and
can be collected in batches.  Unlike the 3"x5" index card ... an individual
3x5 card can exist in multiple batches, and the characteristics
of a batch can be related to another.

Access can be granted, through a password mechanism, to allow
full administrative access, writing and creating cards,
appending information to existing cards only, or the most
restrictive of read-only.

Requires:
	Apache2		- web server
	PHP7		- embedded scripting and display
	Postgres 10.x	- database
		(with plpgsql - Postgres procedural language - for triggers)


Principle Author:	R.K. Owen, Ph.D.
Initial Date:		05/12/2002

The current version number is given in the cards.inc file.
All configurable color and site values are given in cards.inc .


INSTALLATION:
Apache2 -
Should be running as user/group "www-data" or the equivalent non-privileged
user/group, The Ubuntu distribution uses "www-data".
The user/group is defined in apache2/envvars.

This can be changed by editing the envvars or apache2.conf and editing it to:
	User www-data
	Group www-data

Or if this is not feasible then edit the 3x5.sql file replacing
"www-data" with whatever user the httpd daemon runs as.

Postgres -
Needs the procedural language to be loaded, which is now loaded by default.
Check by executing psql and giving \dL at the prompt.  Should see
plpgsql in the list.

Older versions of Postgres required installing the PL/PostgreSQL
procedural language manually with something like:
	createlang plpgsql template1
Read src/pl/plpgsql/src/INSTALL in the PostgreSQL sources for further
info.

Create the database with (must be a user that can do this ... if
not as yourself, then as the postgres user.)
	createdb i3x5

Create a user "www-data", the default user the httpd daemon user,
which will be given access to the i3x5 schema:
	createuser -D -A www-data

Create tables by starting the PostgreSQL interactive terminal
and invoking the sql scripts.  The prompt is given as "i3x5=#".
	psql i3x5
	i3x5=# \i 3x5.sql	(ignore the errors if starting from scratch)
	i3x5=# \i 3x5_help.sql
	i3x5=# \q

------------------------------------------------------------------------
Most hosting services do not provide an adequate environment for running
psql from the commandline.  However, most offer phpPgAdmin from the
CPanel web interface.  This should be sufficient for creating and
populating the necessary tables.

You will find in the far upper right hand corner "SQL | History | Find".
Click on "SQL" and in the dialog box use the "or upload an SQL script"
to choose the appropriate .sql script to process.
------------------------------------------------------------------------

PHP - 
The configuration options are given here (tailor the path to your own site)

configure \
	--with-apxs --prefix=/php_path/php/7.2 \
	--with-config-file-path=/php_path/php/7.2/lib \
	--with-exec-dir=/php_path/php/7.2/bin --with-openssl \
	--without-pear --enable-xml --enable-wddx \
	--with-pgsql --with-gdbm

Or use packages.  The following are the list for Ubuntu.

php
php-common
php-pgsql

Which can be installed with
	apt install php php-common php-pgsql

You may want to increase the value for session.gc_maxlifetime
in /etc/php/X.Y/apache2/php.ini .  The default time is 24 minutes.
Increase this time and a person can be "logged" in longer.
However, this can't be reliably changed if hosted elsewhere.

========================================================================
Install the libjs-jquery-ui package and dependencies
apt install libjs-jquery-ui

The interface now uses jQuery to dynamically set some heights and widths.
Note that iframes default to 150x300 pixels, and no CSS appears to change
this unless values are explicitly given.  I.e. it doesn't recognize 100%.

========================================================================
Database Connection

The database connection string can be defined in a couple of ways.
1) The .htaccess file can be used to define the DATABASE_URL and DB_CRYPT
environment variables.  If DB_CRYPT is set then it's automatically assumed
encryption is enabled. (This sets $db_encode .) 

If you use Heroku there is no need to edit the .htaccess file and define
the DATABASE_URL.  This is defined for you already when you created the
PostgreSQL addon with something like:

	heroku addons:create --app i3x5 heroku-postgresql:hobby-dev

The DB_CRYPT environment variable is defined for your i3x5 app with
something like this:

	heroku config:set DB_CRYPT=SomeString

If you're using environment variables, then there's no need to edit
the given db_connect.inc file.

2) If environment variables are not used then you will need to edit
db_connect.inc and give the database password and connection values
there.  The db_connect.inc has an example of the keyword type of
connection string.  .htaccess has an example of the postgresql URL connection
string.

In either case if your system has the pgcrypto extenstion then you can set
$db_encode to true and define some encryption string with $db_crypt.

Not all webhosting services provide this as part of their basic
service (e.g. BlueHost).
This encodes the user passwords for the many levels.  However, note
that passwords are still stored within the database, but just
encrypted.  So a casual browser of the database won't be able to view
these passwords unless they have the encryption key.

The extra/ directory has convenient SQL scripts for converting from
encoded to unencoded or back.

========================================================================

Web page layout: page and [iframe]
				index.php
				[_parent]
+----------------+-----------------------------------------------------+
|                |                                                     |
|  indexT.php    |                    indexM.php                       |
|    (title)     |                  and all others                     |
|                |                      [main]                         |
+----------------+                                                     |
|                |                                                     |
|  indexB.php    |                                                     |
|   (options)    |                                                     |
|                |                                                     |
+----------------+                                                     |
|                |                                                     |
|    context     |                                                     |
|   sensitive    |                                                     |
|     help       |                                                     |
|   [helptext]   |                                                     |
|                |                                                     |
+----------------+-----------------------------------------------------+

========================================================================
The following are attributions for various items used in 3x5, which
are gratefully acknowledged.

Calendar icon:
	office-calendar-icon.png
	Artist: Papirus Development Team
	Iconset: Papirus Apps Icons (1418 icons)
	License: GNU General Public License v3.0
	Commercial usage: Allowed