shadowsocks / shadowsocks-rust

A Rust port of shadowsocks
https://shadowsocks.org/
MIT License
8.71k stars 1.19k forks source link

Debian package: Presumed lack of dependency #1700

Closed marek22k closed 1 month ago

marek22k commented 1 month ago

Hello,

when installing the Debian package I noticed that it tries to run pwgen, but it is not installed. If pwgen is needed, it makes sense to add it as a dependency.

marek@router1:~$ sudo apt install ./shadowsocks-rust_1.21.0_amd64.deb 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'shadowsocks-rust' instead of './shadowsocks-rust_1.21.0_amd64.deb'
The following package was automatically installed and is no longer required:
  linux-image-6.1.0-13-amd64
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  shadowsocks-rust
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/5,798 kB of archives.
After this operation, 33.3 MB of additional disk space will be used.
Get:1 /home/marek/shadowsocks-rust_1.21.0_amd64.deb shadowsocks-rust amd64 1.21.0 [5,798 kB]
Selecting previously unselected package shadowsocks-rust.
(Reading database ... 69438 files and directories currently installed.)
Preparing to unpack .../shadowsocks-rust_1.21.0_amd64.deb ...
Unpacking shadowsocks-rust (1.21.0) ...
Setting up shadowsocks-rust (1.21.0) ...
/var/lib/dpkg/info/shadowsocks-rust.postinst: 33: pwgen: not found
N: Download is performed unsandboxed as root as file '/home/marek/shadowsocks-rust_1.21.0_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
zonyitoo commented 1 month ago

Please submit a PR for fixing the debian package build script.

marek22k commented 1 month ago

I am delighted to have been encouraged to submit a PR. As far as I've seen in the code, pwgen is used to replace the !barfoo placeholder. However, this functionality is also bought into Shadowsocks with ssservice genkey -m "[CIPHER]". Is there a particular reason to prefer pwgen?

zonyitoo commented 1 month ago

It was copied from shadowsocks-libev project. I don't really know why it was required originally.

marek22k commented 1 month ago

I tried my luck with a PR. The password in the example configuration file is now created with ssservice genkey instead of pwgen.