local-arch-repo/README.md

65 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2022-01-22 22:37:57 +01:00
# local-arch-repo
2022-01-23 05:15:08 +01:00
Running multiple Arch devices? Create your own package archive repository and simply add another device.
2022-02-21 05:07:23 +01:00
This is actually for a PinePhone (aarch64), PIs (armv7h) and other x86_64 Arch devices. Probably others will follow.
2022-01-23 05:58:31 +01:00
# What does it?
These are just a few bash scripts to install your local repository or add another client, and two hooks for your pacman updates.
On the _server_ side, the __rsync daemon__ + credentials + config file modifications are created to be ready for the clients. Furthermore, the __hooks__ are placed and also the `repo-add.sh` script for the `post exec` commands - after the client has pushed its packages or for the server after it has received an update via pacman (hook). The `pacman.conf` is modified for the new repository and the new package cache path.
On the _client_ side, `pacman.conf` is also changed for the new repository. Like on the server, the hooks are placed and `archive_packages.sh` is copied to the root folder, which will be activated via the hook. Rsync credentials are created.
2022-01-23 04:30:46 +01:00
# Usage
2022-01-23 05:58:31 +01:00
Just run the `start.sh` script and chose either `SERVER` or `client`.
2022-01-23 04:30:46 +01:00
## Packages
```
2022-01-23 08:45:11 +01:00
sudo pacman -S rsync pacman-contrib
2022-01-23 04:30:46 +01:00
```
## Webserver
### Nginx
Add this to you webserver.
```
server {
listen 8080;
server_name SERVER_IP;
location / {
root /srv/http/repo/;
autoindex on;
}
}
```
### python
```
cd /srv/http/repo/
python -m http.server
```
### darkhttpd
```
2022-01-23 05:15:08 +01:00
pacman -S darkhttpd
2022-01-23 04:30:46 +01:00
sudo -u http darkhttpd /srv/http/repo/ --no-server-id
```
## (Optional) Crontab -e
Packages older than half a year will be deleted.
```
2024-04-13 04:56:15 +02:00
@monthly find /srv/http/repo/* -mtime +182.5 -type f -regex ".*pkg*.*" -delete
2022-01-23 04:30:46 +01:00
```
2022-01-23 05:15:08 +01:00
## Server & client
2022-01-23 04:30:46 +01:00
```
git clone https://github.com/TECH-SAVIOURS-ORG/local-arch-repo.git
cd local-arch-repo
2022-01-23 05:15:08 +01:00
chmod u+x start.sh
sudo ./start.sh
2022-01-23 04:30:46 +01:00
```
2022-01-23 08:45:11 +01:00
## Test it (client)
2022-01-23 04:30:46 +01:00
```
/root/archive_packages.sh
2022-01-23 06:00:53 +01:00
```