├── +R.sh ├── .editorconfig ├── .gitattributes ├── README.md ├── RPi_LED_flash_codes.adoc ├── RPi_hardware_code.md ├── boot ├── overlays │ ├── tft35a.dtbo │ ├── waveshare35a.dtbo │ ├── waveshare35b-v2.dtbo │ ├── waveshare35b.dtbo │ └── waveshare35c.dtbo └── wifi0 ├── create-alarm.sh ├── create-ros.sh ├── create.sh ├── etc ├── X11 │ ├── lcd0 │ ├── lcd180 │ ├── lcd270 │ ├── lcd90 │ └── xinit │ │ └── rotateconf ├── avahi │ └── services │ │ └── ros.service ├── cava.conf ├── conf.d │ └── devmon ├── iwd │ └── main.conf ├── mime.types ├── modprobe.d │ └── brcmfmac.conf ├── modules-load.d │ └── ntfs3.conf ├── nginx │ └── nginx.conf ├── pacman.d │ └── hooks │ │ └── 90-systemd-update.hook ├── php │ └── php.ini ├── samba │ └── smb.conf ├── shairport-sync.conf ├── spotifyd.conf ├── sudoers.d │ └── raudio ├── systemd │ └── system │ │ ├── avahi-daemon.service.d │ │ └── override.conf │ │ ├── bluealsa-dbus.service │ │ ├── bluealsa.service.d │ │ └── override.conf │ │ ├── bluetooth.service.d │ │ └── override.conf │ │ ├── bluetoothbutton.service │ │ ├── bootsplash.service │ │ ├── cava.service │ │ ├── lcdchar.service │ │ ├── localbrowser.service │ │ ├── mpd.service.d │ │ └── override.conf │ │ ├── mpdidle.service │ │ ├── nginx.service.d │ │ └── override.conf │ │ ├── php-fpm.service.d │ │ └── override.conf │ │ ├── powerbutton.service │ │ ├── radio.service │ │ ├── rotaryencoder.service │ │ ├── shairport-sync.service.d │ │ └── override.conf │ │ ├── shairport.service │ │ ├── startup.service │ │ ├── systemd-udevd.service.d │ │ └── ipaddressallow.conf │ │ ├── upmpdcli.service │ │ └── websocket.service ├── udev │ └── rules.d │ │ ├── bluetooth.rules │ │ ├── cdrom.rules │ │ ├── ntfs.rules │ │ ├── usbbluetooth.rules │ │ ├── usbdac.rules │ │ └── usbwifi.rules ├── udevil │ └── udevil.conf └── upmpdcli.conf ├── hdmi-wfhd.md ├── i2s_setting.md ├── imagecreate.sh ├── imagereset.sh ├── imageupload.md ├── imageupload.sh ├── imagewrite.sh ├── mpc_update.md ├── reset.sh ├── root ├── .config │ └── procps │ │ └── toprc └── .profile ├── select-features.png ├── select-hw.png └── srv └── http └── data └── mpdconf ├── conf ├── autoupdate.conf ├── buffer.conf ├── camilladsp.conf ├── cdio.conf ├── ffmpeg.conf ├── fifo.conf ├── httpd.conf ├── normalization.conf ├── outputbuffer.conf ├── replaygain.conf ├── snapserver.conf ├── soxr-custom.conf └── soxr.conf ├── curl.conf └── mpd.conf /+R.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | optbox=( --colors --no-shadow --no-collapse ) 4 | 5 | dialog "${optbox[@]}" --infobox " 6 | 7 | 8 | \Z1r\Z0Audio 9 | " 9 58 10 | sleep 1 11 | 12 | cmd=$( dialog "${optbox[@]}" --output-fd 1 --menu " 13 | \Z1r\Z0Audio: 14 | " 8 0 0 \ 15 | 1 'Create rAudio' \ 16 | 2 'Reset to default' \ 17 | 3 'Compress to image file' \ 18 | 4 'Upload image files' \ 19 | 5 'Update package repository' \ 20 | 6 'Distcc client' \ 21 | 7 'Docker' \ 22 | 8 'SSH to RPi' ) 23 | 24 | url=https://github.com/rern/rOS/raw/main 25 | urlio=https://github.com/rern/rern.github.io/raw/main 26 | 27 | case $cmd in 28 | 1 ) bash <( curl -sL $url/create.sh );; 29 | 2 ) bash <( curl -sL $url/reset.sh );; 30 | 3 ) bash <( curl -sL $url/imagecreate.sh );; 31 | 4 ) bash <( curl -sL $url/imageupload.sh );; 32 | 5 ) bash <( curl -sL $urlio/repoupdate.sh );; 33 | 6 ) bash <( curl -sL $urlio/distcc-client.sh );; 34 | 7 ) bash <( curl -sL $urlio/docker.sh );; 35 | 8 ) rpiip=$( dialog "${opt[@]}" --output-fd 1 --inputbox " 36 | IP: 37 | " 0 0 192.168.1. ) 38 | sed -i "/$rpiip/ d" ~/.ssh/known_hosts 39 | sshpass -p ros ssh -t -o StrictHostKeyChecking=no root@$rpiip 40 | ;; 41 | esac 42 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = tab 6 | indent_size = 4 7 | end_of_line = lf 8 | insert_final_newline = true 9 | 10 | [*.{css,js,jsx,html,md,php,sass}] # Matches multiple types with brace expansion notation 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Automatically normalize line endings for all text-based files 2 | # http://git-scm.com/docs/gitattributes#_end_of_line_conversion 3 | * text=auto 4 | 5 | # For the following file types, normalize line endings to LF on 6 | # checkin and prevent conversion to CRLF when they are checked out 7 | # (this is required in order to prevent newline related issues like, 8 | # for example, after the build script is run) 9 | .* text eol=lf 10 | *.css text eol=lf 11 | *.html text eol=lf 12 | *.js text eol=lf 13 | *.json text eol=lf 14 | *.md text eol=lf 15 | *.php text eol=lf 16 | *.py text eol=lf 17 | *.sh text eol=lf 18 | *.txt text eol=lf 19 | *.xml text eol=lf 20 | 21 | # Ensure those won't be messed up with 22 | *.jpg binary 23 | *.png binary 24 | *.gif binary 25 | *.data binary 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | rOS - DIY rAudio 2 | --- 3 | Build [**rAudio**](https://github.com/rern/rAudio-1) - Audio player and renderer for Raspberry Pi 4 | 5 | - For all **Raspberry Pi**s: 6 | - 64bit: 7 | - `4`, `3` and `2` 8 | - `Zero 2` cannot be used to run this DIY. Use pre-built [image file](https://github.com/rern/rAudio-1#image-files) instead. 9 | - 32bit: 10 | - `2 (BCM2836)` 11 | - Legacy: 12 | - `1` and `Zero` : Arch Linux Arm [ended ARMv6 CPU support](https://archlinuxarm.org/forum/viewtopic.php?f=3&t=15721). Use pre-built [image file](https://github.com/rern/rAudio-1#image-files) instead. 13 | - Create **rAudio** from latest releases of [**Arch Linux Arm**](https://archlinuxarm.org/about/downloads) 14 | - Interactive interface 15 | - Options: 16 | - Run `ROOT` partition on USB drive 17 | - Run on USB only - no SD card ([boot from USB](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md)) 18 | - Pre-configure Wi-Fi connection (headless mode) 19 | - Exclude features (can be as light as possible in terms of build time and disk space) 20 | - Take less than 15 minutes for the whole process with a decent download speed. 21 | 22 | **Procedure** 23 | - [Prepare partitions](#prepare-partitions) 24 | - Create `BOOT` and `ROOT` partitions 25 | - [Create Arch Linux Arm + rAudio](#create-arch-linux-arm--raudio) 26 | - Use wired LAN connection if possible 27 | - Use router assigned IP address if possible 28 | - Router may take some time to broadcast hostname of DHCP Raspberry Pi 29 | - Optional - Pre-configure Wi-Fi connection 30 | - Select features 31 | - Download Arch Linux Arm 32 | - Write `BOOT` and `ROOT` 33 | - SSH connect PC to Raspberry Pi 34 | - Upgrade kernel and default packages 35 | - Install feature packages 36 | - Install web user interface 37 | - Configure 38 | - Set defaults 39 | - [Optionals](#optionals) 40 | - Setup Wi-Fi auto-connect 41 | - Create image file 42 | - Expert mode (1 command line ) 43 | - For those who know how to read and confirm syntax of SD card partitions. 44 | - For Alternative 1: Micro SD card only 45 | ```sh 46 | bash <( wget -qO - https://github.com/rern/rOS/raw/main/create.sh ) 47 | ``` 48 | - If the SD card was not recognized, use GParted to wipe all partitions. 49 | 50 | ![dialog1](https://github.com/rern/rOS/raw/main/select-hw.png) 51 | ![dialog2](https://github.com/rern/rOS/raw/main/select-features.png) 52 | 53 | **Need** 54 | - PC - Linux - any distro 55 | - or on USB e.g., [Manjaro](https://itsfoss.com/create-live-usb-manjaro-linux/) - Arch Linux 56 | - or on Raspberry Pi itself (If no GUI, `fdisk` and `mount` skills needed.) 57 | - or on VirtualBox on Windows (with network set as `Bridge Adapter`) - Slowest 58 | - Raspberry Pi 59 | - Network connection to Raspberry Pi 60 | - Wired LAN 61 | - Optional: Wi-Fi (if necessary) 62 | - Media: 63 | - Micro SD card shoule be at least class 10 or U1. 64 | - Option 1: Micro SD card: 8GB+ for `BOOT` + `ROOT` partitions 65 | - Option 2: Micro SD card + USB drive (`ROOT` partition on USB drive) 66 | - Micro SD card: 100MB+ for `BOOT` partition only 67 | - USB drive: 8GB+ for `ROOT` partition (or USB hard drive with existing data) 68 | - Option 3: USB drive only - no SD card (Boot from USB drive) 69 | - Raspberry Pi 3 and 2 v1.2 only (4 not yet supported) 70 | - USB drive: 8GB+ for `BOOT` + `ROOT` partition 71 | - Note for USB drive: 72 | - Suitable for hard drives or faster-than-SD-card thumb drives. 73 | - Boot from USB drive: 74 | - Suitable for solid state drives. 75 | - Normal hard drive needs external power, e.g., powered USB hub, to have it spin up 5+ seconds before boot. 76 | - Boot takes 10+ seconds longer (detect no sd card > read boot loader into memory > boot) 77 | --- 78 | 79 | ### Prepare partitions 80 | - On Linux PC 81 | - Open **GParted** app (Manjaro root password: `manjaro`) 82 | - 3 Alternatives: 83 | - Micro SD card only 84 | - Micro SD card + USB drive 85 | - USB drive only 86 | 87 | **Alternative 1: Micro SD card only** 88 | - `Unmount` > `Delete` all partitions (make sure it's the micro SD card) 89 | - Create partitions: 90 | 91 | | No. | Size | Type | Format | Label | 92 | |-----|-------------|---------|--------|-------| 93 | | #1 | 100MiB | primary | fat32 | BOOT | 94 | | #2 | (the rest) | primary | ext4 | ROOT | 95 | 96 | **Alternative 2: Micro SD card + USB drive** 97 | - Micro SD card 98 | - `Unmount` > `Delete` all partitions (Caution: make sure it's the SD card) 99 | - Create a partition: 100 | 101 | | No. | Size | Type | Format | Label | 102 | |-----|-------------|---------|--------|-------| 103 | | #1 | 100MiB | primary | fat32 | BOOT | 104 | 105 | - USB drive - Blank: 106 | - `Unmount` > `Delete` all partitions (Caution: make sure it's the USB drive) 107 | - Create partitions: 108 | 109 | | No. | Size | Type | Format | Label | 110 | |-----|-------------|---------|--------|-------| 111 | | #1 | 5000MiB | primary | ext4 | ROOT | 112 | | #2 | (the rest) | primary | ext4 | (any) | 113 | 114 | - or USB drive - with existing data: 115 | - No need to reformat or change format of existing partition 116 | - Resize the existing to get 5000MiB unallocated space (anywhere - at the end, middle or start of the disk) 117 | - Create a partition in the space: 118 | 119 | | No. | Size | Type | Format | Label | 120 | |-------|-------------|---------|--------|-------| 121 | | (any) | (existing) | primary | (any) | (any) | 122 | | (any) | 5000MiB | primary | ext4 | ROOT | 123 | 124 | **Alternative 3: USB drive only** 125 | 126 | - Enable boot from USB: [Set boot bit](https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md) (Micro SD card can still be used as usual if inserted.) 127 | - Create partitions: (Drive with existing data must be resized and rearranged respectively.) 128 | 129 | | No. | Size | Type | Format | Label | 130 | |-----|-------------|---------|--------|-------| 131 | | #1 | 100MiB | primary | fat32 | BOOT | 132 | | #2 | 5000MiB | primary | ext4 | ROOT | 133 | | #3 | (the rest) | primary | ext4 | (any) | 134 | 135 | --- 136 | 137 | ### Create Arch Linux Arm + rAudio 138 | - Open **Files** app (**File Manager** on Manjaro) 139 | - Click `BOOT` and `ROOT` to mount 140 | - Note each path in location bar or hover mouse over `BOOT` and `ROOT` for confirmation 141 | - Switch user to root 142 | ```sh 143 | su 144 | ``` 145 | - Create script 146 | ```sh 147 | bash <( wget -qO - https://github.com/rern/rOS/raw/main/create-alarm.sh ) 148 | ``` 149 | - RPi 2 and 3 get the same `ArchLinuxARM-rpi-2-latest.tar.gz` 150 | - Errors or too slow download: press `Ctrl+C` and run `./create-alarm.sh` again (while in `Create Arch Linux Arm` mode only) 151 | - If there're other applications running and "Create Arch Linux Arm" progress was stalled, open another terminal and run `sync` command. 152 | 153 | --- 154 | 155 | ### Optionals 156 | **Setup Wi-Fi auto-connect** for headless/no screen (if not set during build) 157 | - On Linux or Windows 158 | - Insert micro SD card 159 | - 3 alternatives: 160 | 1. From existing 161 | - Backup the profile file from `/etc/netctl/PROFILE` 162 | - Rename it to `wifi` then copy it to `BOOT` before power on. 163 | 2. Edit template file - name and password 164 | - Open `wifi0` in BOOT with text editor 165 | - Edit SSID and Key 166 | - Save as `wifi` 167 | 3. Generate a complex profile - static IP, hidden SSID 168 | - With [**Pre-configure Wi-Fi connection**](https://rern.github.io/WiFi_profile/) 169 | - Save it in BOOT 170 | - Move micro SD card to Raspberry Pi 171 | - Power on 172 | 173 | **Create image file** (Micro SD card mode only) 174 | 175 | - Once started rAudio successfully 176 | - SSH to RPi 177 | - Reset for image 178 | ```sh 179 | ssh root@ 180 | bash <( wget -qO - https://github.com/rern/rOS/raw/main/reset.sh ) 181 | ``` 182 | - Shutdown 183 | - Move micro SD card to Linux 184 | - Create compressed image file 185 | ```sh 186 | bash <( wget -qO - https://github.com/rern/rOS/raw/main/imagecreate.sh ) 187 | ``` 188 | 189 | **LED flashes - errors** 190 | Decode: https://support.pishop.ca/article/33-raspberry-pi-act-led-error-patterns 191 | 192 | **Fix - Error: Known host keys on SSH** 193 | ```sh 194 | sed -i "/IP_ADDRESS/ d" ~/.ssh/known_hosts 195 | ``` 196 | -------------------------------------------------------------------------------- /RPi_LED_flash_codes.adoc: -------------------------------------------------------------------------------- 1 | == LED Warning Flash Codes 2 | (from: https://github.com/raspberrypi/documentation/blob/develop/documentation/asciidoc/computers/configuration/led_blink_warnings.adoc[LED Warning Flash Codes]) 3 | 4 | If a Raspberry Pi fails to boot for some reason, or has to shut down, in many cases an LED will be flashed a specific number of times to indicate what happened. The LED will blink for a number of long flashes (0 or more), then short flashes, to indicate the exact status. In most cases, the pattern will repeat after a 2 second gap. 5 | 6 | [cols="^,^,"] 7 | |=== 8 | | Long flashes | Short flashes | Status 9 | 10 | | 0 11 | | 3 12 | | Generic failure to boot 13 | 14 | | 0 15 | | 4 16 | | start*.elf not found 17 | 18 | | 0 19 | | 7 20 | | Kernel image not found 21 | 22 | | 0 23 | | 8 24 | | SDRAM failure 25 | 26 | | 0 27 | | 9 28 | | Insufficient SDRAM 29 | 30 | | 0 31 | | 10 32 | | In HALT state 33 | 34 | | 2 35 | | 1 36 | | Partition not FAT 37 | 38 | | 2 39 | | 2 40 | | Failed to read from partition 41 | 42 | | 2 43 | | 3 44 | | Extended partition not FAT 45 | 46 | | 2 47 | | 4 48 | | File signature/hash mismatch - Pi 4 49 | 50 | | 3 51 | | 1 52 | | SPI EEPROM error - Pi 4 53 | 54 | | 3 55 | | 2 56 | | SPI EEPROM is write protected - Pi 4 57 | 58 | | 3 59 | | 3 60 | | I2C error - Pi 4 61 | 62 | | 3 63 | | 4 64 | | Secure-boot configuration is not valid 65 | 66 | | 4 67 | | 4 68 | | Unsupported board type 69 | 70 | | 4 71 | | 5 72 | | Fatal firmware error 73 | 74 | | 4 75 | | 6 76 | | Power failure type A 77 | 78 | | 4 79 | | 7 80 | | Power failure type B 81 | |=== 82 | -------------------------------------------------------------------------------- /RPi_hardware_code.md: -------------------------------------------------------------------------------- 1 | **Raspberry Pi Hardware Code** 2 | 3 | - Code: `EDCBBA=$( awk '/Revision/ {print $NF}' /proc/cpuinfo )` 4 | 5 | 6 | | Name | code `BB` | wl | eth | SoC | CPU x core | GHz | code `C` | 7 | |:--------|:----------|:------|:-------|:----------|:-----------------|:---------|:---------| 8 | | | | | | | | | | 9 | | **ARMv6Z** (32bit) | 10 | | Zero | `09` | X | X | BCM2835 | ARM1176JZF-S x 1 | 1 | `0` | 11 | | Zero W | `0c` | | X | ↑ | ↑ | ↑ | ↑ | 12 | | A+ | `02` | X | X | ↑ | ↑ | ↑ | ↑ | 13 | | B+ | `03` | X | | ↑ | ↑ | ↑ | ↑ | 14 | | | | | | | | | | 15 | | **ARMv7-A** (32bit) | 16 | | 2B | `04` | X | | BCM2836 | Cortex-A7 x 4 | 0.9 | `1` | 17 | | | | | | | | | | 18 | | **ARMv8-A** (64/32bit) | 19 | | Zero 2W | `12` | | X | BCM2710A1 | Cortex-A53 x 4 | 1 | `2` | 20 | | 2B 1.2 | `04` | X | | BCM2837 | ↑ | 0.9 | ↑ | 21 | | 3B | `08` | | | ↑ | ↑ | 1.2 | ↑ | 22 | | | | | | | | | | 23 | | 3A+ | `0e` | +5GHz | X | BCM2837B0 | ↑ | 1.4 | ↑ | 24 | | 3B+ | `0d` | ↑ | Gbit | ↑ | ↑ | ↑ | ↑ | 25 | | | | | | | | | | 26 | | 4B | `11` | ↑ | ↑ | BCM2711 | Cortex-A72 x 4 | 1.5/1.8 | `3` | 27 | | | | | | | | | | 28 | | **ARMv8.2-A** (64/32bit) | 29 | | 5 | `17` | ↑ | ↑ | BCM2712 | Cortex-A76 x 4 | 2.4 | `4` | 30 | ```sh 31 | #!/bin/bash 32 | revision=$( grep ^Revision /proc/cpuinfo ) 33 | BB=${revision: -3:2} 34 | if [[ $BB == 00 ]]; then # 1 - BB[C] 35 | [[ ${revision: -1} =~ 7|8|9 ]] && model=A || model=B 36 | elif [[ $BB == 04 ]]; then # 2B - [A]BB 37 | [[ ${revision: -4:1} == 1 ]] && model=2B || model=2B1.2 38 | else 39 | declare -A BB_model=( [01]=CM1 [02]=A+ [03]=B+ [06]=CM1 [08]=3B [09]=Zero [0a]=CM3 [0c]=ZeroW [0d]=3B+ [0e]=3A+ \ 40 | [10]=CM3+ [11]=4B [12]=Zero2W [13]=400 [14]=CM4 [15]=CM4S [16]=CM2 [17]=5 ) 41 | model=${BB_model[$BB]} 42 | fi 43 | echo $model 44 | ``` 45 | 46 | - `A` - PCB revision 47 | - `BB` - Name - `BB=${EDCBBA: -3:2}` (Zero W: `19000c1` - 7 characters) 48 | - `C` - CPU - `C=${EDCBBA: -4:1}` 49 | - `D` - Manufacturer: 50 | - `0` - Sony - UK 51 | - `2` - Embest - China 52 | - `3` - Sony - Japan 53 | - `5` - Stadium - China 54 | - `E` - RAM: 55 | - `9` - 512KB 56 | - `a` - 1GB 57 | - `b` - 2GB 58 | - `c` - 4GB 59 | - `d` - 8GB 60 | - Example: `a22082` : 1GB - Embest - BCM2837 - Raspberry Pi 3B - revision 2 61 | - Single core (Zero and 1 - BCM2835): `[[ $C == 0 ]]` 62 | - On-board Wi-Fi and Bluetooth: `[[ ! $BB =~ ^(00|01|02|03|04|09)$ ]]` (not zero, 1, 2) 63 | - Ethernet: 64 | - Model A - without ethernet 65 | - Model B - on-board ethernet 66 | - On-board HDMI: (If not connected, disabled by kernel.) 67 | - None in Zero and Zero 2: 68 | - 3.5mm headphone output 69 | - DSI - MIPI display interface 70 | - `/boot/kernel*.img` : 71 | - `/boot/kernel8.img` - 64bit 72 | - `/boot/kernel7.img` - 32bit 73 | - `/boot/kernel.img` - legacy (Zero, 1) 74 | -------------------------------------------------------------------------------- /boot/overlays/tft35a.dtbo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rern/rOS/198473d17e91fabe83adae0f885c70bfc523d08b/boot/overlays/tft35a.dtbo -------------------------------------------------------------------------------- /boot/overlays/waveshare35a.dtbo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rern/rOS/198473d17e91fabe83adae0f885c70bfc523d08b/boot/overlays/waveshare35a.dtbo -------------------------------------------------------------------------------- /boot/overlays/waveshare35b-v2.dtbo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rern/rOS/198473d17e91fabe83adae0f885c70bfc523d08b/boot/overlays/waveshare35b-v2.dtbo -------------------------------------------------------------------------------- /boot/overlays/waveshare35b.dtbo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rern/rOS/198473d17e91fabe83adae0f885c70bfc523d08b/boot/overlays/waveshare35b.dtbo -------------------------------------------------------------------------------- /boot/overlays/waveshare35c.dtbo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rern/rOS/198473d17e91fabe83adae0f885c70bfc523d08b/boot/overlays/waveshare35c.dtbo -------------------------------------------------------------------------------- /boot/wifi0: -------------------------------------------------------------------------------- 1 | # Replace NAME and PASSWORD 2 | # Save this file as 'wifi' 3 | 4 | Interface=wlan0 5 | Connection=wireless 6 | IP=dhcp 7 | Security=wpa 8 | ESSID="NAME" 9 | Key="PASSWORD" 10 | -------------------------------------------------------------------------------- /create-alarm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | trap exit INT 4 | 5 | # required packages 6 | if [[ -e /usr/bin/pacman ]]; then 7 | [[ ! -e /usr/bin/bsdtar ]] && packages+='bsdtar ' 8 | [[ ! -e /usr/bin/dialog ]] && packages+='dialog ' 9 | [[ ! -e /usr/bin/nmap ]] && packages+='nmap ' 10 | [[ ! -e /usr/bin/pv ]] && packages+='pv ' 11 | [[ $packages ]] && pacman -Sy --noconfirm $packages 12 | else 13 | [[ ! -e /usr/bin/bsdtar ]] && packages+='bsdtar libarchive-tools ' 14 | [[ ! -e /usr/bin/dialog ]] && packages+='dialog ' 15 | [[ ! -e /usr/bin/nmap ]] && packages+='nmap ' 16 | [[ ! -e /usr/bin/pv ]] && packages+='pv ' 17 | [[ $packages ]] && apt install -y $packages 18 | fi 19 | 20 | title='r A u d i o' 21 | optbox=( --colors --no-shadow --no-collapse ) 22 | opt=( --backtitle "$title" ${optbox[@]} ) 23 | #---------------------------------------------------------------------------- 24 | dialog "${optbox[@]}" --infobox " 25 | 26 | \Z1Arch Linux Arm\Z0 27 | for 28 | Raspberry Pi 29 | " 9 58 30 | sleep 2 31 | 32 | nopathcheck=$1 33 | if [[ $nopathcheck ]]; then 34 | BOOT=/mnt/BOOT 35 | ROOT=/mnt/ROOT 36 | else 37 | BOOT=$( mount | grep /dev.*BOOT | cut -d' ' -f3 ) 38 | ROOT=$( mount | grep /dev.*ROOT | cut -d' ' -f3 ) 39 | # check mounts 40 | [[ ! $BOOT ]] && warnings+=" 41 | BOOT not mounted" 42 | [[ ! $ROOT ]] && warnings+=" 43 | ROOT not mounted" 44 | if [[ ! $warnings ]]; then 45 | # check duplicate names 46 | (( $( echo "$BOOT" | wc -l ) > 1 )) && warnings+=" 47 | BOOT has more than 1" 48 | (( $( echo "$ROOT" | wc -l ) > 1 )) && warnings+=" 49 | ROOT has more than 1" 50 | # check empty to prevent wrong partitions 51 | [[ $( ls $BOOT | grep -v 'System Volume Information\|lost+found\|features' ) ]] && warnings+=" 52 | BOOT not empty" 53 | [[ $( ls $ROOT | grep -v 'lost+found' ) ]] && warnings+=" 54 | ROOT not empty" 55 | # check fstype 56 | [[ $( df --output=fstype $BOOT | tail -1 ) != vfat ]] && warnings+=" 57 | BOOT not fat32" 58 | [[ $( df --output=fstype $ROOT | tail -1 ) != ext4 ]] && warnings+="\ 59 | ROOT not ext4" 60 | fi 61 | # partition warnings 62 | if [[ $warnings ]]; then 63 | #---------------------------------------------------------------------------- 64 | dialog "${opt[@]}" --msgbox " 65 | \Z1Warnings:\Z0 66 | $warnings 67 | 68 | " 0 0 69 | exit 70 | 71 | fi 72 | fi 73 | 74 | # get build data 75 | getData() { # --menu <0=autoW dialog> <0=autoH menu> 76 | if [[ ! $nopathcheck ]]; then 77 | #---------------------------------------------------------------------------- 78 | dialog "${opt[@]}" --yesno " 79 | Confirm \Z1SD card\Z0 path: 80 | 81 | BOOT: \Z1$BOOT\Z0 82 | ROOT: \Z1$ROOT\Z0 83 | 84 | " 0 0 85 | [[ $? == 1 ]] && exit 86 | 87 | fi 88 | 89 | latest=$( curl -sL https://github.com/rern/rAudio-addons/raw/main/addonslist.json | sed -E -n '/"rAudio"/ {n;s/.*: *"(.*)"/\1/; p}' ) 90 | #---------------------------------------------------------------------------- 91 | release=$( dialog "${opt[@]}" --output-fd 1 --nocancel --inputbox " 92 | \Z1r\Z0Audio release: 93 | " 0 0 $latest ) 94 | if ! curl -sIfo /dev/null 'https://github.com/rern/rAudio/releases/tag/'$release; then 95 | echo $release not found. 96 | exit 97 | fi 98 | 99 | echo $release > $BOOT/release 100 | #---------------------------------------------------------------------------- 101 | rpi=$( dialog "${opt[@]}" --output-fd 1 --nocancel --menu " 102 | \Z1Raspberry Pi:\Z0 103 | " 8 0 0 \ 104 | 1 '64bit : 4, 3, 2, Zero 2' \ 105 | 2 '32bit : 2 (BCM2836)' ) 106 | 107 | file=ArchLinuxARM-rpi- 108 | if [[ $rpi == 1 ]]; then 109 | file+=aarch64- 110 | rpiname=64bit 111 | sboot=45 112 | else 113 | file+=armv7- 114 | rpiname=32bit 115 | sboot=60 116 | fi 117 | file+=latest.tar.gz 118 | routerip=$( ip r get 1 | head -1 | cut -d' ' -f3 ) 119 | subip=${routerip%.*}. 120 | #---------------------------------------------------------------------------- 121 | dialog "${opt[@]}" --yesno " 122 | RPi with \Z1pre-assigned\Z0 IP? 123 | 124 | " 0 0 125 | if [[ $? == 0 ]]; then 126 | #---------------------------------------------------------------------------- 127 | assignedip=$( dialog "${opt[@]}" --output-fd 1 --nocancel --inputbox " 128 | \Z1Pre-assigned\Z0 IP: 129 | " 0 0 $subip ) 130 | [[ $rpi == 1 ]] && sboot=30 || sboot=40 131 | confirmassignedip=" 132 | Assigned IP : $assignedip" 133 | fi 134 | #---------------------------------------------------------------------------- 135 | dialog --defaultno "${opt[@]}" --yesno " 136 | Connect \Z1Wi-Fi\Z0 on boot? 137 | 138 | " 0 0 139 | if [[ $? == 0 ]]; then 140 | #---------------------------------------------------------------------------- 141 | ssid=$( dialog "${opt[@]}" --output-fd 1 --nocancel --inputbox " 142 | \Z1Wi-Fi\Z0 - SSID: 143 | " 0 0 $ssid ) 144 | #---------------------------------------------------------------------------- 145 | password=$( dialog "${opt[@]}" --output-fd 1 --nocancel --inputbox " 146 | \Z1Wi-Fi\Z0 - Password: 147 | " 0 0 $password ) 148 | #---------------------------------------------------------------------------- 149 | wpa=$( dialog "${opt[@]}" --output-fd 1 --nocancel --menu " 150 | \Z1Wi-Fi\Z0 -Security: 151 | " 8 0 0 \ 152 | 1 WPA \ 153 | 2 WEP \ 154 | 3 None ) 155 | case $wpa in 156 | 1 ) wpa=wpa;; 157 | 2 ) wpa=wep;; 158 | esac 159 | confirmwifi=" 160 | SSID : \Z1$ssid\Z0 161 | Password : \Z1$password\Z0 162 | Security : \Z1${wpa^^}\Z0" 163 | fi 164 | #---------------------------------------------------------------------------- 165 | dialog "${opt[@]}" --yesno " 166 | \Z1Confirm data:\Z0 167 | 168 | \Z1r\Z0Audio 169 | Release : $release 170 | Raspberry Pi : \Z1$rpiname\Z0 171 | 172 | BOOT path : \Z1$BOOT\Z0 173 | ROOT path : \Z1$ROOT\Z0 174 | $confirmwifi 175 | $confirmassignedip 176 | " 0 0 177 | [[ $? == 1 ]] && getData 178 | } 179 | getData 180 | 181 | foundIP() { 182 | #---------------------------------------------------------------------------- 183 | ans=$( dialog "${opt[@]}" --output-fd 1 --nocancel --menu " 184 | \Z1Found IP address of RPi?\Z0 185 | " 8 30 0 \ 186 | 1 'Yes' \ 187 | 2 'Rescan' \ 188 | 3 'Ping assigned IP' \ 189 | 4 'No' ) 190 | case $ans in 191 | 2 ) scanIP;; 192 | #---------------------------------------------------------------------------- 193 | 3 ) ipping=$( dialog "${opt[@]}" --output-fd 1 --nocancel --inputbox " 194 | Ping RPi at IP: 195 | " 0 0 $subip ) 196 | pingIP 5 $ipping 197 | #---------------------------------------------------------------------------- 198 | dialog "${opt[@]}" --msgbox " 199 | $ping 200 | " 15 90 201 | foundIP 202 | ;; 203 | #---------------------------------------------------------------------------- 204 | 4 ) dialog "${opt[@]}" --msgbox " 205 | RPi IP cannot be found. 206 | Try starting over again. 207 | 208 | " 0 0 209 | clear -x && exit 210 | ;; 211 | esac 212 | } 213 | pingIP() { 214 | wait=$1 215 | ip=$2 216 | ping=$( ping -4 -c 1 -w $wait $ip | sed "s/\(. received.*loss\)/from \\\Z1\1\\\Z0/" ) 217 | if grep -q '100% packet loss' <<< "$ping"; then 218 | ping+=$'\n\n'"$ip \Z1NOT\Z0 found." 219 | else 220 | ping+=$'\n\n'"$ip \Z1found\Z0." 221 | fi 222 | } 223 | scanIP() { 224 | #---------------------------------------------------------------------------- 225 | dialog "${opt[@]}" --infobox " 226 | Scan hosts in network ... 227 | 228 | " 5 50 229 | lines=$( nmap -sn $subip* \ 230 | | grep '^Nmap scan\|^MAC' \ 231 | | paste -sd ' \n' \ 232 | | grep 'MAC Address' \ 233 | | sed -e 's/Nmap.*for \|MAC Address//g' -e '/Raspberry Pi/ {s/^/\\Z1/; s/$/\\Z0/}' \ 234 | | tac ) 235 | #---------------------------------------------------------------------------- 236 | dialog "${opt[@]}" --msgbox " 237 | \Z1Find IP address of Raspberry Pi:\Z0 238 | (If Raspberri Pi not listed, ping may find it.) 239 | \Z4[arrowdown] = scrolldown\Z0 240 | 241 | $lines 242 | 243 | " 25 80 244 | 245 | foundIP 246 | } 247 | sshRpi() { 248 | ip=$1 249 | sed -i "/$ip/ d" ~/.ssh/known_hosts 250 | for i in 1 2 3; do 251 | ssh -tt -o StrictHostKeyChecking=no root@$ip /root/create-ros.sh 252 | if [[ $? == 0 ]]; then 253 | exit 254 | else 255 | sleep 3 256 | fi 257 | done 258 | scanIP 259 | } 260 | 261 | # features 262 | bluealsa='\Z1BlueALSA\Z0 - Bluetooth audio' 263 | camilla='\Z1CamillaDSP\Z0 - Digital signal processor' 264 | browser='\Z1Firefox\Z0 - Browser on RPi screen' 265 | iwd='\Z1iwd\Z0 - RPi access point' 266 | samba='\Z1Samba\Z0 - File sharing' 267 | shairport='\Z1Shairport\Z0 - AirPlay renderer' 268 | snapcast='\Z1Snapcast\Z0 - Synchronous multiroom player' 269 | spotify='\Z1Spotifyd\Z0 - Spotify renderer' 270 | upmpdcli='\Z1upmpdcli\Z0 - UPnP renderer' 271 | 272 | 273 | selectFeatures() { # --checklist <0=autoW dialog> <0=autoH checklist> 274 | #---------------------------------------------------------------------------- 275 | select=$( dialog "${opt[@]}" --output-fd 1 --nocancel --checklist " 276 | \Z1Select features to install: 277 | \Z4[space] = Select / Deselect\Z0 278 | " 9 0 0 \ 279 | 1 "$bluealsa" on \ 280 | 2 "$camilla" on \ 281 | 3 "$browser" on \ 282 | 4 "$iwd" on \ 283 | 5 "$samba" on \ 284 | 6 "$shairport" on \ 285 | 7 "$snapcast" on \ 286 | 8 "$spotify" on \ 287 | 9 "$upmpdcli" on ) 288 | 289 | select=" $select " 290 | [[ $select == *' 1 '* ]] && list+="$bluealsa"$'\n' && features+='bluealsa bluez bluez-utils python-dbus python-gobject python-requests ' 291 | [[ $select == *' 2 '* ]] && list+="$camilla"$'\n' && features+='camilladsp python-websocket-client ' 292 | [[ $select == *' 3 '* ]] && list+="$browser"$'\n' && features+='firefox matchbox-window-manager plymouth-lite-rbp-git upower xf86-video-fbturbo ' 293 | [[ $select == *' 4 '* ]] && list+="$iwd"$'\n' && features+='iwd ' 294 | [[ $select == *' 5 '* ]] && list+="$samba"$'\n' && features+='samba ' 295 | [[ $select == *' 6 '* ]] && list+="$shairport"$'\n' && features+='shairport-sync ' 296 | [[ $select == *' 7 '* ]] && list+="$snapcast"$'\n' && features+='snapcast ' 297 | [[ $select == *' 8 '* ]] && list+="$spotify"$'\n' && features+='spotifyd ' 298 | [[ $select == *' 9 '* ]] && list+="$upmpdcli"$'\n' && features+='upmpdcli python-upnpp ' 299 | } 300 | selectFeatures 301 | 302 | [[ ! $list ]] && list=(none) 303 | #---------------------------------------------------------------------------- 304 | dialog "${opt[@]}" --yesno " 305 | Confirm features to install: 306 | 307 | $list 308 | 309 | " 0 0 310 | 311 | if [[ $? == 0 ]]; then 312 | echo $features > $BOOT/features 313 | else 314 | selectFeatures 315 | fi 316 | 317 | SECONDS=0 318 | 319 | # package mirror server 320 | readarray -t lines <<< $( curl -skL https://github.com/archlinuxarm/PKGBUILDs/raw/master/core/pacman-mirrorlist/mirrorlist \ 321 | | sed -E -n '/^### Mirror/,$ {/^\s*$|^### Mirror/ d; s|.*//(.*)\.mirror.*|\1|; p}' ) 322 | clist=( 0 'Auto (By Geo-IP)' ) 323 | codelist=( 0 ) 324 | i=0 325 | for line in "${lines[@]}"; do 326 | if [[ ${line:0:4} == '### ' ]];then 327 | city= 328 | country=${line:4} 329 | elif [[ ${line:0:3} == '## ' ]];then 330 | city=${line:3} 331 | else 332 | [[ $city ]] && cc="$country - $city" || cc=$country 333 | [[ $cc == $ccprev ]] && cc+=' 2' 334 | ccprev=$cc 335 | (( i++ )) 336 | clist+=( $i "$cc" ) 337 | codelist+=( $line ) 338 | fi 339 | done 340 | #---------------------------------------------------------------------------- 341 | code=$( dialog "${opt[@]}" --output-fd 1 --nocancel --menu " 342 | \Z1Package mirror server:\Z0 343 | " 0 0 0 \ 344 | "${clist[@]}" ) 345 | mirror=${codelist[$code]} 346 | [[ $mirror == 0 ]] && url=http://os.archlinuxarm.org/os || url=http://$mirror.mirror.archlinuxarm.org/os 347 | 348 | # if already downloaded, verify latest 349 | if [[ -e $file ]]; then 350 | #---------------------------------------------------------------------------- 351 | curl -skLO $url/$file.md5 \ 352 | | dialog "${opt[@]}" --gauge " 353 | Verify already downloaded file ... 354 | " 9 50 355 | md5sum --quiet -c $file.md5 || rm $file 356 | fi 357 | 358 | # download 359 | if [[ -e $file ]]; then 360 | #---------------------------------------------------------------------------- 361 | dialog "${opt[@]}" --infobox " 362 | Existing is the latest: 363 | \Z1$file\Z0 364 | 365 | No download required. 366 | 367 | " 0 0 368 | sleep 2 369 | else 370 | #---------------------------------------------------------------------------- 371 | ( wget -O $file $url/$file 2>&1 \ 372 | | stdbuf -o0 awk '/[.] +[0-9][0-9]?[0-9]?%/ { \ 373 | print "XXX\n "substr($0,63,3) 374 | print "\\n Download" 375 | print "\\n \\Z1'$file'\\Z0" 376 | print "\\n Time left: "substr($0,74,5)"\nXXX" }' ) \ 377 | | dialog "${opt[@]}" --gauge " 378 | Connecting ... 379 | " 9 50 380 | # checksum 381 | curl -skLO $url/$file.md5 382 | if ! md5sum -c $file.md5; then 383 | rm $file 384 | #---------------------------------------------------------------------------- 385 | dialog "${opt[@]}" --msgbox " 386 | \Z1Download incomplete!\Z0 387 | 388 | Run \Z1./create-alarm.sh\Z0 again. 389 | 390 | " 0 0 391 | exit 392 | fi 393 | fi 394 | 395 | rm $file.md5 396 | 397 | # expand 398 | #---------------------------------------------------------------------------- 399 | ( pv -n $file \ 400 | | bsdtar -C $ROOT -xpf - ) 2>&1 \ 401 | | dialog "${opt[@]}" --gauge " 402 | Decompress 403 | \Z1$file\Z0 ... 404 | " 9 50 405 | 406 | sync & 407 | 408 | Sstart=$( date +%s ) 409 | dirty=$( awk '/Dirty:/{print $2}' /proc/meminfo ) 410 | #---------------------------------------------------------------------------- 411 | ( while (( $( awk '/Dirty:/{print $2}' /proc/meminfo ) > 1000 )); do 412 | left=$( awk '/Dirty:/{print $2}' /proc/meminfo ) 413 | echo $(( $(( dirty - left )) * 100 / dirty )) 414 | sleep 2 415 | done ) \ 416 | | dialog "${opt[@]}" --gauge " 417 | Write to SD card 418 | \Z1$file\Z0 ... 419 | " 9 50 420 | 421 | sync 422 | 423 | # fstab 424 | partuuidBOOT=$( blkid | awk '/LABEL="BOOT"/ {print $NF}' | tr -d '"' ) 425 | partuuidROOT=${partuuidBOOT:0:-1}2 426 | echo "\ 427 | $partuuidBOOT /boot vfat defaults,noatime 0 0 428 | $partuuidROOT / ext4 defaults,noatime 0 0" > $ROOT/etc/fstab 429 | 430 | # cmdline.txt, config.txt 431 | cmdline="root=$partuuidROOT rw rootwait plymouth.enable=0 dwc_otg.lpm_enable=0 ipv6.disable=1 fsck.repair=yes isolcpus=3 console=" 432 | [[ $features != *matchbox* ]] && cmdline+='tty1' || cmdline+='tty3 quiet loglevel=0 logo.nologo vt.global_cursor_default=0' 433 | config="\ 434 | disable_overscan=1 435 | disable_splash=1 436 | dtparam=audio=on 437 | hdmi_force_hotplug=1" 438 | [[ $features != *firefox* ]] && config=$( sed '/^hdmi/ d' <<< $config ) 439 | mv $ROOT/boot/* $BOOT 440 | echo $cmdline > $BOOT/cmdline.txt0 441 | echo "$config" > $BOOT/config.txt0 442 | 443 | # wifi 444 | if [[ $ssid ]]; then 445 | profile=$ROOT/etc/netctl/$ssid 446 | echo 'Interface=wlan0 447 | Connection=wireless 448 | IP=dhcp 449 | ESSID="'$ssid'" 450 | Security='$wpa' 451 | Key="'$password'"' > $profile 452 | [[ ! $wpa ]] && sed -E -i '/^Security|^Key/ d' "$profile" 453 | dir="$ROOT/etc/systemd/system/netctl@$ssid.service.d" 454 | mkdir -p $dir 455 | echo "\ 456 | [Unit] 457 | BindsTo=sys-subsystem-net-devices-wlan0.device 458 | After=sys-subsystem-net-devices-wlan0.device" > "$dir/profile.conf" 459 | ln -sr $ROOT/usr/lib/systemd/system/netctl@.service "$ROOT/etc/systemd/system/multi-user.target.wants/netctl@$ssid.service" 460 | fi 461 | 462 | # dhcpd - disable arp 463 | echo noarp >> $ROOT/etc/dhcpcd.conf 464 | 465 | # mirror server 466 | [[ $mirror != 0 ]] && sed -i '/^Server/ s|//.*mirror|//'$mirror'.mirror|' $ROOT/etc/pacman.d/mirrorlist 467 | 468 | # fix dns errors 469 | echo DNSSEC=no >> $ROOT/etc/systemd/resolved.conf 470 | 471 | # fix: time not sync on wlan 472 | files=$( ls $ROOT/etc/systemd/network/* ) 473 | for file in $files; do 474 | ! grep -q RequiredForOnline=no $file && echo ' 475 | [Link] 476 | RequiredForOnline=no' >> $file 477 | done 478 | 479 | # disable wait-online 480 | rm -r $ROOT/etc/systemd/system/network-online.target.wants 481 | 482 | # fix: long wait login 483 | sed -i '/^-.*pam_systemd/ s/^/#/' $ROOT/etc/pam.d/system-login 484 | 485 | # ssh - root login, blank password 486 | sed -i -e 's/#\(PermitRootLogin \).*/\1yes/ 487 | ' -e 's/#\(PermitEmptyPasswords \).*/\1yes/ 488 | ' $ROOT/etc/ssh/sshd_config 489 | 490 | # set root password 491 | id=$( awk -F':' '/^root/ {print $3}' $ROOT/etc/shadow ) 492 | sed -i "s/^root.*/root::$id::::::/" $ROOT/etc/shadow 493 | 494 | # get create-ros.sh 495 | createrosfile=$ROOT/root/create-ros.sh 496 | curl -skL https://github.com/rern/rOS/raw/main/create-ros.sh -o $createrosfile 497 | chmod 755 $createrosfile 498 | 499 | #---------------------------------------------------------------------------- 500 | dialog "${optbox[@]}" --msgbox " 501 | 502 | Arch Linux Arm 503 | for 504 | \Z1Raspberry Pi $rpiname\Z0 505 | Created successfully. 506 | 507 | $( date -d@$SECONDS -u +%M:%S ) 508 | " 12 58 509 | 510 | umount -l $BOOT 511 | umount -l $ROOT 512 | 513 | [[ ${partuuidBOOT:0:-3} != ${partuuidROOT:0:-3} ]] && usb=' and USB drive' 514 | #---------------------------------------------------------------------------- 515 | dialog "${optbox[@]}" --msgbox " 516 | \Z1Arch Linux Arm\Z0 is ready. 517 | 518 | \Z1BOOT\Z0 and \Z1ROOT\Z0 have been unmounted. 519 | 520 | - Move micro SD card$usb to RPi > Power on 521 | - Press \Z1Enter\Z0 to start boot timer > IP scan 522 | 523 | " 13 55 524 | 525 | title='r A u d i o - Connect to Raspberry Pi' 526 | opt=( --backtitle "$title" ${optbox[@]} ) 527 | #---------------------------------------------------------------------------- 528 | ( for (( i = 1; i < sboot; i++ )); do 529 | echo $(( i * 100 / sboot )) 530 | sleep 1 531 | done ) \ 532 | | dialog "${opt[@]}" --gauge " 533 | Boot ... 534 | \Z1Arch Linux Arm\Z0 535 | " 9 50 536 | 537 | if [[ $assignedip ]]; then 538 | #---------------------------------------------------------------------------- 539 | ( for i in {1..10}; do 540 | cat < /dev/null && break 548 | sleep 3 549 | done ) \ 550 | | dialog "${opt[@]}" --gauge '' 9 50 551 | if ping -4 -c 1 -w 1 $assignedip &> /dev/null; then 552 | dialog "${opt[@]}" --infobox " 553 | SSH Arch Linux Arm ... 554 | @ \Z1$assignedip\Z0 555 | " 9 50 556 | sleep 3 557 | sshRpi $assignedip 558 | else 559 | scanIP 560 | fi 561 | else 562 | scanIP 563 | fi 564 | 565 | # connect RPi 566 | #---------------------------------------------------------------------------- 567 | rpiip=$( dialog "${opt[@]}" --output-fd 1 --cancel-label Rescan --inputbox " 568 | \Z1Raspberry Pi IP:\Z0 569 | 570 | " 0 0 $subip ) 571 | [[ $? == 1 ]] && scanIP 572 | 573 | sshRpi $rpiip 574 | -------------------------------------------------------------------------------- /create-ros.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | trap exit INT 4 | 5 | SECONDS=0 6 | 7 | features=$( cat /boot/features ) 8 | 9 | banner() { 10 | echo 11 | def='\e[0m' 12 | bg='\e[44m' 13 | printf "$bg%*s$def\n" $COLUMNS 14 | printf "$bg%-${COLUMNS}s$def\n" " $1" 15 | printf "$bg%*s$def\n" $COLUMNS 16 | } 17 | #---------------------------------------------------------------------------- 18 | banner 'Initialize Arch Linux Arm ...' 19 | 20 | pacman-key --init 21 | pacman-key --populate archlinuxarm 22 | systemctl restart systemd-timesyncd # force time sync 23 | 24 | rm -f /var/lib/pacman/db.lck # in case of rerun 25 | 26 | # fill entropy pool (fix - Kernel entropy pool is not initialized) 27 | systemctl start systemd-random-seed 28 | 29 | title='r A u d i o' 30 | optbox=( --colors --no-shadow --no-collapse ) 31 | opt=( --backtitle "$title" ${optbox[@]} ) 32 | #---------------------------------------------------------------------------- 33 | dialog "${optbox[@]}" --infobox " 34 | 35 | 36 | \Z1r\Z0Audio 37 | " 9 58 38 | sleep 2 39 | 40 | clear -x # needed: fix stdout not scroll 41 | #---------------------------------------------------------------------------- 42 | banner 'Upgrade system and default packages ...' 43 | 44 | packages='alsaequal alsa-utils cava cronie cd-discid dosfstools dtc evtest gifsicle 45 | hdparm hfsprogs i2c-tools imagemagick inetutils iwd jq kid3-common libgpiod mmc-utils mpc mpd mpd_oled nfs-utils nginx-mainline nss-mdns 46 | parted php-fpm python-rpi-gpio python-rplcd python-smbus2 python-websocket-client python-websockets sudo udevil websocat wget ' 47 | 48 | if [[ -e /boot/kernel8.img ]]; then 49 | pacman -R --noconfirm linux-aarch64 uboot-raspberrypi 50 | packages+='linux-rpi raspberrypi-utils ' 51 | fi 52 | 53 | # add +R repo 54 | if ! grep -q '^\[+R\]' /etc/pacman.conf; then 55 | sed -i -e '/community/,/^$/ d 56 | ' -e '/aur/,/^$/ d 57 | ' -e '/core/ i\ 58 | [+R]\ 59 | SigLevel = Optional TrustAll\ 60 | Server = https://rern.github.io/$arch\ 61 | ' /etc/pacman.conf 62 | fi 63 | 64 | pacman -Syu --noconfirm 65 | if [[ $? != 0 ]]; then 66 | echo -e "\e[38;5;0m\e[48;5;3m ! \e[0m Retry upgrade system ..." 67 | sleep 3 68 | pacman -Syu --noconfirm 69 | if [[ $? != 0 ]]; then 70 | echo -e "\e[38;5;7m\e[48;5;1m ! \e[0m System upgrade incomplete." 71 | exit 72 | fi 73 | fi 74 | 75 | if [[ -e /boot/cmdline.txt0 ]]; then 76 | mv -f /boot/cmdline.txt{0,} 77 | mv -f /boot/config.txt{0,} 78 | fi 79 | # usb boot - disable sd card polling 80 | ! df | grep -q /dev/mmcblk && echo 'dtoverlay=sdtweak,poll_once' >> /boot/config.txt 81 | #---------------------------------------------------------------------------- 82 | banner 'Install packages ...' 83 | 84 | pacman -S --noconfirm --needed $packages $features 85 | if [[ $? != 0 ]]; then 86 | echo -e "\e[38;5;0m\e[48;5;3m ! \e[0m Retry download packages ..." 87 | pacman -S --noconfirm --needed $packages $features 88 | if [[ $? != 0 ]]; then 89 | echo -e "\e[38;5;7m\e[48;5;1m ! \e[0m Packages download incomplete." 90 | exit 91 | 92 | fi 93 | fi 94 | #---------------------------------------------------------------------------- 95 | banner 'Get configurations and user interface ...' 96 | 97 | mkdir -p /tmp/config 98 | release=$( cat /boot/release ) 99 | curl -skL https://github.com/rern/rAudio/archive/$release.tar.gz | bsdtar xvf - --strip 1 -C /tmp/config 100 | curl -skL https://github.com/rern/rOS/archive/main.tar.gz | bsdtar xvf - --strip 1 -C /tmp/config 101 | rm -f /tmp/config/{.*,*} 102 | 103 | chmod -R go-wx /tmp/config 104 | chmod -R u+rwX,go+rX /tmp/config 105 | cp -r /tmp/config/* / 106 | chown http:http /etc/fstab 107 | chown -R http:http /etc/netctl /etc/systemd/network 108 | dirbash=/srv/http/bash 109 | chmod -R 755 $dirbash 110 | 111 | mkdir /srv/http/assets/img/guide 112 | curl -skL https://github.com/rern/_assets/raw/master/guide/guide.tar.xz | bsdtar xf - -C /srv/http/assets/img/guide 113 | #--------------------------------------------------------------------------------- 114 | banner 'Configure ...' 115 | 116 | # alsa 117 | alsactl store 118 | # bluetooth 119 | if [[ -e /usr/bin/bluetoothctl ]]; then 120 | sed -i 's/#*\(AutoEnable=\).*/\1true/' /etc/bluetooth/main.conf 121 | else 122 | rm -rf /etc/systemd/system/{bluealsa,bluetooth}.service.d 123 | rm -f /etc/systemd/system/blue* 124 | fi 125 | # camilladsp 126 | if [[ -e /usr/bin/camilladsp ]]; then 127 | sed -i '/^CONFIG/ s|etc|srv/http/data|' /etc/default/camilladsp 128 | dirconfigs=/srv/http/data/camilladsp/configs 129 | mkdir -p $dirconfigs 130 | sed -e '/ Volume:/,/type: Volume/ d 131 | ' -e '/- Volume/ d 132 | ' /etc/camilladsp/configs/camilladsp.yml > $dirconfigs/camilladsp.yml 133 | else 134 | rm -f /srv/http/data/mpdconf/conf/camilladsp.conf 135 | fi 136 | # cava 137 | ln -s /etc/cava.conf /root/.config/cava 138 | # cron - for addons updates 139 | echo "00 01 * * * $dirbash/settings/addons-data.sh" | crontab - 140 | echo VISUAL=nano >> /etc/environment 141 | # firefox 142 | if [[ -e /usr/bin/firefox ]]; then 143 | echo MOZ_USE_XINPUT2 DEFAULT=1 >> /etc/security/pam_env.conf # fix touch scroll 144 | chmod 775 /etc/X11/xorg.conf.d # fix permission for rotate file 145 | mv /usr/share/X11/xorg.conf.d/{10,45}-evdev.conf # reorder 146 | timeout 1 firefox --headless &> /dev/null # init /root/.mozilla/firefox 147 | profile=$( ls /root/.mozilla/firefox | grep release$ ) 148 | systemctl disable getty@tty1 # disable login prompt 149 | systemctl enable bootsplash localbrowser 150 | else 151 | rm -f /etc/systemd/system/{bootsplash,localbrowser}* 152 | rm -rf /etc/X11 153 | fi 154 | # initramfs disable 155 | dirhooks=/etc/pacman.d/hooks 156 | mkdir -p $dirhooks 157 | for file in linux-rpi mkinitcpio-install; do 158 | ln -s /dev/null $dirhooks/90-$file.hook 159 | done 160 | # iwd 161 | if [[ -e /usr/bin/iwctl ]]; then 162 | mkdir -p /var/lib/iwd/ap 163 | echo "\ 164 | [Security] 165 | Passphrase=raudioap 166 | 167 | [IPv4] 168 | Address=192.168.5.1 169 | " > /var/lib/iwd/ap/rAudio.ap 170 | groupadd netdev # fix: group for iwd 171 | else 172 | rm -f /etc/iwd/main.conf 173 | fi 174 | # locale 175 | if ! locale | grep -q -m1 ^LANG=C.UTF-8; then 176 | if ! grep -q ^C.UTF-8 /etc/locale.gen; then 177 | echo 'C.UTF-8 UTF-8' >> /etc/locale.gen 178 | locale-gen 179 | fi 180 | localectl set-locale LANG=C.UTF-8 181 | fi 182 | # mpd 183 | chsh -s /bin/bash mpd 184 | # motd 185 | ln -sf $dirbash/motd.sh /etc/profile.d/ 186 | # pam - fix freedesktop.home1.service not found (upgrade somehow overwrite) 187 | sed -i '/^-.*pam_systemd_home/ s/^/#/' /etc/pam.d/system-auth 188 | # password 189 | echo root:ros | chpasswd 190 | # samba 191 | if [[ -e /usr/bin/smbd ]]; then 192 | ( echo ros; echo ros ) | smbpasswd -s -a root 193 | else 194 | rm -rf /etc/samba 195 | fi 196 | # shairport-sync 197 | if [[ ! -e /usr/bin/shairport-sync ]]; then 198 | rm /etc/shairport-sync.conf /etc/systemd/system/shairport.service 199 | rm -rf /etc/systemd/system/shairport-sync.service.d/ 200 | fi 201 | # snapcast 202 | if [[ -e /usr/bin/snapserver ]]; then 203 | sed -i '/^#bind_to_address/ a\ 204 | bind_to_address = 0.0.0.0 205 | ' /etc/snapserver.conf 206 | fi 207 | # spotifyd 208 | if [[ -e /usr/bin/spotifyd ]]; then 209 | ln -s /lib/systemd/{user,system}/spotifyd.service 210 | else 211 | rm /etc/spotifyd.conf /etc/systemd/system/spotifyd.service 212 | fi 213 | # sshd 214 | sed -i -e 's/\(PermitEmptyPasswords \).*/#\1no/ 215 | ' -e 's/.*\(PrintLastLog \).*/\1no/ 216 | ' /etc/ssh/sshd_config 217 | echo '. /srv/http/bash/bashrc' >> /etc/bash.bashrc # prompt 218 | # user 219 | users=$( cut -d: -f1 /etc/passwd ) 220 | for user in $users; do 221 | chage -E -1 $user # set expire to none 222 | done 223 | # upmpdcli 224 | if [[ -e /usr/bin/upmpdcli ]]; then 225 | dir=/var/cache/upmpdcli/ohcreds 226 | file=$dir/credkey.pem 227 | mkdir -p $dir 228 | openssl genrsa -out $file 4096 229 | openssl rsa -in $file -RSAPublicKey_out 230 | chown upmpdcli:root $file 231 | else 232 | rm -rf /etc/upmpdcli.conf /etc/systemd/system/upmpdcli.service 233 | fi 234 | # wireless-regdom 235 | echo 'WIRELESS_REGDOM="00"' > /etc/conf.d/wireless-regdom 236 | # default startup services 237 | systemctl daemon-reload 238 | systemctl enable avahi-daemon cronie devmon@http nginx php-fpm startup websocket 239 | 240 | #--------------------------------------------------------------------------------- 241 | # data - settings directories 242 | $dirbash/settings/system-datadefault.sh $release 243 | # flag expand partition 244 | touch /boot/expand 245 | [[ -e /boot/finish.sh ]] && . /boot/finish.sh 246 | rm -f /boot/{features,finish.sh,release} \ 247 | /boot/{cmdline,config}.txt.pacnew \ 248 | /root/create-ros.sh 249 | #---------------------------------------------------------------------------- 250 | dialog "${optbox[@]}" --infobox " 251 | 252 | \Z1r\Z0Audio created successfully. 253 | 254 | \Z1Reboot\Z0 ... 255 | 256 | $( date -d@$SECONDS -u +%M:%S ) 257 | " 9 58 258 | 259 | shutdown -r now 260 | -------------------------------------------------------------------------------- /create.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | trap exit INT 4 | 5 | optbox=( --colors --no-shadow --no-collapse ) 6 | 7 | dialog "${optbox[@]}" --infobox " 8 | 9 | \Z1Partition Micro SD Card\Z0 10 | for 11 | Arch Linux Arm 12 | " 9 58 13 | sleep 2 14 | 15 | dialog "${optbox[@]}" --msgbox " 16 | \Z1Insert micro SD card\Z0 17 | 18 | If already inserted: 19 | For proper detection, remove and reinsert again. 20 | 21 | " 0 0 22 | 23 | deviceLine() { 24 | devline=$( dmesg \ 25 | | tail -15 \ 26 | | grep ' sd.* GiB\|mmcblk.* GiB' \ 27 | | tail -1 ) 28 | } 29 | deviceLine 30 | [[ ! $devline ]] && sleep 2 && deviceLine 31 | if [[ ! $devline ]]; then 32 | dialog "${optbox[@]}" --infobox " 33 | \Z1No SD card found.\Z0 34 | 35 | " 0 0 36 | exit 37 | fi 38 | 39 | if [[ $devline == *\[sd?\]* ]]; then 40 | name=$( echo $devline | sed -E 's|.*\[(.*)\].*|\1|' ) 41 | dev=/dev/$name 42 | partboot=${dev}1 43 | partroot=${dev}2 44 | else 45 | name=$( echo $devline | sed -E 's/.*] (.*): .*/\1/' ) 46 | dev=/dev/$name 47 | partboot=${dev}p1 48 | partroot=${dev}p2 49 | fi 50 | 51 | list=$( lsblk -o name,size,mountpoint | sed "/^$name/ {s/^/\\\Z1/; s/$/\\\Z0/}" ) 52 | dialog "${optbox[@]}" --yesno " 53 | Device list: 54 | $list 55 | 56 | Warning: 57 | Make sure this is the target SD card. 58 | \Z1All data on this device will be deleted.\Z0 59 | 60 | Continue formatting: 61 | $( echo "$list" | grep '\\Z1' ) 62 | 63 | " 0 0 64 | 65 | [[ $? != 0 ]] && exit 66 | 67 | clear -x 68 | 69 | umount $partboot $partroot 2> /dev/null 70 | 71 | wipefs -a $dev 72 | # setup partitions - create partitions with gparted > get parameters: sfdisk -d /dev/mmcblk0 | grep ^/dev 73 | echo "\ 74 | $partboot : start= 2048, size= 409600, type=b 75 | $partroot : start= 411648, size= 13107200, type=83 76 | " | sfdisk $dev 77 | 78 | umount $partboot $partroot 2> /dev/null 79 | 80 | mkfs.fat -F 32 $partboot 81 | mkfs.ext4 -F $partroot 82 | 83 | fsck.fat -a $partboot 84 | e2fsck -p $partroot 85 | 86 | fatlabel $partboot BOOT 87 | e2label $partroot ROOT 88 | 89 | mkdir -p /mnt/{BOOT,ROOT} 90 | mount $partboot /mnt/BOOT 91 | mount $partroot /mnt/ROOT 92 | 93 | bash <( curl -sL https://github.com/rern/rOS/raw/main/create-alarm.sh ) nopathcheck 94 | -------------------------------------------------------------------------------- /etc/X11/lcd0: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "calibration" 3 | MatchProduct "ADS7846 Touchscreen" 4 | Option "Calibration" "571 3757 363 3904" 5 | EndSection 6 | -------------------------------------------------------------------------------- /etc/X11/lcd180: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "calibration" 3 | MatchProduct "ADS7846 Touchscreen" 4 | Option "Calibration" "3740 509 3909 241" 5 | EndSection 6 | -------------------------------------------------------------------------------- /etc/X11/lcd270: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "calibration" 3 | MatchProduct "ADS7846 Touchscreen" 4 | Option "Calibration" "311 3917 3810 449" 5 | Option "SwapAxes" "1" 6 | EndSection 7 | -------------------------------------------------------------------------------- /etc/X11/lcd90: -------------------------------------------------------------------------------- 1 | Section "InputClass" 2 | Identifier "calibration" 3 | MatchProduct "ADS7846 Touchscreen" 4 | Option "Calibration" "3878 317 558 3842" 5 | Option "SwapAxes" "1" 6 | EndSection 7 | -------------------------------------------------------------------------------- /etc/X11/xinit/rotateconf: -------------------------------------------------------------------------------- 1 | Section "Device" 2 | Identifier "RpiFB" 3 | Driver "fbdev" 4 | Option "rotate" "ROTATION_SETTING" 5 | EndSection 6 | 7 | Section "InputClass" 8 | Identifier "Touchscreen" 9 | Driver "libinput" 10 | MatchIsTouchscreen "on" 11 | MatchDevicePath "/dev/input/event*" 12 | Option "calibrationmatrix" "MATRIX_SETTING" 13 | EndSection 14 | 15 | Section "Monitor" 16 | Identifier "generic" 17 | EndSection 18 | 19 | Section "Screen" 20 | Identifier "screen1" 21 | Device "RpiFB" 22 | Monitor "generic" 23 | EndSection 24 | 25 | Section "ServerLayout" 26 | Identifier "slayo1" 27 | Screen "screen1" 28 | EndSection 29 | -------------------------------------------------------------------------------- /etc/avahi/services/ros.service: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %h 5 | 6 | _http._tcp 7 | 80 8 | 9 | 10 | -------------------------------------------------------------------------------- /etc/cava.conf: -------------------------------------------------------------------------------- 1 | [general] 2 | bars = 1 3 | 4 | [input] 5 | method = fifo 6 | source = /tmp/mpd.fifo 7 | 8 | [output] 9 | method = raw 10 | channels = mono 11 | mono_option = average 12 | data_format = ascii 13 | ascii_max_range = 42 14 | -------------------------------------------------------------------------------- /etc/conf.d/devmon: -------------------------------------------------------------------------------- 1 | ARGS='--exec-on-drive "/usr/bin/sudo /srv/http/bash/settings/system.sh usbconnect" --exec-on-remove "/usr/bin/sudo /srv/http/bash/settings/system.sh usbremove"' 2 | -------------------------------------------------------------------------------- /etc/iwd/main.conf: -------------------------------------------------------------------------------- 1 | [General] 2 | EnableNetworkConfiguration=true 3 | 4 | [Scan] 5 | DisablePeriodicScan=true 6 | 7 | [Network] 8 | EnableIPv6=false 9 | -------------------------------------------------------------------------------- /etc/mime.types: -------------------------------------------------------------------------------- 1 | 2 | types { 3 | text/html html htm shtml; 4 | text/css css; 5 | text/xml xml; 6 | image/gif gif; 7 | image/jpeg jpeg jpg; 8 | application/javascript js; 9 | application/atom+xml atom; 10 | application/rss+xml rss; 11 | 12 | text/mathml mml; 13 | text/plain txt; 14 | text/vnd.sun.j2me.app-descriptor jad; 15 | text/vnd.wap.wml wml; 16 | text/x-component htc; 17 | 18 | image/png png; 19 | image/svg+xml svg svgz; 20 | image/tiff tif tiff; 21 | image/vnd.wap.wbmp wbmp; 22 | image/webp webp; 23 | image/x-icon ico; 24 | image/x-jng jng; 25 | image/x-ms-bmp bmp; 26 | 27 | font/woff woff; 28 | font/woff2 woff2; 29 | 30 | application/java-archive jar war ear; 31 | application/json json; 32 | application/mac-binhex40 hqx; 33 | application/msword doc; 34 | application/pdf pdf; 35 | application/postscript ps eps ai; 36 | application/rtf rtf; 37 | application/vnd.apple.mpegurl m3u8; 38 | application/vnd.google-earth.kml+xml kml; 39 | application/vnd.google-earth.kmz kmz; 40 | application/vnd.ms-excel xls; 41 | application/vnd.ms-fontobject eot; 42 | application/vnd.ms-powerpoint ppt; 43 | application/vnd.oasis.opendocument.graphics odg; 44 | application/vnd.oasis.opendocument.presentation odp; 45 | application/vnd.oasis.opendocument.spreadsheet ods; 46 | application/vnd.oasis.opendocument.text odt; 47 | application/vnd.openxmlformats-officedocument.presentationml.presentation 48 | pptx; 49 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet 50 | xlsx; 51 | application/vnd.openxmlformats-officedocument.wordprocessingml.document 52 | docx; 53 | application/vnd.wap.wmlc wmlc; 54 | application/x-7z-compressed 7z; 55 | application/x-cocoa cco; 56 | application/x-java-archive-diff jardiff; 57 | application/x-java-jnlp-file jnlp; 58 | application/x-makeself run; 59 | application/x-perl pl pm; 60 | application/x-pilot prc pdb; 61 | application/x-rar-compressed rar; 62 | application/x-redhat-package-manager rpm; 63 | application/x-sea sea; 64 | application/x-shockwave-flash swf; 65 | application/x-stuffit sit; 66 | application/x-tcl tcl tk; 67 | application/x-x509-ca-cert der pem crt; 68 | application/x-xpinstall xpi; 69 | application/xhtml+xml xhtml; 70 | application/xspf+xml xspf; 71 | application/zip zip; 72 | 73 | application/octet-stream bin exe dll; 74 | application/octet-stream deb; 75 | application/octet-stream dmg; 76 | application/octet-stream iso img; 77 | application/octet-stream msi msp msm; 78 | 79 | audio/midi mid midi kar; 80 | audio/mpeg mp3; 81 | audio/ogg ogg; 82 | audio/x-m4a m4a; 83 | audio/x-realaudio ra; 84 | 85 | video/3gpp 3gpp 3gp; 86 | video/mp2t ts; 87 | video/mp4 mp4; 88 | video/mpeg mpeg mpg; 89 | video/quicktime mov; 90 | video/webm webm; 91 | video/x-flv flv; 92 | video/x-m4v m4v; 93 | video/x-mng mng; 94 | video/x-ms-asf asx asf; 95 | video/x-ms-wmv wmv; 96 | video/x-msvideo avi; 97 | } 98 | -------------------------------------------------------------------------------- /etc/modprobe.d/brcmfmac.conf: -------------------------------------------------------------------------------- 1 | options brcmfmac feature_disable=0x82000 2 | -------------------------------------------------------------------------------- /etc/modules-load.d/ntfs3.conf: -------------------------------------------------------------------------------- 1 | ntfs3 2 | -------------------------------------------------------------------------------- /etc/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user root; 2 | worker_processes 1; 3 | 4 | events { 5 | worker_connections 1024; 6 | } 7 | 8 | http { 9 | include /etc/mime.types; 10 | default_type application/octet-stream; 11 | sendfile on; 12 | keepalive_timeout 65; 13 | client_max_body_size 200M; 14 | 15 | server { 16 | listen 80; 17 | server_name localhost; 18 | access_log /dev/null; 19 | 20 | location / { 21 | root /srv/http; 22 | index index.php index.html index.htm; 23 | } 24 | 25 | # php-fpm 26 | location ~ \.php$ { 27 | root /srv/http; 28 | include fastcgi_params; 29 | fastcgi_buffers 16 16k; 30 | fastcgi_buffer_size 32k; 31 | fastcgi_busy_buffers_size 32k; 32 | fastcgi_index index.php; 33 | fastcgi_param SCRIPT_FILENAME $request_filename; 34 | fastcgi_pass unix:/run/php-fpm/php-fpm.sock; 35 | fastcgi_read_timeout 3600; 36 | proxy_buffers 4 256k; 37 | proxy_buffer_size 128k; 38 | proxy_busy_buffers_size 256k; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /etc/pacman.d/hooks/90-systemd-update.hook: -------------------------------------------------------------------------------- 1 | [Trigger] 2 | Type = Path 3 | Operation = Install 4 | Operation = Upgrade 5 | Operation = Remove 6 | Target = usr/ 7 | 8 | [Action] 9 | Description = Remove package list cache ... 10 | When = PostTransaction 11 | Exec = /usr/bin/rm -f /tmp/packages 12 | 13 | -------------------------------------------------------------------------------- /etc/php/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ;;;;;;;;;;;;;;;;;;; 4 | ; About php.ini ; 5 | ;;;;;;;;;;;;;;;;;;; 6 | ; PHP's initialization file, generally called php.ini, is responsible for 7 | ; configuring many of the aspects of PHP's behavior. 8 | 9 | ; PHP attempts to find and load this configuration from a number of locations. 10 | ; The following is a summary of its search order: 11 | ; 1. SAPI module specific location. 12 | ; 2. The PHPRC environment variable. (As of PHP 5.2.0) 13 | ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) 14 | ; 4. Current working directory (except CLI) 15 | ; 5. The web server's directory (for SAPI modules), or directory of PHP 16 | ; (otherwise in Windows) 17 | ; 6. The directory from the --with-config-file-path compile time option, or the 18 | ; Windows directory (usually C:\windows) 19 | ; See the PHP docs for more specific information. 20 | ; http://php.net/configuration.file 21 | 22 | ; The syntax of the file is extremely simple. Whitespace and lines 23 | ; beginning with a semicolon are silently ignored (as you probably guessed). 24 | ; Section headers (e.g. [Foo]) are also silently ignored, even though 25 | ; they might mean something in the future. 26 | 27 | ; Directives following the section heading [PATH=/www/mysite] only 28 | ; apply to PHP files in the /www/mysite directory. Directives 29 | ; following the section heading [HOST=www.example.com] only apply to 30 | ; PHP files served from www.example.com. Directives set in these 31 | ; special sections cannot be overridden by user-defined INI files or 32 | ; at runtime. Currently, [PATH=] and [HOST=] sections only work under 33 | ; CGI/FastCGI. 34 | ; http://php.net/ini.sections 35 | 36 | ; Directives are specified using the following syntax: 37 | ; directive = value 38 | ; Directive names are *case sensitive* - foo=bar is different from FOO=bar. 39 | ; Directives are variables used to configure PHP or PHP extensions. 40 | ; There is no name validation. If PHP can't find an expected 41 | ; directive because it is not set or is mistyped, a default value will be used. 42 | 43 | ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one 44 | ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression 45 | ; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a 46 | ; previously set variable or directive (e.g. ${foo}) 47 | 48 | ; Expressions in the INI file are limited to bitwise operators and parentheses: 49 | ; | bitwise OR 50 | ; ^ bitwise XOR 51 | ; & bitwise AND 52 | ; ~ bitwise NOT 53 | ; ! boolean NOT 54 | 55 | ; Boolean flags can be turned on using the values 1, On, True or Yes. 56 | ; They can be turned off using the values 0, Off, False or No. 57 | 58 | ; An empty string can be denoted by simply not writing anything after the equal 59 | ; sign, or by using the None keyword: 60 | 61 | ; foo = ; sets foo to an empty string 62 | ; foo = None ; sets foo to an empty string 63 | ; foo = "None" ; sets foo to the string 'None' 64 | 65 | ; If you use constants in your value, and these constants belong to a 66 | ; dynamically loaded extension (either a PHP extension or a Zend extension), 67 | ; you may only use these constants *after* the line that loads the extension. 68 | 69 | ;;;;;;;;;;;;;;;;;;; 70 | ; About this file ; 71 | ;;;;;;;;;;;;;;;;;;; 72 | ; PHP comes packaged with two INI files. One that is recommended to be used 73 | ; in production environments and one that is recommended to be used in 74 | ; development environments. 75 | 76 | ; php.ini-production contains settings which hold security, performance and 77 | ; best practices at its core. But please be aware, these settings may break 78 | ; compatibility with older or less security conscience applications. We 79 | ; recommending using the production ini in production and testing environments. 80 | 81 | ; php.ini-development is very similar to its production variant, except it is 82 | ; much more verbose when it comes to errors. We recommend using the 83 | ; development version only in development environments, as errors shown to 84 | ; application users can inadvertently leak otherwise secure information. 85 | 86 | ; This is the php.ini-production INI file. 87 | 88 | ;;;;;;;;;;;;;;;;;;; 89 | ; Quick Reference ; 90 | ;;;;;;;;;;;;;;;;;;; 91 | ; The following are all the settings which are different in either the production 92 | ; or development versions of the INIs with respect to PHP's default behavior. 93 | ; Please see the actual settings later in the document for more details as to why 94 | ; we recommend these changes in PHP's behavior. 95 | 96 | ; display_errors 97 | ; Default Value: On 98 | ; Development Value: On 99 | ; Production Value: Off 100 | 101 | ; display_startup_errors 102 | ; Default Value: Off 103 | ; Development Value: On 104 | ; Production Value: Off 105 | 106 | ; error_reporting 107 | ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 108 | ; Development Value: E_ALL 109 | ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT 110 | 111 | ; log_errors 112 | ; Default Value: Off 113 | ; Development Value: On 114 | ; Production Value: On 115 | 116 | ; max_input_time 117 | ; Default Value: -1 (Unlimited) 118 | ; Development Value: 60 (60 seconds) 119 | ; Production Value: 60 (60 seconds) 120 | 121 | ; output_buffering 122 | ; Default Value: Off 123 | ; Development Value: 4096 124 | ; Production Value: 4096 125 | 126 | ; register_argc_argv 127 | ; Default Value: On 128 | ; Development Value: Off 129 | ; Production Value: Off 130 | 131 | ; request_order 132 | ; Default Value: None 133 | ; Development Value: "GP" 134 | ; Production Value: "GP" 135 | 136 | ; session.gc_divisor 137 | ; Default Value: 100 138 | ; Development Value: 1000 139 | ; Production Value: 1000 140 | 141 | ; session.sid_bits_per_character 142 | ; Default Value: 4 143 | ; Development Value: 5 144 | ; Production Value: 5 145 | 146 | ; short_open_tag 147 | ; Default Value: On 148 | ; Development Value: Off 149 | ; Production Value: Off 150 | 151 | ; variables_order 152 | ; Default Value: "EGPCS" 153 | ; Development Value: "GPCS" 154 | ; Production Value: "GPCS" 155 | 156 | ;;;;;;;;;;;;;;;;;;;; 157 | ; php.ini Options ; 158 | ;;;;;;;;;;;;;;;;;;;; 159 | ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" 160 | ;user_ini.filename = ".user.ini" 161 | 162 | ; To disable this feature set this option to an empty value 163 | ;user_ini.filename = 164 | 165 | ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) 166 | ;user_ini.cache_ttl = 300 167 | 168 | ;;;;;;;;;;;;;;;;;;;; 169 | ; Language Options ; 170 | ;;;;;;;;;;;;;;;;;;;; 171 | 172 | ; Enable the PHP scripting language engine under Apache. 173 | ; http://php.net/engine 174 | engine = On 175 | 176 | ; This directive determines whether or not PHP will recognize code between 177 | ; tags as PHP source which should be processed as such. It is 178 | ; generally recommended that should be used and that this feature 179 | ; should be disabled, as enabling it may result in issues when generating XML 180 | ; documents, however this remains supported for backward compatibility reasons. 181 | ; Note that this directive does not control the would work. 321 | ; http://php.net/syntax-highlighting 322 | ;highlight.string = #DD0000 323 | ;highlight.comment = #FF9900 324 | ;highlight.keyword = #007700 325 | ;highlight.default = #0000BB 326 | ;highlight.html = #000000 327 | 328 | ; If enabled, the request will be allowed to complete even if the user aborts 329 | ; the request. Consider enabling it if executing long requests, which may end up 330 | ; being interrupted by the user or a browser timing out. PHP's default behavior 331 | ; is to disable this feature. 332 | ; http://php.net/ignore-user-abort 333 | ;ignore_user_abort = On 334 | 335 | ; Determines the size of the realpath cache to be used by PHP. This value should 336 | ; be increased on systems where PHP opens many files to reflect the quantity of 337 | ; the file operations performed. 338 | ; Note: if open_basedir is set, the cache is disabled 339 | ; http://php.net/realpath-cache-size 340 | ;realpath_cache_size = 4096k 341 | 342 | ; Duration of time, in seconds for which to cache realpath information for a given 343 | ; file or directory. For systems with rarely changing files, consider increasing this 344 | ; value. 345 | ; http://php.net/realpath-cache-ttl 346 | ;realpath_cache_ttl = 120 347 | 348 | ; Enables or disables the circular reference collector. 349 | ; http://php.net/zend.enable-gc 350 | zend.enable_gc = On 351 | 352 | ; If enabled, scripts may be written in encodings that are incompatible with 353 | ; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such 354 | ; encodings. To use this feature, mbstring extension must be enabled. 355 | ; Default: Off 356 | ;zend.multibyte = Off 357 | 358 | ; Allows to set the default encoding for the scripts. This value will be used 359 | ; unless "declare(encoding=...)" directive appears at the top of the script. 360 | ; Only affects if zend.multibyte is set. 361 | ; Default: "" 362 | ;zend.script_encoding = 363 | 364 | ; Allows to include or exclude arguments from stack traces generated for exceptions 365 | ; Default: Off 366 | ; In production, it is recommended to turn this setting on to prohibit the output 367 | ; of sensitive information in stack traces 368 | zend.exception_ignore_args = On 369 | 370 | ;;;;;;;;;;;;;;;;; 371 | ; Miscellaneous ; 372 | ;;;;;;;;;;;;;;;;; 373 | 374 | ; Decides whether PHP may expose the fact that it is installed on the server 375 | ; (e.g. by adding its signature to the Web server header). It is no security 376 | ; threat in any way, but it makes it possible to determine whether you use PHP 377 | ; on your server or not. 378 | ; http://php.net/expose-php 379 | expose_php = On 380 | 381 | ;;;;;;;;;;;;;;;;;;; 382 | ; Resource Limits ; 383 | ;;;;;;;;;;;;;;;;;;; 384 | 385 | ; Maximum execution time of each script, in seconds 386 | ; http://php.net/max-execution-time 387 | ; Note: This directive is hardcoded to 0 for the CLI SAPI 388 | max_execution_time = 30 389 | 390 | ; Maximum amount of time each script may spend parsing request data. It's a good 391 | ; idea to limit this time on productions servers in order to eliminate unexpectedly 392 | ; long running scripts. 393 | ; Note: This directive is hardcoded to -1 for the CLI SAPI 394 | ; Default Value: -1 (Unlimited) 395 | ; Development Value: 60 (60 seconds) 396 | ; Production Value: 60 (60 seconds) 397 | ; http://php.net/max-input-time 398 | max_input_time = 60 399 | 400 | ; Maximum input variable nesting level 401 | ; http://php.net/max-input-nesting-level 402 | ;max_input_nesting_level = 64 403 | 404 | ; How many GET/POST/COOKIE input variables may be accepted 405 | ;max_input_vars = 1000 406 | 407 | ; Maximum amount of memory a script may consume 408 | ; http://php.net/memory-limit 409 | memory_limit = 128M 410 | 411 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 412 | ; Error handling and logging ; 413 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 414 | 415 | ; This directive informs PHP of which errors, warnings and notices you would like 416 | ; it to take action for. The recommended way of setting values for this 417 | ; directive is through the use of the error level constants and bitwise 418 | ; operators. The error level constants are below here for convenience as well as 419 | ; some common settings and their meanings. 420 | ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT 421 | ; those related to E_NOTICE and E_STRICT, which together cover best practices and 422 | ; recommended coding standards in PHP. For performance reasons, this is the 423 | ; recommend error reporting setting. Your production server shouldn't be wasting 424 | ; resources complaining about best practices and coding standards. That's what 425 | ; development servers and development settings are for. 426 | ; Note: The php.ini-development file has this setting as E_ALL. This 427 | ; means it pretty much reports everything which is exactly what you want during 428 | ; development and early testing. 429 | ; 430 | ; Error Level Constants: 431 | ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) 432 | ; E_ERROR - fatal run-time errors 433 | ; E_RECOVERABLE_ERROR - almost fatal run-time errors 434 | ; E_WARNING - run-time warnings (non-fatal errors) 435 | ; E_PARSE - compile-time parse errors 436 | ; E_NOTICE - run-time notices (these are warnings which often result 437 | ; from a bug in your code, but it's possible that it was 438 | ; intentional (e.g., using an uninitialized variable and 439 | ; relying on the fact it is automatically initialized to an 440 | ; empty string) 441 | ; E_STRICT - run-time notices, enable to have PHP suggest changes 442 | ; to your code which will ensure the best interoperability 443 | ; and forward compatibility of your code 444 | ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup 445 | ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's 446 | ; initial startup 447 | ; E_COMPILE_ERROR - fatal compile-time errors 448 | ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) 449 | ; E_USER_ERROR - user-generated error message 450 | ; E_USER_WARNING - user-generated warning message 451 | ; E_USER_NOTICE - user-generated notice message 452 | ; E_DEPRECATED - warn about code that will not work in future versions 453 | ; of PHP 454 | ; E_USER_DEPRECATED - user-generated deprecation warnings 455 | ; 456 | ; Common Values: 457 | ; E_ALL (Show all errors, warnings and notices including coding standards.) 458 | ; E_ALL & ~E_NOTICE (Show all errors, except for notices) 459 | ; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) 460 | ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) 461 | ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 462 | ; Development Value: E_ALL 463 | ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT 464 | ; http://php.net/error-reporting 465 | error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT 466 | 467 | ; This directive controls whether or not and where PHP will output errors, 468 | ; notices and warnings too. Error output is very useful during development, but 469 | ; it could be very dangerous in production environments. Depending on the code 470 | ; which is triggering the error, sensitive information could potentially leak 471 | ; out of your application such as database usernames and passwords or worse. 472 | ; For production environments, we recommend logging errors rather than 473 | ; sending them to STDOUT. 474 | ; Possible Values: 475 | ; Off = Do not display any errors 476 | ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) 477 | ; On or stdout = Display errors to STDOUT 478 | ; Default Value: On 479 | ; Development Value: On 480 | ; Production Value: Off 481 | ; http://php.net/display-errors 482 | display_errors = Off 483 | 484 | ; The display of errors which occur during PHP's startup sequence are handled 485 | ; separately from display_errors. PHP's default behavior is to suppress those 486 | ; errors from clients. Turning the display of startup errors on can be useful in 487 | ; debugging configuration problems. We strongly recommend you 488 | ; set this to 'off' for production servers. 489 | ; Default Value: Off 490 | ; Development Value: On 491 | ; Production Value: Off 492 | ; http://php.net/display-startup-errors 493 | display_startup_errors = Off 494 | 495 | ; Besides displaying errors, PHP can also log errors to locations such as a 496 | ; server-specific log, STDERR, or a location specified by the error_log 497 | ; directive found below. While errors should not be displayed on productions 498 | ; servers they should still be monitored and logging is a great way to do that. 499 | ; Default Value: Off 500 | ; Development Value: On 501 | ; Production Value: On 502 | ; http://php.net/log-errors 503 | log_errors = On 504 | 505 | ; Set maximum length of log_errors. In error_log information about the source is 506 | ; added. The default is 1024 and 0 allows to not apply any maximum length at all. 507 | ; http://php.net/log-errors-max-len 508 | log_errors_max_len = 1024 509 | 510 | ; Do not log repeated messages. Repeated errors must occur in same file on same 511 | ; line unless ignore_repeated_source is set true. 512 | ; http://php.net/ignore-repeated-errors 513 | ignore_repeated_errors = Off 514 | 515 | ; Ignore source of message when ignoring repeated messages. When this setting 516 | ; is On you will not log errors with repeated messages from different files or 517 | ; source lines. 518 | ; http://php.net/ignore-repeated-source 519 | ignore_repeated_source = Off 520 | 521 | ; If this parameter is set to Off, then memory leaks will not be shown (on 522 | ; stdout or in the log). This is only effective in a debug compile, and if 523 | ; error reporting includes E_WARNING in the allowed list 524 | ; http://php.net/report-memleaks 525 | report_memleaks = On 526 | 527 | ; This setting is on by default. 528 | ;report_zend_debug = 0 529 | 530 | ; Store the last error/warning message in $php_errormsg (boolean). Setting this value 531 | ; to On can assist in debugging and is appropriate for development servers. It should 532 | ; however be disabled on production servers. 533 | ; This directive is DEPRECATED. 534 | ; Default Value: Off 535 | ; Development Value: Off 536 | ; Production Value: Off 537 | ; http://php.net/track-errors 538 | ;track_errors = Off 539 | 540 | ; Turn off normal error reporting and emit XML-RPC error XML 541 | ; http://php.net/xmlrpc-errors 542 | ;xmlrpc_errors = 0 543 | 544 | ; An XML-RPC faultCode 545 | ;xmlrpc_error_number = 0 546 | 547 | ; When PHP displays or logs an error, it has the capability of formatting the 548 | ; error message as HTML for easier reading. This directive controls whether 549 | ; the error message is formatted as HTML or not. 550 | ; Note: This directive is hardcoded to Off for the CLI SAPI 551 | ; http://php.net/html-errors 552 | ;html_errors = On 553 | 554 | ; If html_errors is set to On *and* docref_root is not empty, then PHP 555 | ; produces clickable error messages that direct to a page describing the error 556 | ; or function causing the error in detail. 557 | ; You can download a copy of the PHP manual from http://php.net/docs 558 | ; and change docref_root to the base URL of your local copy including the 559 | ; leading '/'. You must also specify the file extension being used including 560 | ; the dot. PHP's default behavior is to leave these settings empty, in which 561 | ; case no links to documentation are generated. 562 | ; Note: Never use this feature for production boxes. 563 | ; http://php.net/docref-root 564 | ; Examples 565 | ;docref_root = "/phpmanual/" 566 | 567 | ; http://php.net/docref-ext 568 | ;docref_ext = .html 569 | 570 | ; String to output before an error message. PHP's default behavior is to leave 571 | ; this setting blank. 572 | ; http://php.net/error-prepend-string 573 | ; Example: 574 | ;error_prepend_string = "" 575 | 576 | ; String to output after an error message. PHP's default behavior is to leave 577 | ; this setting blank. 578 | ; http://php.net/error-append-string 579 | ; Example: 580 | ;error_append_string = "" 581 | 582 | ; Log errors to specified file. PHP's default behavior is to leave this value 583 | ; empty. 584 | ; http://php.net/error-log 585 | ; Example: 586 | ;error_log = php_errors.log 587 | ; Log errors to syslog (Event Log on Windows). 588 | ;error_log = syslog 589 | 590 | ; The syslog ident is a string which is prepended to every message logged 591 | ; to syslog. Only used when error_log is set to syslog. 592 | ;syslog.ident = php 593 | 594 | ; The syslog facility is used to specify what type of program is logging 595 | ; the message. Only used when error_log is set to syslog. 596 | ;syslog.facility = user 597 | 598 | ; Set this to disable filtering control characters (the default). 599 | ; Some loggers only accept NVT-ASCII, others accept anything that's not 600 | ; control characters. If your logger accepts everything, then no filtering 601 | ; is needed at all. 602 | ; Allowed values are: 603 | ; ascii (all printable ASCII characters and NL) 604 | ; no-ctrl (all characters except control characters) 605 | ; all (all characters) 606 | ; raw (like "all", but messages are not split at newlines) 607 | ; http://php.net/syslog.filter 608 | ;syslog.filter = ascii 609 | 610 | ;windows.show_crt_warning 611 | ; Default value: 0 612 | ; Development value: 0 613 | ; Production value: 0 614 | 615 | ;;;;;;;;;;;;;;;;; 616 | ; Data Handling ; 617 | ;;;;;;;;;;;;;;;;; 618 | 619 | ; The separator used in PHP generated URLs to separate arguments. 620 | ; PHP's default setting is "&". 621 | ; http://php.net/arg-separator.output 622 | ; Example: 623 | ;arg_separator.output = "&" 624 | 625 | ; List of separator(s) used by PHP to parse input URLs into variables. 626 | ; PHP's default setting is "&". 627 | ; NOTE: Every character in this directive is considered as separator! 628 | ; http://php.net/arg-separator.input 629 | ; Example: 630 | ;arg_separator.input = ";&" 631 | 632 | ; This directive determines which super global arrays are registered when PHP 633 | ; starts up. G,P,C,E & S are abbreviations for the following respective super 634 | ; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty 635 | ; paid for the registration of these arrays and because ENV is not as commonly 636 | ; used as the others, ENV is not recommended on productions servers. You 637 | ; can still get access to the environment variables through getenv() should you 638 | ; need to. 639 | ; Default Value: "EGPCS" 640 | ; Development Value: "GPCS" 641 | ; Production Value: "GPCS"; 642 | ; http://php.net/variables-order 643 | variables_order = "GPCS" 644 | 645 | ; This directive determines which super global data (G,P & C) should be 646 | ; registered into the super global array REQUEST. If so, it also determines 647 | ; the order in which that data is registered. The values for this directive 648 | ; are specified in the same manner as the variables_order directive, 649 | ; EXCEPT one. Leaving this value empty will cause PHP to use the value set 650 | ; in the variables_order directive. It does not mean it will leave the super 651 | ; globals array REQUEST empty. 652 | ; Default Value: None 653 | ; Development Value: "GP" 654 | ; Production Value: "GP" 655 | ; http://php.net/request-order 656 | request_order = "GP" 657 | 658 | ; This directive determines whether PHP registers $argv & $argc each time it 659 | ; runs. $argv contains an array of all the arguments passed to PHP when a script 660 | ; is invoked. $argc contains an integer representing the number of arguments 661 | ; that were passed when the script was invoked. These arrays are extremely 662 | ; useful when running scripts from the command line. When this directive is 663 | ; enabled, registering these variables consumes CPU cycles and memory each time 664 | ; a script is executed. For performance reasons, this feature should be disabled 665 | ; on production servers. 666 | ; Note: This directive is hardcoded to On for the CLI SAPI 667 | ; Default Value: On 668 | ; Development Value: Off 669 | ; Production Value: Off 670 | ; http://php.net/register-argc-argv 671 | register_argc_argv = Off 672 | 673 | ; When enabled, the ENV, REQUEST and SERVER variables are created when they're 674 | ; first used (Just In Time) instead of when the script starts. If these 675 | ; variables are not used within a script, having this directive on will result 676 | ; in a performance gain. The PHP directive register_argc_argv must be disabled 677 | ; for this directive to have any effect. 678 | ; http://php.net/auto-globals-jit 679 | auto_globals_jit = On 680 | 681 | ; Whether PHP will read the POST data. 682 | ; This option is enabled by default. 683 | ; Most likely, you won't want to disable this option globally. It causes $_POST 684 | ; and $_FILES to always be empty; the only way you will be able to read the 685 | ; POST data will be through the php://input stream wrapper. This can be useful 686 | ; to proxy requests or to process the POST data in a memory efficient fashion. 687 | ; http://php.net/enable-post-data-reading 688 | ;enable_post_data_reading = Off 689 | 690 | ; Maximum size of POST data that PHP will accept. 691 | ; Its value may be 0 to disable the limit. It is ignored if POST data reading 692 | ; is disabled through enable_post_data_reading. 693 | ; http://php.net/post-max-size 694 | post_max_size = 256M 695 | 696 | ; Automatically add files before PHP document. 697 | ; http://php.net/auto-prepend-file 698 | auto_prepend_file = 699 | 700 | ; Automatically add files after PHP document. 701 | ; http://php.net/auto-append-file 702 | auto_append_file = 703 | 704 | ; By default, PHP will output a media type using the Content-Type header. To 705 | ; disable this, simply set it to be empty. 706 | ; 707 | ; PHP's built-in default media type is set to text/html. 708 | ; http://php.net/default-mimetype 709 | default_mimetype = "text/html" 710 | 711 | ; PHP's default character set is set to UTF-8. 712 | ; http://php.net/default-charset 713 | default_charset = "UTF-8" 714 | 715 | ; PHP internal character encoding is set to empty. 716 | ; If empty, default_charset is used. 717 | ; http://php.net/internal-encoding 718 | ;internal_encoding = 719 | 720 | ; PHP input character encoding is set to empty. 721 | ; If empty, default_charset is used. 722 | ; http://php.net/input-encoding 723 | ;input_encoding = 724 | 725 | ; PHP output character encoding is set to empty. 726 | ; If empty, default_charset is used. 727 | ; See also output_buffer. 728 | ; http://php.net/output-encoding 729 | ;output_encoding = 730 | 731 | ;;;;;;;;;;;;;;;;;;;;;;;;; 732 | ; Paths and Directories ; 733 | ;;;;;;;;;;;;;;;;;;;;;;;;; 734 | 735 | ; UNIX: "/path1:/path2" 736 | ;include_path = ".:/php/includes" 737 | ; 738 | ; Windows: "\path1;\path2" 739 | ;include_path = ".;c:\php\includes" 740 | ; 741 | ; PHP's default setting for include_path is ".;/path/to/php/pear" 742 | ; http://php.net/include-path 743 | 744 | ; The root of the PHP pages, used only if nonempty. 745 | ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root 746 | ; if you are running php as a CGI under any web server (other than IIS) 747 | ; see documentation for security issues. The alternate is to use the 748 | ; cgi.force_redirect configuration below 749 | ; http://php.net/doc-root 750 | doc_root = 751 | 752 | ; The directory under which PHP opens the script using /~username used only 753 | ; if nonempty. 754 | ; http://php.net/user-dir 755 | user_dir = 756 | 757 | ; Directory in which the loadable extensions (modules) reside. 758 | ; http://php.net/extension-dir 759 | extension_dir = "/usr/lib/php/modules/" 760 | ; On windows: 761 | ;extension_dir = "ext" 762 | 763 | ; Directory where the temporary files should be placed. 764 | ; Defaults to the system default (see sys_get_temp_dir) 765 | ;sys_temp_dir = "/tmp" 766 | 767 | ; Whether or not to enable the dl() function. The dl() function does NOT work 768 | ; properly in multithreaded servers, such as IIS or Zeus, and is automatically 769 | ; disabled on them. 770 | ; http://php.net/enable-dl 771 | enable_dl = Off 772 | 773 | ; cgi.force_redirect is necessary to provide security running PHP as a CGI under 774 | ; most web servers. Left undefined, PHP turns this on by default. You can 775 | ; turn it off here AT YOUR OWN RISK 776 | ; **You CAN safely turn this off for IIS, in fact, you MUST.** 777 | ; http://php.net/cgi.force-redirect 778 | ;cgi.force_redirect = 1 779 | 780 | ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with 781 | ; every request. PHP's default behavior is to disable this feature. 782 | ;cgi.nph = 1 783 | 784 | ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 785 | ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP 786 | ; will look for to know it is OK to continue execution. Setting this variable MAY 787 | ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. 788 | ; http://php.net/cgi.redirect-status-env 789 | ;cgi.redirect_status_env = 790 | 791 | ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's 792 | ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok 793 | ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting 794 | ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting 795 | ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts 796 | ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. 797 | ; http://php.net/cgi.fix-pathinfo 798 | ;cgi.fix_pathinfo=1 799 | 800 | ; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside 801 | ; of the web tree and people will not be able to circumvent .htaccess security. 802 | ;cgi.discard_path=1 803 | 804 | ; FastCGI under IIS supports the ability to impersonate 805 | ; security tokens of the calling client. This allows IIS to define the 806 | ; security context that the request runs under. mod_fastcgi under Apache 807 | ; does not currently support this feature (03/17/2002) 808 | ; Set to 1 if running under IIS. Default is zero. 809 | ; http://php.net/fastcgi.impersonate 810 | ;fastcgi.impersonate = 1 811 | 812 | ; Disable logging through FastCGI connection. PHP's default behavior is to enable 813 | ; this feature. 814 | ;fastcgi.logging = 0 815 | 816 | ; cgi.rfc2616_headers configuration option tells PHP what type of headers to 817 | ; use when sending HTTP response code. If set to 0, PHP sends Status: header that 818 | ; is supported by Apache. When this option is set to 1, PHP will send 819 | ; RFC2616 compliant header. 820 | ; Default is zero. 821 | ; http://php.net/cgi.rfc2616-headers 822 | ;cgi.rfc2616_headers = 0 823 | 824 | ; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! 825 | ; (shebang) at the top of the running script. This line might be needed if the 826 | ; script support running both as stand-alone script and via PHP CGI<. PHP in CGI 827 | ; mode skips this line and ignores its content if this directive is turned on. 828 | ; http://php.net/cgi.check-shebang-line 829 | ;cgi.check_shebang_line=1 830 | 831 | ;;;;;;;;;;;;;;;; 832 | ; File Uploads ; 833 | ;;;;;;;;;;;;;;;; 834 | 835 | ; Whether to allow HTTP file uploads. 836 | ; http://php.net/file-uploads 837 | file_uploads = On 838 | 839 | ; Temporary directory for HTTP uploaded files (will use system default if not 840 | ; specified). 841 | ; http://php.net/upload-tmp-dir 842 | ;upload_tmp_dir = 843 | 844 | ; Maximum allowed size for uploaded files. 845 | ; http://php.net/upload-max-filesize 846 | upload_max_filesize = 256M 847 | 848 | ; Maximum number of files that can be uploaded via a single request 849 | max_file_uploads = 20 850 | 851 | ;;;;;;;;;;;;;;;;;; 852 | ; Fopen wrappers ; 853 | ;;;;;;;;;;;;;;;;;; 854 | 855 | ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. 856 | ; http://php.net/allow-url-fopen 857 | allow_url_fopen = On 858 | 859 | ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. 860 | ; http://php.net/allow-url-include 861 | allow_url_include = Off 862 | 863 | ; Define the anonymous ftp password (your email address). PHP's default setting 864 | ; for this is empty. 865 | ; http://php.net/from 866 | ;from="john@doe.com" 867 | 868 | ; Define the User-Agent string. PHP's default setting for this is empty. 869 | ; http://php.net/user-agent 870 | ;user_agent="PHP" 871 | 872 | ; Default timeout for socket based streams (seconds) 873 | ; http://php.net/default-socket-timeout 874 | default_socket_timeout = 60 875 | 876 | ; If your scripts have to deal with files from Macintosh systems, 877 | ; or you are running on a Mac and need to deal with files from 878 | ; unix or win32 systems, setting this flag will cause PHP to 879 | ; automatically detect the EOL character in those files so that 880 | ; fgets() and file() will work regardless of the source of the file. 881 | ; http://php.net/auto-detect-line-endings 882 | ;auto_detect_line_endings = Off 883 | 884 | ;;;;;;;;;;;;;;;;;;;;;; 885 | ; Dynamic Extensions ; 886 | ;;;;;;;;;;;;;;;;;;;;;; 887 | 888 | ; If you wish to have an extension loaded automatically, use the following 889 | ; syntax: 890 | ; 891 | ; extension=modulename 892 | ; 893 | ; For example: 894 | ; 895 | ; extension=mysqli 896 | ; 897 | ; When the extension library to load is not located in the default extension 898 | ; directory, You may specify an absolute path to the library file: 899 | ; 900 | ; extension=/path/to/extension/mysqli.so 901 | ; 902 | ; Note : The syntax used in previous PHP versions ('extension=.so' and 903 | ; 'extension='php_.dll') is supported for legacy reasons and may be 904 | ; deprecated in a future PHP major version. So, when it is possible, please 905 | ; move to the new ('extension=) syntax. 906 | ; 907 | ;extension=bcmath 908 | ;extension=bz2 909 | ;extension=calendar 910 | extension=curl 911 | ;extension=dba 912 | ;extension=enchant 913 | ;extension=exif 914 | ;extension=ffi 915 | ;extension=ftp 916 | ;extension=gd 917 | ;extension=gettext 918 | ;extension=gmp 919 | ;extension=iconv 920 | ;extension=imap 921 | ;extension=intl 922 | ;extension=ldap 923 | ;extension=mysqli 924 | ;extension=odbc 925 | ;zend_extension=opcache 926 | ;extension=pdo_dblib 927 | ;extension=pdo_mysql 928 | ;extension=pdo_odbc 929 | ;extension=pdo_pgsql 930 | ;extension=pdo_sqlite 931 | ;extension=pgsql 932 | ;extension=pspell 933 | ;extension=shmop 934 | ;extension=snmp 935 | ;extension=soap 936 | ;extension=sockets 937 | ;extension=sodium 938 | ;extension=sqlite3 939 | ;extension=sysvmsg 940 | ;extension=sysvsem 941 | ;extension=sysvshm 942 | ;extension=tidy 943 | ;extension=xmlrpc 944 | ;extension=xsl 945 | extension=zip 946 | 947 | ;;;;;;;;;;;;;;;;;;; 948 | ; Module Settings ; 949 | ;;;;;;;;;;;;;;;;;;; 950 | 951 | [CLI Server] 952 | ; Whether the CLI web server uses ANSI color coding in its terminal output. 953 | cli_server.color = On 954 | 955 | [Date] 956 | ; Defines the default timezone used by the date functions 957 | ; http://php.net/date.timezone 958 | ;date.timezone = 959 | 960 | ; http://php.net/date.default-latitude 961 | ;date.default_latitude = 31.7667 962 | 963 | ; http://php.net/date.default-longitude 964 | ;date.default_longitude = 35.2333 965 | 966 | ; http://php.net/date.sunrise-zenith 967 | ;date.sunrise_zenith = 90.583333 968 | 969 | ; http://php.net/date.sunset-zenith 970 | ;date.sunset_zenith = 90.583333 971 | 972 | [filter] 973 | ; http://php.net/filter.default 974 | ;filter.default = unsafe_raw 975 | 976 | ; http://php.net/filter.default-flags 977 | ;filter.default_flags = 978 | 979 | [iconv] 980 | ; Use of this INI entry is deprecated, use global input_encoding instead. 981 | ; If empty, default_charset or input_encoding or iconv.input_encoding is used. 982 | ; The precedence is: default_charset < input_encoding < iconv.input_encoding 983 | ;iconv.input_encoding = 984 | 985 | ; Use of this INI entry is deprecated, use global internal_encoding instead. 986 | ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. 987 | ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding 988 | ;iconv.internal_encoding = 989 | 990 | ; Use of this INI entry is deprecated, use global output_encoding instead. 991 | ; If empty, default_charset or output_encoding or iconv.output_encoding is used. 992 | ; The precedence is: default_charset < output_encoding < iconv.output_encoding 993 | ; To use an output encoding conversion, iconv's output handler must be set 994 | ; otherwise output encoding conversion cannot be performed. 995 | ;iconv.output_encoding = 996 | 997 | [imap] 998 | ; rsh/ssh logins are disabled by default. Use this INI entry if you want to 999 | ; enable them. Note that the IMAP library does not filter mailbox names before 1000 | ; passing them to rsh/ssh command, thus passing untrusted data to this function 1001 | ; with rsh/ssh enabled is insecure. 1002 | ;imap.enable_insecure_rsh=0 1003 | 1004 | [intl] 1005 | ;intl.default_locale = 1006 | ; This directive allows you to produce PHP errors when some error 1007 | ; happens within intl functions. The value is the level of the error produced. 1008 | ; Default is 0, which does not produce any errors. 1009 | ;intl.error_level = E_WARNING 1010 | ;intl.use_exceptions = 0 1011 | 1012 | [sqlite3] 1013 | ; Directory pointing to SQLite3 extensions 1014 | ; http://php.net/sqlite3.extension-dir 1015 | ;sqlite3.extension_dir = 1016 | 1017 | ; SQLite defensive mode flag (only available from SQLite 3.26+) 1018 | ; When the defensive flag is enabled, language features that allow ordinary 1019 | ; SQL to deliberately corrupt the database file are disabled. This forbids 1020 | ; writing directly to the schema, shadow tables (eg. FTS data tables), or 1021 | ; the sqlite_dbpage virtual table. 1022 | ; https://www.sqlite.org/c3ref/c_dbconfig_defensive.html 1023 | ; (for older SQLite versions, this flag has no use) 1024 | ;sqlite3.defensive = 1 1025 | 1026 | [Pcre] 1027 | ; PCRE library backtracking limit. 1028 | ; http://php.net/pcre.backtrack-limit 1029 | ;pcre.backtrack_limit=100000 1030 | 1031 | ; PCRE library recursion limit. 1032 | ; Please note that if you set this value to a high number you may consume all 1033 | ; the available process stack and eventually crash PHP (due to reaching the 1034 | ; stack size limit imposed by the Operating System). 1035 | ; http://php.net/pcre.recursion-limit 1036 | ;pcre.recursion_limit=100000 1037 | 1038 | ; Enables or disables JIT compilation of patterns. This requires the PCRE 1039 | ; library to be compiled with JIT support. 1040 | ;pcre.jit=1 1041 | 1042 | [Pdo] 1043 | ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" 1044 | ; http://php.net/pdo-odbc.connection-pooling 1045 | ;pdo_odbc.connection_pooling=strict 1046 | 1047 | ;pdo_odbc.db2_instance_name 1048 | 1049 | [Pdo_mysql] 1050 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1051 | ; MySQL defaults. 1052 | pdo_mysql.default_socket= 1053 | 1054 | [Phar] 1055 | ; http://php.net/phar.readonly 1056 | ;phar.readonly = On 1057 | 1058 | ; http://php.net/phar.require-hash 1059 | ;phar.require_hash = On 1060 | 1061 | ;phar.cache_list = 1062 | 1063 | [mail function] 1064 | ; For Win32 only. 1065 | ; http://php.net/smtp 1066 | SMTP = localhost 1067 | ; http://php.net/smtp-port 1068 | smtp_port = 25 1069 | 1070 | ; For Win32 only. 1071 | ; http://php.net/sendmail-from 1072 | ;sendmail_from = me@example.com 1073 | 1074 | ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). 1075 | ; http://php.net/sendmail-path 1076 | ;sendmail_path = 1077 | 1078 | ; Force the addition of the specified parameters to be passed as extra parameters 1079 | ; to the sendmail binary. These parameters will always replace the value of 1080 | ; the 5th parameter to mail(). 1081 | ;mail.force_extra_parameters = 1082 | 1083 | ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename 1084 | mail.add_x_header = Off 1085 | 1086 | ; The path to a log file that will log all mail() calls. Log entries include 1087 | ; the full path of the script, line number, To address and headers. 1088 | ;mail.log = 1089 | ; Log mail to syslog (Event Log on Windows). 1090 | ;mail.log = syslog 1091 | 1092 | [ODBC] 1093 | ; http://php.net/odbc.default-db 1094 | ;odbc.default_db = Not yet implemented 1095 | 1096 | ; http://php.net/odbc.default-user 1097 | ;odbc.default_user = Not yet implemented 1098 | 1099 | ; http://php.net/odbc.default-pw 1100 | ;odbc.default_pw = Not yet implemented 1101 | 1102 | ; Controls the ODBC cursor model. 1103 | ; Default: SQL_CURSOR_STATIC (default). 1104 | ;odbc.default_cursortype 1105 | 1106 | ; Allow or prevent persistent links. 1107 | ; http://php.net/odbc.allow-persistent 1108 | odbc.allow_persistent = On 1109 | 1110 | ; Check that a connection is still valid before reuse. 1111 | ; http://php.net/odbc.check-persistent 1112 | odbc.check_persistent = On 1113 | 1114 | ; Maximum number of persistent links. -1 means no limit. 1115 | ; http://php.net/odbc.max-persistent 1116 | odbc.max_persistent = -1 1117 | 1118 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1119 | ; http://php.net/odbc.max-links 1120 | odbc.max_links = -1 1121 | 1122 | ; Handling of LONG fields. Returns number of bytes to variables. 0 means 1123 | ; passthru. 1124 | ; http://php.net/odbc.defaultlrl 1125 | odbc.defaultlrl = 4096 1126 | 1127 | ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. 1128 | ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation 1129 | ; of odbc.defaultlrl and odbc.defaultbinmode 1130 | ; http://php.net/odbc.defaultbinmode 1131 | odbc.defaultbinmode = 1 1132 | 1133 | [MySQLi] 1134 | 1135 | ; Maximum number of persistent links. -1 means no limit. 1136 | ; http://php.net/mysqli.max-persistent 1137 | mysqli.max_persistent = -1 1138 | 1139 | ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements 1140 | ; http://php.net/mysqli.allow_local_infile 1141 | ;mysqli.allow_local_infile = On 1142 | 1143 | ; Allow or prevent persistent links. 1144 | ; http://php.net/mysqli.allow-persistent 1145 | mysqli.allow_persistent = On 1146 | 1147 | ; Maximum number of links. -1 means no limit. 1148 | ; http://php.net/mysqli.max-links 1149 | mysqli.max_links = -1 1150 | 1151 | ; Default port number for mysqli_connect(). If unset, mysqli_connect() will use 1152 | ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the 1153 | ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look 1154 | ; at MYSQL_PORT. 1155 | ; http://php.net/mysqli.default-port 1156 | mysqli.default_port = 3306 1157 | 1158 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1159 | ; MySQL defaults. 1160 | ; http://php.net/mysqli.default-socket 1161 | mysqli.default_socket = 1162 | 1163 | ; Default host for mysqli_connect() (doesn't apply in safe mode). 1164 | ; http://php.net/mysqli.default-host 1165 | mysqli.default_host = 1166 | 1167 | ; Default user for mysqli_connect() (doesn't apply in safe mode). 1168 | ; http://php.net/mysqli.default-user 1169 | mysqli.default_user = 1170 | 1171 | ; Default password for mysqli_connect() (doesn't apply in safe mode). 1172 | ; Note that this is generally a *bad* idea to store passwords in this file. 1173 | ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") 1174 | ; and reveal this password! And of course, any users with read access to this 1175 | ; file will be able to reveal the password as well. 1176 | ; http://php.net/mysqli.default-pw 1177 | mysqli.default_pw = 1178 | 1179 | ; Allow or prevent reconnect 1180 | mysqli.reconnect = Off 1181 | 1182 | [mysqlnd] 1183 | ; Enable / Disable collection of general statistics by mysqlnd which can be 1184 | ; used to tune and monitor MySQL operations. 1185 | mysqlnd.collect_statistics = On 1186 | 1187 | ; Enable / Disable collection of memory usage statistics by mysqlnd which can be 1188 | ; used to tune and monitor MySQL operations. 1189 | mysqlnd.collect_memory_statistics = Off 1190 | 1191 | ; Records communication from all extensions using mysqlnd to the specified log 1192 | ; file. 1193 | ; http://php.net/mysqlnd.debug 1194 | ;mysqlnd.debug = 1195 | 1196 | ; Defines which queries will be logged. 1197 | ;mysqlnd.log_mask = 0 1198 | 1199 | ; Default size of the mysqlnd memory pool, which is used by result sets. 1200 | ;mysqlnd.mempool_default_size = 16000 1201 | 1202 | ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. 1203 | ;mysqlnd.net_cmd_buffer_size = 2048 1204 | 1205 | ; Size of a pre-allocated buffer used for reading data sent by the server in 1206 | ; bytes. 1207 | ;mysqlnd.net_read_buffer_size = 32768 1208 | 1209 | ; Timeout for network requests in seconds. 1210 | ;mysqlnd.net_read_timeout = 31536000 1211 | 1212 | ; SHA-256 Authentication Plugin related. File with the MySQL server public RSA 1213 | ; key. 1214 | ;mysqlnd.sha256_server_public_key = 1215 | 1216 | [OCI8] 1217 | 1218 | ; Connection: Enables privileged connections using external 1219 | ; credentials (OCI_SYSOPER, OCI_SYSDBA) 1220 | ; http://php.net/oci8.privileged-connect 1221 | ;oci8.privileged_connect = Off 1222 | 1223 | ; Connection: The maximum number of persistent OCI8 connections per 1224 | ; process. Using -1 means no limit. 1225 | ; http://php.net/oci8.max-persistent 1226 | ;oci8.max_persistent = -1 1227 | 1228 | ; Connection: The maximum number of seconds a process is allowed to 1229 | ; maintain an idle persistent connection. Using -1 means idle 1230 | ; persistent connections will be maintained forever. 1231 | ; http://php.net/oci8.persistent-timeout 1232 | ;oci8.persistent_timeout = -1 1233 | 1234 | ; Connection: The number of seconds that must pass before issuing a 1235 | ; ping during oci_pconnect() to check the connection validity. When 1236 | ; set to 0, each oci_pconnect() will cause a ping. Using -1 disables 1237 | ; pings completely. 1238 | ; http://php.net/oci8.ping-interval 1239 | ;oci8.ping_interval = 60 1240 | 1241 | ; Connection: Set this to a user chosen connection class to be used 1242 | ; for all pooled server requests with Oracle 11g Database Resident 1243 | ; Connection Pooling (DRCP). To use DRCP, this value should be set to 1244 | ; the same string for all web servers running the same application, 1245 | ; the database pool must be configured, and the connection string must 1246 | ; specify to use a pooled server. 1247 | ;oci8.connection_class = 1248 | 1249 | ; High Availability: Using On lets PHP receive Fast Application 1250 | ; Notification (FAN) events generated when a database node fails. The 1251 | ; database must also be configured to post FAN events. 1252 | ;oci8.events = Off 1253 | 1254 | ; Tuning: This option enables statement caching, and specifies how 1255 | ; many statements to cache. Using 0 disables statement caching. 1256 | ; http://php.net/oci8.statement-cache-size 1257 | ;oci8.statement_cache_size = 20 1258 | 1259 | ; Tuning: Enables statement prefetching and sets the default number of 1260 | ; rows that will be fetched automatically after statement execution. 1261 | ; http://php.net/oci8.default-prefetch 1262 | ;oci8.default_prefetch = 100 1263 | 1264 | ; Compatibility. Using On means oci_close() will not close 1265 | ; oci_connect() and oci_new_connect() connections. 1266 | ; http://php.net/oci8.old-oci-close-semantics 1267 | ;oci8.old_oci_close_semantics = Off 1268 | 1269 | [PostgreSQL] 1270 | ; Allow or prevent persistent links. 1271 | ; http://php.net/pgsql.allow-persistent 1272 | pgsql.allow_persistent = On 1273 | 1274 | ; Detect broken persistent links always with pg_pconnect(). 1275 | ; Auto reset feature requires a little overheads. 1276 | ; http://php.net/pgsql.auto-reset-persistent 1277 | pgsql.auto_reset_persistent = Off 1278 | 1279 | ; Maximum number of persistent links. -1 means no limit. 1280 | ; http://php.net/pgsql.max-persistent 1281 | pgsql.max_persistent = -1 1282 | 1283 | ; Maximum number of links (persistent+non persistent). -1 means no limit. 1284 | ; http://php.net/pgsql.max-links 1285 | pgsql.max_links = -1 1286 | 1287 | ; Ignore PostgreSQL backends Notice message or not. 1288 | ; Notice message logging require a little overheads. 1289 | ; http://php.net/pgsql.ignore-notice 1290 | pgsql.ignore_notice = 0 1291 | 1292 | ; Log PostgreSQL backends Notice message or not. 1293 | ; Unless pgsql.ignore_notice=0, module cannot log notice message. 1294 | ; http://php.net/pgsql.log-notice 1295 | pgsql.log_notice = 0 1296 | 1297 | [bcmath] 1298 | ; Number of decimal digits for all bcmath functions. 1299 | ; http://php.net/bcmath.scale 1300 | bcmath.scale = 0 1301 | 1302 | [browscap] 1303 | ; http://php.net/browscap 1304 | ;browscap = extra/browscap.ini 1305 | 1306 | [Session] 1307 | ; Handler used to store/retrieve data. 1308 | ; http://php.net/session.save-handler 1309 | session.save_handler = files 1310 | 1311 | ; Argument passed to save_handler. In the case of files, this is the path 1312 | ; where data files are stored. Note: Windows users have to change this 1313 | ; variable in order to use PHP's session functions. 1314 | ; 1315 | ; The path can be defined as: 1316 | ; 1317 | ; session.save_path = "N;/path" 1318 | ; 1319 | ; where N is an integer. Instead of storing all the session files in 1320 | ; /path, what this will do is use subdirectories N-levels deep, and 1321 | ; store the session data in those directories. This is useful if 1322 | ; your OS has problems with many files in one directory, and is 1323 | ; a more efficient layout for servers that handle many sessions. 1324 | ; 1325 | ; NOTE 1: PHP will not create this directory structure automatically. 1326 | ; You can use the script in the ext/session dir for that purpose. 1327 | ; NOTE 2: See the section on garbage collection below if you choose to 1328 | ; use subdirectories for session storage 1329 | ; 1330 | ; The file storage module creates files using mode 600 by default. 1331 | ; You can change that by using 1332 | ; 1333 | ; session.save_path = "N;MODE;/path" 1334 | ; 1335 | ; where MODE is the octal representation of the mode. Note that this 1336 | ; does not overwrite the process's umask. 1337 | ; http://php.net/session.save-path 1338 | ;session.save_path = "/tmp" 1339 | 1340 | ; Whether to use strict session mode. 1341 | ; Strict session mode does not accept an uninitialized session ID, and 1342 | ; regenerates the session ID if the browser sends an uninitialized session ID. 1343 | ; Strict mode protects applications from session fixation via a session adoption 1344 | ; vulnerability. It is disabled by default for maximum compatibility, but 1345 | ; enabling it is encouraged. 1346 | ; https://wiki.php.net/rfc/strict_sessions 1347 | session.use_strict_mode = 0 1348 | 1349 | ; Whether to use cookies. 1350 | ; http://php.net/session.use-cookies 1351 | session.use_cookies = 1 1352 | 1353 | ; http://php.net/session.cookie-secure 1354 | ;session.cookie_secure = 1355 | 1356 | ; This option forces PHP to fetch and use a cookie for storing and maintaining 1357 | ; the session id. We encourage this operation as it's very helpful in combating 1358 | ; session hijacking when not specifying and managing your own session id. It is 1359 | ; not the be-all and end-all of session hijacking defense, but it's a good start. 1360 | ; http://php.net/session.use-only-cookies 1361 | session.use_only_cookies = 1 1362 | 1363 | ; Name of the session (used as cookie name). 1364 | ; http://php.net/session.name 1365 | session.name = PHPSESSID 1366 | 1367 | ; Initialize session on request startup. 1368 | ; http://php.net/session.auto-start 1369 | session.auto_start = 0 1370 | 1371 | ; Lifetime in seconds of cookie or, if 0, until browser is restarted. 1372 | ; http://php.net/session.cookie-lifetime 1373 | session.cookie_lifetime = 0 1374 | 1375 | ; The path for which the cookie is valid. 1376 | ; http://php.net/session.cookie-path 1377 | session.cookie_path = / 1378 | 1379 | ; The domain for which the cookie is valid. 1380 | ; http://php.net/session.cookie-domain 1381 | session.cookie_domain = 1382 | 1383 | ; Whether or not to add the httpOnly flag to the cookie, which makes it 1384 | ; inaccessible to browser scripting languages such as JavaScript. 1385 | ; http://php.net/session.cookie-httponly 1386 | session.cookie_httponly = 1387 | 1388 | ; Add SameSite attribute to cookie to help mitigate Cross-Site Request Forgery (CSRF/XSRF) 1389 | ; Current valid values are "Lax" or "Strict" 1390 | ; https://tools.ietf.org/html/draft-west-first-party-cookies-07 1391 | session.cookie_samesite = 1392 | 1393 | ; Handler used to serialize data. php is the standard serializer of PHP. 1394 | ; http://php.net/session.serialize-handler 1395 | session.serialize_handler = php 1396 | 1397 | ; Defines the probability that the 'garbage collection' process is started on every 1398 | ; session initialization. The probability is calculated by using gc_probability/gc_divisor, 1399 | ; e.g. 1/100 means there is a 1% chance that the GC process starts on each request. 1400 | ; Default Value: 1 1401 | ; Development Value: 1 1402 | ; Production Value: 1 1403 | ; http://php.net/session.gc-probability 1404 | session.gc_probability = 1 1405 | 1406 | ; Defines the probability that the 'garbage collection' process is started on every 1407 | ; session initialization. The probability is calculated by using gc_probability/gc_divisor, 1408 | ; e.g. 1/100 means there is a 1% chance that the GC process starts on each request. 1409 | ; For high volume production servers, using a value of 1000 is a more efficient approach. 1410 | ; Default Value: 100 1411 | ; Development Value: 1000 1412 | ; Production Value: 1000 1413 | ; http://php.net/session.gc-divisor 1414 | session.gc_divisor = 1000 1415 | 1416 | ; After this number of seconds, stored data will be seen as 'garbage' and 1417 | ; cleaned up by the garbage collection process. 1418 | ; http://php.net/session.gc-maxlifetime 1419 | session.gc_maxlifetime = 1440 1420 | 1421 | ; NOTE: If you are using the subdirectory option for storing session files 1422 | ; (see session.save_path above), then garbage collection does *not* 1423 | ; happen automatically. You will need to do your own garbage 1424 | ; collection through a shell script, cron entry, or some other method. 1425 | ; For example, the following script would is the equivalent of 1426 | ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): 1427 | ; find /path/to/sessions -cmin +24 -type f | xargs rm 1428 | 1429 | ; Check HTTP Referer to invalidate externally stored URLs containing ids. 1430 | ; HTTP_REFERER has to contain this substring for the session to be 1431 | ; considered as valid. 1432 | ; http://php.net/session.referer-check 1433 | session.referer_check = 1434 | 1435 | ; Set to {nocache,private,public,} to determine HTTP caching aspects 1436 | ; or leave this empty to avoid sending anti-caching headers. 1437 | ; http://php.net/session.cache-limiter 1438 | session.cache_limiter = nocache 1439 | 1440 | ; Document expires after n minutes. 1441 | ; http://php.net/session.cache-expire 1442 | session.cache_expire = 180 1443 | 1444 | ; trans sid support is disabled by default. 1445 | ; Use of trans sid may risk your users' security. 1446 | ; Use this option with caution. 1447 | ; - User may send URL contains active session ID 1448 | ; to other person via. email/irc/etc. 1449 | ; - URL that contains active session ID may be stored 1450 | ; in publicly accessible computer. 1451 | ; - User may access your site with the same session ID 1452 | ; always using URL stored in browser's history or bookmarks. 1453 | ; http://php.net/session.use-trans-sid 1454 | session.use_trans_sid = 0 1455 | 1456 | ; Set session ID character length. This value could be between 22 to 256. 1457 | ; Shorter length than default is supported only for compatibility reason. 1458 | ; Users should use 32 or more chars. 1459 | ; http://php.net/session.sid-length 1460 | ; Default Value: 32 1461 | ; Development Value: 26 1462 | ; Production Value: 26 1463 | session.sid_length = 26 1464 | 1465 | ; The URL rewriter will look for URLs in a defined set of HTML tags. 1466 | ;
is special; if you include them here, the rewriter will 1467 | ; add a hidden field with the info which is otherwise appended 1468 | ; to URLs. tag's action attribute URL will not be modified 1469 | ; unless it is specified. 1470 | ; Note that all valid entries require a "=", even if no value follows. 1471 | ; Default Value: "a=href,area=href,frame=src,form=" 1472 | ; Development Value: "a=href,area=href,frame=src,form=" 1473 | ; Production Value: "a=href,area=href,frame=src,form=" 1474 | ; http://php.net/url-rewriter.tags 1475 | session.trans_sid_tags = "a=href,area=href,frame=src,form=" 1476 | 1477 | ; URL rewriter does not rewrite absolute URLs by default. 1478 | ; To enable rewrites for absolute paths, target hosts must be specified 1479 | ; at RUNTIME. i.e. use ini_set() 1480 | ; tags is special. PHP will check action attribute's URL regardless 1481 | ; of session.trans_sid_tags setting. 1482 | ; If no host is defined, HTTP_HOST will be used for allowed host. 1483 | ; Example value: php.net,www.php.net,wiki.php.net 1484 | ; Use "," for multiple hosts. No spaces are allowed. 1485 | ; Default Value: "" 1486 | ; Development Value: "" 1487 | ; Production Value: "" 1488 | ;session.trans_sid_hosts="" 1489 | 1490 | ; Define how many bits are stored in each character when converting 1491 | ; the binary hash data to something readable. 1492 | ; Possible values: 1493 | ; 4 (4 bits: 0-9, a-f) 1494 | ; 5 (5 bits: 0-9, a-v) 1495 | ; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") 1496 | ; Default Value: 4 1497 | ; Development Value: 5 1498 | ; Production Value: 5 1499 | ; http://php.net/session.hash-bits-per-character 1500 | session.sid_bits_per_character = 5 1501 | 1502 | ; Enable upload progress tracking in $_SESSION 1503 | ; Default Value: On 1504 | ; Development Value: On 1505 | ; Production Value: On 1506 | ; http://php.net/session.upload-progress.enabled 1507 | ;session.upload_progress.enabled = On 1508 | 1509 | ; Cleanup the progress information as soon as all POST data has been read 1510 | ; (i.e. upload completed). 1511 | ; Default Value: On 1512 | ; Development Value: On 1513 | ; Production Value: On 1514 | ; http://php.net/session.upload-progress.cleanup 1515 | ;session.upload_progress.cleanup = On 1516 | 1517 | ; A prefix used for the upload progress key in $_SESSION 1518 | ; Default Value: "upload_progress_" 1519 | ; Development Value: "upload_progress_" 1520 | ; Production Value: "upload_progress_" 1521 | ; http://php.net/session.upload-progress.prefix 1522 | ;session.upload_progress.prefix = "upload_progress_" 1523 | 1524 | ; The index name (concatenated with the prefix) in $_SESSION 1525 | ; containing the upload progress information 1526 | ; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" 1527 | ; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" 1528 | ; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" 1529 | ; http://php.net/session.upload-progress.name 1530 | ;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" 1531 | 1532 | ; How frequently the upload progress should be updated. 1533 | ; Given either in percentages (per-file), or in bytes 1534 | ; Default Value: "1%" 1535 | ; Development Value: "1%" 1536 | ; Production Value: "1%" 1537 | ; http://php.net/session.upload-progress.freq 1538 | ;session.upload_progress.freq = "1%" 1539 | 1540 | ; The minimum delay between updates, in seconds 1541 | ; Default Value: 1 1542 | ; Development Value: 1 1543 | ; Production Value: 1 1544 | ; http://php.net/session.upload-progress.min-freq 1545 | ;session.upload_progress.min_freq = "1" 1546 | 1547 | ; Only write session data when session data is changed. Enabled by default. 1548 | ; http://php.net/session.lazy-write 1549 | ;session.lazy_write = On 1550 | 1551 | [Assertion] 1552 | ; Switch whether to compile assertions at all (to have no overhead at run-time) 1553 | ; -1: Do not compile at all 1554 | ; 0: Jump over assertion at run-time 1555 | ; 1: Execute assertions 1556 | ; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) 1557 | ; Default Value: 1 1558 | ; Development Value: 1 1559 | ; Production Value: -1 1560 | ; http://php.net/zend.assertions 1561 | zend.assertions = -1 1562 | 1563 | ; Assert(expr); active by default. 1564 | ; http://php.net/assert.active 1565 | ;assert.active = On 1566 | 1567 | ; Throw an AssertionError on failed assertions 1568 | ; http://php.net/assert.exception 1569 | ;assert.exception = On 1570 | 1571 | ; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) 1572 | ; http://php.net/assert.warning 1573 | ;assert.warning = On 1574 | 1575 | ; Don't bail out by default. 1576 | ; http://php.net/assert.bail 1577 | ;assert.bail = Off 1578 | 1579 | ; User-function to be called if an assertion fails. 1580 | ; http://php.net/assert.callback 1581 | ;assert.callback = 0 1582 | 1583 | ; Eval the expression with current error_reporting(). Set to true if you want 1584 | ; error_reporting(0) around the eval(). 1585 | ; http://php.net/assert.quiet-eval 1586 | ;assert.quiet_eval = 0 1587 | 1588 | [COM] 1589 | ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs 1590 | ; http://php.net/com.typelib-file 1591 | ;com.typelib_file = 1592 | 1593 | ; allow Distributed-COM calls 1594 | ; http://php.net/com.allow-dcom 1595 | ;com.allow_dcom = true 1596 | 1597 | ; autoregister constants of a component's typlib on com_load() 1598 | ; http://php.net/com.autoregister-typelib 1599 | ;com.autoregister_typelib = true 1600 | 1601 | ; register constants casesensitive 1602 | ; http://php.net/com.autoregister-casesensitive 1603 | ;com.autoregister_casesensitive = false 1604 | 1605 | ; show warnings on duplicate constant registrations 1606 | ; http://php.net/com.autoregister-verbose 1607 | ;com.autoregister_verbose = true 1608 | 1609 | ; The default character set code-page to use when passing strings to and from COM objects. 1610 | ; Default: system ANSI code page 1611 | ;com.code_page= 1612 | 1613 | [mbstring] 1614 | ; language for internal character representation. 1615 | ; This affects mb_send_mail() and mbstring.detect_order. 1616 | ; http://php.net/mbstring.language 1617 | ;mbstring.language = Japanese 1618 | 1619 | ; Use of this INI entry is deprecated, use global internal_encoding instead. 1620 | ; internal/script encoding. 1621 | ; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) 1622 | ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. 1623 | ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding 1624 | ;mbstring.internal_encoding = 1625 | 1626 | ; Use of this INI entry is deprecated, use global input_encoding instead. 1627 | ; http input encoding. 1628 | ; mbstring.encoding_translation = On is needed to use this setting. 1629 | ; If empty, default_charset or input_encoding or mbstring.input is used. 1630 | ; The precedence is: default_charset < input_encoding < mbsting.http_input 1631 | ; http://php.net/mbstring.http-input 1632 | ;mbstring.http_input = 1633 | 1634 | ; Use of this INI entry is deprecated, use global output_encoding instead. 1635 | ; http output encoding. 1636 | ; mb_output_handler must be registered as output buffer to function. 1637 | ; If empty, default_charset or output_encoding or mbstring.http_output is used. 1638 | ; The precedence is: default_charset < output_encoding < mbstring.http_output 1639 | ; To use an output encoding conversion, mbstring's output handler must be set 1640 | ; otherwise output encoding conversion cannot be performed. 1641 | ; http://php.net/mbstring.http-output 1642 | ;mbstring.http_output = 1643 | 1644 | ; enable automatic encoding translation according to 1645 | ; mbstring.internal_encoding setting. Input chars are 1646 | ; converted to internal encoding by setting this to On. 1647 | ; Note: Do _not_ use automatic encoding translation for 1648 | ; portable libs/applications. 1649 | ; http://php.net/mbstring.encoding-translation 1650 | ;mbstring.encoding_translation = Off 1651 | 1652 | ; automatic encoding detection order. 1653 | ; "auto" detect order is changed according to mbstring.language 1654 | ; http://php.net/mbstring.detect-order 1655 | ;mbstring.detect_order = auto 1656 | 1657 | ; substitute_character used when character cannot be converted 1658 | ; one from another 1659 | ; http://php.net/mbstring.substitute-character 1660 | ;mbstring.substitute_character = none 1661 | 1662 | ; overload(replace) single byte functions by mbstring functions. 1663 | ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), 1664 | ; etc. Possible values are 0,1,2,4 or combination of them. 1665 | ; For example, 7 for overload everything. 1666 | ; 0: No overload 1667 | ; 1: Overload mail() function 1668 | ; 2: Overload str*() functions 1669 | ; 4: Overload ereg*() functions 1670 | ; http://php.net/mbstring.func-overload 1671 | ;mbstring.func_overload = 0 1672 | 1673 | ; enable strict encoding detection. 1674 | ; Default: Off 1675 | ;mbstring.strict_detection = On 1676 | 1677 | ; This directive specifies the regex pattern of content types for which mb_output_handler() 1678 | ; is activated. 1679 | ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) 1680 | ;mbstring.http_output_conv_mimetype= 1681 | 1682 | ; This directive specifies maximum stack depth for mbstring regular expressions. It is similar 1683 | ; to the pcre.recursion_limit for PCRE. 1684 | ; Default: 100000 1685 | ;mbstring.regex_stack_limit=100000 1686 | 1687 | ; This directive specifies maximum retry count for mbstring regular expressions. It is similar 1688 | ; to the pcre.backtrack_limit for PCRE. 1689 | ; Default: 1000000 1690 | ;mbstring.regex_retry_limit=1000000 1691 | 1692 | [gd] 1693 | ; Tell the jpeg decode to ignore warnings and try to create 1694 | ; a gd image. The warning will then be displayed as notices 1695 | ; disabled by default 1696 | ; http://php.net/gd.jpeg-ignore-warning 1697 | ;gd.jpeg_ignore_warning = 1 1698 | 1699 | [exif] 1700 | ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. 1701 | ; With mbstring support this will automatically be converted into the encoding 1702 | ; given by corresponding encode setting. When empty mbstring.internal_encoding 1703 | ; is used. For the decode settings you can distinguish between motorola and 1704 | ; intel byte order. A decode setting cannot be empty. 1705 | ; http://php.net/exif.encode-unicode 1706 | ;exif.encode_unicode = ISO-8859-15 1707 | 1708 | ; http://php.net/exif.decode-unicode-motorola 1709 | ;exif.decode_unicode_motorola = UCS-2BE 1710 | 1711 | ; http://php.net/exif.decode-unicode-intel 1712 | ;exif.decode_unicode_intel = UCS-2LE 1713 | 1714 | ; http://php.net/exif.encode-jis 1715 | ;exif.encode_jis = 1716 | 1717 | ; http://php.net/exif.decode-jis-motorola 1718 | ;exif.decode_jis_motorola = JIS 1719 | 1720 | ; http://php.net/exif.decode-jis-intel 1721 | ;exif.decode_jis_intel = JIS 1722 | 1723 | [Tidy] 1724 | ; The path to a default tidy configuration file to use when using tidy 1725 | ; http://php.net/tidy.default-config 1726 | ;tidy.default_config = /usr/local/lib/php/default.tcfg 1727 | 1728 | ; Should tidy clean and repair output automatically? 1729 | ; WARNING: Do not use this option if you are generating non-html content 1730 | ; such as dynamic images 1731 | ; http://php.net/tidy.clean-output 1732 | tidy.clean_output = Off 1733 | 1734 | [soap] 1735 | ; Enables or disables WSDL caching feature. 1736 | ; http://php.net/soap.wsdl-cache-enabled 1737 | soap.wsdl_cache_enabled=1 1738 | 1739 | ; Sets the directory name where SOAP extension will put cache files. 1740 | ; http://php.net/soap.wsdl-cache-dir 1741 | soap.wsdl_cache_dir="/tmp" 1742 | 1743 | ; (time to live) Sets the number of second while cached file will be used 1744 | ; instead of original one. 1745 | ; http://php.net/soap.wsdl-cache-ttl 1746 | soap.wsdl_cache_ttl=86400 1747 | 1748 | ; Sets the size of the cache limit. (Max. number of WSDL files to cache) 1749 | soap.wsdl_cache_limit = 5 1750 | 1751 | [sysvshm] 1752 | ; A default size of the shared memory segment 1753 | ;sysvshm.init_mem = 10000 1754 | 1755 | [ldap] 1756 | ; Sets the maximum number of open links or -1 for unlimited. 1757 | ldap.max_links = -1 1758 | 1759 | [dba] 1760 | ;dba.default_handler= 1761 | 1762 | [opcache] 1763 | ; Determines if Zend OPCache is enabled 1764 | ;opcache.enable=1 1765 | 1766 | ; Determines if Zend OPCache is enabled for the CLI version of PHP 1767 | ;opcache.enable_cli=0 1768 | 1769 | ; The OPcache shared memory storage size. 1770 | ;opcache.memory_consumption=128 1771 | 1772 | ; The amount of memory for interned strings in Mbytes. 1773 | ;opcache.interned_strings_buffer=8 1774 | 1775 | ; The maximum number of keys (scripts) in the OPcache hash table. 1776 | ; Only numbers between 200 and 1000000 are allowed. 1777 | ;opcache.max_accelerated_files=10000 1778 | 1779 | ; The maximum percentage of "wasted" memory until a restart is scheduled. 1780 | ;opcache.max_wasted_percentage=5 1781 | 1782 | ; When this directive is enabled, the OPcache appends the current working 1783 | ; directory to the script key, thus eliminating possible collisions between 1784 | ; files with the same name (basename). Disabling the directive improves 1785 | ; performance, but may break existing applications. 1786 | ;opcache.use_cwd=1 1787 | 1788 | ; When disabled, you must reset the OPcache manually or restart the 1789 | ; webserver for changes to the filesystem to take effect. 1790 | ;opcache.validate_timestamps=1 1791 | 1792 | ; How often (in seconds) to check file timestamps for changes to the shared 1793 | ; memory storage allocation. ("1" means validate once per second, but only 1794 | ; once per request. "0" means always validate) 1795 | ;opcache.revalidate_freq=2 1796 | 1797 | ; Enables or disables file search in include_path optimization 1798 | ;opcache.revalidate_path=0 1799 | 1800 | ; If disabled, all PHPDoc comments are dropped from the code to reduce the 1801 | ; size of the optimized code. 1802 | ;opcache.save_comments=1 1803 | 1804 | ; Allow file existence override (file_exists, etc.) performance feature. 1805 | ;opcache.enable_file_override=0 1806 | 1807 | ; A bitmask, where each bit enables or disables the appropriate OPcache 1808 | ; passes 1809 | ;opcache.optimization_level=0x7FFFBFFF 1810 | 1811 | ;opcache.dups_fix=0 1812 | 1813 | ; The location of the OPcache blacklist file (wildcards allowed). 1814 | ; Each OPcache blacklist file is a text file that holds the names of files 1815 | ; that should not be accelerated. The file format is to add each filename 1816 | ; to a new line. The filename may be a full path or just a file prefix 1817 | ; (i.e., /var/www/x blacklists all the files and directories in /var/www 1818 | ; that start with 'x'). Line starting with a ; are ignored (comments). 1819 | ;opcache.blacklist_filename= 1820 | 1821 | ; Allows exclusion of large files from being cached. By default all files 1822 | ; are cached. 1823 | ;opcache.max_file_size=0 1824 | 1825 | ; Check the cache checksum each N requests. 1826 | ; The default value of "0" means that the checks are disabled. 1827 | ;opcache.consistency_checks=0 1828 | 1829 | ; How long to wait (in seconds) for a scheduled restart to begin if the cache 1830 | ; is not being accessed. 1831 | ;opcache.force_restart_timeout=180 1832 | 1833 | ; OPcache error_log file name. Empty string assumes "stderr". 1834 | ;opcache.error_log= 1835 | 1836 | ; All OPcache errors go to the Web server log. 1837 | ; By default, only fatal errors (level 0) or errors (level 1) are logged. 1838 | ; You can also enable warnings (level 2), info messages (level 3) or 1839 | ; debug messages (level 4). 1840 | ;opcache.log_verbosity_level=1 1841 | 1842 | ; Preferred Shared Memory back-end. Leave empty and let the system decide. 1843 | ;opcache.preferred_memory_model= 1844 | 1845 | ; Protect the shared memory from unexpected writing during script execution. 1846 | ; Useful for internal debugging only. 1847 | ;opcache.protect_memory=0 1848 | 1849 | ; Allows calling OPcache API functions only from PHP scripts which path is 1850 | ; started from specified string. The default "" means no restriction 1851 | ;opcache.restrict_api= 1852 | 1853 | ; Mapping base of shared memory segments (for Windows only). All the PHP 1854 | ; processes have to map shared memory into the same address space. This 1855 | ; directive allows to manually fix the "Unable to reattach to base address" 1856 | ; errors. 1857 | ;opcache.mmap_base= 1858 | 1859 | ; Facilitates multiple OPcache instances per user (for Windows only). All PHP 1860 | ; processes with the same cache ID and user share an OPcache instance. 1861 | ;opcache.cache_id= 1862 | 1863 | ; Enables and sets the second level cache directory. 1864 | ; It should improve performance when SHM memory is full, at server restart or 1865 | ; SHM reset. The default "" disables file based caching. 1866 | ;opcache.file_cache= 1867 | 1868 | ; Enables or disables opcode caching in shared memory. 1869 | ;opcache.file_cache_only=0 1870 | 1871 | ; Enables or disables checksum validation when script loaded from file cache. 1872 | ;opcache.file_cache_consistency_checks=1 1873 | 1874 | ; Implies opcache.file_cache_only=1 for a certain process that failed to 1875 | ; reattach to the shared memory (for Windows only). Explicitly enabled file 1876 | ; cache is required. 1877 | ;opcache.file_cache_fallback=1 1878 | 1879 | ; Enables or disables copying of PHP code (text segment) into HUGE PAGES. 1880 | ; This should improve performance, but requires appropriate OS configuration. 1881 | ;opcache.huge_code_pages=1 1882 | 1883 | ; Validate cached file permissions. 1884 | ;opcache.validate_permission=0 1885 | 1886 | ; Prevent name collisions in chroot'ed environment. 1887 | ;opcache.validate_root=0 1888 | 1889 | ; If specified, it produces opcode dumps for debugging different stages of 1890 | ; optimizations. 1891 | ;opcache.opt_debug_level=0 1892 | 1893 | ; Specifies a PHP script that is going to be compiled and executed at server 1894 | ; start-up. 1895 | ; http://php.net/opcache.preload 1896 | ;opcache.preload= 1897 | 1898 | ; Preloading code as root is not allowed for security reasons. This directive 1899 | ; facilitates to let the preloading to be run as another user. 1900 | ; http://php.net/opcache.preload_user 1901 | ;opcache.preload_user= 1902 | 1903 | ; Prevents caching files that are less than this number of seconds old. It 1904 | ; protects from caching of incompletely updated files. In case all file updates 1905 | ; on your site are atomic, you may increase performance by setting it to "0". 1906 | ;opcache.file_update_protection=2 1907 | 1908 | ; Absolute path used to store shared lockfiles (for *nix only). 1909 | ;opcache.lockfile_path=/tmp 1910 | 1911 | [curl] 1912 | ; A default value for the CURLOPT_CAINFO option. This is required to be an 1913 | ; absolute path. 1914 | ;curl.cainfo = 1915 | 1916 | [openssl] 1917 | ; The location of a Certificate Authority (CA) file on the local filesystem 1918 | ; to use when verifying the identity of SSL/TLS peers. Most users should 1919 | ; not specify a value for this directive as PHP will attempt to use the 1920 | ; OS-managed cert stores in its absence. If specified, this value may still 1921 | ; be overridden on a per-stream basis via the "cafile" SSL stream context 1922 | ; option. 1923 | ;openssl.cafile= 1924 | 1925 | ; If openssl.cafile is not specified or if the CA file is not found, the 1926 | ; directory pointed to by openssl.capath is searched for a suitable 1927 | ; certificate. This value must be a correctly hashed certificate directory. 1928 | ; Most users should not specify a value for this directive as PHP will 1929 | ; attempt to use the OS-managed cert stores in its absence. If specified, 1930 | ; this value may still be overridden on a per-stream basis via the "capath" 1931 | ; SSL stream context option. 1932 | ;openssl.capath= 1933 | 1934 | [ffi] 1935 | ; FFI API restriction. Possible values: 1936 | ; "preload" - enabled in CLI scripts and preloaded files (default) 1937 | ; "false" - always disabled 1938 | ; "true" - always enabled 1939 | ;ffi.enable=preload 1940 | 1941 | ; List of headers files to preload, wildcard patterns allowed. 1942 | ;ffi.preload= 1943 | -------------------------------------------------------------------------------- /etc/samba/smb.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | server string = Samba %v on %L 3 | log level = 0 4 | 5 | min receivefile size = 16384 6 | use sendfile = yes 7 | aio read size = 2048 8 | aio write size = 2048 9 | read raw = yes 10 | write raw = yes 11 | getwd cache = yes 12 | oplocks = yes 13 | max xmit = 32768 14 | dead time = 15 15 | large readwrite = yes 16 | unix extensions = no 17 | strict locking = no 18 | 19 | guest ok = yes 20 | map to guest = bad user 21 | 22 | load printers = no 23 | printing = bsd 24 | printcap name = /dev/null 25 | disable spoolss = yes 26 | 27 | [SD] 28 | path = /mnt/MPD/SD 29 | read only = no 30 | 31 | [USB] 32 | path = /mnt/MPD/USB 33 | read only = no 34 | dfree command = /srv/http/bash/smbdfree.sh 35 | -------------------------------------------------------------------------------- /etc/shairport-sync.conf: -------------------------------------------------------------------------------- 1 | general = { 2 | name = "rAudio" 3 | run_this_when_volume_is_set = "/usr/bin/sudo /srv/http/bash/cmd.sh volumepushstream"; 4 | } 5 | sessioncontrol = { 6 | run_this_before_play_begins = "/usr/bin/sudo /srv/http/bash/cmd.sh shairport"; 7 | run_this_after_play_ends = "/usr/bin/sudo /srv/http/bash/cmd.sh shairportstop"; 8 | } 9 | alsa = { 10 | output_device = "hw:0"; 11 | mixer_control_name = "PCM"; 12 | } 13 | -------------------------------------------------------------------------------- /etc/spotifyd.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | bitrate = 320 3 | onevent = "/srv/http/bash/spotifyd.sh" 4 | use_mpris = false 5 | backend = "alsa" 6 | volume_controller = "alsa" 7 | device = "default:CARD=Headphones" 8 | mixer = "Headphone" 9 | control = "hw:0" 10 | -------------------------------------------------------------------------------- /etc/sudoers.d/raudio: -------------------------------------------------------------------------------- 1 | http ALL=(ALL) NOPASSWD: ALL 2 | mpd ALL=(ALL) NOPASSWD: /usr/bin/xset 3 | upmpdcli ALL=(ALL) NOPASSWD: /srv/http/bash/* 4 | -------------------------------------------------------------------------------- /etc/systemd/system/avahi-daemon.service.d/override.conf: -------------------------------------------------------------------------------- 1 | [Unit] 2 | After=systemd-resolved.service 3 | 4 | -------------------------------------------------------------------------------- /etc/systemd/system/bluealsa-dbus.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Dbus for Bluetooth audio as receiver 3 | After=bluetooth.service 4 | Requires=bluetooth.service 5 | 6 | [Service] 7 | ExecStart=/srv/http/bash/bluealsa-dbus.py 8 | -------------------------------------------------------------------------------- /etc/systemd/system/bluealsa.service.d/override.conf: -------------------------------------------------------------------------------- 1 | [Unit] 2 | After=bluetooth.service 3 | Requires=bluetooth.service 4 | 5 | [Service] 6 | CPUAffinity=3 7 | ExecStart= 8 | ExecStart=/usr/bin/bluealsa -p a2dp-sink -p a2dp-source 9 | -------------------------------------------------------------------------------- /etc/systemd/system/bluetooth.service.d/override.conf: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Requires=startup.service 3 | BindsTo=bluealsa.service bluealsa-aplay.service bluealsa-dbus.service 4 | 5 | [Service] 6 | CPUAffinity=3 7 | ExecStart= 8 | ExecStart=/usr/lib/bluetooth/bluetoothd -P battery 9 | ExecStartPost=/srv/http/bash/settings/system.sh bluetoothstart 10 | 11 | [Install] 12 | WantedBy= 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /etc/systemd/system/bluetoothbutton.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Bluetooth buttons 3 | 4 | [Service] 5 | Type=simple 6 | ExecStart=/srv/http/bash/bluetoothbutton.sh 7 | -------------------------------------------------------------------------------- /etc/systemd/system/bootsplash.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description = Splash screen on startup 3 | DefaultDependencies=no 4 | After=systemd-vconsole-setup.service 5 | Before=sysinit.target 6 | 7 | [Service] 8 | Type=oneshot 9 | RemainAfterExit=yes 10 | ExecStart=/usr/bin/ply-image /srv/http/assets/img/splash.png 11 | 12 | [Install] 13 | WantedBy=getty.target 14 | -------------------------------------------------------------------------------- /etc/systemd/system/cava.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=VU level for VU LED and VU meter 3 | 4 | [Service] 5 | User=root 6 | ExecStart=/srv/http/bash/vu.sh 7 | ExecStop=/srv/http/bash/vu.sh stop 8 | -------------------------------------------------------------------------------- /etc/systemd/system/lcdchar.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Character LCD 3 | 4 | [Service] 5 | ExecStart=/srv/http/bash/lcdchar.py 6 | -------------------------------------------------------------------------------- /etc/systemd/system/localbrowser.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Browser on RPi 3 | After=startup.service 4 | 5 | [Service] 6 | Type=idle 7 | ExecStart=/usr/bin/startx /srv/http/bash/startx.sh 8 | 9 | [Install] 10 | WantedBy=multi-user.target 11 | -------------------------------------------------------------------------------- /etc/systemd/system/mpd.service.d/override.conf: -------------------------------------------------------------------------------- 1 | [Unit] 2 | BindsTo=mpdidle.service 3 | 4 | [Service] 5 | CPUAffinity=3 6 | ExecStart= 7 | ExecStart=/usr/bin/mpd --systemd /srv/http/data/mpdconf/mpd.conf 8 | -------------------------------------------------------------------------------- /etc/systemd/system/mpdidle.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=MPD idle 3 | Requires=mpd.service 4 | After=mpd.service 5 | 6 | [Service] 7 | ExecStart=/srv/http/bash/mpdidle.sh 8 | -------------------------------------------------------------------------------- /etc/systemd/system/nginx.service.d/override.conf: -------------------------------------------------------------------------------- 1 | [Unit] 2 | After=php-fpm.service 3 | 4 | [Service] 5 | # allow mount 6 | PrivateTmp=false 7 | -------------------------------------------------------------------------------- /etc/systemd/system/php-fpm.service.d/override.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | PrivateTmp=false 3 | ProtectSystem=false 4 | PrivateDevices=false 5 | 6 | # allow modprobe, rmmod 7 | ProtectKernelModules=false 8 | ProtectKernelTunables=false 9 | 10 | ProtectControlGroups=false 11 | RestrictRealtime=false 12 | RestrictNamespaces=false 13 | -------------------------------------------------------------------------------- /etc/systemd/system/powerbutton.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Power button 3 | After=startup.service 4 | 5 | [Service] 6 | ExecStart=/srv/http/bash/powerbutton.sh 7 | 8 | [Install] 9 | WantedBy=getty.target 10 | -------------------------------------------------------------------------------- /etc/systemd/system/radio.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Web Radio metadata 3 | 4 | [Service] 5 | Type=simple 6 | ExecStart=/srv/http/bash/status-radio.sh 7 | -------------------------------------------------------------------------------- /etc/systemd/system/rotaryencoder.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Rotary encoder 3 | After=startup.service 4 | 5 | [Service] 6 | ExecStart=/srv/http/bash/rotaryencoder.sh 7 | 8 | [Install] 9 | WantedBy=default.target 10 | -------------------------------------------------------------------------------- /etc/systemd/system/shairport-sync.service.d/override.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | CPUAffinity=3 3 | User=root 4 | Group=root 5 | -------------------------------------------------------------------------------- /etc/systemd/system/shairport.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Shairport Sync metadata 3 | After=network.target shairport-sync.service 4 | 5 | [Service] 6 | ExecStart=/srv/http/bash/shairport.sh 7 | User=root 8 | Group=root 9 | -------------------------------------------------------------------------------- /etc/systemd/system/startup.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=rAudio Startup 3 | After=nginx.service 4 | 5 | [Service] 6 | Type=oneshot 7 | ExecStart=/srv/http/bash/startup.sh 8 | 9 | [Install] 10 | WantedBy=multi-user.target 11 | -------------------------------------------------------------------------------- /etc/systemd/system/systemd-udevd.service.d/ipaddressallow.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | IPAddressDeny= 3 | -------------------------------------------------------------------------------- /etc/systemd/system/upmpdcli.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=UPnP Renderer front-end to MPD 3 | After=startup.service 4 | 5 | [Service] 6 | Type=simple 7 | CPUAffinity=3 8 | ExecStart=/usr/bin/upmpdcli -c /etc/upmpdcli.conf 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | -------------------------------------------------------------------------------- /etc/systemd/system/websocket.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Websocket server 3 | Before=startup.service 4 | 5 | [Service] 6 | ExecStart=/srv/http/bash/websocket.py 7 | 8 | [Install] 9 | WantedBy=multi-user.target 10 | -------------------------------------------------------------------------------- /etc/udev/rules.d/bluetooth.rules: -------------------------------------------------------------------------------- 1 | ACTION=="add", \ 2 | SUBSYSTEM=="bluetooth", \ 3 | ENV{DEVTYPE}=="link", \ 4 | RUN+="/srv/http/bash/settings/networks-bluetooth.sh connect" 5 | 6 | ACTION=="remove", \ 7 | SUBSYSTEM=="bluetooth", \ 8 | ENV{DEVTYPE}=="link", \ 9 | RUN+="/srv/http/bash/settings/networks-bluetooth.sh disconnect" 10 | -------------------------------------------------------------------------------- /etc/udev/rules.d/cdrom.rules: -------------------------------------------------------------------------------- 1 | # power on : add > change 2 | # insert CD : change 3 | # eject CD : change > eject 4 | # power off : remove 5 | 6 | SUBSYSTEM!="block", GOTO="cdrom_end" 7 | KERNEL!="sr[0-9]*", GOTO="cdrom_end" 8 | ENV{DEVTYPE}!="disk", GOTO="cdrom_end" 9 | 10 | ##### power off 11 | ACTION=="remove", RUN+="/srv/http/bash/audiocd.sh off", GOTO="cdrom_end" 12 | 13 | # tag device as CDROM 14 | KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1" 15 | 16 | # stop any mounts on eject button pressed 17 | ENV{ID_CDROM}=="1", ENV{SYSTEMD_MOUNT_DEVICE_BOUND}="1" 18 | 19 | ##### eject button 20 | ENV{DISK_EJECT_REQUEST}=="?*", RUN+="/srv/http/bash/audiocd.sh eject", GOTO="cdrom_end" 21 | 22 | # import device, media properties and lock tray to enable eject button events 23 | IMPORT{program}="cdrom_id --lock-media $devnode" 24 | 25 | # cleans up of stale mounts after eject 26 | ENV{DISK_MEDIA_CHANGE}=="?*", ENV{ID_CDROM_MEDIA}!="?*", ENV{SYSTEMD_READY}="0" 27 | 28 | KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100" 29 | 30 | ##### set rw permission (default 0660) 31 | ACTION=="add", MODE="0666", RUN+="/srv/http/bash/audiocd.sh on" 32 | 33 | ##### power on, insert, eject 34 | ACTION=="change", RUN+="/srv/http/bash/audiocd.sh" 35 | 36 | LABEL="cdrom_end" -------------------------------------------------------------------------------- /etc/udev/rules.d/ntfs.rules: -------------------------------------------------------------------------------- 1 | ACTION=="add", \ 2 | SUBSYSTEM=="block", \ 3 | ENV{ID_FS_TYPE}=="ntfs", \ 4 | ENV{ID_FS_TYPE}="ntfs3", \ 5 | RUN+="/srv/http/bash/settings/system.sh usbconnect" 6 | 7 | ACTION=="remove", \ 8 | SUBSYSTEM=="block", \ 9 | ENV{ID_FS_TYPE}=="ntfs", \ 10 | ENV{ID_FS_TYPE}="ntfs3", \ 11 | RUN+="/srv/http/bash/settings/system.sh usbremove" 12 | -------------------------------------------------------------------------------- /etc/udev/rules.d/usbbluetooth.rules: -------------------------------------------------------------------------------- 1 | ACTION=="add", \ 2 | SUBSYSTEM=="bluetooth", \ 3 | ENV{DEVTYPE}=="host", \ 4 | RUN+="/srv/http/bash/settings/networks.sh usbbluetoothon" 5 | 6 | ACTION=="remove", \ 7 | SUBSYSTEM=="bluetooth", \ 8 | ENV{DEVTYPE}=="host", \ 9 | RUN+="/srv/http/bash/settings/networks.sh usbbluetoothoff" 10 | -------------------------------------------------------------------------------- /etc/udev/rules.d/usbdac.rules: -------------------------------------------------------------------------------- 1 | ACTION=="add", \ 2 | SUBSYSTEMS=="usb", \ 3 | KERNEL=="card*", \ 4 | SUBSYSTEM=="sound", \ 5 | RUN+="/srv/http/bash/settings/player-conf.sh add" 6 | 7 | ACTION=="remove", \ 8 | SUBSYSTEMS=="usb", \ 9 | KERNEL=="card*", \ 10 | SUBSYSTEM=="sound", \ 11 | RUN+="/srv/http/bash/settings/player-conf.sh remove" 12 | -------------------------------------------------------------------------------- /etc/udev/rules.d/usbwifi.rules: -------------------------------------------------------------------------------- 1 | ACTION=="add", \ 2 | SUBSYSTEMS=="usb", \ 3 | SUBSYSTEM=="net", \ 4 | RUN+="/srv/http/bash/settings/networks.sh usbwifion" 5 | 6 | ACTION=="remove", \ 7 | SUBSYSTEMS=="usb", \ 8 | SUBSYSTEM=="net", \ 9 | RUN+="/srv/http/bash/settings/networks.sh usbwifioff" 10 | -------------------------------------------------------------------------------- /etc/udevil/udevil.conf: -------------------------------------------------------------------------------- 1 | ############################################################################## 2 | # 3 | # udevil configuration file /etc/udevil/udevil.conf 4 | # 5 | # This file controls what devices, networks, and files users may mount and 6 | # unmount via udevil (set suid). 7 | # 8 | # IMPORTANT: IT IS POSSIBLE TO CREATE SERIOUS SECURITY PROBLEMS IF THIS FILE 9 | # IS MISCONFIGURED - EDIT WITH CARE 10 | # 11 | # Note: For greater control for specific users, including root, copy this 12 | # file to /etc/udevil/udevil-user-USERNAME.conf replacing USERNAME with the 13 | # desired username (eg /etc/udevil/udevil-user-jim.conf). 14 | # 15 | # Format: 16 | # OPTION = VALUE[, VALUE, ...] 17 | # 18 | # DO NOT USE QUOTES except literally 19 | # Lines beginning with # are ignored 20 | # 21 | ############################################################################## 22 | 23 | 24 | # To log all uses of udevil, set log_file to a file path: 25 | # log_file = /var/log/udevil.log 26 | 27 | # Approximate number of days to retain log entries (0=forever, max=60): 28 | log_keep_days = 1 29 | 30 | 31 | # allowed_types determines what fstypes can be passed by a user to the u/mount 32 | # program, what device filesystems may be un/mounted implicitly, and what 33 | # network filesystems may be un/mounted. 34 | # It may also include the 'file' keyword, indicating that the user is allowed 35 | # to mount files (eg an ISO file). The $KNOWN_FILESYSTEMS variable may 36 | # be included to include common local filesystems as well as those listed in 37 | # /etc/filesystems and /proc/filesystems. 38 | # allowed_types_USERNAME, if present, is used to override allowed_types for 39 | # the specific user 'USERNAME'. For example, to allow user 'jim' to mount 40 | # only vfat filesystems, add: 41 | # allowed_types_jim = vfat 42 | # Setting allowed_types = * does NOT allow all types, as this is a security 43 | # risk, but does allow all recognized types. 44 | # allowed_types = $KNOWN_FILESYSTEMS, file, cifs, smbfs, nfs, curlftpfs, ftpfs, sshfs, davfs, tmpfs, ramfs 45 | allowed_types = $KNOWN_FILESYSTEMS, file, hfsplus 46 | 47 | 48 | # allowed_users is a list of users permitted to mount and unmount with udevil. 49 | # Wildcards (* or ?) may be used in the usernames. To allow all users, 50 | # specify "allowed_users=*". UIDs may be included using the form UID=1000. 51 | # For example: allowed_users = carl, UID=1000, pre* 52 | # Also note that permission to execute udevil may be limited to users belonging 53 | # to the group that owns /usr/bin/udevil, such as 'plugdev' or 'storage', 54 | # depending on installation. 55 | # allowed_users_FSTYPE, if present, is used to override allowed_users when 56 | # mounting or unmounting a specific fstype (eg nfs, ext3, file). 57 | # Note that when mounting a file, fstype will always be 'file' regardless of 58 | # the internal fstype of the file. 59 | # For example, to allow only user 'bob' to mount nfs shares, add: 60 | # allowed_users_nfs = bob 61 | # The root user is NOT automatically allowed to use udevil in some cases unless 62 | # listed here (except for unmounting anything or mounting fstab devices). 63 | allowed_users = * 64 | 65 | 66 | # allowed_groups is a list of groups permitted to mount and unmount with 67 | # udevil. The user MUST belong to at least one of these groups. Wildcards 68 | # or GIDs may NOT be used in group names, but a single * may be used to allow 69 | # all groups. 70 | # Also note that permission to execute udevil may be limited to users belonging 71 | # to the group that owns /usr/bin/udevil, such as 'plugdev' or 'storage', 72 | # depending on installation. 73 | # allowed_groups_FSTYPE, if present, is used to override allowed_groups when 74 | # mounting or unmounting a specific fstype (eg nfs, ext3, file). For example, 75 | # to allow only members of the 'network' group to mount smb and nfs shares, 76 | # use both of these lines: 77 | # allowed_groups_smbfs = network 78 | # allowed_groups_nfs = network 79 | # The root user is NOT automatically allowed to use udevil in some cases unless 80 | # listed here (except for unmounting anything or mounting fstab devices). 81 | allowed_groups = * 82 | 83 | 84 | # allowed_media_dirs specifies the media directories in which user mount points 85 | # may be located. The first directory which exists and does not contain a 86 | # wildcard will be used as the default media directory (normally /media or 87 | # /media/$USER). 88 | # The $USER variable, if included, will be replaced with the username of the 89 | # user running udevil. Wildcards may also be used in any directory EXCEPT the 90 | # default. Wildcards will not match a /, except a /** suffix for recursion. 91 | # allowed_media_dirs_FSTYPE, if present, is used to override allowed_media_dirs 92 | # when mounting or unmounting a specific fstype (eg ext2, nfs). For example, 93 | # to cause /media/network to be used as the default media directory for 94 | # nfs and ftpfs mounts, use these two lines: 95 | # allowed_media_dirs_nfs = /media/network, /media, /media/$USER 96 | # allowed_media_dirs_ftpfs = /media/network, /media, /media/$USER 97 | # NOTE: If you want only the user who mounted a device to have access to it 98 | # and be allowed to unmount it, specify /media/$USER as the first 99 | # allowed media directory (only /media/$USER is created on demand). 100 | # IMPORTANT: If an allowed file is mounted to a media directory, the user may 101 | # be permitted to unmount its associated loop device even though internal. 102 | # INCLUDING /MNT HERE IS NOT RECOMMENDED. ALL ALLOWED MEDIA DIRECTORIES 103 | # SHOULD BE OWNED AND WRITABLE ONLY BY ROOT. 104 | allowed_media_dirs = /mnt/MPD/USB 105 | 106 | 107 | # allowed_devices is the first criteria for what block devices users may mount 108 | # or unmount. If a device is not listed in allowed_devices, it cannot be 109 | # un/mounted (unless in fstab). However, even if a device is listed, other 110 | # factors may prevent its use. For example, access to system internal devices 111 | # will be denied to normal users even if they are included in allowed_devices. 112 | # allowed_devices_FSTYPE, if present, is used to override allowed_devices when 113 | # mounting or unmounting a specific fstype (eg ext3, ntfs). For example, to 114 | # prevent all block devices containing an ext4 filesystem from being 115 | # un/mounted use: 116 | # allowed_devices_ext4 = 117 | # Note: Wildcards may be used, but a wildcard will never match a /, except 118 | # for "allowed_devices=*" which allows any device. The recommended setting is 119 | # allowed_devices = /dev/* 120 | # WARNING: ALLOWING USERS TO MOUNT DEVICES OUTSIDE OF /dev CAN CAUSE SERIOUS 121 | # SECURITY PROBLEMS. DO NOT ALLOW DEVICES IN /dev/shm 122 | allowed_devices = /dev/* 123 | 124 | 125 | # allowed_internal_devices causes udevil to treat any listed block devices as 126 | # removable, thus allowing normal users to un/mount them (providing they are 127 | # also listed in allowed_devices). 128 | # allowed_internal_devices_FSTYPE, if present, is used to override 129 | # allowed_internal_devices when mounting or unmounting a specific fstype 130 | # (eg ext3, ntfs). For example, to allow block devices containing a vfat 131 | # filesystem to be un/mounted even if they are system internal devices, use: 132 | # allowed_internal_devices_vfat = /dev/sdb* 133 | # Some removable esata drives look like internal drives to udevil. To avoid 134 | # this problem, they can be treated as removable with this setting. 135 | # WARNING: SETTING A SYSTEM DEVICE HERE CAN CAUSE SERIOUS SECURITY PROBLEMS. 136 | # allowed_internal_devices = 137 | 138 | 139 | # allowed_internal_uuids and allowed_internal_uuids_FSTYPE work similarly to 140 | # allowed_internal_devices, except that UUIDs are specified instead of devices. 141 | # For example, to allow un/mounting of an internal filesystem based on UUID: 142 | # allowed_internal_uuids = cc0c4489-8def-1e5b-a304-ab87c3cb626c0 143 | # WARNING: SETTING A SYSTEM DEVICE HERE CAN CAUSE SERIOUS SECURITY PROBLEMS. 144 | # allowed_internal_uuids = 145 | 146 | 147 | # forbidden_devices is used to prevent block devices from being un/mounted 148 | # even if other settings would allow them (except devices in fstab). 149 | # forbidden_devices_FSTYPE, if present, is used to override 150 | # forbidden_devices when mounting or unmounting a specific fstype 151 | # (eg ext3, ntfs). For example, to prevent device /dev/sdd1 from being 152 | # mounted when it contains an ntfs filesystem, use: 153 | # forbidden_devices_ntfs = /dev/sdd1 154 | # NOTE: device node paths are canonicalized before being tested, so forbidding 155 | # a link to a device will have no effect. 156 | forbidden_devices = 157 | 158 | 159 | # allowed_networks determines what hosts may be un/mounted by udevil users when 160 | # using nfs, cifs, smbfs, curlftpfs, ftpfs, or sshfs. Hosts may be specified 161 | # using a hostname (eg myserver.com) or IP address (192.168.1.100). 162 | # Wildcards may be used in hostnames and IP addresses, but CIDR notation 163 | # (192.168.1.0/16) is NOT supported. IP v6 is supported. For example: 164 | # allowed_networks = 127.0.0.1, 192.168.1.*, 10.0.0.*, localmachine, *.okay.com 165 | # Or, to prevent un/mounting of any network shares, set: 166 | # allowed_networks = 167 | # allowed_networks_FSTYPE, if present, is used to override allowed_networks 168 | # when mounting or unmounting a specific network fstype (eg nfs, cifs, sshfs, 169 | # curlftpfs). For example, to limit nfs and samba shares to only local 170 | # networks, use these two lines: 171 | # allowed_networks_nfs = 192.168.1.*, 10.0.0.* 172 | # allowed_networks_cifs = 192.168.1.*, 10.0.0.* 173 | allowed_networks = * 174 | 175 | 176 | # forbidden_networks and forbidden_networks_FSTYPE are used to specify networks 177 | # that are never allowed, even if other settings allow them (except fstab). 178 | # NO REVERSE LOOKUP IS PERFORMED, so including bad.com will only have an effect 179 | # if the user uses that hostname. IP lookup is always performed, so forbidding 180 | # an IP address will also forbid all corresponding hostnames. 181 | forbidden_networks = 182 | 183 | 184 | # allowed_files is used to determine what files in what directories may be 185 | # un/mounted. A user must also have read permission on a file to mount it. 186 | # Note: Wildcards may be used, but a wildcard will never match a /, except 187 | # for "allowed_files=*" which allows any file, and a /** suffix, which matches 188 | # all files recursively. 189 | # For example, to allow only files in the /share directory to be mounted, use: 190 | # allowed_files = /share/* 191 | # To allow all files in the /share directory AND all subdirectories use: 192 | # allowed_files = /share/** 193 | # NOTE: Specifying allowed_files_FSTYPE will NOT work because the fstype of 194 | # files is always 'file'. 195 | allowed_files = * 196 | 197 | 198 | # forbidden_files is used to specify files that are never allowed, even if 199 | # other settings allow them (except fstab). Specify a full path. 200 | # Note: Wildcards may be used, but a wildcard will never match a /, except 201 | # for "forbidden_files = *", or a /** suffix, which matches all recursively. 202 | # NOTE: file paths are canonicalized before being tested, so forbidding 203 | # a link to a file will have no effect. 204 | forbidden_files = 205 | 206 | 207 | # default_options specifies what options are always included when performing 208 | # a mount, in addition to any options the user may specify. 209 | # Note: When a device is present in /etc/fstab, and the user does not specify 210 | # a mount point, the device is mounted with normal user permissions using 211 | # the fstab entry, without these options. 212 | # default_options_FSTYPE, if present, is used to override default_options 213 | # when mounting a specific fstype (eg ext2, nfs). 214 | # The variables $USER, $UID, and $GID are changed to the user's username, UID, 215 | # and GID. 216 | # FOR GOOD SECURITY, default_options SHOULD ALWAYS INCLUDE: nosuid,noexec,nodev 217 | # WARNING: OPTIONS PRESENT OR MISSING CAN CAUSE SERIOUS SECURITY PROBLEMS. 218 | default_options = nosuid, noexec, nodev, noatime 219 | default_options_file = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, ro 220 | # mount iso9660 with 'ro' to prevent mount read-only warning 221 | default_options_iso9660 = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, ro, utf8 222 | default_options_udf = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID 223 | default_options_msdos = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=$UID, gid=$GID 224 | default_options_umsdos = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=$UID, gid=$GID 225 | default_options_cifs = nosuid, noexec, nodev, uid=$UID, gid=$GID 226 | default_options_smbfs = nosuid, noexec, nodev, uid=$UID, gid=$GID 227 | default_options_sshfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, nonempty, allow_other 228 | default_options_curlftpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID, nonempty, allow_other 229 | default_options_ftpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID 230 | default_options_davfs = nosuid, noexec, nodev, uid=$UID, gid=$GID 231 | default_options_tmpfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID 232 | default_options_ramfs = nosuid, noexec, nodev, noatime, uid=$UID, gid=$GID 233 | default_options_ntfs = nosuid, noexec, nodev, noatime, fmask=0000, dmask=0000, utf8 234 | default_options_vfat = nosuid, noexec, nodev, noatime, fmask=0000, dmask=0000, utf8 235 | default_options_exfat = nosuid, noexec, nodev, noatime, fmask=0000, dmask=0000, utf8 236 | default_options_hfsplus = nosuid, noexec, nodev, noatime, rw, uid=$UID, gid=$GID 237 | 238 | 239 | # allowed_options determines all options that a user may specify when mounting. 240 | # All the options used in default_options above must be included here too, or 241 | # they will be rejected. If the user attempts to use an option not included 242 | # here, an error will result. Wildcards may be used. 243 | # allowed_options_FSTYPE, if present, is used to override allowed_options 244 | # when mounting a specific fstype (eg ext2, nfs). 245 | # The variables $USER, $UID, and $GID are changed to the user's username, UID, 246 | # and GID. 247 | # If you want to forbid remounts, remove 'remount' from here. 248 | # WARNING: OPTIONS HERE CAN CAUSE SERIOUS SECURITY PROBLEMS - CHOOSE CAREFULLY 249 | allowed_options = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=$UID, gid=$GID, ro, rw, sync, flush, iocharset=*, utf8, remount 250 | allowed_options_nfs = nosuid, noexec, nodev, noatime, ro, rw, sync, remount, port=*, rsize=*, wsize=*, hard, proto=*, timeo=*, retrans=* 251 | allowed_options_cifs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, domain=*, uid=$UID, gid=$GID, credentials=* 252 | allowed_options_smbfs = nosuid, noexec, nodev, ro, rw, remount, port=*, user=*, username=*, pass=*, password=*, guest, domain=*, uid=$UID, gid=$GID, credentials=* 253 | allowed_options_sshfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other, idmap=user, BatchMode=yes, port=* 254 | allowed_options_curlftpfs = nosuid, noexec, nodev, noatime, ro, rw, uid=$UID, gid=$GID, nonempty, allow_other, user=* 255 | allowed_options_ftpfs = nosuid, noexec, nodev, noatime, ro, rw, port=*, user=*, pass=*, root=*, uid=$UID, gid=$GID 256 | allowed_options_ntfs = nosuid, noexec, nodev, noatime, fmask=0000, dmask=0000, utf8 257 | allowed_options_vfat = nosuid, noexec, nodev, noatime, fmask=0000, dmask=0000, utf8 258 | allowed_options_exfat = nosuid, noexec, nodev, noatime, fmask=0000, dmask=0000, utf8 259 | allowed_options_hfsplus = nosuid, noexec, nodev, noatime, rw, uid=$UID, gid=$GID 260 | 261 | 262 | # mount_point_mode, if present and set to a non-empty value, will cause udevil 263 | # to set the mode (permissions) on the moint point after mounting If not 264 | # specified or if left empty, the mode is not changed. Mode must be octal 265 | # starting with a zero (0755). 266 | # mount_point_mode_FSTYPE, if present, is used to override mount_point_mode 267 | # when mounting a specific fstype (eg ext2, nfs). 268 | # NOT SETTING A MODE CAN HAVE SECURITY IMPLICATIONS FOR SOME FSTYPES 269 | mount_point_mode = 0777 270 | # don't set a mode for some types: 271 | mount_point_mode_sshfs = 272 | mount_point_mode_curlftpfs = 273 | mount_point_mode_ftpfs = 274 | 275 | 276 | # Use the settings below to change the default locations of programs used by 277 | # udevil, or (advanced topic) to redirect commands to your scripts. 278 | # When substituting scripts, make sure they are root-owned and accept the 279 | # options used by udevil (for example, the mount_program must accept --fake, 280 | # -o, -v, and other options valid to mount.) 281 | # Be sure to specify the full path and include NO OPTIONS or other arguments. 282 | # These programs may also be specified as configure options when building 283 | # udevil. 284 | # THESE PROGRAMS ARE RUN AS ROOT 285 | # mount_program = /bin/mount 286 | # umount_program = /bin/umount 287 | # losetup_program = /sbin/losetup 288 | # setfacl_program = /usr/bin/setfacl 289 | 290 | 291 | # validate_exec specifies a program or script which provides additional 292 | # validation of a mount or unmount command, beyond the checks performed by 293 | # udevil. The program is run as a normal user (if root runs udevil, 294 | # validate_exec will NOT be run). The program is NOT run if the user is 295 | # mounting a device without root privileges (a device in fstab). 296 | # The program is passed the username, a printable description of what is 297 | # happening, and the entire udevil command line as the first three arguments. 298 | # The program must return an exit status of 0 to allow the mount or unmount 299 | # to proceed. If it returns non-zero, the user will be denied permission. 300 | # For example, validate_exec might specify a script which notifies you 301 | # of the command being run, or performs additional steps to authenticate the 302 | # user. 303 | # Specify a full path to the program, with NO options or arguments. 304 | # validate_exec = 305 | 306 | 307 | # validate_rootexec works similarly to validate_exec, except that the program 308 | # is run as root. validate_rootexec will also be run if the root user runs 309 | # udevil. If both validate_exec and validate_rootexec are specified, 310 | # validate_rootexec will run first, followed by validate_exec. 311 | # The program must return an exit status of 0 to allow the mount or unmount 312 | # to proceed. If it returns non-zero, the user will be denied permission. 313 | # Unless you are familiar with writing root scripts, it is recommended that 314 | # rootexec settings NOT be used, as it is easy to inadvertently open exploits. 315 | # THIS PROGRAM IS ALWAYS RUN AS ROOT, even if the user running udevil is not. 316 | # validate_rootexec = 317 | 318 | 319 | # success_exec is run after a successful mount, remount, or unmount. The 320 | # program is run as a normal user (if root runs udevil, success_exec 321 | # will NOT be run). 322 | # The program is passed the username, a printable description of what action 323 | # was taken, and the entire udevil command line as the first three arguments. 324 | # The program's exit status is ignored. 325 | # For example, success_exec might run a script which informs you of what action 326 | # was taken, and might perform further actions. 327 | # Specify a full path to the program, with NO options or arguments. 328 | # success_exec = 329 | 330 | 331 | # success_rootexec works similarly to success_exec, except that the program is 332 | # run as root. success_rootexec will also be run if the root user runs udevil. 333 | # If both success_exec and success_rootexec are specified, success_rootexec 334 | # will run first, followed by success_exec. 335 | # Unless you are familiar with writing root scripts, it is recommended that 336 | # rootexec settings NOT be used, as it is easy to inadvertently open exploits. 337 | # THIS PROGRAM IS ALWAYS RUN AS ROOT, even if the user running udevil is not. 338 | # success_rootexec = 339 | -------------------------------------------------------------------------------- /etc/upmpdcli.conf: -------------------------------------------------------------------------------- 1 | friendlyname = rAudio 2 | ownqueue = 0 3 | iconpath = /srv/http/assets/img/icon.png 4 | onstart = /usr/bin/sudo /srv/http/bash/cmd.sh upnpstart 5 | onplay = /srv/http/bash/status-push.sh 6 | onpause = /srv/http/bash/status-push.sh 7 | onstop = /srv/http/bash/status-push.sh 8 | -------------------------------------------------------------------------------- /hdmi-wfhd.md: -------------------------------------------------------------------------------- 1 | HDMI setting for WFHD 2560 x 1080 2 | --- 3 | 4 | `config.txt` 5 | ```sh 6 | ... 7 | hdmi_drive=2 8 | hdmi_ignore_edid=0xa5000080 9 | hdmi_group=2 10 | hdmi_mode=87 11 | hdmi_aspect_21_9=7 12 | hdmi_pixel_freq_limit=400000000 13 | hdmi_cvt=2560 1080 50 7 0 0 1 14 | max_framebuffer_width=2560 15 | max_framebuffer_height=1080 16 | framebuffer_width=2560 17 | framebuffer_height=1080 18 | ``` 19 | -------------------------------------------------------------------------------- /i2s_setting.md: -------------------------------------------------------------------------------- 1 | I2S Setting 2 | --- 3 | 4 | ### System > I2S module: 5 | - Populate select: `/srv/http/settings/system-i2smodules.php` 6 | - set `selected` and show 7 | - `name` = `/srv/http/data/system/audio-output` 8 | - `sysname` = `/srv/http/data/system/audio-aplayname` 9 | - Selected: `/srv/http/assets/js/system.js` 10 | - `/boot/config.txt` 11 | - disable on-board audio 12 | - append `dtoverlay=` 13 | - `sysname` > `/srv/http/data/system/audio-aplayname` 14 | - `name` > `/srv/http/data/system/audio-output` 15 | - set reboot flag 16 | 17 | ### MPD > Interface: 18 | - Populate select: `/srv/http/settings/mpd.php` 19 | - get `aplayname` list with `aplay -l` 20 | - each card: 21 | - `aplayname` 22 | - if subdevices, append index 23 | - get from `/srv/http/settings/i2s/` 24 | - `mixer_control` for each card 25 | - if `routecmd` exists, route to subdevice 26 | - `extlabel` for USB DAC notify change 27 | - set `selected` 28 | - Selected: (skip if USB DAC) 29 | - `/srv/http/assets/js/mpd.js` 30 | - `name` > `/srv/http/data/system/audio-output` 31 | - `sysname` > `/srv/http/data/system/audio-aplayname` 32 | 33 | ### Boot: 34 | - Script: `/srv/http/settings/mpd-conf.sh` 35 | -------------------------------------------------------------------------------- /imagecreate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cleanup() { 4 | umount -l $partboot $partroot 2> /dev/null 5 | rmdir /home/$USER/{BOOT,ROOT} 2> /dev/null 6 | exit 7 | } 8 | trap cleanup INT 9 | 10 | # required packages 11 | if [[ -e /usr/bin/pacman ]]; then 12 | [[ ! -e /usr/bin/bsdtar ]] && packages+='bsdtar ' 13 | [[ ! -e /usr/bin/dialog ]] && packages+='dialog ' 14 | [[ $packages ]] && pacman -Sy --noconfirm $packages 15 | else 16 | [[ ! -e /usr/bin/bsdtar ]] && packages+='bsdtar libarchive-tools ' 17 | [[ ! -e /usr/bin/dialog ]] && packages+='dialog ' 18 | [[ $packages ]] && apt install -y $packages 19 | fi 20 | 21 | optbox=( --colors --no-shadow --no-collapse --nocancel ) 22 | 23 | dialog "${optbox[@]}" --infobox " 24 | 25 | \Z1r\Z0Audio 26 | 27 | \Z1Create\Z0 Image File 28 | " 9 58 29 | sleep 2 30 | 31 | banner() { 32 | echo 33 | def='\e[0m' 34 | bg='\e[44m' 35 | printf "$bg%*s$def\n" $COLUMNS 36 | printf "$bg%-${COLUMNS}s$def\n" " $1" 37 | printf "$bg%*s$def\n" $COLUMNS 38 | } 39 | 40 | dialog "${optbox[@]}" --msgbox " 41 | \Z1Insert micro SD card\Z0 42 | If already inserted: 43 | For proper detection, remove and reinsert again. 44 | 45 | " 0 0 46 | 47 | deviceLine() { 48 | devline=$( dmesg \ 49 | | tail \ 50 | | grep ' sd.* GiB\|mmcblk.* GiB' \ 51 | | tail -1 ) 52 | } 53 | deviceLine 54 | [[ ! $devline ]] && sleep 2 && deviceLine 55 | 56 | if [[ ! $devline ]]; then 57 | dialog "${optbox[@]}" --infobox " 58 | \Z1No SD card found.\Z0 59 | " 0 0 60 | exit 61 | fi 62 | 63 | if [[ $devline == *\[sd?\]* ]]; then 64 | name=$( echo $devline | sed -E 's|.*\[(.*)\].*|\1|' ) 65 | dev=/dev/$name 66 | partboot=${dev}1 67 | partroot=${dev}2 68 | else 69 | name=$( echo $devline | sed -E 's/.*] (.*): .*/\1/' ) 70 | dev=/dev/$name 71 | partboot=${dev}p1 72 | partroot=${dev}p2 73 | fi 74 | 75 | list=$( lsblk -o name,size,mountpoint | grep -v ^loop | sed "/^$name/ {s/^/\\\Z1/; s/$/\\\Z0/}" ) 76 | dialog "${optbox[@]}" --yesno " 77 | Device list: 78 | $list 79 | 80 | Confirm SD card: 81 | $( echo "$list" | grep '\\Z1' ) 82 | " 0 0 83 | [[ $? != 0 ]] && exit 84 | 85 | umount -l $partboot $partroot 2> /dev/null 86 | 87 | BOOT=/mnt/BOOT 88 | ROOT=/mnt/ROOT 89 | [[ $( ls -A $BOOT 2> /dev/null ) ]] && warnings=" 90 | $BOOT not empty." 91 | [[ $( ls -A $ROOT 2> /dev/null ) ]] && warnings+=" 92 | $ROOT not empty." 93 | [[ $warnings ]] && dialog "${optbox[@]}" --infobox "$warnings" 0 0 && exit 94 | 95 | mkdir -p /mnt/{BOOT,ROOT} 96 | mount $partboot $BOOT 97 | mount $partroot $ROOT 98 | 99 | if [[ ! -e $BOOT/config.txt ]]; then 100 | dialog "${optbox[@]}" --infobox " 101 | \Z1$dev\Z0 is not \Z1r\Z0Audio. 102 | " 0 0 103 | exit 104 | fi 105 | 106 | release=$( cat $ROOT/srv/http/data/addons/r1 ) 107 | if [[ -e $BOOT/kernel8.img ]]; then 108 | model=64bit 109 | elif [[ -e $BOOT/kernel7.img ]]; then 110 | model=RPi2 111 | else # $BOOT/kernel.img 112 | model=RPi0-1 113 | fi 114 | 115 | imagefile=$( dialog "${optbox[@]}" --output-fd 1 --inputbox " 116 | Image filename: 117 | " 0 0 rAudio-$model-$release.img.xz ) 118 | 119 | selectdir=$PWD/ 120 | [[ -e $PWD/BIG ]] && selectdir+=BIG 121 | imagedir=$( dialog "${optbox[@]}" --title 'Save to: ([space]=select)' --stdout --dselect $selectdir 20 40 ) 122 | imagepath="${imagedir%/}/$imagefile" # %/ - remove trailing / 123 | 124 | clear -x 125 | touch $BOOT/expand # auto expand root partition 126 | umount -l -v $partboot $partroot 127 | rmdir /home/$USER/{BOOT,ROOT} 2> /dev/null 128 | e2fsck -fy $partroot 129 | 130 | banner "Image: $imagefile" 131 | 132 | banner 'Shrink ROOT partition ...' 133 | echo 134 | 135 | bar='\e[44m \e[0m' 136 | partsize=$( fdisk -l $partroot | awk '/^Disk/ {print $2" "$3}' ) 137 | used=$( df -k 2> /dev/null | grep $partroot | awk '{print $3}' ) 138 | 139 | shrink() { 140 | echo -e "$bar Shrink Pass #$1 ...\n" 141 | partinfo=$( tune2fs -l $partroot ) 142 | blockcount=$( awk '/Block count/ {print $NF}' <<< "$partinfo" ) 143 | freeblocks=$( awk '/Free blocks/ {print $NF}' <<< "$partinfo" ) 144 | blocksize=$( awk '/Block size/ {print $NF}' <<< "$partinfo" ) 145 | 146 | sectorsize=$( sfdisk -l $dev | awk '/Units/ {print $8}' ) 147 | startsector=$( fdisk -l $dev | grep $partroot | awk '{print $2}' ) 148 | 149 | usedblocks=$(( blockcount - freeblocks )) 150 | targetblocks=$(( usedblocks * 105 / 100 )) 151 | Kblock=$(( blocksize / 1024 )) 152 | newsize=$(( ( targetblocks + Kblock - 1 ) / Kblock * Kblock )) 153 | sectorsperblock=$(( blocksize / sectorsize )) 154 | endsector=$(( startsector + newsize * sectorsperblock )) 155 | 156 | if (( $(( newsize - target )) < 10 )); then 157 | echo Already reached minimum size. 158 | else 159 | # shrink filesystem to minimum 160 | resize2fs -fp $partroot $(( newsize * Kblock ))K 161 | parted $dev ---pretend-input-tty < "$imagepath" 184 | 185 | byte=$( stat --printf="%s" "$imagepath" ) 186 | mb=$( awk "BEGIN { printf \"%.1f\n\", $byte / 1024 / 1024 }" ) 187 | 188 | dialog "${optbox[@]}" --infobox " 189 | Image file created: 190 | \Z1$imagepath\Z0 191 | $mb MiB 192 | 193 | \Z1BOOT\Z0 and \Z1ROOT\Z0 have been unmounted. 194 | " 10 58 195 | -------------------------------------------------------------------------------- /imagereset.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dirdata=/srv/http/data 4 | optbox=( --colors --no-shadow --no-collapse ) 5 | 6 | banner() { 7 | echo 8 | def='\e[0m' 9 | bg='\e[44m' 10 | printf "$bg%*s$def\n" $COLUMNS 11 | printf "$bg%-${COLUMNS}s$def\n" " $1" 12 | printf "$bg%*s$def\n" $COLUMNS 13 | } 14 | 15 | select=$( dialog "${optbox[@]}" \ 16 | --output-fd 1 \ 17 | --checklist '\n\Z1Select tasks:\n 18 | \Z4[space] = Select / Deselect\Z0' 9 50 0 \ 19 | 1 "Reset MPD database" on \ 20 | 2 "Reset user data directory" on \ 21 | 3 "Clear package cache" on \ 22 | 4 "Clear system log" on \ 23 | 5 "Clear Wi-Fi connection" on ) 24 | 25 | clear 26 | [[ $? == 1 ]] && exit 27 | 28 | select=" $select " 29 | 30 | systemctl stop mpd 31 | mount | grep /mnt/MPD/NAS && umount -l "/mnt/MPD/NAS/"* 32 | mount | grep /mnt/MPD/USB && udevil umount -l "/mnt/MPD/USB/"* 33 | 34 | if [[ $select == *' 1 '* ]]; then 35 | banner 'Reset MPD database ...' 36 | rm -f $dirdata/mpd/* 37 | fi 38 | if [[ $select == *' 2 '* ]]; then 39 | banner 'Reset user data directory ...' 40 | rm -rf /root/.cache/* 41 | rm -f $dirdata/{bookmarks,coverarts,lyrics,playlists,webradios}/* 42 | curl -skL https://github.com/rern/rAudio-addons/raw/main/webradio/radioparadise.tar.xz | bsdtar xvf - -C $dirdata/webradio 43 | echo '{ 44 | "playlists" : 0 45 | , "webradio" : '$( find -L $dirdata/webradio -type f ! -path '*/img/*' | wc -l )' 46 | }' > $dirdata/mpd/counts 47 | fi 48 | if [[ $select == *' 3 '* ]]; then 49 | banner 'Clear package cache ...' 50 | rm -f /var/cache/pacman/pkg/* 51 | fi 52 | if [[ $select == *' 4 '* ]]; then 53 | banner 'Clear system log ...' 54 | rm -rf /var/log/journal/* 55 | fi 56 | if [[ $select == *' 5 '* ]]; then 57 | banner 'Clear Bluetooth and Wi-Fi connection ...' 58 | rm -rf /var/lib/bluetooth/* 59 | profiles=$( ls -1p /etc/netctl | grep -v / ) 60 | if [[ $profiles ]]; then 61 | while read profile; do 62 | netctl disable "$profile" 63 | done <<< $profiles 64 | rm /etc/netctl/* 2> /dev/null 65 | fi 66 | fi 67 | 68 | if [[ ! -e /boot/kernel.img ]]; then # skip on rpi 0, 1 69 | curl -skL https://github.com/archlinuxarm/PKGBUILDs/raw/master/core/pacman-mirrorlist/mirrorlist -o /etc/pacman.d/mirrorlist 70 | fi 71 | 72 | rm -rf /root/.config/chromium 73 | 74 | banner 'Check disk ...' 75 | fsck.fat -traw /dev/mmcblk0p1 76 | rm -f /boot/FSCK* 77 | 78 | dialog "${optbox[@]}" --infobox " 79 | \Z1r\Z0Audio reset finished. 80 | 81 | \Z1Shutdown\Z0 ... 82 | 83 | Before disconnecting power, observe \Z2\Zr \ZR\Z0 LED: 84 | - Stop all services - Blips 85 | - Shutdown - 10 steady flashes to completely off 86 | " 11 65 87 | shutdown -h now 88 | exit 89 | -------------------------------------------------------------------------------- /imageupload.md: -------------------------------------------------------------------------------- 1 | Image Files Upload 2 | --- 3 | - Install `github-cli` 4 | ```sh 5 | su 6 | pacman -Sy github-cli 7 | ``` 8 | 9 | - Login 10 | ```sh 11 | su USER 12 | cd 13 | # create ssh key 14 | ssh-keygen 15 | 16 | # login 17 | gh auth login -p ssh -w 18 | 19 | # ? What account do you want to log into? 20 | # > GitHub.com 21 | # ? Upload your SSH public key to your GitHub account? 22 | # > Skip (if already) 23 | ``` 24 | - Upload [SSH keys](https://github.com/settings/keys) > `New SSH key` via github.com 25 | - Get key: `cat .ssh/id_rsa.pub` 26 | 27 | - Clone repo 28 | ```sh 29 | gh repo clone rern/rAudio 30 | ``` 31 | 32 | - Upload 33 | ```sh 34 | cd rAudio 35 | gh release create //*.img.xz 36 | ``` 37 | -------------------------------------------------------------------------------- /imageupload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | [[ ! -e /usr/bin/gh ]] && echo -e "\nPackage github-cli not yet installed.\n" && exit 3 | 4 | [[ $EUID == 0 ]] && echo -e "\nsu x and run again.\n" && exit 5 | 6 | [[ ! -d /home/x/rAudio ]] && git clone https://github.com/rern/rAudio/ 7 | 8 | cd /home/x/rAudio 9 | 10 | ! gh auth status &> /dev/null && gh auth login -p ssh -w 11 | 12 | rm -f rAudio*img.xz 13 | ln -s ../BIG/*.xz . 14 | 15 | optbox=( --colors --no-shadow --no-collapse ) 16 | imgfiles=( $( ls rAudio*.img.xz 2> /dev/null ) ) 17 | for file in "${imgfiles[@]}"; do 18 | filelist+=" $file on" 19 | done 20 | 21 | selectfiles=$( dialog "${optbox[@]}" --output-fd 1 --nocancel --no-items --checklist " 22 | \Z1Select files to upload:\Z0 23 | $imgdir" $(( ${#imgfiles[@]} + 6 )) 0 0 \ 24 | $filelist ) 25 | files=( $selectfiles ) 26 | (( ${#files[@]} != 3 )) && echo 'Image files count not 3.' && exit 27 | 28 | file0=${files[0]} 29 | dir=$( dirname $file0 ) 30 | release=$( echo ${file0/*-} | cut -d. -f1 ) 31 | for model in 64bit RPi2 RPi0-1; do 32 | file=rAudio-$model-$release.img.xz 33 | echo "MD5 $file ..." 34 | image_md5_mirror+=( "[$file](https://github.com/rern/rAudio/releases/download/i$release/$file) \ 35 | | $( md5sum $dir/$file | cut -d' ' -f1 ) \ 36 | | [< file](https://cloud.s-t-franz.de/s/kdFZXN9Na28nfD8/download?path=%2F&files=$file)" ) 37 | done 38 | notes=' 39 | | Raspberry Pi | Image File | MD5 | Mirror | 40 | |:-------------------------|:-----------|:----|:-------| 41 | | `4` `3` `2 1.2` `Zero2` | '${image_md5_mirror[0]}' | 42 | | `2` | '${image_md5_mirror[1]}' | 43 | | `1` `Zero` | '${image_md5_mirror[2]}' | 44 | ' 45 | echo -e "\nUpload rAudio Image Files: i$release ...\n" 46 | 47 | gh release create i$release --title i$release --notes "$notes" $selectfiles 48 | -------------------------------------------------------------------------------- /imagewrite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # required packages 4 | if [[ -e /usr/bin/pacman ]]; then 5 | [[ ! -e /usr/bin/dialog ]] && packages+='dialog ' 6 | [[ ! -e /usr/bin/pv ]] && packages+='pv ' 7 | [[ ! -e /usr/bin/xz ]] && packages+='xz ' 8 | [[ $packages ]] && pacman -Sy --noconfirm $packages 9 | else 10 | [[ ! -e /usr/bin/dialog ]] && packages+='dialog ' 11 | [[ ! -e /usr/bin/pv ]] && packages+='pv ' 12 | [[ ! -e /usr/bin/xz ]] && packages+='xz-utils ' 13 | [[ $packages ]] && apt install -y $packages 14 | fi 15 | 16 | optbox=( --colors --no-shadow --no-collapse ) 17 | 18 | dialog "${optbox[@]}" --infobox " 19 | 20 | \Z1r\Z0Audio 21 | 22 | \Z1Write\Z0 Image File 23 | " 9 58 24 | sleep 2 25 | 26 | banner() { 27 | echo 28 | def='\e[0m' 29 | bg='\e[44m' 30 | printf "$bg%*s$def\n" $COLUMNS 31 | printf "$bg%-${COLUMNS}s$def\n" " $1" 32 | printf "$bg%*s$def\n" $COLUMNS 33 | } 34 | 35 | dialog "${optbox[@]}" --msgbox " 36 | \Z1Insert micro SD card\Z0 37 | If already inserted: 38 | For proper detection, remove and reinsert again. 39 | 40 | " 0 0 41 | 42 | sd=$( dmesg -T | tail | grep ' sd .*GB' ) 43 | [[ -z $sd ]] && sleep 2 && sd=$( dmesg -T | tail | grep ' sd .* logical blocks' ) 44 | 45 | if [[ -z $sd ]]; then 46 | dialog "${optbox[@]}" --infobox " 47 | \Z1No SD card found.\Z0 48 | " 0 0 49 | exit 50 | fi 51 | 52 | dev=/dev/$( echo $sd | awk -F'[][]' '{print $4}' ) 53 | detail=$( echo $sd | sed 's/ sd /\nsd /; s/\(\[sd.\]\) /\1\n/; s/\(blocks\): (\(.*\))/\1\n\\Z1\2\\Z0/' ) 54 | 55 | dialog "${optbox[@]}" --yesno " 56 | Confirm micro SD card: \Z1$dev\Z0 57 | Detail: 58 | $detail 59 | 60 | " 0 0 61 | 62 | [[ $? != 0 ]] && exit 63 | 64 | rpi=$( dialog "${optbox[@]}" --output-fd 1 --menu " 65 | \Z1Target:\Z0 66 | " 8 0 0 \ 67 | 0 'Raspberry Pi Zero' \ 68 | 1 'Raspberry Pi 1' \ 69 | 2 'Raspberry Pi 2' \ 70 | 3 'Raspberry Pi 3' \ 71 | 4 'Raspberry Pi 4' \ 72 | 5 'Raspberry Pi 64bit' \ 73 | 6 'Select image file' ) 74 | 75 | case $rpi in 76 | 0 | 1 ) file=rAudio-1-RPi0-1.img.xz ;; 77 | 2 | 3 ) file=rAudio-1-RPi2-3.img.xz ;; 78 | 4 ) file=rAudio-1-RPi4.img.xz ;; 79 | 5 ) file=rAudio-1-RPi64.img.xz ;; 80 | 6 ) file=$( basename $( dialog "${optbox[@]}" --title 'Image file' --stdout --fselect $PWD/ 30 70 ) );; 81 | esac 82 | 83 | [[ ! -e $file ]] && echo Image file not found. && exit 84 | 85 | clear -x 86 | 87 | banner 'Write ...' 88 | echo SD card: $dev 89 | echo File : $file 90 | 91 | ( pv -n $file \ 92 | | xz -dc - \ 93 | | dd of=$dev bs=4M conv=fsync ) 2>&1 \ 94 | | dialog "${optbox[@]}" --gauge " 95 | Write to SD card 96 | \Z1$file\Z0 ... 97 | " 9 58 98 | 99 | sync 100 | 101 | dialog "${optbox[@]}" --infobox " 102 | \Z1$file\Z0 103 | 104 | Image file written successfully. 105 | 106 | \Z1Micro SD card\Z0 unmounted. 107 | " 9 58 108 | -------------------------------------------------------------------------------- /mpc_update.md: -------------------------------------------------------------------------------- 1 | ### RuneAudio+R e Update Database 2 | 3 | **Flags:** 4 | - Use only `updating` flag from start to finish. 5 | - Resume on boot: 6 | - `updating` flag for resume `mpc update` 7 | - `listing` flag for resume without `mpc update` 8 | 9 | **Pre:** 10 | - Flag `updating` 11 | - Pushstream broadcast `updating_db` 12 | - `passive.js` show updating status 13 | 14 | **Start:** `mpc rescan` or `mpc update` 15 | 16 | **End:** `mpdidle.sh` 17 | - Gets update event from MPD 18 | - Verify with updating flag and mpc status not updating 19 | 20 | **Query:** `cmd.sh mpcupdatelist` 21 | - Flag `listing` 22 | - Get all list modes into files: 23 | - Album mode: `album^^artist^^file` 24 | - Normal `mpc listall` 25 | - `*.wav` - MPD not read albumartist 26 | - Others: `name` 27 | 28 | **Files:** 29 | - Save each mode to files 30 | - Count 31 | 32 | **Finish:** 33 | - Pushstream broadcast counts 34 | - `passive.js` 35 | - Hide updating status 36 | - Update Library counts 37 | - Remove flags 38 | 39 | -------------------------------------------------------------------------------- /reset.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | optbox=( --colors --no-shadow --no-collapse ) 4 | 5 | dialog "${optbox[@]}" --infobox " 6 | 7 | \Z1r\Z0Audio 8 | 9 | \Z1Reset\Z0 for Image File 10 | " 9 58 11 | sleep 2 12 | 13 | routerip=$( ip r get 1 | head -1 | cut -d' ' -f3 ) 14 | subip=${routerip%.*}. 15 | 16 | rpiip=$( dialog "${optbox[@]}" --output-fd 1 --inputbox " 17 | \Z1Raspberry Pi IP:\Z0 18 | " 0 0 $subip ) 19 | 20 | sed -i "/$rpiip/ d" ~/.ssh/known_hosts 21 | 22 | sshpass -p ros ssh -t -o StrictHostKeyChecking=no root@$rpiip 'bash <( curl -sL https://github.com/rern/rOS/raw/main/imagereset.sh )' 23 | -------------------------------------------------------------------------------- /root/.config/procps/toprc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rern/rOS/198473d17e91fabe83adae0f885c70bfc523d08b/root/.config/procps/toprc -------------------------------------------------------------------------------- /root/.profile: -------------------------------------------------------------------------------- 1 | PATH+=:/srv/http/bash:/srv/http/bash/settings:/opt/vc/bin 2 | -------------------------------------------------------------------------------- /select-features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rern/rOS/198473d17e91fabe83adae0f885c70bfc523d08b/select-features.png -------------------------------------------------------------------------------- /select-hw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rern/rOS/198473d17e91fabe83adae0f885c70bfc523d08b/select-hw.png -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/autoupdate.conf: -------------------------------------------------------------------------------- 1 | auto_update "yes" 2 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/buffer.conf: -------------------------------------------------------------------------------- 1 | audio_buffer_size "4096" 2 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/camilladsp.conf: -------------------------------------------------------------------------------- 1 | audio_output { 2 | name "CamillaDSP" 3 | device "hw:Loopback,1" 4 | type "alsa" 5 | auto_resample "no" 6 | mixer_type "none" 7 | } 8 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/cdio.conf: -------------------------------------------------------------------------------- 1 | input { 2 | plugin "cdio_paranoia" 3 | speed "12" 4 | } 5 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/ffmpeg.conf: -------------------------------------------------------------------------------- 1 | decoder { 2 | plugin "ffmpeg" 3 | enabled "yes" 4 | } 5 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/fifo.conf: -------------------------------------------------------------------------------- 1 | audio_output { 2 | name "Named pipe" 3 | type "fifo" 4 | path "/tmp/mpd.fifo" 5 | format "44100:16:1" 6 | } 7 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/httpd.conf: -------------------------------------------------------------------------------- 1 | audio_output { 2 | type "httpd" 3 | name "Streaming" 4 | encoder "flac" 5 | port "8000" 6 | quality "5.0" 7 | format "44100:16:2" 8 | always_on "yes" 9 | } 10 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/normalization.conf: -------------------------------------------------------------------------------- 1 | volume_normalization "yes" 2 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/outputbuffer.conf: -------------------------------------------------------------------------------- 1 | max_output_buffer_size "8192" 2 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/replaygain.conf: -------------------------------------------------------------------------------- 1 | replaygain "album" 2 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/snapserver.conf: -------------------------------------------------------------------------------- 1 | audio_output { 2 | name "SnapServer" 3 | type "fifo" 4 | path "/tmp/snapfifo" 5 | format "48000:16:2" 6 | } 7 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/soxr-custom.conf: -------------------------------------------------------------------------------- 1 | resampler { 2 | plugin "soxr" 3 | quality "custom" 4 | precision "20" 5 | phase_response "50" 6 | passband_end "91.3" 7 | stopband_begin "100" 8 | attenuation "0" 9 | flags "0" 10 | } 11 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/conf/soxr.conf: -------------------------------------------------------------------------------- 1 | resampler { 2 | plugin "soxr" 3 | quality "very high" 4 | threads "1" 5 | } 6 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/curl.conf: -------------------------------------------------------------------------------- 1 | input { 2 | plugin "curl" 3 | } 4 | -------------------------------------------------------------------------------- /srv/http/data/mpdconf/mpd.conf: -------------------------------------------------------------------------------- 1 | bind_to_address "0.0.0.0" 2 | db_file "/srv/http/data/mpd/mpd.db" 3 | music_directory "/mnt/MPD" 4 | playlist_directory "/srv/http/data/playlists" 5 | state_file "/var/lib/mpd/mpdstate" 6 | user "mpd" 7 | include_optional "curl.conf" 8 | # file - plug and play content 9 | include_optional "output.conf" 10 | include_optional "bluetooth.conf" 11 | # link 12 | include_optional "autoupdate.conf" 13 | include_optional "camilladsp.conf" 14 | include_optional "cdio.conf" 15 | include_optional "custom.conf" 16 | include_optional "ffmpeg.conf" 17 | include_optional "fifo.conf" 18 | include_optional "httpd.conf" 19 | include_optional "normalization.conf" 20 | include_optional "outputbuffer.conf" 21 | include_optional "replaygain.conf" 22 | include_optional "snapserver.conf" 23 | include_optional "soxr.conf" 24 | include_optional "soxr-custom.conf" 25 | --------------------------------------------------------------------------------