This repository has been archived by the owner on Oct 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
338 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,7 @@ docker stack deploy -c docker-compose-traefik.yml rb | |
# download distribution | ||
mkdir -p radiobrowser | ||
cd radiobrowser | ||
wget https://github.com/segler-alex/radiobrowser-api-rust/releases/download/0.6.4/radiobrowser-dist.tar.gz | ||
wget https://github.com/segler-alex/radiobrowser-api-rust/releases/download/0.6.5/radiobrowser-dist.tar.gz | ||
tar -zxf radiobrowser-dist.tar.gz | ||
|
||
# config database | ||
|
@@ -101,9 +101,9 @@ sudo systemctl start radiobrowser | |
* create database and database user | ||
|
||
```bash | ||
wget https://github.com/segler-alex/radiobrowser-api-rust/releases/download/0.6.4/radiobrowser-api-rust_0.6.4_amd64.deb | ||
wget https://github.com/segler-alex/radiobrowser-api-rust/releases/download/0.6.5/radiobrowser-api-rust_0.6.5_amd64.deb | ||
sudo apt install default-mysql-server | ||
sudo dpkg -i radiobrowser-api-rust_0.6.4_amd64.deb | ||
sudo dpkg -i radiobrowser-api-rust_0.6.5_amd64.deb | ||
cat /usr/share/radiobrowser/init.sql | mysql | ||
``` | ||
|
||
|
@@ -184,6 +184,18 @@ Apache config file example | |
Follow this guide to get a free certificate | ||
<https://certbot.eff.org/> | ||
|
||
### Ansible role | ||
|
||
```bash | ||
# clone this project | ||
git clone https://github.com/segler-alex/radiobrowser-api-rust.git | ||
cd radiobrowser-api-rust | ||
# checkout stable | ||
git checkout stable | ||
# deploy, change email adress, for ssl with certbot | ||
ansible-playbook -e "[email protected]" -e "version=0.6.5" -e "ansible_python_interpreter=auto" -i "test.example.com,test2.example.com" ansible/playbook.yml | ||
``` | ||
|
||
## Building | ||
|
||
### Distribution tar.gz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[servers] | ||
test.api.radio-browser.info | ||
|
||
[servers:vars] | ||
ansible_python_interpreter=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- hosts: all | ||
remote_user: root | ||
roles: | ||
- radiobrowser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
- name: Reload package cache | ||
apt: | ||
update_cache: yes | ||
upgrade: yes | ||
- name: Install apache2 and mysql | ||
apt: | ||
name: apache2,default-mysql-server,python3-pymysql,certbot,python-certbot-apache | ||
- name: Create a new database with name 'radio' | ||
mysql_db: | ||
name: radio | ||
state: present | ||
login_unix_socket: /var/run/mysqld/mysqld.sock | ||
- name: Create database user | ||
mysql_user: | ||
name: radiouser | ||
password: password | ||
priv: 'radio.*:ALL' | ||
state: present | ||
login_unix_socket: /var/run/mysqld/mysqld.sock | ||
- name: Install a .deb package from the internet. | ||
apt: | ||
deb: "https://github.com/segler-alex/radiobrowser-api-rust/releases/download/{{version}}/radiobrowser-api-rust_{{version}}_amd64.deb" | ||
- name: Create www root | ||
file: | ||
state: directory | ||
path: /var/www/radio | ||
- name: Add apache2 virtual host | ||
template: | ||
src: ../templates/radio-browser.conf.j2 | ||
dest: /etc/apache2/sites-available/radio-browser.conf | ||
- name: Enable apache2 modules | ||
apache2_module: | ||
state: present | ||
name: proxy_http | ||
- name: Enable site | ||
command: a2ensite radio-browser | ||
- name: Reload service apache2 | ||
service: | ||
name: apache2 | ||
state: reloaded | ||
- name: Enable radiobrowser service | ||
service: | ||
name: radiobrowser | ||
state: restarted | ||
enabled: yes | ||
- name: Setup certbot | ||
command: certbot --apache --agree-tos -m {{email}} -d {{ansible_fqdn}} -n --redirect |
18 changes: 18 additions & 0 deletions
18
ansible/roles/radiobrowser/templates/radio-browser.conf.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<VirtualHost *:80> | ||
ServerName {{ ansible_fqdn }} | ||
|
||
ServerAdmin {{ email }} | ||
DocumentRoot /var/www/radio | ||
|
||
ErrorLog ${APACHE_LOG_DIR}/error.radio.log | ||
CustomLog ${APACHE_LOG_DIR}/access.radio.log combined | ||
|
||
ProxyPass "/" "http://localhost:8080/" | ||
ProxyPassReverse "/" "http://localhost:8080/" | ||
|
||
<Directory /var/www/radio/> | ||
AllowOverride All | ||
Order allow,deny | ||
allow from all | ||
</Directory> | ||
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.