Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to add API key ?? #4

Open
changchichung opened this issue Jun 23, 2021 · 5 comments
Open

how to add API key ?? #4

changchichung opened this issue Jun 23, 2021 · 5 comments

Comments

@changchichung
Copy link

I run linx-server in docker , I can upload in web UI now .
but I can not find API key or instructions about how to add keys.
so , where can I find/set the API keys?

@G-R-A-F-F
Copy link

Download a keygen for your platform:

https://github.com/andreimarcu/linx-server/releases/download/v2.3.8/linx-genkey-v2.3.8_linux-amd64
https://github.com/andreimarcu/linx-server/releases/download/v2.3.8/linx-genkey-v2.3.8_linux-arm64
https://github.com/andreimarcu/linx-server/releases/download/v2.3.8/linx-genkey-v2.3.8_linux-arm

I used AMD version on my PC. It was a pain to run it inside the container.
Make executable and run ./linx-genkey*

Type password and copy result into auth.txt as a new line.

You might also want to track these hashes somewhere else in case you want to remove certain ones after.

@dotcomUNDERGROUND
Copy link

API keys are same as authfile? Or I need to set it on some other location?

As API ill use the same password I use for basic auth? Or the hash?

@G-R-A-F-F
Copy link

Yes. No. Yes. No.
authfile.txt is the file to keep all the API tokens that genkey generates.
You can use this to generate new tokens:
echo 'ABC' | ./linx-genkey-v2.3.8_linux-amd64 | awk -F ' ' '{print $5}'

You can use the ABC key on the basic web GUI auth and using CLI:
curl -k -H "Linx-Api-Key: ABC" -T $1 https\://linx-share-url.com\:port/upload/

Hashes are to be kept as a secret.

@turbomaster95
Copy link

Btw I made my authfile.txt using this command:
while true; do shuf -n 1 hashes.txt | ./linx-genkey-v2.3.8_linux-arm64 | awk -F ' ' '{print $5}'; done | tee authfile.txt
The hashes.txt I generated using
`
import os

while True:
try:
gen = lambda x: os.urandom(x).hex()
print(gen(9))
except BrokenPipeError:
continue
`
This python code

@G-R-A-F-F
Copy link

I did something similar using bitwarden cli

for k in {1..10}
do
  pass=$(bw generate -p --words 3)
  hash=$(echo $pass | ./linx-genkey-v2.3.8_linux-amd64 | awk -F ' ' '{print $5}')
  echo -e $pass' '$hash
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants