Commit b37f6e5e0e363671612c78d7b6ddb9610fe85306

Add feature to write a template config

  Now, by default you have to provide a template trac.ini file which will be
used to setup the new trac.ini in the project.
  • .gitignore 1 +
  • new_project.sh 24 --++++++++++++++++++++++
  • trac.ini.template.sample 259 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  • Diff rendering mode:
  • inline
  • side by side

.gitignore

1trac.config1trac.config
2trac.ini.template

new_project.sh

10# > trac-admin /path/to/trac/env deploy /path/to/trac/env/deploy/10# > trac-admin /path/to/trac/env deploy /path/to/trac/env/deploy/
11# 4. chmod to add group permissions11# 4. chmod to add group permissions
12# > chmod g+rwx /path/to/trac/env -R12# > chmod g+rwx /path/to/trac/env -R
13#
13# 5. Copy the template trac.ini file to be the trac.ini file and copy some
14# config from the old trac.ini file to the new one
1415
15readConfig() {16readConfig() {
16 configFile='trac.config'17 configFile='trac.config'
57 chmod g+rwx $trac_project$project -R57 chmod g+rwx $trac_project$project -R
58}58}
5959
60writeTracConfig() {
61 oldconfig="$trac_project$project/conf/trac.ini"
62 newconfig='trac.ini.template'
63 echo "Writing template config to $oldconfig"
64 if [ ! -e $newconfig ]; then
65 echo "File: $newconfig does not exist. Could not write template \
66 configuration. You have to manually configure the config file now.\
67 Everything else is setup."
68 exit 0;
69 fi
70 name=$(sed -n 's/^name = \(.*\)$/\1/p' $oldconfig)
71 db=$(sed -n 's/^database = \(.*\)$/\1/p' $oldconfig)
72 $db=${db//\//\\/}
73 $(cp $newconfig $oldconfig)
74 $newconfig=$oldconfig
75 $(sed -i "s/^name =$/name = $name/" $newconfig)
76 $(sed -i "s/^database =$/database = $db/" $newconfig)
77}
78
60usage() {79usage() {
61 echo "Usage is $0 --name <name of the project>"80 echo "Usage is $0 --name <name of the project>"
62}81}
6382
64setup() {83setup() {
65 createDB && initTracEnv && deployTracEnv && chmodTracEnv;
84 createDB && initTracEnv && deployTracEnv && chmodTracEnv && writeTracConfig;
66 echo "Done.."85 echo "Done.."
67 exit 0;86 exit 0;
68}87}

trac.ini.template.sample

1# -*- coding: utf-8 -*-
2
3[account-manager]
4account_changes_notify_addresses =
5force_passwd_change = true
6htdigest_file = /path/to/trac/projects/.passwd
7htdigest_realm = TracRealm
8notify_actions = new,change,delete
9password_store = HtDigestStore
10verify_email = false
11
12[attachment]
13max_size = 262144
14max_zip_size = 2097152
15render_unsafe_content = false
16
17[browser]
18color_scale = True
19downloadable_paths = /trunk, /branches/*, /tags/*
20hide_properties = svk:merge
21intermediate_color =
22intermediate_point =
23newest_color = (255, 136, 136)
24oldest_color = (136, 136, 255)
25oneliner_properties = trac:summary
26render_unsafe_content = false
27wiki_properties = trac:description
28
29[changeset]
30max_diff_bytes = 10000000
31max_diff_files = 0
32wiki_format_messages = true
33
34[components]
35acct_mgr.admin.accountmanageradminpanel = enabled
36acct_mgr.guard.* = enabled
37acct_mgr.htfile.htdigeststore = enabled
38acct_mgr.notification.accountchangelistener = enabled
39acct_mgr.register.emailverificationmodule = enabled
40acct_mgr.register.registrationmodule = enabled
41acct_mgr.web_ui.accountmodule = enabled
42acct_mgr.web_ui.loginmodule = enabled
43trac.web.auth.loginmodule = disabled
44tracopt.ticket.commit_updater.* = enabled
45tracopt.versioncontrol.git.* = enabled
46tracspamfilter.* = enabled
47webadmin.* = enabled
48
49[git]
50cached_repository = false
51git_bin = git
52git_fs_encoding = utf-8
53persistent_cache = false
54shortrev_len = 7
55trac_user_rlookup = false
56use_committer_id = true
57use_committer_time = true
58wikishortrev_len = 40
59
60[header_logo]
61alt = (your logo here)
62height = 100
63link = /
64src = site/yourlogo.png
65width = 100
66
67[inherit]
68htdocs_dir =
69plugins_dir =
70templates_dir =
71
72[logging]
73log_file = trac.log
74log_level = DEBUG
75log_type = none
76
77[milestone]
78stats_provider = DefaultTicketGroupStatsProvider
79
80[mimeviewer]
81max_preview_size = 262144
82mime_map = text/x-dylan:dylan, text/x-idl:ice, text/x-ada:ads:adb
83mime_map_patterns = text/plain:README|INSTALL|COPYING.*
84pygments_default_style = trac
85pygments_modes =
86tab_width = 8
87treat_as_binary = application/octet-stream, application/pdf, application/postscript, application/msword,application/rtf,
88
89[notification]
90admit_domains =
91always_notify_owner = false
92always_notify_reporter = false
93always_notify_updater = true
94ambiguous_char_width = single
95batch_subject_template = $prefix Batch modify: $tickets_descr
96email_sender = SmtpEmailSender
97ignore_domains =
98mime_encoding = none
99sendmail_path = sendmail
100smtp_always_bcc =
101smtp_always_cc =
102smtp_default_domain =
103smtp_enabled = false
104smtp_from = trac@localhost
105smtp_from_author = false
106smtp_from_name =
107smtp_password =
108smtp_port = 25
109smtp_replyto = trac@localhost
110smtp_server = localhost
111smtp_subject_prefix = __default__
112smtp_user =
113ticket_subject_template = $prefix #$ticket.id: $summary
114use_public_cc = false
115use_short_addr = false
116use_tls = false
117
118[project]
119admin =
120admin_trac_url = .
121descr =
122footer = Visit the Trac open source project at<br /><a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a>
123icon = common/trac.ico
124name =
125url =
126
127[query]
128default_anonymous_query = status!=closed&cc~=$USER
129default_query = status!=closed&owner=$USER
130items_per_page = 100
131ticketlink_query = ?status=!closed
132
133[report]
134items_per_page = 100
135items_per_page_rss = 0
136
137[revisionlog]
138default_log_limit = 100
139graph_colors = ['#cc0', '#0c0', '#0cc', '#00c', '#c0c', '#c00']
140
141[roadmap]
142stats_provider = DefaultTicketGroupStatsProvider
143
144[search]
145min_query_length = 3
146
147[spam-filter]
148captcha = ImageCaptcha
149captcha_areyouahuman_publisher_key =
150captcha_areyouahuman_scoring_key =
151captcha_expression_ceiling = 10
152captcha_expression_terms = 3
153captcha_image_alphabet = abcdefghkmnopqrstuvwxyz0123456789
154captcha_image_font_size = 25
155captcha_image_fonts = vera.ttf
156captcha_image_letters = 6
157captcha_karma_lifetime = 86400
158captcha_keycaptcha_private_key =
159captcha_keycaptcha_user_id =
160captcha_recaptcha_private_key =
161captcha_recaptcha_public_key =
162reject_handler = CaptchaSystem
163
164[ticket]
165default_cc =
166default_component =
167default_description =
168default_keywords =
169default_milestone =
170default_owner = < default >
171default_priority = major
172default_resolution = fixed
173default_severity =
174default_summary =
175default_type = defect
176default_version =
177max_comment_size = 262144
178max_description_size = 262144
179preserve_newlines = default
180restrict_owner = false
181workflow = ConfigurableTicketWorkflow
182
183[ticket-workflow]
184accept = new,assigned,accepted,reopened -> accepted
185accept.operations = set_owner_to_self
186accept.permissions = TICKET_MODIFY
187leave = * -> *
188leave.default = 1
189leave.operations = leave_status
190reassign = new,assigned,accepted,reopened -> assigned
191reassign.operations = set_owner
192reassign.permissions = TICKET_MODIFY
193reopen = closed -> reopened
194reopen.operations = del_resolution
195reopen.permissions = TICKET_CREATE
196resolve = new,assigned,accepted,reopened -> closed
197resolve.operations = set_resolution
198resolve.permissions = TICKET_MODIFY
199
200[timeline]
201abbreviated_messages = True
202changeset_collapse_events = false
203changeset_long_messages = false
204changeset_show_files = 0
205default_daysback = 30
206max_daysback = 90
207newticket_formatter = oneliner
208ticket_show_details = false
209
210[trac]
211auth_cookie_lifetime = 0
212auth_cookie_path =
213authz_file =
214authz_module_name =
215auto_preview_timeout = 2.0
216auto_reload = False
217backup_dir = db
218base_url =
219check_auth_ip = false
220database =
221debug_sql = False
222default_charset = utf-8
223default_date_format =
224default_dateinfo_format = relative
225default_language =
226default_timezone = GMT +6:00
227genshi_cache_size = 128
228htdocs_location =
229ignore_auth_case = false
230jquery_location =
231jquery_ui_location =
232jquery_ui_theme_location =
233mainnav = wiki, timeline, roadmap, browser, tickets, newticket, search
234metanav = login, logout, prefs, help, about
235mysqldump_path = mysqldump
236never_obfuscate_mailto = false
237permission_policies = DefaultPermissionPolicy, LegacyAttachmentPolicy
238permission_store = DefaultPermissionStore
239pg_dump_path = pg_dump
240repository_dir =
241repository_sync_per_request = (default)
242repository_type = git
243resizable_textareas = true
244secure_cookies = False
245show_email_addresses = false
246show_ip_addresses = false
247timeout = 20
248use_base_url_for_redirect = False
249
250[versioncontrol]
251allowed_repository_dir_prefixes =
252
253[wiki]
254ignore_missing_pages = false
255max_size = 262144
256render_unsafe_content = false
257safe_schemes = cvs, file, ftp, git, irc, http, https, news, sftp, smb, ssh, svn, svn+ssh
258split_page_names = false