Show More
@@ -115,6 +115,12 b' rss_include_diff = false' | |||||
115 | show_sha_length = 12 |
|
115 | show_sha_length = 12 | |
116 | show_revision_number = true |
|
116 | show_revision_number = true | |
117 |
|
117 | |||
|
118 | ## gist URL alias, used to create nicer urls for gist. This should be an | |||
|
119 | ## url that does rewrites to _admin/gists/<gistid>. | |||
|
120 | ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal | |||
|
121 | ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/<gistid> | |||
|
122 | gist_alias_url = | |||
|
123 | ||||
118 | ## white list of API enabled controllers. This allows to add list of |
|
124 | ## white list of API enabled controllers. This allows to add list of | |
119 | ## controllers to which access will be enabled by api_key. eg: to enable |
|
125 | ## controllers to which access will be enabled by api_key. eg: to enable | |
120 | ## api access to raw_files put `FilesController:raw`, to enable access to patches |
|
126 | ## api access to raw_files put `FilesController:raw`, to enable access to patches |
@@ -534,6 +534,28 b' Sample config for nginx using proxy::' | |||||
534 | #server 127.0.0.1:5002; |
|
534 | #server 127.0.0.1:5002; | |
535 | } |
|
535 | } | |
536 |
|
536 | |||
|
537 | ## gist alias | |||
|
538 | server { | |||
|
539 | listen 443; | |||
|
540 | server_name gist.myserver.com; | |||
|
541 | access_log /var/log/nginx/gist.access.log; | |||
|
542 | error_log /var/log/nginx/gist.error.log; | |||
|
543 | ||||
|
544 | ssl on; | |||
|
545 | ssl_certificate gist.rhodecode.myserver.com.crt; | |||
|
546 | ssl_certificate_key gist.rhodecode.myserver.com.key; | |||
|
547 | ||||
|
548 | ssl_session_timeout 5m; | |||
|
549 | ||||
|
550 | ssl_protocols SSLv3 TLSv1; | |||
|
551 | ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5; | |||
|
552 | ssl_prefer_server_ciphers on; | |||
|
553 | ||||
|
554 | location / { | |||
|
555 | rewrite ^/(.*) https://rhodecode.myserver.com/_admin/gists/$1; | |||
|
556 | } | |||
|
557 | } | |||
|
558 | ||||
537 | server { |
|
559 | server { | |
538 | listen 443; |
|
560 | listen 443; | |
539 | server_name rhodecode.myserver.com; |
|
561 | server_name rhodecode.myserver.com; | |
@@ -550,16 +572,8 b' Sample config for nginx using proxy::' | |||||
550 | ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5; |
|
572 | ssl_ciphers DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:EDH-RSA-DES-CBC3-SHA:AES256-SHA:DES-CBC3-SHA:AES128-SHA:RC4-SHA:RC4-MD5; | |
551 | ssl_prefer_server_ciphers on; |
|
573 | ssl_prefer_server_ciphers on; | |
552 |
|
574 | |||
553 | # uncomment if you have nginx with chunking module compiled |
|
575 | ## uncomment root directive if you want to serve static files by nginx | |
554 | # fixes the issues of having to put postBuffer data for large git |
|
576 | ## requires static_files = false in .ini file | |
555 | # pushes |
|
|||
556 | #chunkin on; |
|
|||
557 | #error_page 411 = @my_411_error; |
|
|||
558 | #location @my_411_error { |
|
|||
559 | # chunkin_resume; |
|
|||
560 | #} |
|
|||
561 |
|
||||
562 | # uncomment if you want to serve static files by nginx |
|
|||
563 | #root /path/to/installation/rhodecode/public; |
|
577 | #root /path/to/installation/rhodecode/public; | |
564 |
|
578 | |||
565 | location / { |
|
579 | location / { | |
@@ -591,18 +605,6 b' pushes or large pushes::' | |||||
591 | proxy_read_timeout 7200; |
|
605 | proxy_read_timeout 7200; | |
592 | proxy_buffers 8 32k; |
|
606 | proxy_buffers 8 32k; | |
593 |
|
607 | |||
594 | Also, when using root path with nginx you might set the static files to false |
|
|||
595 | in the production.ini file:: |
|
|||
596 |
|
||||
597 | [app:main] |
|
|||
598 | use = egg:rhodecode |
|
|||
599 | full_stack = true |
|
|||
600 | static_files = false |
|
|||
601 | lang=en |
|
|||
602 | cache_dir = %(here)s/data |
|
|||
603 |
|
||||
604 | In order to not have the statics served by the application. This improves speed. |
|
|||
605 |
|
||||
606 |
|
|
608 | ||
607 | Apache virtual host reverse proxy example |
|
609 | Apache virtual host reverse proxy example | |
608 | ----------------------------------------- |
|
610 | ----------------------------------------- |
@@ -115,6 +115,12 b' rss_include_diff = false' | |||||
115 | show_sha_length = 12 |
|
115 | show_sha_length = 12 | |
116 | show_revision_number = true |
|
116 | show_revision_number = true | |
117 |
|
117 | |||
|
118 | ## gist URL alias, used to create nicer urls for gist. This should be an | |||
|
119 | ## url that does rewrites to _admin/gists/<gistid>. | |||
|
120 | ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal | |||
|
121 | ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/<gistid> | |||
|
122 | gist_alias_url = | |||
|
123 | ||||
118 | ## white list of API enabled controllers. This allows to add list of |
|
124 | ## white list of API enabled controllers. This allows to add list of | |
119 | ## controllers to which access will be enabled by api_key. eg: to enable |
|
125 | ## controllers to which access will be enabled by api_key. eg: to enable | |
120 | ## api access to raw_files put `FilesController:raw`, to enable access to patches |
|
126 | ## api access to raw_files put `FilesController:raw`, to enable access to patches |
@@ -115,6 +115,12 b' rss_include_diff = false' | |||||
115 | show_sha_length = 12 |
|
115 | show_sha_length = 12 | |
116 | show_revision_number = true |
|
116 | show_revision_number = true | |
117 |
|
117 | |||
|
118 | ## gist URL alias, used to create nicer urls for gist. This should be an | |||
|
119 | ## url that does rewrites to _admin/gists/<gistid>. | |||
|
120 | ## example: http://gist.rhodecode.org/{gistid}. Empty means use the internal | |||
|
121 | ## RhodeCode url, ie. http[s]://rhodecode.server/_admin/gists/<gistid> | |||
|
122 | gist_alias_url = | |||
|
123 | ||||
118 | ## white list of API enabled controllers. This allows to add list of |
|
124 | ## white list of API enabled controllers. This allows to add list of | |
119 | ## controllers to which access will be enabled by api_key. eg: to enable |
|
125 | ## controllers to which access will be enabled by api_key. eg: to enable | |
120 | ## api access to raw_files put `FilesController:raw`, to enable access to patches |
|
126 | ## api access to raw_files put `FilesController:raw`, to enable access to patches |
@@ -24,12 +24,12 b'' | |||||
24 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
24 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
25 |
|
25 | |||
26 | import os |
|
26 | import os | |
|
27 | import time | |||
27 | import logging |
|
28 | import logging | |
28 | import datetime |
|
29 | import datetime | |
29 | import traceback |
|
30 | import traceback | |
30 | import hashlib |
|
31 | import hashlib | |
31 |
import |
|
32 | import collections | |
32 | from collections import defaultdict |
|
|||
33 |
|
33 | |||
34 | from sqlalchemy import * |
|
34 | from sqlalchemy import * | |
35 | from sqlalchemy.ext.hybrid import hybrid_property |
|
35 | from sqlalchemy.ext.hybrid import hybrid_property | |
@@ -1120,7 +1120,7 b' class Repository(Base, BaseModel):' | |||||
1120 | .filter(ChangesetComment.repo == self) |
|
1120 | .filter(ChangesetComment.repo == self) | |
1121 | if revisions: |
|
1121 | if revisions: | |
1122 | cmts = cmts.filter(ChangesetComment.revision.in_(revisions)) |
|
1122 | cmts = cmts.filter(ChangesetComment.revision.in_(revisions)) | |
1123 | grouped = defaultdict(list) |
|
1123 | grouped = collections.defaultdict(list) | |
1124 | for cmt in cmts.all(): |
|
1124 | for cmt in cmts.all(): | |
1125 | grouped[cmt.revision].append(cmt) |
|
1125 | grouped[cmt.revision].append(cmt) | |
1126 | return grouped |
|
1126 | return grouped | |
@@ -2155,6 +2155,11 b' class Gist(Base, BaseModel):' | |||||
2155 | return cls.query().filter(cls.gist_access_id == gist_access_id).scalar() |
|
2155 | return cls.query().filter(cls.gist_access_id == gist_access_id).scalar() | |
2156 |
|
2156 | |||
2157 | def gist_url(self): |
|
2157 | def gist_url(self): | |
|
2158 | import rhodecode | |||
|
2159 | alias_url = rhodecode.CONFIG.get('gist_alias_url') | |||
|
2160 | if alias_url: | |||
|
2161 | return alias_url.replace('{gistid}', self.gist_access_id) | |||
|
2162 | ||||
2158 | from pylons import url |
|
2163 | from pylons import url | |
2159 | return url('gist', id=self.gist_access_id, qualified=True) |
|
2164 | return url('gist', id=self.gist_access_id, qualified=True) | |
2160 |
|
2165 |
@@ -38,14 +38,16 b'' | |||||
38 | <div class="ui-btn yellow badge">${_('Private gist')}</div> |
|
38 | <div class="ui-btn yellow badge">${_('Private gist')}</div> | |
39 | %endif |
|
39 | %endif | |
40 | </div> |
|
40 | </div> | |
41 | <span style="color: #AAA"> |
|
41 | <div class="left item ${'' if c.gist.gist_description else 'last'}" style="color: #AAA"> | |
42 | %if c.gist.gist_expires == -1: |
|
42 | %if c.gist.gist_expires == -1: | |
43 | ${_('Expires')}: ${_('never')} |
|
43 | ${_('Expires')}: ${_('never')} | |
44 | %else: |
|
44 | %else: | |
45 | ${_('Expires')}: ${h.age(h.time_to_datetime(c.gist.gist_expires))} |
|
45 | ${_('Expires')}: ${h.age(h.time_to_datetime(c.gist.gist_expires))} | |
46 | %endif |
|
46 | %endif | |
47 |
</ |
|
47 | </div> | |
48 |
|
|
48 | <div class="left item last"> | |
|
49 | ${c.gist.gist_description} | |||
|
50 | </div> | |||
49 | <div class="buttons"> |
|
51 | <div class="buttons"> | |
50 | ## only owner should see that |
|
52 | ## only owner should see that | |
51 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id: |
|
53 | %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id: | |
@@ -71,7 +73,8 b'' | |||||
71 | % for file in c.files: |
|
73 | % for file in c.files: | |
72 | <div style="border: 1px solid #EEE;margin-top:20px"> |
|
74 | <div style="border: 1px solid #EEE;margin-top:20px"> | |
73 | <div id="${h.FID('G', file.path)}" class="stats" style="border-bottom: 1px solid #DDD;padding: 8px 14px;"> |
|
75 | <div id="${h.FID('G', file.path)}" class="stats" style="border-bottom: 1px solid #DDD;padding: 8px 14px;"> | |
74 |
< |
|
76 | <a href="${c.gist.gist_url()}">¶</a> | |
|
77 | <b style="margin:0px 0px 0px 4px">${file.path}</b> | |||
75 | ##<div class="buttons"> |
|
78 | ##<div class="buttons"> | |
76 | ## ${h.link_to(_('Show as raw'),h.url(''),class_="ui-btn")} |
|
79 | ## ${h.link_to(_('Show as raw'),h.url(''),class_="ui-btn")} | |
77 | ##</div> |
|
80 | ##</div> |
General Comments 0
You need to be logged in to leave comments.
Login now