Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arch compatiblity #74

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
# PiKrellCam
# PiKrellCam Fork

This repo contains a for of pikrellcam that is compatible with Debian, Arch and soon Alpine. See below for installation instructions and the original repo links.

## PiKrellCam

PiKrellCam is an audio/video recording motion detect program with an OSD web
interface that detects motion using the Raspberry Pi camera MMAL motion vectors.

Read about it and install instructions at:
Read about it at the original developers page:
[PiKrellCam webpage](http://billw2.github.io/pikrellcam/pikrellcam.html)

Git download with:
$ git clone https://github.com/billw2/pikrellcam
$ git clone https://github.com/olipinski/pikrellcam

---

## Arch specific instructions

To install on Arch you might want the following package from AUR:

https://aur.archlinux.org/packages/mpack/

---

## Alpine (WIP) specific instructions

Alpine installation is a WIP. Currently, it would require a recompile of the binary and shipping a sepearte one, plus an installation of more RasPi libs.

Alpine installation requires it to be in ``sys`` mode.

``doas`` is used by default. If your Alpine installation uses ``sudo`` instead , you might want to install ``doas`` instead, or modify the bash files in this repo.

---

## Camera configuration in /boot/config.txt

Also you will need to setup the camera to work on Arch/Alpine. This can usually be done with edits to /boot/config.txt, but might depend on the specific Pi. For example on the PiZero this could be the config:

```
# See /boot/overlays/README for all available options
gpu_mem=128
start_file=start_x.elf
fixup_file=fixup_x.dat
initramfs initramfs-linux.img followkernel
cma_lwm= cma_hwm= cma_offline_start=
disable_camera_led=1
```
25 changes: 25 additions & 0 deletions etc/nginx-arch-site-default
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
server {
listen PORT default_server;
listen [::]:PORT default_server;

root PIKRELLCAM_WWW;
auth_basic "Restricted";
auth_basic_user_file PIKRELLCAM_WWW/.htpasswd;


index index.php index.html index.htm;

server_name _;

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
}

25 changes: 25 additions & 0 deletions etc/nginx-bullseye-site-default
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
server {
listen PORT default_server;
listen [::]:PORT default_server;

root PIKRELLCAM_WWW;
auth_basic "Restricted";
auth_basic_user_file PIKRELLCAM_WWW/.htpasswd;


index index.php index.html index.htm;

server_name _;

location / {
try_files $uri $uri/ =404;
}

location ~ \.php$ {
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
}

12 changes: 12 additions & 0 deletions etc/pikrellcam.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=The PiKrellCam service
After=network.target

[Service]
WorkingDirectory=PWD
User=USER
ExecStart=PWD/pikrellcam
ExecStop=/bin/kill -s QUIT $MAINPID

[Install]
WantedBy=default.target
8 changes: 5 additions & 3 deletions etc/pikrellcam.sudoers
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# If started from the web page, real user needs to be pi.
# so give www-data permission to run sudo -u pi pikrellcam
# If started from the web page, real user needs to be the $user.
# so give nginx user permission to run sudo -u $user pikrellcam
# Additionally the next permission is required for the systemd service if running on arch

www-data ALL=(USER) NOPASSWD: pikrellcam
NGINX_USER ALL=(USER) NOPASSWD: pikrellcam
#USER ALL=(ALL:ALL) NOPASSWD: ALL
Loading