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

Editing .env file doesn't change anything #57

Open
softfan2019 opened this issue Dec 3, 2024 · 16 comments
Open

Editing .env file doesn't change anything #57

softfan2019 opened this issue Dec 3, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@softfan2019
Copy link

softfan2019 commented Dec 3, 2024

Hi,
I previously asked about IPv6, after a system restart service again started in IPv4 while the
/opt/elora-vpn/.env had the IPv6 address after some test, I changed the code in
/opt/elora-vpn/main.py
to host=("::" if DEBUG else "::"),
and it started to work on IPv6.

same problem with SSL editing .env file with cert path had no effect but changing the code and directly adding path to main.py worked.

now i have same problem with telegram, first I added the values for BOT in webpanel and restart service but it didn't change .env file values while web panel showed information in fields.
So I edited .env file with telegram token and other information and still no telegram BOT.
I changed debug value to true and added the debug level line but journal only shows stop and start of service.

I think somehow script dosnt get its setting from .env file in /opt/elora-vpn/.env.

Thanks

@softfan2019 softfan2019 changed the title Editing .env file dosn't change anything Editing .env file doesn't change anything Dec 3, 2024
@eloravpn
Copy link
Owner

eloravpn commented Dec 3, 2024

Hi @softfan2019,

For both issues, you don't need to make any changes to main.py. All of them can be managed in the Settings tab within the Panel. Simply adjust the configuration there and restart the panel to apply the changes! Alternatively, you can modify the .env file directly.

Please do not make any changes to main.py.

@softfan2019
Copy link
Author

As I said for SSL file path, first attempt was in webpanel with no effect and then I edited .env with still no change, and only change in main.py took effect.
for Telegram BOT also first attempt was in webpanel with no effect and then edited the .env file and still I don't have BOT connection.
For Debug I edited .env file and no detail log is shown.

Is it possible that setting are not saved to or read from .env file?

@eloravpn
Copy link
Owner

eloravpn commented Dec 3, 2024

Web panel settings take precedence over the configurations in the .env file. After saving changes in the web panel, ensure you restart the panel for the updates to take effect.

@eloravpn eloravpn added the bug Something isn't working label Dec 3, 2024
@softfan2019
Copy link
Author

I got bot working, but I think that there must be a problem or bug in setting sequence.
What I did in steps:
1- check web panel telegram bot info and SSL are filled in related fields.
2- Stop service and restore all files to default , main.py and .env
3- Edit .env file with IPv6 setting and port.
UVICORN_HOST=:: UVICORN_PORT=443
4- started the service ---> Result the panel wont load!
5- Stopped the service and edited the main.py with this code
host=("::" if DEBUG else "::"), port=443,
5- started the service ---> Result web panel load and can log in. telegram bot is connected.

So for now the problem is limited to host and port of IPv6 that won't get read from .env file.

I thought I know the cause, because of priority of setting and their order.
When I Install fresh version because server doesn't have IPv4 it wont load, So it put a default value in web panel data base on local host IPv4.
and after that any change to .env file is useless and I am forced to edit main.py to change host setting.
and when I open the web panel->Settings->Basic in host section I see these value that I think are from database.
Unicorn host: 0.0.0.0 Unicorn port: 443
I change the host value to :: and saved and restore main.py to original code. result: I lost web panel again. So as I said for now for IPv6 my only way is to edit main.py and put values there.

hope to find the reason.
Thanks.

@eloravpn
Copy link
Owner

eloravpn commented Dec 5, 2024

I'll review these steps thoroughly and get back to you.

@eloravpn
Copy link
Owner

eloravpn commented Dec 6, 2024

Hi @softfan2019, could you please install the latest version and let me know?

@hugetoucan
Copy link

Hi @eloravpn same problem here its just ignoring .env file

@softfan2019
Copy link
Author

Hi @softfan2019, could you please install the latest version and let me know?

Hi @eloravpn , Sorry for delay. I updated script ( using command provided in page, so not clean install)
Problem of ipv6 and port still exist, it will not read values from .env file and I am forced to put values in main file.

@eloravpn
Copy link
Owner

Hi @softfan2019
Did you also modify the value in the Settings menu on the Panel?

@hugetoucan
Copy link

Hi @softfan2019
Did you also modify the value in the Settings menu on the Panel?

Yes, but now I'm reinstall panel, and modify only settings in panel, and somehow after restart "systemctl" it worked, but .env file not modified, and any change there not applying in panel🙃

@tkmw1985
Copy link

Same problem. Are there any solutions? How to make it work?

@eloravpn
Copy link
Owner

@tkmw1985 Just set these configurations in the panel's Settings page.

@tkmw1985
Copy link

@tkmw1985 Just set these configurations in the panel's Settings page.

Unfortunately, I followed all the steps carefully but after installing the certificates in the panel, the login page appeared but did not log in!

@eloravpn
Copy link
Owner

@tkmw1985
Did you also modify the config.json file?

@tkmw1985
Copy link

Hello sir. It will be better if you add these steps to the readme file for those who are installing the first time

  1. Install with the script
  2. obtain SSL certificates
  3. setup SSL certificates in the panel
  4. indicate SSL certificates path in directory /opt/elora-vpn/.env
  5. modify "BASE_URL": "https://your-domain.com:your-port/api", in /opt/elora-vpn/static/config.json

@eloravpn
Copy link
Owner

@tkmw1985 @softfan2019 @hugetoucan

In the new version, you can configure all settings related to SSL and IPv6 in the settings menu.
We also test IPV6 support!

Refer to these sections for more details:
SSL Certificate Setup: https://github.com/eloravpn/EloraVPNManager#ssl-certificate-setup
Configuring IPv6 Support: https://github.com/eloravpn/EloraVPNManager#configuring-ipv6-support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants