Compare commits

...

3 Commits

Author SHA1 Message Date
dan 9bd755b016 aggiornato readme 2020-12-10 23:57:52 +01:00
dan 4ef50cc869 setup servizi via docker 2020-12-10 23:57:31 +01:00
dan 68812f3af5 setup sistema 2020-12-10 23:57:17 +01:00
3 changed files with 203 additions and 1 deletions

View File

@ -37,7 +37,12 @@
Usa debian, docker, nginx, azuracast, wordpress e dokuwiki.
[setup sistema](setup-01.md)
[setup servizi via docker](setup-02.md)
[docker-composer yalm files](srv)
*Thanks to textart.sh for the lovely ascii art of a croco.*
*Thanks to Brethil.*

100
setup-01.md 100644
View File

@ -0,0 +1,100 @@
# acCrocRadio setup Sistema
## DNS
DNS-zone presso il registrar
esempio: accroc.radio
```
* 10800 IN A 10.000.00.001
@ 10800 IN A 10.000.00.001
wiki 10800 IN CNAME accroc.radio.
ac 10800 IN CNAME accroc.radio.
wp 10800 IN CNAME accroc.radio.
www 10800 IN CNAME accroc.radio.
```
## Installazione
Debian 10
> apt update ; apt upgrade ; apt clean
> apt install sudo ssh screen net-tools htop strace ntp ufw figlet apg wipe
> apt install curl git apt-transport-https tmux byobu man elinks grc dnsutils
> apt install fish tree zip nmap rsync mutt logwatch rkhunter
## Hostname
> hostnamectl set-hostname croco
> figlet: figlet cRoc > /etc/motd
## Firewall
```
ufw default deny incoming
ufw default allow outgoing
ufw allow ssh
ufw allow 80, 443, 2022, 8000, 8005
ufw enable
```
Consigliato: cambiare porta sshd, abilitare ssh login passwordless
## Time
> dpkg-reconfigure tzdata
Europe/Rome
## Dotfiles
~/.bashrc
```
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias docker='grc docker'
```
~/.nanorc
```
syntax "all" "[\.]*$"
color green "^#.*$"
set tabsize 4
set tabstospaces
```
## Mailserver
> apt install postfix
Posta solo locale.
Per riconfigurare:
> dpkg-reconfigure postfix
## SWAP
> free -h
> fallocate -l 2G /swapfile
> ls -lh /swapfile
> chmod 600 /swapfile
> mkswap /swapfile
> swapon /swapfile
> swapon --show
> sudo cp /etc/fstab /etc/fstab.bak
> echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
> cat /proc/sys/vm/swappiness
> sysctl vm.swappiness=10
> echo vm.swappiness=10 >> /etc/sysctl.conf
> cat /proc/sys/vm/vfs_cache_pressure
> sysctl vm.vfs_cache_pressure=50
> echo vm.vfs_cache_pressure=50 >> /etc/sysctl.conf

97
setup-02.md 100644
View File

@ -0,0 +1,97 @@
# acCrocRadio setup servizi via docker
## Azuracast
> mkdir -p /srv/azuracast
> cd /srv/azuracast
> curl -fsSL https://raw.githubusercontent.com/AzuraCast/AzuraCast/master/docker.sh > docker.sh
> chmod a+x docker.sh
> ./docker.sh install
media in: /var/lib/docker/volumes/azuracast_station_data/_data/{station_name}/media/
backup in: /var/lib/docker/volumes/azuracast_backups/_data
Controllare i permessi: docker exec -it azuracast_web bash
Upgrade
> ./docker.sh update-self
> ./docker.sh update
Logs
> docker-compose logs -f
> docker-compose logs -f service [web | stations]
Stop containers di azuracast
> cd /srv/azuracast
> docker-compose down
> edit .env e docker-compose.override.yml
Go container azuracast
> docker-compose up -d
Manual azuracast backup
> ./docker.sh backup --exclude-media path-to-backup.tar.gz
Manuale azuracast backup restore
> ./docker.sh restore [/path/to/backup.tar.gz]
Permessi con ACL
sftp su porta 2022
Links:
https://www.azuracast.com/station-management/djs/streaming-software.html
https://github.com/AzuraCast/AzuraCast/issues
https://www.azuracast.com/install/docker.html
https://www.azuracast.com/developers/docker-sh.html
https://www.azuracast.com/administration/users/
https://www.azuracast.com/extending/multisite.html
https://www.azuracast.com/help/docker/
https://github.com/AzuraCast/AzuraRelay
https://www.azuracast.com/developers/nowplaying.html
## Webpage
> netstat -tulpn
> ufw status verbose
> mkdir -p /srv/website/www
> cd /srv/website
> docker pull nginx
> edit docker-compose.yml e webpage.env
> docker-compose up -d
## Dokuwiki
> docker pull linuxserver/dokuwiki
> edit docker-compose.yml e dokuwiki.env
> mkdir /srv/dokuwiki/
> chown user:user [path-to-wiki]
> docker-compose up -d
> http://wiki.accroc.radio/install.php
> ssh -p 50022 root@00.000.00.000 -NL 8080:172.28.0.7:80
> http://localhost:8080/install.php
> wiki admin/Configuration Settings panel: set Use Nice URL to .htaccess
> tick Use slash as namespace separator in URLs
Restart the container
data in: /var/lib/docker/volumes/dokuwiki_data/_data/dokuwiki/data
testo puro:
https://wiki.accroc.radio/test?do=export_xhtmlbody
https://www.dokuwiki.org/export
## Wordpress
> mkdir /srv/wordpress/
> docker pull wordpress:latest
> edit docker-compose.yml e wordpress.env
> docker-compose up -d