mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	Merge pull request #1733 from m-anish/azuracast
Initial checkin of AzuraCast role [for online radio stations]
This commit is contained in:
		
						commit
						5fc4d22057
					
				
					 13 changed files with 175 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -3,6 +3,12 @@
 | 
			
		|||
- name: ...IS BEGINNING ====================================
 | 
			
		||||
  command: echo
 | 
			
		||||
 | 
			
		||||
- name: AZURACAST
 | 
			
		||||
  include_role:
 | 
			
		||||
    name: azuracast
 | 
			
		||||
  when: azuracast_install | bool
 | 
			
		||||
  tags: azuracast
 | 
			
		||||
 | 
			
		||||
- name: DOKUWIKI
 | 
			
		||||
  include_role:
 | 
			
		||||
    name: dokuwiki
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										19
									
								
								roles/azuracast/README.rst
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								roles/azuracast/README.rst
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,19 @@
 | 
			
		|||
==========
 | 
			
		||||
AzuraCast README
 | 
			
		||||
==========
 | 
			
		||||
 | 
			
		||||
This playbook adds `AzuraCast <https://azuracast.com/>`_ to Internet-in-a-Box (IIAB) for network radio station functionality.  With 'AzuraCast' you and your community can schedule podcasts, music, and even do live streaming of audio content.  A variety of streaming formats are supported.
 | 
			
		||||
 | 
			
		||||
Please see AzuraCast's `screenshots <https://www.azuracast.com/about/screenshots.html>`_.
 | 
			
		||||
 | 
			
		||||
Currently, this will only run on Ubuntu 18.04, Debian 9, Debian 10. Support for Raspberry Pi is experimental, so please test and report any issues.
 | 
			
		||||
 | 
			
		||||
Using It
 | 
			
		||||
--------
 | 
			
		||||
 | 
			
		||||
