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

[bug] version cannot be displayed in all-in-one docker image #2981

Open
hsluoyz opened this issue Jun 2, 2024 · 6 comments
Open

[bug] version cannot be displayed in all-in-one docker image #2981

hsluoyz opened this issue Jun 2, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@hsluoyz
Copy link
Member

hsluoyz commented Jun 2, 2024

Use Docker Option-1 to install Casdoor: https://casdoor.org/docs/basic/try-with-docker#option-1-use-the-toy-database

Go to: http://localhost:8000/sysinfo , the version is empty:

image

It should work like the non-Docker demo site: https://door.casdoor.com/sysinfo

image

@casbin-bot
Copy link
Contributor

@casbin-bot casbin-bot added the bug Something isn't working label Jun 2, 2024
@seeleclover
Copy link

I have identified the cause of the problem.

When I used Docker to install Casdoor, I initiated debugging on the /api/get-version-info interface and received a return message of "msg": "repository does not exist". This indicates that this interface gets the version by reading the Git History. However, the content packaged into Docker does not include the Git History.

I found in controllers/systeminfo.go that although there are two ways to get the version when this interface is called, in any case, when the first method fails, it will immediately return the exception to the front-end.

@seeleclover
Copy link

I think this interface should determine which method to use to obtain the version based on the runmode in conf/app.conf. If it is dev, then obtain the version through Git History; If it is prod, then obtain the version through version_info.txt.

@seeleclover
Copy link

May I ask, how would it be more appropriate to solve this problem?
Or rather, follow the original logic of the program. First, try to obtain the version through Git History. If the retrieval fails, then retrieve the version through the version_info.txt ?
@hsluoyz

@hsluoyz
Copy link
Member Author

hsluoyz commented Jun 5, 2024

@seeleclover we will fix it by ourselves

@seeleclover
Copy link

OK, thanks.

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

Successfully merging a pull request may close this issue.

3 participants