To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / extra / soundsoftware / scripted-deploy / config @ 1581:ae8043b014c7
| 1 | 1570:ae2f71010562 | Chris | |
|---|---|---|---|
| 2 | # A test Apache config. Lacks SSL, lacks a desirable extra layer of |
||
| 3 | # authentication for admin interface paths. Do not deploy this. |
||
| 4 | |||
| 5 | PerlLoadModule Apache::Authn::SoundSoftware |
||
| 6 | |||
| 7 | <VirtualHost *:80> |
||
| 8 | ServerName code.soundsoftware.ac.uk |
||
| 9 | ServerAdmin chris.cannam@soundsoftware.ac.uk |
||
| 10 | |||
| 11 | DocumentRoot /var/www/code/public |
||
| 12 | PassengerRestartDir restart_files |
||
| 13 | PassengerHighPerformance on |
||
| 14 | PassengerMaxRequests 50000 |
||
| 15 | PassengerStatThrottleRate 5 |
||
| 16 | PassengerStartTimeout 60 |
||
| 17 | 1571:4c2b25b7e85f | Chris | PassengerFriendlyErrorPages on |
| 18 | 1570:ae2f71010562 | Chris | RailsSpawnMethod smart |
| 19 | ExpiresDefault "access plus 1 minute" |
||
| 20 | |||
| 21 | <DirectoryMatch "^/.*/\.svn/"> |
||
| 22 | Order allow,deny |
||
| 23 | Deny from all |
||
| 24 | Satisfy All |
||
| 25 | </DirectoryMatch> |
||
| 26 | |||
| 27 | <DirectoryMatch "^/.*/\.hg/"> |
||
| 28 | Order allow,deny |
||
| 29 | Deny from all |
||
| 30 | Satisfy All |
||
| 31 | </DirectoryMatch> |
||
| 32 | |||
| 33 | <DirectoryMatch "^/.*/\.git/"> |
||
| 34 | Order allow,deny |
||
| 35 | Deny from all |
||
| 36 | Satisfy All |
||
| 37 | </DirectoryMatch> |
||
| 38 | |||
| 39 | <Directory /var/www/code/public> |
||
| 40 | Options -MultiViews |
||
| 41 | </Directory> |
||
| 42 | |||
| 43 | <Directory /var/www/code/public/themes/soundsoftware/stylesheets/fonts> |
||
| 44 | # Avoid other sites embedding our fonts |
||
| 45 | RewriteEngine on |
||
| 46 | RewriteCond %{HTTP_REFERER} !^$
|
||
| 47 | RewriteCond %{HTTP_REFERER} !^http(s)?://code.soundsoftware.ac.uk/.*$ [NC]
|
||
| 48 | RewriteRule \.(ttf|woff|eot|otf|svg|zip|gz|html|txt)$ - [F] |
||
| 49 | </Directory> |
||
| 50 | |||
| 51 | ScriptAlias /hg "/var/hg/index.cgi" |
||
| 52 | |||
| 53 | <Location /hg> |
||
| 54 | AuthName "Mercurial" |
||
| 55 | AuthType Basic |
||
| 56 | Require valid-user |
||
| 57 | PerlAccessHandler Apache::Authn::SoundSoftware::access_handler |
||
| 58 | PerlAuthenHandler Apache::Authn::SoundSoftware::authen_handler |
||
| 59 | PerlSetVar HTTPS "on" |
||
| 60 | SoundSoftwareDSN "dbi:Pg:database=code;host=localhost" |
||
| 61 | SoundSoftwareDbUser "code" |
||
| 62 | SoundSoftwareDbPass "INSERT_POSTGRES_PASSWORD_HERE" |
||
| 63 | SoundSoftwareRepoPrefix "/var/hg/" |
||
| 64 | 1576:d1de6986e429 | Chris | #!!! "on" in production please!: |
| 65 | SoundSoftwareSslRequired "off" |
||
| 66 | 1570:ae2f71010562 | Chris | Options +ExecCGI |
| 67 | AddHandler cgi-script .cgi |
||
| 68 | ExpiresDefault now |
||
| 69 | </Location> |
||
| 70 | |||
| 71 | Alias /git "/var/files/git-mirror" |
||
| 72 | |||
| 73 | <Directory "/var/files/git-mirror"> |
||
| 74 | Options -Indexes +FollowSymLinks |
||
| 75 | Order allow,deny |
||
| 76 | Allow from all |
||
| 77 | </Directory> |
||
| 78 | <Directory ~ "/var/files/git-mirror/.*\.workdir"> |
||
| 79 | Order allow,deny |
||
| 80 | Deny from all |
||
| 81 | </Directory> |
||
| 82 | <Directory ~ "/var/files/git-mirror/__.*"> |
||
| 83 | Order allow,deny |
||
| 84 | Deny from all |
||
| 85 | </Directory> |
||
| 86 | |||
| 87 | ErrorLog /var/log/apache2/code-error.log |
||
| 88 | CustomLog /var/log/apache2/code-access.log vhost_combined |
||
| 89 | |||
| 90 | LogLevel warn |
||
| 91 | ServerSignature Off |
||
| 92 | |||
| 93 | </VirtualHost> |
||
| 94 | |||
| 95 | production: |
||
| 96 | adapter: postgresql |
||
| 97 | database: code |
||
| 98 | host: localhost |
||
| 99 | username: code |
||
| 100 | password: "INSERT_POSTGRES_PASSWORD_HERE" |
||
| 101 | |||
| 102 | 1576:d1de6986e429 | Chris | [paths] |
| 103 | / = /var/hg/* |
||
| 104 | |||
| 105 | [web] |
||
| 106 | allow_archive = gz, zip, bz2 |
||
| 107 | allow_push = * |
||
| 108 | #!/usr/bin/env python |
||
| 109 | # |
||
| 110 | # An example CGI script to export multiple hgweb repos, edit as necessary |
||
| 111 | |||
| 112 | # adjust python path if not a system-wide install: |
||
| 113 | #import sys |
||
| 114 | #sys.path.insert(0, "/path/to/python/lib") |
||
| 115 | |||
| 116 | # enable importing on demand to reduce startup time |
||
| 117 | from mercurial import demandimport; demandimport.enable() |
||
| 118 | |||
| 119 | # Uncomment to send python tracebacks to the browser if an error occurs: |
||
| 120 | import cgitb |
||
| 121 | cgitb.enable() |
||
| 122 | |||
| 123 | # If you'd like to serve pages with UTF-8 instead of your default |
||
| 124 | # locale charset, you can do so by uncommenting the following lines. |
||
| 125 | # Note that this will cause your .hgrc files to be interpreted in |
||
| 126 | # UTF-8 and all your repo files to be displayed using UTF-8. |
||
| 127 | # |
||
| 128 | import os |
||
| 129 | os.environ["HGENCODING"] = "UTF-8" |
||
| 130 | |||
| 131 | from mercurial.hgweb.hgwebdir_mod import hgwebdir |
||
| 132 | import mercurial.hgweb.wsgicgi as wsgicgi |
||
| 133 | |||
| 134 | # The config file looks like this. You can have paths to individual |
||
| 135 | # repos, collections of repos in a directory tree, or both. |
||
| 136 | # |
||
| 137 | # [paths] |
||
| 138 | # virtual/path1 = /real/path1 |
||
| 139 | # virtual/path2 = /real/path2 |
||
| 140 | # virtual/root = /real/root/* |
||
| 141 | # / = /real/root2/* |
||
| 142 | # virtual/root2 = /real/root2/** |
||
| 143 | # |
||
| 144 | # [collections] |
||
| 145 | # /prefix/to/strip/off = /root/of/tree/full/of/repos |
||
| 146 | # |
||
| 147 | # paths example: |
||
| 148 | # |
||
| 149 | # * First two lines mount one repository into one virtual path, like |
||
| 150 | # '/real/path1' into 'virtual/path1'. |
||
| 151 | # |
||
| 152 | # * The third entry mounts every mercurial repository found in '/real/root' |
||
| 153 | # in 'virtual/root'. This format is preferred over the [collections] one, |
||
| 154 | # since using absolute paths as configuration keys is not supported on every |
||
| 155 | # platform (especially on Windows). |
||
| 156 | # |
||
| 157 | # * The fourth entry is a special case mounting all repositories in |
||
| 158 | # /'real/root2' in the root of the virtual directory. |
||
| 159 | # |
||
| 160 | # * The fifth entry recursively finds all repositories under the real root, |
||
| 161 | # and mounts them using their relative path (to given real root) under the |
||
| 162 | # virtual root. |
||
| 163 | # |
||
| 164 | # collections example: say directory tree /foo contains repos /foo/bar, |
||
| 165 | # /foo/quux/baz. Give this config section: |
||
| 166 | # [collections] |
||
| 167 | # /foo = /foo |
||
| 168 | # Then repos will list as bar and quux/baz. |
||
| 169 | # |
||
| 170 | # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
|
||
| 171 | # or use a dictionary with entries like 'virtual/path': '/real/path' |
||
| 172 | |||
| 173 | application = hgwebdir('hgweb.config')
|
||
| 174 | wsgicgi.launch(application) |
||
| 175 | 1571:4c2b25b7e85f | Chris | PassengerMaxPoolSize 60 |
| 176 | |||
| 177 | LoadModule passenger_module /var/lib/gems/2.3.0/gems/passenger-4.0.60/buildout/apache2/mod_passenger.so |
||
| 178 | PassengerRoot /var/lib/gems/2.3.0/gems/passenger-4.0.60 |
||
| 179 | PassengerDefaultRuby /usr/bin/ruby2.3 |
||
| 180 | # Apache::DBI is supposed to be a transparent replacement for Perl DBI with |
||
| 181 | # better performance when multiple connections are made with common DSN, user |
||
| 182 | # and password |
||
| 183 | PerlModule Apache::DBI |