local-arch-repo/README.md

57 lines
1020 B
Markdown
Raw 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-01-23 04:30:46 +01:00
This is actually for a pinephone and other x86_64 Arch devices. Probably PIs (armv7l) will follow.
# Usage
## Packages
```
sudo pacman -S rsync
```
## 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.
```
@monthly find /srv/http/repo/* -mtime +182.5 '!' -regex '*pkg*' -exec rm {} \;
```
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
```
## Test it
```
/root/archive_packages.sh
```