Diskuse:155PIN2 Projekt - Informatika 2: Porovnání verzí
m Cajthaml přesunul stránku Diskuse:153PIN2 Projekt - Informatika 2 na Diskuse:155PIN2 Projekt - Informatika 2 |
|||
(Není zobrazeno 11 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/ | 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 | ||
Řádek 10: | Řádek 14: | ||
<pre> | <pre> | ||
<Location /trac/ | <Location /trac/pin2> | ||
SetHandler mod_python | SetHandler mod_python | ||
PythonInterpreter main_interpreter | PythonInterpreter main_interpreter | ||
PythonHandler trac.web.modpython_frontend | PythonHandler trac.web.modpython_frontend | ||
PythonOption TracEnv /opt/trac/ | PythonOption TracEnv /opt/trac/pin2 | ||
PythonOption TracUriRoot /trac/ | PythonOption TracUriRoot /trac/pin2 | ||
</Location> | </Location> | ||
<Location /trac/ | <Location /trac/pin2/login> | ||
SetHandler mod_python | SetHandler mod_python | ||
PythonInterpreter main_interpreter | PythonInterpreter main_interpreter | ||
PythonHandler trac.web.modpython_frontend | PythonHandler trac.web.modpython_frontend | ||
PythonOption TracEnv /opt/trac/ | PythonOption TracEnv /opt/trac/pin2 | ||
PythonOption TracUriRoot /trac/ | PythonOption TracUriRoot /trac/pin2 | ||
AuthType Basic | AuthType Basic | ||
AuthName " | AuthName "PIN2 Trac" | ||
AuthUserFile /opt/trac/ | AuthUserFile /opt/trac/pin2/.htpasswd | ||
Require valid-user | Require valid-user | ||
</Location> | </Location> | ||
</pre> | </pre> | ||
/etc/init.d/apache2 restart | |||
=== Přidání uživatele === | === Přidání uživatele === | ||
htpasswd /opt/trac/ | 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-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