update streaming audio meter site
This commit is contained in:
parent
31ecd60011
commit
0084d3abb0
16 changed files with 346 additions and 3 deletions
100
files/darktheme.css
Normal file
100
files/darktheme.css
Normal file
|
@ -0,0 +1,100 @@
|
|||
@import 'https://fonts.googleapis.com/css?family=Open+Sans';
|
||||
|
||||
* {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
line-height: 1.75em;
|
||||
font-size: 16px;
|
||||
background-color: #222;
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.simple-container {
|
||||
max-width: 675px;
|
||||
margin: 0 auto;
|
||||
padding-top: 70px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.simple-print {
|
||||
fill: white;
|
||||
stroke: white;
|
||||
}
|
||||
.simple-print svg {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.simple-close {
|
||||
color: white;
|
||||
border-color: white;
|
||||
}
|
||||
|
||||
.simple-ext-info {
|
||||
border-top: 1px solid #aaa;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 30px;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 20px;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 16px;
|
||||
line-height: 27px;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
border-bottom: 1px solid #D8D8D8;
|
||||
border-top: 1px solid #D8D8D8;
|
||||
}
|
||||
|
||||
hr {
|
||||
height: 1px;
|
||||
background-color: #d8d8d8;
|
||||
border: none;
|
||||
width: 100%;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
a[href] {
|
||||
color: #1e8ad6;
|
||||
}
|
||||
|
||||
a[href]:hover {
|
||||
color: #3ba0e6;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
li {
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
aside,
|
||||
[class *= "sidebar"],
|
||||
[id *= "sidebar"] {
|
||||
max-width: 90%;
|
||||
margin: 0 auto;
|
||||
border: 1px solid lightgrey;
|
||||
padding: 5px 15px;
|
||||
}
|
||||
|
||||
@media (min-width: 1921px) {
|
||||
body {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
BIN
files/opensans.ttf
Normal file
BIN
files/opensans.ttf
Normal file
Binary file not shown.
1
files/video-js.min.css
vendored
Normal file
1
files/video-js.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
26
files/video.min.js
vendored
Normal file
26
files/video.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
files/videojs-http-streaming.min.js
vendored
Normal file
6
files/videojs-http-streaming.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -14,4 +14,21 @@ ntp_servers:
|
|||
- 2.pool.ntp.org iburst
|
||||
- 3.pool.ntp.org iburst
|
||||
|
||||
local_users:
|
||||
- name: video
|
||||
pubkeys:
|
||||
- l3d@pinkie.l3d.yt
|
||||
- l3d@bsns.l3d
|
||||
- l3d@backup.l3d.yt
|
||||
- l3d@derpy.l3d.yt
|
||||
- l3d@mobile.l3d.yt
|
||||
- l3d@backup-rsa
|
||||
|
||||
unattended_mail: "{{ lookup('community.general.passwordstore', 'other/ansible/do1jlr/unattended_mail') }}"
|
||||
acme_notification_email: "{{ unattended_mail }}"
|
||||
nginx__infrastructure_domain__enabled: false
|
||||
|
||||
nginx_sites:
|
||||
- name: '{{ incentory_hostname }}'
|
||||
webroot:
|
||||
user: 'video'
|
||||
|
|
6
roles/ffmpeg_install/README.md
Normal file
6
roles/ffmpeg_install/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
ffmpeg
|
||||
==========
|
||||
|
||||
Ansible role to install ffmpeg for debian.
|
||||
|
||||
See https://packages.debian.org/search?suite=sid&searchon=names&keywords=ffmpeg
|
8
roles/ffmpeg_install/handlers/main.yml
Normal file
8
roles/ffmpeg_install/handlers/main.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
- name: Apt update
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
clean: true
|
||||
update_cache: true
|
||||
when:
|
||||
- ansible_pkg_mgr == "apt"
|
20
roles/ffmpeg_install/tasks/apt.yml
Normal file
20
roles/ffmpeg_install/tasks/apt.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
- name: Create /etc/apt/preferences
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: templates/package_preferences.j2
|
||||
dest: /etc/apt/preferences
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: Apt update
|
||||
|
||||
- name: Add eth zurich and default apt for Debian unstable/testing
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: "templates/apt_list.j2"
|
||||
dest: '/etc/apt/sources.list.d/ffmpeg_debian.list'
|
||||
mode: 0644
|
||||
group: root
|
||||
owner: root
|
||||
notify: Apt update
|
17
roles/ffmpeg_install/tasks/main.yml
Normal file
17
roles/ffmpeg_install/tasks/main.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
- name: Update apt cache
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
clean: true
|
||||
update_cache: true
|
||||
register: _pre_update_apt_cache
|
||||
until: _pre_update_apt_cache is succeeded
|
||||
when:
|
||||
- ansible_pkg_mgr == "apt"
|
||||
|
||||
- name: Install latest ffmpeg from unstable
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
name: ['ffmpeg']
|
||||
state: latest
|
||||
# noqa: ansible-lint package-latest
|
18
roles/ffmpeg_install/templates/apt_list.j2
Normal file
18
roles/ffmpeg_install/templates/apt_list.j2
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Debian mirror der ETH Zürich
|
||||
# https://debian.ethz.ch/
|
||||
# https://wiki.debianforum.de/Sources.list
|
||||
|
||||
# Testing mirror:
|
||||
deb https://debian.ethz.ch/debian testing main contrib non-free
|
||||
deb http://deb.debian.org/debian/ testing main contrib non-free
|
||||
deb-src http://deb.debian.org/debian/ testing main contrib non-free
|
||||
|
||||
|
||||
deb https://debian.ethz.ch/debian unstable main contrib non-free
|
||||
deb http://deb.debian.org/debian/ unstable main contrib non-free
|
||||
deb-src http://deb.debian.org/debian/ unstable main contrib non-free
|
||||
|
||||
|
||||
# Contact for proplems with the mirror:
|
||||
# https://readme.phys.ethz.ch/services/contact/
|
||||
# Or #isgphys on irc.phys.ethz.ch
|
18
roles/ffmpeg_install/templates/package_preferences.j2
Normal file
18
roles/ffmpeg_install/templates/package_preferences.j2
Normal file
|
@ -0,0 +1,18 @@
|
|||
# /etc/apt/preferences
|
||||
{{ ansible_managed | comment }}
|
||||
|
||||
Package: *
|
||||
Pin: release a=stable
|
||||
Pin-Priority: 700
|
||||
|
||||
Package: *
|
||||
Pin: release a={{ ansible_distribution_release }}
|
||||
Pin-Priority: 699
|
||||
|
||||
Package: *
|
||||
Pin: release a=testing
|
||||
Pin-Priority: 65
|
||||
|
||||
Package: *
|
||||
Pin: release a=unstable
|
||||
Pin-Priority: 60
|
54
roles/streaming_website/tasks/main.yml
Normal file
54
roles/streaming_website/tasks/main.yml
Normal file
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
- name: Copy videojs-http-streaming.min.js
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: 'files/videojs-http-streaming.min.js'
|
||||
dest: '/srv/www/{{ inventory_hostname }}/videojs-http-streaming.min.js'
|
||||
owner: video
|
||||
group: video
|
||||
mode: 0644
|
||||
|
||||
- name: Copy video.min.js
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: 'files/video.min.js'
|
||||
dest: '/srv/www/{{ inventory_hostname }}/video.min.js'
|
||||
owner: video
|
||||
group: video
|
||||
mode: 0644
|
||||
|
||||
- name: Copy video-js.min.css
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: 'files/video-js.min.css'
|
||||
dest: '/srv/www/{{ inventory_hostname }}/video-js.min.css'
|
||||
owner: video
|
||||
group: video
|
||||
mode: 0644
|
||||
|
||||
- name: Copy darktheme.css
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: 'files/darktheme.css'
|
||||
dest: '/srv/www/{{ inventory_hostname }}/darktheme.css'
|
||||
owner: video
|
||||
group: video
|
||||
mode: 0644
|
||||
|
||||
- name: Copy opensans.ttf
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: 'files/opensans.ttf'
|
||||
dest: '/srv/www/{{ inventory_hostname }}/opensans.ttf'
|
||||
owner: video
|
||||
group: video
|
||||
mode: 0644
|
||||
|
||||
- name: Copy index.html
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: 'templates/index.html.j2'
|
||||
dest: '/srv/www/{{ inventory_hostname }}/index.html'
|
||||
owner: video
|
||||
group: video
|
||||
mode: 0644
|
16
site.yml
16
site.yml
|
@ -18,8 +18,18 @@
|
|||
- {role: do1jlr.admin_base, tags: [default, init, users, accounts, dotfiles]}
|
||||
- {role: do1jlr.dotfiles, tags: [default, dotfiles]}
|
||||
|
||||
- name: Video Tasks
|
||||
#- name: Video Tasks from debian sid
|
||||
# TODO: Webserver stuff
|
||||
# hosts: all
|
||||
# roles:
|
||||
# - {role: ffmpeg, tags: ffmpeg}
|
||||
# - {role: nginx_rtmp, tags: nginx}
|
||||
|
||||
- name: Video tasks instead with debian stable
|
||||
hosts: all
|
||||
roles:
|
||||
- {role: ffmpeg, tags: ffmpeg}
|
||||
- {role: nginx_rtmp, tags: nginx}
|
||||
- {role: ffmpeg_install, tags: ffmpeg}
|
||||
- {role: do1jlr.webhost, tags: [web, webhost], become: true}
|
||||
- {role: do1jlr.acmetool, tags: [web, acmetool], become: true}
|
||||
- {role: do1jlr.nginx, tags: [web, nginx]}
|
||||
|
||||
|
|
17
templates/files/nginx/sites/example.com_tls.conf
Normal file
17
templates/files/nginx/sites/example.com_tls.conf
Normal file
|
@ -0,0 +1,17 @@
|
|||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
|
||||
server_name example.com;
|
||||
|
||||
include snippets/tls_parameters_{{ site.name }}.snippet.conf;
|
||||
include snippets/tls_certificate_{{ site.name }}.snippet.conf;
|
||||
include snippets/logging_{{ site.name }}.snippet.conf;
|
||||
|
||||
root /srv/www/example.com;
|
||||
|
||||
location / {
|
||||
charset utf-8;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
}
|
25
templates/index.html.j2
Normal file
25
templates/index.html.j2
Normal file
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset=utf-8 />
|
||||
<title>{{ inventory_hostname }} - Audiometer</title>
|
||||
<link href="darktheme.css" rel="stylesheet">
|
||||
<link href="video-js.min.css" rel="stylesheet">
|
||||
<!-- Ansible managed, ask mailto:l3d@winkekatze.tv for details -->
|
||||
<meta content="width=device-width,initial-scale=1.0" name="viewport"/>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Audiometer {{ inventory_hostname }}</h1>
|
||||
<video-js id=vid1 width=640 height=960 class="vjs-default-skin" controls>
|
||||
<source
|
||||
src="stream.m3u8"
|
||||
type="application/x-mpegURL">
|
||||
</video-js>
|
||||
<script src="video.min.js"></script>
|
||||
<script src="videojs-http-streaming.min.js"></script>
|
||||
<script>
|
||||
var player = videojs('vid1');
|
||||
player.play();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue