feat: add wondershaper and update README.md

This commit is contained in:
Tha14 2022-12-29 15:23:46 +02:00
parent c46aab45e1
commit 6f079d1967
No known key found for this signature in database
GPG Key ID: C2B875C3A9D53CFC
5 changed files with 20 additions and 7 deletions

View File

@ -25,12 +25,13 @@
1. This container will download the latest version of uam every time it is started and will install apt packages so keep that in mind. 1. This container will download the latest version of uam every time it is started and will install apt packages so keep that in mind.
2. The http service for uam is enabled and listening on http://127.0.0.1:17099 for the single instance. For the UAM swarm you need to define the listening port for each instance. 2. The http service for uam is enabled and listening on http://127.0.0.1:17099 for the single instance. For the UAM swarm you need to define the listening port for each instance.
3. Make sure you port forward manually as upnp will most likely not work. 3. Make sure you port forward manually as upnp will most likely not work.
4. You can adjust the maximum upload and download bandwidth of uam by changing the `NETLIMUP` and `NETLIMDOWN` env variables.
## ToDo: ## ToDo:
- [x] Add CI tests to make sure the scripts work. - [x] Add CI tests to make sure the scripts work.
- [x] Make PBKEY a required variable to avoid running uam without it. - [x] Make PBKEY a required variable to avoid running uam without it.
- [ ] Remove unnecessary packages. - [ ] Remove unnecessary packages.
- [ ] Try to speed up mime database update. - [ ] Try to speed up mime database update.
- [ ] Include wondershaper or sch_cake in `apt install` and environment configuration parameters for it. - [x] Include wondershaper or sch_cake in `apt install` and environment configuration parameters for it.
- [ ] See if it's possible to automatically increment port numbers for the swarm script. - [ ] See if it's possible to automatically increment port numbers for the swarm script.
- [ ] Try to package up-to-date databases to prevent warm-up problems. - [ ] Try to package up-to-date databases to prevent warm-up problems.

View File

@ -15,13 +15,15 @@ services:
volumes: volumes:
- "./entrypoint.sh:/opt/entrypoint.sh" - "./entrypoint.sh:/opt/entrypoint.sh"
- "/opt/uam_data/uam_1:/root/.uam" - "/opt/uam_data/uam_1:/root/.uam"
command: /bin/sh -c "chmod +x /opt/entrypoint.sh && /opt/entrypoint.sh $${PBKEY} $${PPORT}" command: /bin/sh -c "chmod +x /opt/entrypoint.sh && /opt/entrypoint.sh $${PBKEY} $${PPORT} $${NETLIMUP} $${NETLIMDOWN}"
ports: ports:
- "127.0.0.1:17100:17099" - "127.0.0.1:17100:17099"
- "4160:4160" - "4160:4160"
environment: environment:
- PBKEY=${PBKEY?err} - PBKEY=${PBKEY?err}
- PPORT=4160 - PPORT=4160
- NETLIMUP=10000
- NETLIMDOWN=18000
uam_2: uam_2:
image: debian:bullseye-slim image: debian:bullseye-slim
@ -37,13 +39,15 @@ services:
volumes: volumes:
- "./entrypoint.sh:/opt/entrypoint.sh" - "./entrypoint.sh:/opt/entrypoint.sh"
- "/opt/uam_data/uam_2:/root/.uam" - "/opt/uam_data/uam_2:/root/.uam"
command: /bin/sh -c "chmod +x /opt/entrypoint.sh && /opt/entrypoint.sh $${PBKEY} $${PPORT}" command: /bin/sh -c "chmod +x /opt/entrypoint.sh && /opt/entrypoint.sh $${PBKEY} $${PPORT} $${NETLIMUP} $${NETLIMDOWN}"
ports: ports:
- "127.0.0.1:17101:17099" - "127.0.0.1:17101:17099"
- "4161:4161" - "4161:4161"
environment: environment:
- PBKEY=${PBKEY?err} - PBKEY=${PBKEY?err}
- PPORT=4161 - PPORT=4161
- NETLIMUP=10000
- NETLIMDOWN=18000
uam_3: uam_3:
image: debian:bullseye-slim image: debian:bullseye-slim
@ -59,10 +63,12 @@ services:
volumes: volumes:
- "./entrypoint.sh:/opt/entrypoint.sh" - "./entrypoint.sh:/opt/entrypoint.sh"
- "/opt/uam_data/uam_3:/root/.uam" - "/opt/uam_data/uam_3:/root/.uam"
command: /bin/sh -c "chmod +x /opt/entrypoint.sh && /opt/entrypoint.sh $${PBKEY} $${PPORT}" command: /bin/sh -c "chmod +x /opt/entrypoint.sh && /opt/entrypoint.sh $${PBKEY} $${PPORT} $${NETLIMUP} $${NETLIMDOWN}"
ports: ports:
- "127.0.0.1:17102:17099" - "127.0.0.1:17102:17099"
- "4162:4162" - "4162:4162"
environment: environment:
- PBKEY=${PBKEY?err} - PBKEY=${PBKEY?err}
- PPORT=4162 - PPORT=4162
- NETLIMUP=10000
- NETLIMDOWN=18000

View File

@ -1,7 +1,8 @@
#!/bin/sh #!/bin/sh
cd /tmp cd /tmp
apt update && apt -yq install wget libglib2.0-0 ca-certificates dnsmasq apt update && apt -yq install wget libglib2.0-0 ca-certificates dnsmasq wondershaper
update-ca-certificates update-ca-certificates
wondershaper eth0 $3 $4 &
wget https://update.u.is/downloads/uam/linux/uam-latest_amd64.deb wget https://update.u.is/downloads/uam/linux/uam-latest_amd64.deb
dpkg -i uam-latest_amd64.deb dpkg -i uam-latest_amd64.deb
cd /opt/uam/ cd /opt/uam/

View File

@ -12,12 +12,16 @@ services:
memlock: -1 memlock: -1
oom_score_adj: -700 oom_score_adj: -700
mem_swappiness: 10 mem_swappiness: 10
cap_add:
- NET_ADMIN
volumes: volumes:
- "./entrypoint.sh:/opt/entrypoint.sh" - "./entrypoint.sh:/opt/entrypoint.sh"
- "/opt/uam_data:/root/.uam" - "/opt/uam_data:/root/.uam"
command: /bin/sh -c "chmod +x /opt/entrypoint.sh && /opt/entrypoint.sh $${PBKEY}" command: /bin/sh -c "chmod +x /opt/entrypoint.sh && /opt/entrypoint.sh $${PBKEY} $${NETLIMUP} $${NETLIMDOWN}"
ports: ports:
- "127.0.0.1:17099:17099" - "127.0.0.1:17099:17099"
- "4156:4156" - "4156:4156"
environment: environment:
- PBKEY=${PBKEY?err} - PBKEY=${PBKEY?err}
- NETLIMUP=10000
- NETLIMDOWN=18000

View File

@ -1,7 +1,8 @@
#!/bin/sh #!/bin/sh
cd /tmp cd /tmp
apt update && apt -yq install wget libglib2.0-0 ca-certificates dnsmasq apt update && apt -yq install wget libglib2.0-0 ca-certificates dnsmasq wondershaper
update-ca-certificates update-ca-certificates
wondershaper eth0 $2 $3 &
wget https://update.u.is/downloads/uam/linux/uam-latest_amd64.deb wget https://update.u.is/downloads/uam/linux/uam-latest_amd64.deb
dpkg -i uam-latest_amd64.deb dpkg -i uam-latest_amd64.deb
cd /opt/uam/ cd /opt/uam/