diff --git a/README.md b/README.md index 7616338..76a8c5a 100755 --- a/README.md +++ b/README.md @@ -86,11 +86,13 @@ With that kind of configuration, the server address will look like *http://serve Quickstart ---------- -The first time you run the server, open its URL to set the initial configuration. You'll be asked to create -a first user. This user will be an admin of the server. +To start using Supysonic, you'll first have to specify where your music library is located and create a user +to allow calls to the API. -Once the first user created, log in to the app. Then you can add other users or manage folders. Folders are -where your music is located. Add one, then hit the scan button. The scanning process might take some time on -large libraries, so be patient. Your browser might even timeout even if the process is still running. Once -scanning is done, you can enjoy your music with the client of your choice. +Let's start by creating the user. To do so, use the +[command-line interface](https://github.com/spl0k/supysonic/wiki/Command-Line-Interface) (`cli.py`). +For the folder(s) (music library) you can either use the CLI, or go to the web interface if you gave admin +rights to the user. Once the folder is created, don't forget to scan it to build the music database (it might +take a while depending on your library size, so be patient). Once scanning is done, you can enjoy your music +with the client of your choice. diff --git a/user.py b/user.py index 932f036..15634f3 100755 --- a/user.py +++ b/user.py @@ -14,9 +14,6 @@ def check_admin(): if not request.path.startswith('/user'): return - if request.endpoint == 'add_user' and User.query.filter(User.admin == True).count() == 0: - return - if request.endpoint in ('user_index', 'add_user', 'del_user', 'export_users', 'import_users', 'do_user_import') and not UserManager.get(session.get('userid'))[1].admin: return redirect(url_for('index')) diff --git a/web.py b/web.py index 6f950a1..ffdced6 100755 --- a/web.py +++ b/web.py @@ -17,16 +17,11 @@ import db from managers.user import UserManager @app.before_request -def init_and_login_check(): +def login_check(): if request.path.startswith('/rest/'): return - admin_count = db.User.query.filter(db.User.admin == True).count() - if admin_count == 0 and request.endpoint != 'add_user': - flash('Not configured. Please create the first admin user') - return redirect(url_for('add_user')) - - if not (admin_count == 0 and request.endpoint == 'add_user') and request.endpoint != 'login': + if request.endpoint != 'login': should_login = False if not session.get('userid'): should_login = True