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

Start error #16

Open
vesnindev opened this issue Aug 3, 2023 · 11 comments
Open

Start error #16

vesnindev opened this issue Aug 3, 2023 · 11 comments

Comments

@vesnindev
Copy link

vesnindev commented Aug 3, 2023

Hi.
I clone repo, setup config.json and when i start commands:

Do not forget to add your config.json file to /opt/wgManagerAPI/config.json

git clone this repository
cd wireguard-manager-and-api to open the repo
go get to get packages
go build -o wgManagerAPI main.go to build an output a executable file
sudo ./wgManagerAPI to run the application.

I got error:

WG MANAGER AND API STARTING UP
Env file loading - 1/6
Logger starting up - 2/6
Starting database - 3/6
Starting of network - 4/6
Created wireguard instance on port 51821
Warning - Failed to add IP address file exists
Warning - Failed to add IP address file exists
Warning - Failed to add IP address file exists
Warning - Failed to add IP address file exists
Starting autochecker - 5/6
Starting API - 6/6
HTTPS about to listen on 8443.root@v340811515netstat -na | grep :8443
:~/Wireguard-Manager-and-API#

in config.json isset real ipv4 adress, but not set ipv6

in log Error - Startup of API serveropen : no such file or directory

@RaspberryTech01
Copy link
Contributor

RaspberryTech01 commented Aug 3, 2023

Can you please check the log files for more info. The warnings are not necessarily bad, they are just informing.

@vesnindev
Copy link
Author

Now I add ipv6^

`cd /root/Wireguard-Manager-and-API;
go get;
go build -o wgManagerAPI main.go;
sudo ./wgManagerAPI;
WG MANAGER AND API STARTING UP
Env file loading - 1/6
Logger starting up - 2/6
Starting database - 3/6

2023/08/03 22:04:44 /root/Wireguard-Manager-and-API/src/db/db.go:62 record not found
[0.574ms] [rows:0] SELECT * FROM ips WHERE ipv6_address = "2a02:748:4000::250" ORDER BY ips.ipv4_address LIMIT 1
Starting of network - 4/6
Created wireguard instance on port 51821
Warning - Failed to add IP address file exists
Starting autochecker - 5/6
Starting API - 6/6
HTTPS about to listen on 8443.root@v340811515:/Wireguard-Manager-and-API# netstat -na | grep :8443
root@v340811515:
/Wireguard-Manager-and-API#

`

This is log file:

2023/08/03 22:04:44 Info - Database connection starting 2023/08/03 22:04:44 Info - Successfully migrated db 2023/08/03 22:04:44 Info - Generating IPs 2023/08/03 22:04:44 Info - IP Address not found, generating 2023/08/03 22:04:46 Info - Generated IPs successfully 2023/08/03 22:04:46 Info - Setting up WG interface 2023/08/03 22:04:46 Info - Starting up wg interface 2023/08/03 22:04:46 Wireguard instance in database was found - overriding some values. 2023/08/03 22:04:46 Info - Creating wg device client 2023/08/03 22:04:46 Info - Interface exists, adding peers 2023/08/03 22:04:46 Info - Closing wg device client 2023/08/03 22:04:46 Info - Checking if IPs exist 2023/08/03 22:04:46 Info - Added IP address to interface 2023/08/03 22:04:46 Warning - Failed to add IP address file exists 2023/08/03 22:04:46 Info - Added IP address to interface 2023/08/03 22:04:46 Info - Added IP address to interface 2023/08/03 22:04:46 Info - Added IP address to interface 2023/08/03 22:04:46 Info - Added IP address to interface 2023/08/03 22:04:46 Info - AutoStart running 2023/08/03 22:04:46 Info - Running check bandwidth 2023/08/03 22:04:46 Info - Creating wg device client 2023/08/03 22:04:46 Info - Closing wg device client 2023/08/03 22:04:46 HTTPS about to listen on 8443. 2023/08/03 22:04:46 Error - Startup of API serveropen : no such file or directory

@RaspberryTech01
Copy link
Contributor

The last line says it is unable to find file or directory. This may be your https certificate. Can you double check location.

@vesnindev
Copy link
Author

I have some questions:

  1. Is it necessary to prescribe ipv6? will it work without it(INSTANCE.IP.GLOBAL.ADDRESS.IPV6) - is this external address correct?

  2. INSTANCE.IP.GLOBAL.ADDRESS.IPV4 - This is the external address of the server, right?

  3. Local addresses can not be changed?

  4. How can I run the API without an SSL certificate? I don't plan to use domains for API

  5. Maximum number of peers on 1 server? for normal operation? 250? I saw 350 in the config

Thanks

@vesnindev
Copy link
Author

vesnindev commented Aug 4, 2023

The last line says it is unable to find file or directory. This may be your https certificate. Can you double check location.


 "CERT": {
      "FULLCHAIN": "",
      "PK": ""
    },

@vesnindev
Copy link
Author

I turned off the SSL and started the API. Other questions are still relevant.

Can you suggest how I can generate QR from the API results and create a config file for import in APP

@vesnindev
Copy link
Author

And how i can get PrivateKey? from API or wg config? I understand correctly that your api creates its own interface and private key? and not use default wg0.conf

@vesnindev
Copy link
Author

And why after add new key, I got "PresharedKey" => "REDACTED" ?

@REMEXFULAP
Copy link

sudo: ./services/start.sh: command not found

@RaspberryTech01
Copy link
Contributor

And how i can get PrivateKey? from API or wg config? I understand correctly that your api creates its own interface and private key? and not use default wg0.conf

Sorry for the late reply. This is correct, it does not use the default wg0.conf. The private key to my knowledge (I haven't worked on this project in ages) is stored in the database in the WireguardInterface table.

@RaspberryTech01
Copy link
Contributor

And why after add new key, I got "PresharedKey" => "REDACTED" ?

This is because a preshared key is an extra layer of security. You are already specifying the preshared key when creating a new key, why do you need to see it?

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

3 participants