Changeset - aaa7c3331186
[Not reviewed]
Bradley M. Kuhn - 11 years ago 2014-07-03 01:04:00
bkuhn@sfconservancy.org
Rename paster command setup-rhodecode to setup-db
5 files changed with 9 insertions and 9 deletions:
0 comments (0 inline, 0 general)
docs/installation_win.rst
Show inline comments
 
@@ -212,25 +212,25 @@ if you closed it reopen it following the
 
  cd C:\RhodeCode\Bin
 
  paster make-config RhodeCode production.ini
 

	
 
Then, you must edit production.ini to fit your needs (ip address, ip
 
port, mail settings, database, whatever). I recommend using NotePad++
 
(free) or similar text editor, as it handles well the EndOfLine
 
character differences between Unix and Windows
 
(http://notepad-plus-plus.org/)
 

	
 
For the sake of simplicity lets run it with the default settings. After
 
your edits (if any), in the previous Command Prompt, type::
 

	
 
 paster setup-rhodecode production.ini
 
 paster setup-db production.ini
 

	
 
(this time a NEW database will be installed, you must follow a different
 
step to later UPGRADE to a newer RhodeCode version)
 

	
 
The script will ask you for confirmation about creating a NEW database,
 
answer yes (y)
 
The script will ask you for repository path, answer C:\\RhodeCode\\Repos
 
(or similar)
 
The script will ask you for admin username and password, answer "admin"
 
+ "123456" (or whatever you want)
 
The script will ask you for admin mail, answer "admin@xxxx.com" (or
 
whatever you want)
docs/setup.rst
Show inline comments
 
@@ -17,56 +17,56 @@ following command to do this::
 
  configuration file contains the various settings for RhodeCode, e.g proxy
 
  port, email settings, usage of static files, cache, celery settings and
 
  logging.
 

	
 

	
 
Next, you need to create the databases used by RhodeCode. I recommend that you
 
use postgresql or sqlite (default). If you choose a database other than the
 
default ensure you properly adjust the db url in your production.ini
 
configuration file to use this other database. RhodeCode currently supports
 
postgresql, sqlite and mysql databases. Create the database by running
 
the following command::
 

	
 
    paster setup-rhodecode production.ini
 
    paster setup-db production.ini
 

	
 
This will prompt you for a "root" path. This "root" path is the location where
 
RhodeCode will store all of its repositories on the current machine. After
 
entering this "root" path ``setup-rhodecode`` will also prompt you for a username
 
and password for the initial admin account which ``setup-rhodecode`` sets
 
entering this "root" path ``setup-db`` will also prompt you for a username
 
and password for the initial admin account which ``setup-db`` sets
 
up for you.
 

	
 
setup process can be fully automated, example for lazy::
 

	
 
    paster setup-rhodecode production.ini --user=nn --password=secret --email=nn@your.kallithea.server --repos=/home/nn/my_repos
 
    paster setup-db production.ini --user=nn --password=secret --email=nn@your.kallithea.server --repos=/home/nn/my_repos
 

	
 

	
 
- The ``setup-rhodecode`` command will create all of the needed tables and an
 
- The ``setup-db`` command will create all of the needed tables and an
 
  admin account. When choosing a root path you can either use a new empty
 
  location, or a location which already contains existing repositories. If you
 
  choose a location which contains existing repositories RhodeCode will simply
 
  add all of the repositories at the chosen location to it's database.
 
  (Note: make sure you specify the correct path to the root).
 
- Note: the given path for mercurial_ repositories **must** be write accessible
 
  for the application. It's very important since the RhodeCode web interface
 
  will work without write access, but when trying to do a push it will
 
  eventually fail with permission denied errors unless it has write access.
 

	
 
You are now ready to use RhodeCode, to run it simply execute::
 

	
 
    paster serve production.ini
 

	
 
- This command runs the RhodeCode server. The web app should be available at the
 
  127.0.0.1:5000. This ip and port is configurable via the production.ini
 
  file created in previous step
 
- Use the admin account you created above when running ``setup-rhodecode``
 
- Use the admin account you created above when running ``setup-db``
 
  to login to the web app.
 
- The default permissions on each repository is read, and the owner is admin.
 
  Remember to update these if needed.
 
- In the admin panel you can toggle ldap, anonymous, permissions settings. As
 
  well as edit more advanced options on users and repositories
 

	
 
Optionally users can create `rcextensions` package that extends RhodeCode
 
functionality. To do this simply execute::
 

	
 
    paster make-rcext production.ini
 

	
 
This will create `rcextensions` package in the same place that your `ini` file
rhodecode/lib/paster_commands/setup_db.py
Show inline comments
 
file renamed from rhodecode/lib/paster_commands/setup_rhodecode.py to rhodecode/lib/paster_commands/setup_db.py
rhodecode/tests/scripts/create_rc.sh
Show inline comments
 
#!/bin/sh
 
psql -U postgres -h localhost -c 'drop database if exists rhodecode;'
 
psql -U postgres -h localhost -c 'create database rhodecode;'
 
paster setup-rhodecode rc.ini --force-yes --user=marcink --password=qweqwe --email=marcin@python-blog.com --repos=/home/marcink/repos --no-public-access
 
paster setup-db rc.ini --force-yes --user=marcink --password=qweqwe --email=marcin@python-blog.com --repos=/home/marcink/repos --no-public-access
 
API_KEY=`psql -R " " -A -U postgres -h localhost -c "select api_key from users where admin=TRUE" -d rhodecode | awk '{print $2}'`
 
echo "run those after running server"
 
paster serve rc.ini --pid-file=rc.pid --daemon
 
sleep 3
 
rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user username:demo1 password:qweqwe email:demo1@example.com
 
rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user username:demo2 password:qweqwe email:demo2@example.com
 
rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user username:demo3 password:qweqwe email:demo3@example.com
 
rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 create_user_group group_name:demo12
 
rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 add_user_to_user_group usergroupid:demo12 userid:demo1
 
rhodecode-api --apikey=$API_KEY --apihost=http://127.0.0.1:5001 add_user_to_user_group usergroupid:demo12 userid:demo2
 
echo "killing server"
 
kill `cat rc.pid`
setup.py
Show inline comments
 
@@ -160,23 +160,23 @@ setup(
 
    [console_scripts]
 
    rhodecode-api =    rhodecode.bin.rhodecode_api:main
 
    rhodecode-gist =   rhodecode.bin.rhodecode_gist:main
 
    rhodecode-config = rhodecode.bin.rhodecode_config:main
 

	
 
    [paste.app_factory]
 
    main = rhodecode.config.middleware:make_app
 

	
 
    [paste.app_install]
 
    main = pylons.util:PylonsInstaller
 

	
 
    [paste.global_paster_command]
 
    setup-rhodecode=rhodecode.lib.paster_commands.setup_rhodecode:Command
 
    setup-db=rhodecode.lib.paster_commands.setup_db:Command
 
    update-repoinfo=rhodecode.lib.paster_commands.update_repoinfo:Command
 
    make-rcext=rhodecode.lib.paster_commands.make_rcextensions:Command
 
    repo-scan=rhodecode.lib.paster_commands.repo_scan:Command
 
    cache-keys=rhodecode.lib.paster_commands.cache_keys:Command
 
    ishell=rhodecode.lib.paster_commands.ishell:Command
 
    make-index=rhodecode.lib.paster_commands.make_index:Command
 
    upgrade-db=rhodecode.lib.dbmigrate:UpgradeDb
 
    celeryd=rhodecode.lib.celerypylons.commands:CeleryDaemonCommand
 
    """,
 
)
0 comments (0 inline, 0 general)