|
…
|
||
|---|---|---|
| .. | ||
| misc | ||
| ccache-remote.sh | ||
| README.server-setup.md | ||
ccache-remote: Server Setup Guide
Redis Server
-
Install packages:
apt install redis-server avahi-daemon avahi-utils -
Configure Redis — merge the settings from
misc/redis/redis-ccache.confinto/etc/redis/redis.conf, or add anincludedirective at the end of your existing config (include /etc/redis/redis-ccache.conf), then restart:sudo systemctl restart redis-serverAuthentication (recommended). Set a password in the config file — either via
requirepass(Redis < 6) or ACL user entry (Redis 6+). See comments inmisc/redis/redis-ccache.conffor both methods. Generate a URL-safe password:openssl rand -hex 24Important: Do not use
openssl rand -base64— base64 passwords contain/,+, and=which break URL parsing inredis://connection strings. On the build host, pass the password in the Redis URL:./compile.sh ENABLE_EXTENSIONS=ccache-remote \ CCACHE_REMOTE_STORAGE="redis://default:YOUR_PASSWORD@192.168.1.65:6379" BOARD=...No authentication (trusted network only). If all machines are on a fully isolated private network and access control is not needed, remove
requirepass, setnopassin the ACL user entry, and setprotected-mode no. See comments inmisc/redis/redis-ccache.conf. No password is needed in the URL:./compile.sh ENABLE_EXTENSIONS=ccache-remote \ CCACHE_REMOTE_STORAGE="redis://192.168.1.65:6379" BOARD=...For advanced security (TLS, ACL, rename-command), see: https://redis.io/docs/latest/operate/oss_and_stack/management/security/
-
Publish DNS-SD service — copy
misc/avahi/ccache-redis.serviceto/etc/avahi/services/:cp misc/avahi/ccache-redis.service /etc/avahi/services/Avahi will pick it up automatically. Clients running
avahi-browse -rpt _ccache._tcpwill discover the Redis service.Or use a systemd unit that ties the announcement to
redis-serverlifetime (stops advertising when Redis is down):cp misc/systemd/ccache-avahi-redis.service /etc/systemd/system/ systemctl enable --now ccache-avahi-redisAlternatively, publish legacy mDNS hostname:
avahi-publish-address -R ccache.local <SERVER_IP>Or as a systemd service (
/etc/systemd/system/ccache-hostname.service):[Unit] Description=Publish ccache.local hostname via Avahi After=avahi-daemon.service redis-server.service BindsTo=redis-server.service [Service] Type=simple ExecStart=/usr/bin/avahi-publish-address -R ccache.local <SERVER_IP> Restart=on-failure [Install] WantedBy=redis-server.service
HTTP/WebDAV Server (nginx)
-
Install nginx with WebDAV support:
apt install nginx-extras avahi-daemon avahi-utils -
Copy
misc/nginx/ccache-webdav.confto/etc/nginx/sites-available/ccache-webdav, then enable and prepare storage:cp misc/nginx/ccache-webdav.conf /etc/nginx/sites-available/ccache-webdav ln -s /etc/nginx/sites-available/ccache-webdav /etc/nginx/sites-enabled/ mkdir -p /var/cache/ccache-webdav/ccache chown -R www-data:www-data /var/cache/ccache-webdav systemctl reload nginx -
Verify:
curl -X PUT -d "test" http://localhost:8088/ccache/test.txt curl http://localhost:8088/ccache/test.txtWARNING: No authentication configured. Use ONLY in a fully trusted private network.
-
Publish DNS-SD service — copy
misc/avahi/ccache-webdav.serviceto/etc/avahi/services/:cp misc/avahi/ccache-webdav.service /etc/avahi/services/Or use a systemd unit that ties the announcement to
nginxlifetime:cp misc/systemd/ccache-avahi-webdav.service /etc/systemd/system/ systemctl enable --now ccache-avahi-webdav
DNS SRV Records (for remote/hosted servers)
Set CCACHE_REMOTE_DOMAIN on the client, then create DNS records.
Redis backend:
_ccache._tcp.example.com. SRV 0 0 6379 ccache.example.com.
_ccache._tcp.example.com. TXT "type=redis"
HTTP/WebDAV backend:
_ccache._tcp.example.com. SRV 0 0 8088 ccache.example.com.
_ccache._tcp.example.com. TXT "type=http" "path=/ccache/"
Client Requirements for mDNS
Install one of the following for .local hostname resolution:
-
libnss-resolve (systemd-resolved):
apt install libnss-resolve/etc/nsswitch.conf:hosts: files resolve [!UNAVAIL=return] dns myhostname -
libnss-mdns (standalone):
apt install libnss-mdns/etc/nsswitch.conf:hosts: files mdns4_minimal [NOTFOUND=return] dns myhostname