summarylogtreecommitdiffstats
path: root/update-aria2-tracker
AgeCommit message (Collapse)Author
6 daysRelease 2.0.0Zhang Hua
This is a major update, here are changes and possible migrations: - No tracker-updating timers and services, `aria2.target` is removed neither. They are merged into `aria2.service` user service and `aria2@.service` system service. But this feature is still existing, you need to set environment variable `ARIA2CD_TRACKER_COMMAND` and we will execute it to update your aria2 config. `ARIA2CD_TRACKER_COMMAND` should generate a comma seperated one line string, which will be used as value of `bt-tracker` in config. For example, if you want to set it by using systemd's drop-in file: ``` # For system service: # /etc/systemd/system/aria2@.service.d/00-tracker.conf # /etc/systemd/system/aria2@<instance>.service.d/00-tracker.conf # For user service: # /etc/systemd/user/aria2.service.d/00-tracker.conf # $HOME/.config/systemd/user/aria2.service.d/00-tracker.conf # [Service] Environment=ARIA2CD_TRACKER_COMMAND="curl -L https://cf.trackerslist.com/best_aria2.txt" ``` This command will be executed in `ExecStartPre` of service, please ensure it does not need too much time to complete. As a part of this change, there is neither no `tracker-config.sh` anymore, we decide if updating config by checking if there is any `bt-tracker` is set. Techinally, we check if `grep -q "^bt-tracker=.*" <path to aria2 config>` returns 0. For example, if you have such config file: ``` ... bt-tracker= ``` We will use outputs from `ARIA2C_TRACKER_COMMAND` to update it, no matter if `bt-tracker` has any value. But we will skip updating if `bt-tracker` is not set or `ARIA2C_TRACKER_COMMAND` is not set. What's more, due to this change, if you used to start aria2 by enabling `aria2.target`, you need to enable `aria2.service` instead. - System unit is a template service. Instance name means config filename without `.conf` suffix in `/etc/aria2cd/` directory. For example, if you want to continue using the old `/etc/aria2cd/aria2.conf` file, you need to start `aria2@aria2.service` instead. - Many commandline overrides in service are removed. Those arguments include `--dir`, `--enable-rpc`, `--save`, `--input-file`, `--dht-file-path`, `--dht-file-path6`, `--save-cookies`, `--load-cookies` and `--log`. You need to set them in config file to continue using them. Due to system service is sandboxed, we recommend saving files at `/var/lib/aria2cd` and saving logs at `/var/log/aria2cd`, or you may have to override this service to allow aria2 writing contents on your disk. Using values used before is fine, see the diff of this commit for them. - Use more sandboxed service. Even user service is more sandboxed, see the diff of this commit about actual changes. After the change, the expose score of `aria2@.service` is 2.1 and the score of `aria2.service` is 2.8, Both are labeled `OK` by `systemd-analyze security` command with systemd 257.5-1. We just test downloading through AriaNg simply and it seems fine, so if this breaks your work, please let us know. - Legacy system service `aria2@.service` is removed. Althouth there is another `aria2@.service`, they are not same. The old one's instance parameter means user, the new one's means config file name.
2024-03-26Use root to update trackerZhang Hua
For editing /etc/aria2cd/aria2.conf successfully
2024-03-26Fix error when config is an empty fileZhang Hua
2024-03-26Misc changesZhang Hua
1. Use Type=simple instead Type=fork Systemd seems to be happier with this 2. Remove tmpfiles.d and sysusers.d Use DynamicUser instead 3. Remove hardcoded arguments in service This should let user have more control 4. Adjust sandbox options in service 5. Move depends in package() So we do not need install aria2 and systemd when building 6. Update broken tracker link But users have to update it manually for installed files 7. aria2.target now runs after service and timer
2022-10-26Fix system tracker updaterzhanghua000
2022-10-26Fix system tracker updaterzhanghua000
2022-10-26Fix system tracker updaterzhanghua000
2022-10-26Rewrite codezhanghua000
2022-10-07Allow auto update trackerzhanghua000