1
0

hg.sr.ht.conf 850 B

12345678910111213141516171819202122232425262728293031
  1. server {
  2. include sourcehut.conf;
  3. include port80.conf;
  4. server_name hg.localtest.me;
  5. client_max_body_size 100M;
  6. location / {
  7. proxy_pass http://srhts:5010;
  8. include headers.conf;
  9. add_header Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline'; img-src * data:; script-src 'self' 'unsafe-inline'" always;
  10. include web.conf;
  11. }
  12. location /query {
  13. proxy_pass http://srhts:5110;
  14. include graphql.conf;
  15. }
  16. location /static {
  17. root /usr/lib/$python/site-packages/hgsrht;
  18. expires 30d;
  19. }
  20. # Let clients reach pull bundles. We don't really need to lock this down even for
  21. # private repos because the bundles are named after the revision hashes... so someone
  22. # would need to guess a SHA value to download anything.
  23. location ~ ^/[~^][a-z0-9_]+/[a-zA-Z0-9_.-]+/\.hg/bundles/.*$ {
  24. root /var/lib/mercurial;
  25. }
  26. }