fork 0k-charms
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
5.0 KiB

  1. description: "PeerTube Server"
  2. maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
  3. ## XXXvlab: docker uses the 'build' directory or the 'image:' option here.
  4. #docker-image: chocobozzz/peertube:production-stretch ## YYY: to save in our docker-registry
  5. data-resources:
  6. - /var/lib/peertube
  7. - /var/log/peertube
  8. - /var/cache/peertube
  9. config-resources:
  10. - /etc/peertube
  11. ## XXXvlab: options here are the one provided to the server as
  12. ## defaults BUT that can be changed from within the web
  13. ## interface.
  14. default-options:
  15. # If enabled, the video will be transcoded to mp4 (x264) with "faststart" flag
  16. # In addition, if some resolutions are enabled the mp4 video file will be transcoded to these new resolutions.
  17. # Please, do not disable transcoding since many uploaded videos will not work
  18. transcoding:
  19. enabled: true
  20. threads: 1
  21. resolutions: # Only created if the original video has a higher resolution, uses more storage!
  22. 240p: true
  23. 360p: true
  24. 480p: true
  25. 720p: true
  26. 1080p: true
  27. import:
  28. # Add ability for your users to import remote videos (from YouTube, torrent...)
  29. videos:
  30. http: # Classic HTTP or all sites supported by youtube-dl https://rg3.github.io/youtube-dl/supportedsites.html
  31. enabled: true
  32. torrent: # Magnet URI or torrent file (use classic TCP/UDP/WebSeed to download the file)
  33. enabled: true
  34. signup:
  35. enabled: true
  36. uses:
  37. postgres-database:
  38. constraint: required
  39. auto: summon
  40. solves:
  41. database: "main storage"
  42. default-options:
  43. extensions:
  44. - pg_trgm
  45. - unaccent
  46. redis-database:
  47. constraint: required
  48. auto: summon
  49. solves:
  50. database: "short time storage"
  51. # log-rotate:
  52. # constraint: recommended
  53. # auto: pair
  54. # solves:
  55. # disk-leak: "/var/log/peertube"
  56. web-proxy:
  57. constraint: required
  58. auto: pair
  59. solves:
  60. proxy: "Public access"
  61. default-options:
  62. apache-custom-rules:
  63. - |
  64. ## From https://gist.github.com/rigelk/07a0b8963fa4fc1ad756374c28479bc7
  65. Protocols h2 http/1.1
  66. # HSTS (mod_headers is required) (63072000 seconds = 2 years) (only activate it knowingly)
  67. #Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
  68. Header always set X-Content-Type-Options nosniff
  69. Header always set X-Robots-Tag none
  70. Header always set X-XSS-Protection "1; mode=block"
  71. # Hard limit, PeerTube does not support videos > 4GB
  72. LimitRequestBody 4294967294
  73. # Set caching on assets for 1 year
  74. <FilesMatch ^/client/(.*\.(js|css|woff2|otf|ttf|woff|eot))$>
  75. Header append Cache-Control "public, max-age=31536000, immutable"
  76. </FilesMatch>
  77. AliasMatch ^/client/(.*\.(js|css|woff2|otf|ttf|woff|eot))$ /var/www/peertube/peertube-latest/client/dist/$1
  78. # Set caching on image files for 1 year
  79. <FilesMatch ^/static/(thumbnails|avatars)/(.*)$>
  80. Header append Cache-Control "public, max-age=31536000, immutable"
  81. </FilesMatch>
  82. AliasMatch ^/static/(thumbnails|avatars)/(.*)$ /var/www/peertube/storage/$1/$2
  83. # Bypass PeerTube webseed route for better performances
  84. Alias /static/webseed /var/www/peertube/storage/videos
  85. <Location /static/webseed>
  86. # Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client
  87. SetOutputFilter RATE_LIMIT
  88. SetEnv rate-limit 800
  89. SetEnvIf Request_Method "GET" GETMETH=1
  90. Header set Access-Control-Allow-Origin "*" env=GETMETH
  91. Header set Access-Control-Allow-Headers "Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type" env=GETMETH
  92. Header set Access-Control-Allow-Methods "GET, OPTIONS" env=GETMETH
  93. Header set toto "foo" env=GETMETH
  94. SetEnvIf GETMETH "1" dontlog
  95. SetEnvIf Request_Method "OPTIONS" OPTIONSMETH=1
  96. Header set Access-Control-Allow-Origin "*" env=OPTIONSMETH
  97. Header set Access-Control-Allow-Headers "Range,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type" env=OPTIONSMETH
  98. Header set Access-Control-Allow-Methods "GET, OPTIONS" env=OPTIONSMETH
  99. Header set Access-Control-Max-Age "1000" env=OPTIONSMETH
  100. Header set Content-Type "text/plain charset=UTF-8" env=OPTIONSMETH
  101. Header set Content-Length "0" env=OPTIONSMETH
  102. </Location>
  103. <Location /videos/embed>
  104. Header unset X-Frame-Options
  105. </Location>
  106. ProxyPreserveHost On
  107. ProxyRequests On
  108. ProxyTimeout 600
  109. # Websocket tracker
  110. RewriteEngine On
  111. RewriteCond %{HTTP:Upgrade} websocket [NC]
  112. RewriteRule /(.*) ws://127.0.0.1:9000/$1 [P,L]
  113. # <Location />
  114. # ProxyPass http://127.0.0.1:9000/
  115. # </Location>