Commit Graph
399 Commits
Author SHA1 Message Date
James Valleroy dccd1deae1 Modify firstboot and user_add forms to use add_user function. 2013-11-04 02:00:40 +00:00
James Valleroy 9238aea8fe Fix check for already existing username in add_user. Add documentation of process for storing and validating hashed passwords. 2013-11-04 01:14:17 +00:00
James Valleroy 01ac7e164e Update tests for auth module, and fix some bugs discovered in auth module. 2013-11-04 00:30:21 +00:00
James Valleroy dbeb31dfa1 Add add_user function to auth module. 2013-11-03 23:39:16 +00:00
James Valleroy 198cea5b58 Use bcrypt to hash passwords for new users in firstboot and user_add forms. Removed references to md5 hashing which was already non-functional. 2013-11-03 21:55:06 +00:00
James Valleroy 3425d265c3 update model 2013-11-03 21:32:47 +00:00
James Valleroy 2da78b515a Use bcrypt for login form. Add tests to check that salts and hashes are random, and check handling of invalid passwords or salts. 2013-11-03 21:32:47 +00:00
Nick Daly 14bbf48c76 Merge pull request #51 from jvalleroy/fix-user-store
Fix user store, remove some obsolete code
2013-11-03 13:17:20 -08:00
James Valleroy 7536b7387b Remove references to deleted md5.js file. 2013-11-02 17:34:17 +00:00
James Valleroy 7b3a2fbe2c Remove completed TODO. 2013-11-02 17:34:17 +00:00
James Valleroy 504a195708 Remove commit line from UserStore. This function was not defined in withsqlite, and also unnecessary since autocommit is on. 2013-11-02 17:34:17 +00:00
Nick Daly 49ce1b9389 Merge JValleroy's test fixes. 2013-11-02 11:37:45 -05:00
Nick Daly c0049d1d8c Merged JValleroy's test updates.
The *user_store* tests can find the user_store module, and now the
tests fail for completely different reasons!
2013-11-02 11:26:35 -05:00
Nick Daly daca06a9b3 Moved actions/privilegedactions_test.py to tests/.
Added new "--pause" option in test.sh to pause after each test.
2013-11-02 10:34:51 -05:00
Nick Daly b14b0db4d2 Merge pull request #48 from jvalleroy/fix-tests
Fix tests
2013-11-02 08:17:11 -07:00
James Valleroy 60ea9f43cd Prepend server_dir to form actions that use absolute paths. 2013-11-02 11:40:18 +00:00
James Valleroy 77948f0e96 prepend server_dir to remaining redirects 2013-11-02 11:34:23 +00:00
James Valleroy 38d3e84961 first_boot needs to move up a folder to reach router. Prepend server_dir to redirects in router, auth, and auth_page. 2013-11-02 11:25:37 +00:00
James Valleroy 4d97c29980 Change firstboot redirects so they don't go to firstboot/firstboot. 2013-11-02 11:03:26 +00:00
James Valleroy 1acc17f403 Fix import of user_store in test. 2013-11-02 02:41:44 +00:00
James Valleroy 8786e6ecc2 Fix import of privilegedactions in tests. 2013-11-02 02:40:49 +00:00
James Valleroy a5adb1c292 Convert unicode (but otherwise valid) hostname to ASCII. Pass hostname option to hostname-change as a string rather than a list. 2013-11-02 02:20:02 +00:00
Nick Daly b9b4e0a2ec Update Apache config for new static directory location.
It's now /plinth/static, not /static.
2013-10-31 19:53:56 -05:00
Nick Daly 2af1617f51 Set the template's basehref from cfg.server_dir.
Previously, the cfg.base_href variable was never set (it's not even in
the sample.config file!).  Now, Plinth uses the specified root
directory (from the *--server_dir* argument) in each URL reference.
2013-10-31 19:36:35 -05:00
Nick Daly e3f1297711 Unify git.sample.config and git.sample.fhs.config.
There's no point to having two copies of what's essentially the same
file.  In the long term, this means the distributions will need to
patch out cfg.py directories instead of plinth.sample.fhs.config.  So,
if diff plinth.sample.config plinth.sample.fhs.config reveals
anything relevant, put that in your patch.
2013-10-30 22:05:29 -05:00
Nick Daly 3a30660c25 Revert 4d529b7585.
Turns out, that was a terrible idea.

Putting privilegedactions in actions/ meant that we tried to interpret
it during startup (along with other similarly silly bugs).  The
fastest way to fix this issue is to merely revert it.
2013-10-30 21:45:43 -05:00
Nick Daly 0296a1a99c Removed unused import. 2013-10-27 17:47:18 -05:00
Nick Daly 9e276c3ffb Undo this change, bad idea.
English letters do not always sort as expected in non-en locales.
2013-10-27 17:41:19 -05:00
Nick Daly dc9331353f Remove local JavaScript; Add /static permissions.
Changes:
1. Remove local minified copies of html5shiv, modernizr, and jquery.
2. Add symlinks to system copies of minified modernizr and jquery. These are installed by libjs-modernizr and libjs-jquery.
3. In apache configuration, change DocumentRoot from plinth/static to just plinth.
4. Add permissions for /static location.
2013-10-27 16:56:32 -05:00
Nick Daly a47ced4563 Add freedombox-setup script for plinth.
This allow us to handle all the Plinth setup in one package.  I've
added one change from Pere's original commit: we disable Apache's
default site.  If the default site is enabled, Plinth doesn't load
correctly (we get 404 errors).
2013-10-27 16:35:12 -05:00
Nick Daly 421f20005e Plinth now hosted on (server)/plinth.
Plinth has been moved from plinth.(server).local to (server)/plinth.
*plinth.py* has been updated to take a new *--server_dir* argument,
which *share/init.d/plinth* now provides.  *plinth.sample.config* has
also been updated.

