Diskuse:155PIN2 Projekt - Informatika 2: Porovnání verzí

Z GeoWikiCZ
 
(Není zobrazeno 12 mezilehlých verzí od jednoho dalšího uživatele.)
Řádek 2: Řádek 2:


=== Založení instance ===
=== Založení instance ===
export TRAC=pin2


  trac-admin /opt/trac/<nazev> initenv
  trac-admin /opt/trac/$TRAC initenv
chgrp www-data /opt/trac/$TRAC -R
chmod g+rw /opt/trac/$TRAC -R


* http://trac.edgewall.org/wiki/TracInstall#CreatingaProjectEnvironment
* http://trac.edgewall.org/wiki/TracInstall#CreatingaProjectEnvironment
cat /etc/apache2/sites-enabled/003-trac
<pre>
<Location /trac/pin2>
  SetHandler mod_python
  PythonInterpreter main_interpreter
  PythonHandler trac.web.modpython_frontend
  PythonOption TracEnv /opt/trac/pin2
  PythonOption TracUriRoot /trac/pin2
</Location>
<Location /trac/pin2/login>
  SetHandler mod_python
  PythonInterpreter main_interpreter
  PythonHandler trac.web.modpython_frontend
  PythonOption TracEnv /opt/trac/pin2
  PythonOption TracUriRoot /trac/pin2
  AuthType Basic
  AuthName "PIN2 Trac"
  AuthUserFile /opt/trac/pin2/.htpasswd
  Require valid-user
</Location>
</pre>
/etc/init.d/apache2 restart


=== Přidání uživatele ===
=== Přidání uživatele ===


  htpasswd /opt/trac/pin2/.htpasswd user
export TRAC=pin2
export USER=landa
 
  htpasswd /opt/trac/$TRAC/.htpasswd $USER
 
trac-admin /opt/trac/$TRAC permission add $USER student
 
Pro admina:


  trac-admin /opt/trac/pin2 permission add user student
  trac-admin /opt/trac/$TRAC permission add $USER TRAC_ADMIN


* http://trac.edgewall.org/wiki/TracPermissions
* http://trac.edgewall.org/wiki/TracPermissions
<source lang=bash>
#!/bin/sh                                                                                                                                                                                                     
TRAC=pin2
USER=$1
htpasswd /opt/trac/$TRAC/.htpasswd $USER
trac-admin /opt/trac/$TRAC permission add $USER student
exit 0
</source>


== Git ==
== Git ==

Aktuální verze z 29. 5. 2014, 19:00

Trac

Založení instance

export TRAC=pin2
trac-admin /opt/trac/$TRAC initenv
chgrp www-data /opt/trac/$TRAC -R
chmod g+rw /opt/trac/$TRAC -R
cat /etc/apache2/sites-enabled/003-trac
<Location /trac/pin2>
   SetHandler mod_python
   PythonInterpreter main_interpreter
   PythonHandler trac.web.modpython_frontend
   PythonOption TracEnv /opt/trac/pin2
   PythonOption TracUriRoot /trac/pin2
</Location>
<Location /trac/pin2/login>
   SetHandler mod_python
   PythonInterpreter main_interpreter
   PythonHandler trac.web.modpython_frontend
   PythonOption TracEnv /opt/trac/pin2
   PythonOption TracUriRoot /trac/pin2
   AuthType Basic
   AuthName "PIN2 Trac"
   AuthUserFile /opt/trac/pin2/.htpasswd
   Require valid-user
</Location>
/etc/init.d/apache2 restart

Přidání uživatele

export TRAC=pin2
export USER=landa
htpasswd /opt/trac/$TRAC/.htpasswd $USER
trac-admin /opt/trac/$TRAC permission add $USER student

Pro admina:

trac-admin /opt/trac/$TRAC permission add $USER TRAC_ADMIN
#!/bin/sh                                                                                                                                                                                                      

TRAC=pin2
USER=$1

htpasswd /opt/trac/$TRAC/.htpasswd $USER
trac-admin /opt/trac/$TRAC permission add $USER student

exit 0

Git

Soubor conf/gitolite.conf:

	repo    pin2/2011
	        RW+     =   @landa

PostGIS

createuser -D -R -S -P <user>
CREATE SCHEMA <user>;
ALTER SCHEMA b11 OWNER TO <user>;
GRANT ALL ON geometry_columns TO <user>;
GRANT SELECT ON spatial_ref_sys TO <user>;
#!/bin/sh                                                                                                                                               

if [ -z $1 ] ; then
    echo "usage: $0 <user>"
    exit 1
fi

USER="$1"
SCHEMA=`echo $USER | cut -d'_' -f2`
DB=pgis_pin2

createuser -D -R -S -P $1
psql $DB -c "CREATE SCHEMA $SCHEMA;"
psql $DB -c "ALTER SCHEMA $SCHEMA OWNER TO $USER;"

psql $DB -c "GRANT ALL ON geometry_columns TO $USER;"
psql $DB -c "GRANT SELECT ON spatial_ref_sys TO $USER;"

exit 0