* Do a normal IIAB install (http://download.iiab.io), making sure to set both variables ``azuracast_install`` and ``azuracast_enabled`` to ``True`` when it prompts you to edit `/etc/iiab/local_vars.yml <http://FAQ.IIAB.IO#What_is_local_vars.yml_and_how_do_I_customize_it.3F>`_, as you begin the installation. 
 | 
			
		||||
* When the IIAB software install completes, it will ask you to reboot, and AzuraCast's console will then be available at http://box.lan:10080
 | 
			
		||||
* This console site will prompt you to complete AzuraCast's initial setup: user accounts, managing stations, radio streams, etc.
 | 
			
		||||
* Finally, check out some `how-to videos <https://www.youtube.com/watch?v=b1Rxlu5P804>`_ to learn to manage your own radio station!
 | 
			
		||||
 | 
			
		||||
Note: When creating a station using AzuraCast's console, its default streaming ports for ``station`` and ``autodj`` need to be in the `port range 10000-10100 <https://github.com/iiab/iiab/wiki/IIAB-Networking#list-of-ports--services>`_.
 | 
			
		||||
							
								
								
									
										22
									
								
								roles/azuracast/defaults/main.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								roles/azuracast/defaults/main.yml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
# A full-featured online radio station suite.
 | 
			
		||||
# Works on Ubuntu 18.04, Debian 9, 10. Uses docker
 | 
			
		||||
 | 
			
		||||
# azuracast_install: False
 | 
			
		||||
# azuracast_enabled: False
 | 
			
		||||
 | 
			
		||||
# azuracast_http_port: 10080
 | 
			
		||||
# azuracast_https_port: 10443
 | 
			
		||||
 | 
			
		||||
## AzuraCast needs many ports in the 8000:8100 range by default, but IIAB services
 | 
			
		||||
## conflict with those ports so this variable below sets a sane prefix. 
 | 
			
		||||
## e.g. setting the below variable to 10 will result in port ranges 10000-10100 
 | 
			
		||||
## being reserved for AzuraCast:
 | 
			
		||||
# azuracast_port_range_prefix: 10
 | 
			
		||||
 | 
			
		||||
# All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml
 | 
			
		||||
# If nec, change them by editing /etc/iiab/local_vars.yml prior to installing!
 | 
			
		||||
 | 
			
		||||
docker_sh_url: https://raw.githubusercontent.com/AzuraCast/AzuraCast/master/docker.sh
 | 
			
		||||
docker_compose_url: https://raw.githubusercontent.com/AzuraCast/AzuraCast/master/docker-compose.sample.yml 
 | 
			
		||||
docker_container_dir: /library/docker
 | 
			
		||||
azuracast_host_dir: /opt/azuracast
 | 
			
		||||
							
								
								
									
										64
									
								
								roles/azuracast/tasks/install.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								roles/azuracast/tasks/install.yml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,64 @@
 | 
			
		|||
- name: AzuraCast - Make AzuraCast config directory
 | 
			
		||||
  file: 
 | 
			
		||||
    path: "{{ azuracast_host_dir }}"
 | 
			
		||||
    state: directory
 | 
			
		||||
 | 
			
		||||
- name: AzuraCast - Copy over .env template to AzuraCast config directory
 | 
			
		||||
  template:
 | 
			
		||||
    src: env.j2
 | 
			
		||||
    dest: "{{ azuracast_host_dir }}/.env"
 | 
			
		||||
    owner: root
 | 
			
		||||
    group: root
 | 
			
		||||
    mode: 0644
 | 
			
		||||
 | 
			
		||||
- name: AzuraCast - Copy over docker-compose.override.yml template to AzuraCast config directory
 | 
			
		||||
  template:
 | 
			
		||||
    src: docker-compose.override.yml.j2
 | 
			
		||||
    dest: "{{ azuracast_host_dir }}/docker-compose.override.yml"
 | 
			
		||||
    owner: root
 | 
			
		||||
    group: root
 | 
			
		||||
    mode: 0644
 | 
			
		||||
 | 
			
		||||
- name: AzuraCast - Download docker.sh script
 | 
			
		||||
  get_url:
 | 
			
		||||
    url: "{{ docker_sh_url }}"
 | 
			
		||||
    dest: "{{ azuracast_host_dir }}/"
 | 
			
		||||
    timeout: "{{ download_timeout }}"
 | 
			
		||||
    mode: 0755
 | 
			
		||||
  when: internet_available | bool
 | 
			
		||||
 | 
			
		||||
- name: AzuraCast - Download docker-compose.yml
 | 
			
		||||
  get_url: 
 | 
			
		||||
    url: "{{ docker_compose_url }}"
 | 
			
		||||
    dest: "{{ azuracast_host_dir }}/docker-compose.yml"
 | 
			
		||||
    timeout: "{{ download_timeout }}"
 | 
			
		||||
    mode: 0755
 | 
			
		||||
 | 
			
		||||
- name: AzuraCast - Make changes to docker.sh script so it runs headless
 | 
			
		||||
  lineinfile:
 | 
			
		||||
    path: "{{ azuracast_host_dir }}/docker.sh"
 | 
			
		||||
    regexp: "^(.*)read reply.*"
 | 
			
		||||
    line: "\\1reply='Y'"
 | 
			
		||||
    backrefs: yes
 | 
			
		||||
 | 
			
		||||
- name: AzuraCast - Make docker container directory
 | 
			
		||||
  file: 
 | 
			
		||||
    path: "{{ docker_container_dir }}"
 | 
			
		||||
    state: directory
 | 
			
		||||
  
 | 
			
		||||
- name: AzuraCast - Link docker container directory
 | 
			
		||||
  file:
 | 
			
		||||
    src: "{{ docker_container_dir }}"
 | 
			
		||||
    dest: "/var/lib/docker"
 | 
			
		||||
    state: link 
 | 
			
		||||
 | 
			
		||||
- name: Change default port number ranges 8xxx:8xxx to Nxxx:Nxxx icecast-stations in docker-compose.yml (N - azuracast_port_range_prefix)
 | 
			
		||||
  replace:
 | 
			
		||||
    path: "{{ azuracast_host_dir }}/docker-compose.yml"
 | 
			
		||||
    regexp: "^( *- \\')8([0-9]{3})\\:8([0-9]{3}\\'.*)$"
 | 
			
		||||
    replace: "\\g<1>{{ azuracast_port_range_prefix }}\\g<2>:{{ azuracast_port_range_prefix }}\\g<3>"
 | 
			
		||||
 | 
			
		||||
- name: AzuraCast - Run the installer
 | 
			
		||||
  shell: "/bin/bash docker.sh install"
 | 
			
		||||
  args:
 | 
			
		||||
    chdir: "{{ azuracast_host_dir }}"
 | 
			
		||||
							
								
								
									
										3
									
								
								roles/azuracast/tasks/main.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								roles/azuracast/tasks/main.yml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,3 @@
 | 
			
		|||
- name: AzuraCast install
 | 
			
		||||
  include_tasks: install.yml
 | 
			
		||||
  when: azuracast_install
 | 
			
		||||
							
								
								
									
										30
									
								
								roles/azuracast/templates/docker-compose.override.yml.j2
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								roles/azuracast/templates/docker-compose.override.yml.j2
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,30 @@
 | 
			
		|||
version: '2.2'
 | 
			
		||||
 | 
			
		||||
services:
 | 
			
		||||
  web:
 | 
			
		||||
    networks:
 | 
			
		||||
      - azure
 | 
			
		||||
 | 
			
		||||
  mariadb:
 | 
			
		||||
    networks:
 | 
			
		||||
      - azure
 | 
			
		||||
 | 
			
		||||
  influxdb:
 | 
			
		||||
    networks:
 | 
			
		||||
      - azure
 | 
			
		||||
 | 
			
		||||
  redis:
 | 
			
		||||
    networks:
 | 
			
		||||
      - azure
 | 
			
		||||
 | 
			
		||||
  stations:
 | 
			
		||||
    networks:
 | 
			
		||||
      - azure
 | 
			
		||||
 | 
			
		||||
networks:
 | 
			
		||||
  azure:
 | 
			
		||||
    driver: bridge
 | 
			
		||||
    ipam:
 | 
			
		||||
      driver: default
 | 
			
		||||
      config:
 | 
			
		||||
        - subnet: 172.36.0.1/16
 | 
			
		||||
							
								
								
									
										4
									
								
								roles/azuracast/templates/env.j2
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								roles/azuracast/templates/env.j2
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,4 @@
 | 
			
		|||
COMPOSE_PROJECT_NAME=azuracast
 | 
			
		||||
 | 
			
		||||
AZURACAST_HTTP_PORT={{ azuracast_http_port }}
 | 
			
		||||
AZURACAST_HTTPS_PORT={{ azuracast_https_port }}
 | 
			
		||||
| 
						 | 
				
			
			@ -84,6 +84,3 @@
 | 
			
		|||
    path: /usr/local/kalite/venv/local/lib/python2.7/site-packages/kalite/packages/dist/ifcfg/parser.py
 | 
			
		||||
    regexp: 'a-zA-Z0-9'
 | 
			
		||||
    replace: 'a-zA-Z0-9\-'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,6 +52,9 @@ gui_port={{ gui_port }}
 | 
			
		|||
iiab_gateway_enabled={{ iiab_gateway_enabled }}
 | 
			
		||||
block_DNS={{ block_DNS }}
 | 
			
		||||
 | 
			
		||||
azuracast_ports="{{ azuracast_port_range_prefix }}000:{{ azuracast_port_range_prefix }}100"
 | 
			
		||||
azuracast_https_port={{ azuracast_https_port }}
 | 
			
		||||
azuracast_http_port={{ azuracast_http_port }}
 | 
			
		||||
calibre_port={{ calibre_port }}
 | 
			
		||||
calibreweb_port={{ calibreweb_port }}
 | 
			
		||||
cups_port={{ cups_port }}
 | 
			
		||||
| 
						 | 
				
			
			@ -141,6 +144,9 @@ if [ "$wan" != "none" ]; then
 | 
			
		|||
 | 
			
		||||
    # 3 = ssh + http-or-https + common IIAB services
 | 
			
		||||
    if [ "$ports_externally_visible" -ge 3 ]; then
 | 
			
		||||
        $IPTABLES -A INPUT -p tcp --dport $azuracast_ports -m state --state NEW -i $wan -j ACCEPT
 | 
			
		||||
        $IPTABLES -A INPUT -p tcp --dport $azuracast_http_port -m state --state NEW -i $wan -j ACCEPT
 | 
			
		||||
        $IPTABLES -A INPUT -p tcp --dport $azuracast_https_port -m state --state NEW -i $wan -j ACCEPT
 | 
			
		||||
        $IPTABLES -A INPUT -p tcp --dport $calibre_port -m state --state NEW -i $wan -j ACCEPT
 | 
			
		||||
        $IPTABLES -A INPUT -p tcp --dport $calibreweb_port -m state --state NEW -i $wan -j ACCEPT
 | 
			
		||||
        $IPTABLES -A INPUT -p tcp --dport $cups_port -m state --state NEW -i $wan -j ACCEPT
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -285,6 +285,18 @@ idmgr_enables: False
 | 
			
		|||
 | 
			
		||||
# 6-GENERIC-APPS
 | 
			
		||||
 | 
			
		||||
azuracast_install: False
 | 
			
		||||
azuracast_enabled: False
 | 
			
		||||
 | 
			
		||||
azuracast_http_port: 10080
 | 
			
		||||
azuracast_https_port: 10443
 | 
			
		||||
 | 
			
		||||
# AzuraCast needs many ports in the 8000:8100 range by default, but IIAB services
 | 
			
		||||
# conflict with those ports so this variable below sets a sane prefix. 
 | 
			
		||||
# e.g. setting the below variable to 10 will result in port ranges 10000-10100 
 | 
			
		||||
# being reserved for AzuraCast:
 | 
			
		||||
azuracast_port_range_prefix: 10
 | 
			
		||||
 | 
			
		||||
dokuwiki_install: False
 | 
			
		||||
dokuwiki_enabled: False
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -178,6 +178,9 @@ iiab_usb_lib_show_all: True
 | 
			
		|||
 | 
			
		||||
# 6-GENERIC-APPS
 | 
			
		||||
 | 
			
		||||
azuracast_install: False
 | 
			
		||||
azuracast_enabled: False
 | 
			
		||||
 | 
			
		||||
dokuwiki_install: True
 | 
			
		||||
dokuwiki_enabled: True
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -178,6 +178,9 @@ iiab_usb_lib_show_all: True
 | 
			
		|||
 | 
			
		||||
# 6-GENERIC-APPS
 | 
			
		||||
 | 
			
		||||
azuracast_install: False
 | 
			
		||||
azuracast_enabled: False
 | 
			
		||||
 | 
			
		||||
dokuwiki_install: False
 | 
			
		||||
dokuwiki_enabled: False
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -178,6 +178,9 @@ iiab_usb_lib_show_all: True
 | 
			
		|||
 | 
			
		||||
# 6-GENERIC-APPS
 | 
			
		||||
 | 
			
		||||
azuracast_install: False
 | 
			
		||||
azuracast_enabled: False
 | 
			
		||||
 | 
			
		||||
dokuwiki_install: False
 | 
			
		||||
dokuwiki_enabled: False
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue