LINCnil / pia-back

Programme développé avec le framework RubyOnRails mettant à disposition une API RESTful à destination des outils PIA et PIA-APP. | Program developped with RubyOnRails providing a RESTful API for the PIA and PIA-APP applications.
GNU General Public License v3.0
156 stars 65 forks source link

Can't run/install pia-back #216

Closed oleksandr-zh closed 1 year ago

oleksandr-zh commented 1 year ago

I install your product according to the wiki I have access to the web interface (successfully installed PIA). I use NGNX Completed all Install the Backend (PIA-BACK) steps. When I try to set up "Server URL Configuration", I have questions: I have three fields: Please, provide the address (URL) of the remote server: ClientID : Client SECRET : Wikipedia does not say anything about this (where to get "Client ID" and "Client SECRET" ?) Here is what I found: I ran the command as per https://github.com/LINCnil/pia-back/blob/master/README.md #############

configure App Set ENABLE_AUTHENTICATION=true inside your .env file

Enter the rails console with bin/rails c

Launch the command Doorkeeper::Application.create(name: "PIA", redirect_uri: "urn:ietf:wg:oauth:2.0:oob", scopes: ["read", "write"])

Find your UID and SECRET information Doorkeeper::Application.select(:uid, :secret).first

Use these credentials into your PIA application

Here is the result I got on my server: Doorkeeper::Application.select(:uid, :secret).first Doorkeeper::Application Load (0.3ms) SELECT "oauth_applications"."uid", "oauth_applications"."secret" FROM "oauth_applications" ORDER BY "oauth_applications"."id" ASC LIMIT $1 [["LIMIT", 1]] => #<Doorkeeper::Application:0x00007ff21557dca8 id: nil, uid: "PlhcHp-BlTThNMm12F8_Xn1waiiQ0J8S6GEzaoB_X-Q", secret: "[FILTERED]">

How do i get the secret? (secret: "[FILTERED]")

Tell me, do you have a more accurate manual on how to install this product?

kevin-atnos commented 1 year ago

Hello,

Indeed, you need to fill this "Server URL Configuration" form with 3 elements:

I have updated the section you are talking about in the README: https://github.com/LINCnil/pia-back#configure-app

I agree it wasn't clear. Now you have a better example on how to get your Client ID and Client SECRET.

I hope it will help you complete your installation. Just let me know.

Regards,

oleksandr-zh commented 1 year ago

Thank kevin-atnos

image

But, i still have error: image

image

What am I doing wrong ?

oleksandr-zh commented 1 year ago

Oh, sorry. I didn't start the server bin/rails s -b 172.17.15.13 -p 3000. Now i have the following question. image How can I activate users?

kevin-atnos commented 1 year ago

Hello,

Now you should have created an admin account, following this: https://github.com/LINCnil/pia-back#create-admin-account

With this account, you can login, and then you will be able to create new users in the "Users" page.

Once you have created a new user with your admin account, this user will receive an email with an activation code (be sure to configure SMFTP adequately: https://github.com/LINCnil/pia-back#smtp-configuration).

Then this user should access your Front URL and configure the Back to enable the authentication mode, as you did here: image

Once he is connected to your back and sees the authentication block, he should click on "activate account" and continue with the process (define a password, ...).

Once done, he will be able to login and start working on PIAs he has been affected to.

Regards,

oleksandr-zh commented 1 year ago

Thanks for the answer. When i try login, i see (authentication.errors.sign_in.404) image

and this (console): image

The user is created and permissions granted: image

oleksandr-zh commented 1 year ago

When i use Forgotten link. end enter code, i see next image

Then click ""Confirm" ( console): image

When you try to login with a new password image

syl-p commented 1 year ago

Helle @oleksandr-zh , what is your pia version and your pia-back version ?

Can you confirm ? ENABLE_AUTHENTICATION=true in your .env file ? When you have checked it, please make a CTRL + MAJ + R to reload you home page.

kevin-atnos commented 1 year ago

Hello @oleksandr-zh,

Very strange! Would you like to have a meeting with us so that we can try to understand better what's going on and also solve your issue?

Can I get your email address so that we can continue by emails please? Else, you can also join us at contact@atnos.com and we can find a slot to check all of that.

Regards,

Kévin

kevin-atnos commented 1 year ago

Hi @oleksandr-zh!

Thank you for joining us in a meeting, we are glad to have solved your issue :) I will close this issue but if you need any more help you can create another issue on Github here.

For anyone coming here: The issue was the missing ENABLE_AUTHENTICATION=true key missing in the .env file.

Regards,