Commit 18c8b6adf50ad824d15c89d731345336431b3fef
1 parent
c581e161
Exists in
master
and in
90 other branches
Replacing logo and favico using nginx alias
Showing
3 changed files
with
21 additions
and
2 deletions
Show diff stats
No preview for this file type
cookbooks/colab/recipes/default.rb
| ... | ... | @@ -41,11 +41,22 @@ template '/etc/colab/settings.d/01-apps.yaml' do |
| 41 | 41 | notifies :restart, 'service[colab]' |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | -cookbook_file '/usr/lib/colab/lib/python2.7/site-packages/colab/static/img/logo.svg' do | |
| 44 | +directory '/var/lib/colab-assets/spb/' do | |
| 45 | + owner 'root' | |
| 46 | + group 'root' | |
| 47 | + mode 0755 | |
| 48 | +end | |
| 49 | + | |
| 50 | +cookbook_file '/var/lib/colab-assets/spb/logo.svg' do | |
| 51 | + owner 'root' | |
| 52 | + group 'root' | |
| 53 | + mode 0644 | |
| 54 | +end | |
| 55 | + | |
| 56 | +cookbook_file '/var/lib/colab-assets/spb/fav.ico' do | |
| 45 | 57 | owner 'root' |
| 46 | 58 | group 'root' |
| 47 | 59 | mode 0644 |
| 48 | - notifies :run, 'execute[colab-admin:collectstatic]' | |
| 49 | 60 | end |
| 50 | 61 | |
| 51 | 62 | execute 'colab-admin migrate' | ... | ... |
cookbooks/colab/templates/colab.conf.erb
| ... | ... | @@ -10,6 +10,14 @@ server { |
| 10 | 10 | access_log /var/log/nginx/colab.access.log; |
| 11 | 11 | error_log /var/log/nginx/colab.error.log; |
| 12 | 12 | |
| 13 | + location ~ ^/static/img/logo\.[^.]+\.svg$ { | |
| 14 | + alias /var/lib/colab-assets/spb/logo.svg; | |
| 15 | + } | |
| 16 | + | |
| 17 | + location ~ ^/static/img/fav\.[^.]+\.ico$ { | |
| 18 | + alias /var/lib/colab-assets/spb/fav.ico; | |
| 19 | + } | |
| 20 | + | |
| 13 | 21 | location / { |
| 14 | 22 | root /usr/share/nginx/colab; |
| 15 | 23 | try_files $uri @colab-app; | ... | ... |