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

404 page not found #6

Open
myde2001 opened this issue Oct 10, 2023 · 16 comments
Open

404 page not found #6

myde2001 opened this issue Oct 10, 2023 · 16 comments

Comments

@myde2001
Copy link

Hi, I can't get to install the app, after cloning the repository and building it with make, all I get after executing the binary and going to the URL of the web server is "404 page not found". Any idea of what's happening? Thanks

@cylonchau
Copy link
Owner

Hi bro, you can refer API document
https://documenter.getpostman.com/view/12796679/UV5agGNr

@myde2001
Copy link
Author

myde2001 commented Oct 11, 2023

Hi bro, you can refer API document https://documenter.getpostman.com/view/12796679/UV5agGNr

Hi, it doesn't work, I cannot find a way to get the WebUI working.

@cylonchau
Copy link
Owner

Hi bro, you can refer API document https://documenter.getpostman.com/view/12796679/UV5agGNr

Hi, it doesn't work, I cannot find a way to get the WebUI working.

You can try run in docker, if you want runinng in linux vm, you need install a nginx or other web server

@joe-at-startupmedia
Copy link

The static assets aren't served by the application. That's why an nginx configuration exists which listens on a different port which can be changed to anything (e.g. 443) https://github.com/cylonchau/firewalld-gateway/blob/aff50c483884cbb78ba1cc2ecb592669f8f17139/uranus.nginx.conf

@cylonchau
Copy link
Owner

cylonchau commented Aug 24, 2024 via email

@cylonchau
Copy link
Owner

The static assets aren't served by the application. That's why an nginx configuration exists which listens on a different port which can be changed to anything (e.g. 443) https://github.com/cylonchau/firewalld-gateway/blob/aff50c483884cbb78ba1cc2ecb592669f8f17139/uranus.nginx.conf

Please refer install manual

@cylonchau
Copy link
Owner

Hi bro, you can refer API document https://documenter.getpostman.com/view/12796679/UV5agGNr

Hi, it doesn't work, I cannot find a way to get the WebUI working.

Please refer install manual

@joe-at-startupmedia
Copy link

joe-at-startupmedia commented Aug 24, 2024

@cylonchau no worries I was able to get the web assets working, I was trying to explain to the OP why the binary doesn't serve the static assets. Personally I had problems establishing communications with DBUS because the latest version doesn't allow tcp communication using the method explained. I would open a separate issue but I have since moved on.

@cylonchau
Copy link
Owner

@cylonchau no worries I was able to get the web assets working, I was trying to explain to the OP why the binary doesn't serve the static assets. Personally I had problems establishing communications with DBUS because the latest version doesn't allow tcp communication using the method explained. I would open a separate issue but I have since moved on.

I haven't figured out how to embed static files into the binary yet. 😥, TCP need configure dbus enable allow remote connection, default is not allow.

@joe-at-startupmedia
Copy link

cylonchau give me a few, I'll open another issue explaining the TCP dbus issue.

@joe-at-startupmedia
Copy link

joe-at-startupmedia commented Aug 24, 2024

@cylonchau I'm getting a 404 trying to register a user:

Started process:

I0824 09:45:11.755718   17525 server.go:79] FLAG: --one_output="false"
I0824 09:45:11.755727   17525 server.go:79] FLAG: --skip_headers="false"
I0824 09:45:11.755743   17525 server.go:79] FLAG: --skip_log_headers="false"
I0824 09:45:11.755751   17525 server.go:79] FLAG: --sql-driver="sqlite"
I0824 09:45:11.755761   17525 server.go:79] FLAG: --stderrthreshold="2"
I0824 09:45:11.755771   17525 server.go:79] FLAG: --v="5"
I0824 09:45:11.755778   17525 server.go:79] FLAG: --vmodule=""
I0824 09:45:11.757932   17525 model.go:35] Databases stats is {MaxOpenConnections:100 OpenConnections:1 InUse:0 Idle:1 WaitCount:0 WaitDuration:0s MaxIdleClosed:0 MaxIdleTimeClosed:0 MaxLifetimeClosed:0}
I0824 09:45:11.758777   17525 http.go:27] Listening and serving HTTP on 0.0.0.0:2952
I0824 09:45:11.760529   17525 processor.go:60] Async event processor started, waitting task...
[root@startup-nginx-1 ~]# curl --location 'localhost:2952/ping'
{"code":10000,"msg":"operation succeeded","data":"pong"}
[root@startup-nginx-1 ~]# curl --location 'http://0.0.0.0:2952/auth/signup' --data '{"username": "admin","password": "111"}'
404 page not found

Any ideas?

@joe-at-startupmedia
Copy link

nvm, I figured it out:

/sso/signup:

I was referring to that old postman docs.

updated command to crate a user is:

curl -X POST "http://0.0.0.0:2952/sso/signup" --data '{"username": "admin1","password": "1112"}'

@cylonchau
Copy link
Owner

nvm, I figured it out:

/sso/signup:

I was referring to that old postman docs.

updated command to crate a user is:

curl -X POST "http://0.0.0.0:2952/sso/signup" --data '{"username": "admin1","password": "1112"}'

This feature must be enable Database config, if not, those router will not reigster, this is only a firewalld rest api.

Please refer install manual, you must change config and migarte database.

	if !config.CONFIG.MySQL.IsEmpty() || !config.CONFIG.SQLite.IsEmpty() {
		ssoRouter := &sso.SSO{}
		ssoRouter.RegisterUserAPI(ssoGroup)
		// auth route
		authRouter := &auth.Auth{}
		authRouter.RegisterUserAPI(authAPI)

		usersRouter := &user.User{}
		usersRouter.RegisterUserAPI(userAPI)

		tokenRouter := &Token.Token{}
		tokenRouter.RegisterTokenAPI(tokenAPI)

		tagRouter := &tag.Tag{}
		tagRouter.RegisterTagAPI(tagGroup)

		hostRouter := &host.Host{}
		hostRouter.RegisterHostAPI(hostGroup)

		asyncHostRouter := &host.AsyncHost{}
		asyncHostRouter.RegisterAsyncHostAPI(hostGroup)

		templateRouter := &template.Template{}
		templateRouter.RegisterTemplateAPI(templateGroup)

		auditRouter := &audit.Audit{}
		auditRouter.RegisterAuditAPI(auditAPI)
	}
}

@joe-at-startupmedia
Copy link

@cylonchau I already ran with --migration. This postman link is outdated: https://documenter.getpostman.com/view/12796679/UV5agGNr#060f80aa-7574-4dd1-b145-36847c784cbd

@cylonchau
Copy link
Owner

cylonchau commented Aug 24, 2024

@cylonchau I already ran with --migration. This postman link is outdated: https://documenter.getpostman.com/view/12796679/UV5agGNr#060f80aa-7574-4dd1-b145-36847c784cbd

must both config database in config file, and run migration; and API doc is already build in, you can use /swagger/index.html access API document.

@cylonchau
Copy link
Owner

@cylonchau no worries I was able to get the web assets working, I was trying to explain to the OP why the binary doesn't serve the static assets. Personally I had problems establishing communications with DBUS because the latest version doesn't allow tcp communication using the method explained. I would open a separate issue but I have since moved on.

Latest version is can embed assets in binary file.

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