Actually, the whole package has been moved to a more Debian-friendly
configuration.  *share/apache2/plinth.conf* has been updated to
reflect the standard Debian directories.  It seems to make more sense
this way, as (other than FreedomMaker, which now uses this package
anyway) no other tools or derivatives use this system.  The
configuration can be patched out by other distributions easily enough.
2013-10-27 16:01:28 -05:00
Nick Daly 1da32164e5 Ignore plinth.config.
How'd we go so long without that??
2013-10-27 10:51:08 -05:00
Nick Daly f56d593217 Automagically test every test in the test directory. 2013-10-27 10:50:17 -05:00
Nick Daly 5e9f221ef5 Simplified hostname name matching test.
The first character must be a letter, and [A-z] is easier to manage
than 52 individual letters.
2013-10-27 10:49:53 -05:00
Nick Daly 065c25039a Rewrote actions/privilegedactions.py to be less exploitable.
I'm sure there are still some exploits in the code, but there are
certainly fewer now.  Instead of just executing whatever arguments are
passed into privilegedactions.privilegedaction_run, we now limit the
actions that can be run in the following ways:

- Only actions that exist in the actions directory can be executed.
  Attempting to run the action "echo; rm -rf /" will look for a file
  named "actions/echo; rm -rf /", of which there are none.

- Shell literals are escaped: attempting to run the "echo" action with
  options like "'hi'; rm -rf /") will echo "'hi'; rm -rf /".

- It is difficult to interact with the spawned process through this
  interface.  We can't control whether the spawned process allows
  interaction.

The details of the contract are included in privilegedactions.py, and
this contract is tested in privilegedactions_test.py.
2013-10-27 10:46:06 -05:00
Nick Daly 4d529b7585 Moved privilegedactions to the actions directory. 2013-10-27 10:26:06 -05:00
James Valleroy f18d4a9e48 Change DocumentRoot in apache configuration, and add permissions for /static. 2013-10-20 09:04:31 -04:00
James Valleroy 13bbe7ea25 Merge branch 'master' of https://github.com/NickDaly/Plinth into replace-minified-js 2013-10-20 08:18:50 -04:00
Petter Reinholdtsen 6e1d144706 Add freedombox-setup script for plinth.
This allow us to handle all plinth setup in one package.
2013-10-19 09:05:36 +02:00
Nick Daly 025c2aebc1 Forgot an Apache module: proxy_http.
Without this module, Apache doesn't know how to proxy HTTP requests.
2013-10-18 17:03:27 -05:00
Nick Daly d84150b103 Fix DocumentRoot: Apache can serve Plinth's static files.
Without this change, Apache tries to serve the static files from
/dev/null/static, which never exists, so users will see all exciting
manner of errors.

I've assumed that the correct directory is the default directory that
Freedom-Maker installs Plinth to, currently ``/home/fbx/plinth``.
Other distributions will need to patch this out to their preferred
location, like ``/usr/share/plinth/static``.
2013-10-18 16:59:35 -05:00
Nick Daly ee5609a2e3 Configure Apache correctly when installing Plinth.
Apache configuration was missing a few modules, and the server needs
to be restarted after those modules are enabled.  Also, the server
needs to be reloaded after the Plinth site is enabled.
2013-10-18 16:52:40 -05:00
Nick Daly da7bd50a09 Corrected "Old Browser" warning: point to FireFox.
It's inappropriate for the FreedomBox project to recommend Non-Free
Software.  Therefore, we point users to the current version of FireFox
if their browser is too old.
2013-10-18 16:49:50 -05:00
James Valleroy cf3eaa479c Remove local minimized copies of modernizr and HTML5 shiv.
Instead add link to system modernizr which includes HTML5 shiv.
Update base template to reflect this change.
2013-10-16 21:56:09 -04:00
James Valleroy 5026c63874 Remove local copy of jquery-min, and link to the system file instead. 2013-10-16 20:07:07 -04:00
Nick Daly 5ec749af8e Removed ExMachina from Plinth, it's no longer used. 2013-10-09 20:16:10 -05:00
Nick Daly 49046c0074 Merge pull request #36 from petterreinholdtsen/master
Make sure 'make all' do not need privileges, and 'make install'
2013-10-07 14:51:36 -07:00
Nick Daly 510dc822a9 Merge pull request #37 from petterreinholdtsen/handle-no-argument
Add missing return statement to parse_arguments().
2013-10-07 14:51:31 -07:00
Nick Daly 7ae7525e60 Merge pull request #38 from petterreinholdtsen/cleanup-init-d-script
Clean up init.d script.
2013-10-07 14:51:23 -07:00
Petter Reinholdtsen 5b9d3efcb0 Clean up init.d script.
Run as user/group plinth, not www-data.
Rewrite to use lsb init-functions for starting/stopping and output.
Use /bin/sh instead of bash to speed up the boot.
2013-10-07 22:15:06 +02:00