ThePorgs / Exegol-images

Docker images of the Exegol project
https://exegol.readthedocs.io/
GNU General Public License v3.0
73 stars 56 forks source link

Fix username-anarchy #342

Closed lap1nou closed 2 months ago

lap1nou commented 2 months ago

Description

Greetings,

If we use username-anarchy using a an input file we got:

/opt/tools/username-anarchy/username-anarchy:238:in `load_names_list': undefined method `exists?' for File:Class (NoMethodError)

        raise "#{filename}: No such file" unless File.exists?(filename)
                                                     ^^^^^^^^
Did you mean?  exist?
        from /opt/tools/username-anarchy/username-anarchy:606:in `<main>'

This PR https://github.com/urbanadventurer/username-anarchy/pull/3/files fix the problem but it wasn't merged and probably never will.

My PR aim to apply the fixing PR directly, so one can do:

username-anarchy -i user.txt

Regards.

Related issues

N /A

Point of attention

N / A

lap1nou commented 2 months ago

Hello @QU35T-code,

I can but the PR will never get merged, even in 1 month, the tool is not maintened anymore.

Regards.

QU35T-code commented 2 months ago

Make sense. What do you think @ShutdownRepo ?

We could also add a sed in the installation to avoid depending on this PR 🤷‍♂️

ShutdownRepo commented 2 months ago

In my opinion we should do a hot merge, with a really long temp fix in case it ever gets merged one day We should use the code below which relies on what our documentation shows (here)

cd /opt/tools/username-anarchy || exit
# https://github.com/urbanadventurer/username-anarchy/pull/3
local temp_fix_limit="2025-04-01"
if [[ "$(date +%Y%m%d)" -gt "$(date -d $temp_fix_limit +%Y%m%d)" ]]; then
  criticalecho "Temp fix expired. Exiting."
else
  git config --local user.email "local"
  git config --local user.name "local"
  local prs=("3")
  for pr in "${prs[@]}"; do git fetch origin "pull/$pr/head:pull/$pr" && git merge --strategy-option theirs --no-edit "pull/$pr"; done
fi