1Panel icon indicating copy to clipboard operation
1Panel copied to clipboard

[Bug] Failed to retrieve UFW status.

Open Wuchieh opened this issue 1 year ago โ€ข 11 comments

Contact Information

No response

1Panel Version

v1.10.22-lts

Problem Description

My UFW is already enabled, but it is displayed as disabled in 1Panel.

ๆˆ‘็š„ ufw ๆ˜ฏๅทฒ็ปๅผ€ๅฏ็š„็Šถๆ€๏ผŒไฝ†ๆ˜ฏๅœจ 1panel ไธญๅดๆ˜พ็คบๆˆๆœชๅฏ็”จ

Steps to Reproduce

When the system language is neither English nor Simplified Chinese, open the /hosts/firewall/port screen.

ๅฝ“็ณป็ปŸไธๆ˜ฏ่‹ฑๆ–‡ๆˆ–็ฎ€ไฝ“ไธญๆ–‡ๆ—ถ๏ผŒๅผ€ๅฏ /hosts/firewall/port ็”ป้ข

The expected correct result

No response

Related log output

No response

Additional Information

It is recommended to set the environment before executing the status query command in backend/utils/firewall/client/ufw.go.

For example:
LANGUAGE=en_US:en ufw status

ๅปบ่ฎฎๅœจ backend/utils/firewall/client/ufw.go ๆ‰ง่กŒ็Šถๆ€ๆŸฅ่ฏขๅ‘ฝไปคๅ‰ ่ฎพ็ฝฎ็Žฏๅขƒ

ๅฆ‚: LANGUAGE=en_US:en ufw status

Wuchieh avatar Dec 23 '24 01:12 Wuchieh

ๆ„Ÿ่ฐขๅ้ฆˆ๏ผŒ้บป็ƒฆๆ‰ง่กŒ which ufw ็œ‹ไธ€ไธ‹

ssongliu avatar Dec 23 '24 01:12 ssongliu

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


Thanks for the feedback, please run which ufw to take a look

wanghe-fit2cloud avatar Dec 23 '24 01:12 wanghe-fit2cloud

ๆ„Ÿ่ฌๅ›ž้ฅ‹๏ผŒ้บป็…ฉ่ซ‹็œ‹which ufwไธ€ไธ‹

ๆ„Ÿ่ฐขๅ้ฆˆ๏ผŒ้บป็ƒฆๆ‰ง่กŒ which ufw ็œ‹ไธ€ไธ‹

$ which ufw /usr/sbin/ufw

Wuchieh avatar Dec 23 '24 01:12 Wuchieh

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


Thanks for the feedback, please take a look at which ufw

Thanks for the feedback, please run which ufw to take a look

$ which ufw /usr/sbin/ufw

wanghe-fit2cloud avatar Dec 23 '24 01:12 wanghe-fit2cloud

่ฟ™ๆ ทๅบ”่ฏฅๆ˜ฏ่ƒฝๆญฃๅธธ่Žทๅ–ๅˆฐ็š„๏ผŒ่ฟ™ไธค้ƒจๅˆ†ๅ“ช้‡Œๆœ‰้—ฎ้ข˜ๆ–นไพฟๆˆชๅ›พ็œ‹็œ‹ๅ— image

ssongliu avatar Dec 23 '24 01:12 ssongliu

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


This should be able to be obtained normally. Can you take a screenshot to see if there are any problems with these two parts? image

wanghe-fit2cloud avatar Dec 23 '24 01:12 wanghe-fit2cloud

่ฟ™ๆ ทๅบ”่ฏฅๆ˜ฏ่ƒฝๆญฃๅธธ่Žทๅ–ๅˆฐ็š„๏ผŒ่ฟ™ไธค้ƒจๅˆ†ๅ“ช้‡Œๆœ‰้—ฎ้ข˜ๆ–นไพฟๆˆชๅ›พ็œ‹็œ‹ๅ— image

ไธๅฅฝๆ„ๆ€๏ผŒๆˆ‘็™ผ็พๆˆ‘ๅœจ Steps to Reproduce ็ถฒ้ ่ทฏๅพ‘ๆ‰“้Œฏไบ†๏ผŒๆญฃ็ขบๆ‡‰่ฉฒๆ˜ฏ /hosts/firewall/port

้€™ๆ˜ฏๆˆชๅœ– image

Wuchieh avatar Dec 23 '24 02:12 Wuchieh

ๆ„Ÿ่ฌๆ„Ÿ่ฌ๏ผŒไธ‹ๅ€‹็‰ˆๆœฌๆˆ‘ๅ€‘ๅ„ชๅŒ–่ฉฒ้ƒจๅˆ†ๅˆคๆ–ท

ssongliu avatar Dec 23 '24 02:12 ssongliu

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


Thank you. We will optimize this part in the next version.

wanghe-fit2cloud avatar Dec 23 '24 02:12 wanghe-fit2cloud

้บป็…ฉๅ†ๆˆชๅœ–็œ‹ไธ€ไธ‹ไธ‹้ขๅ‘ฝไปค่ฟ”ๅ›ž

ufw status | grep Status

้˜ฒ็ซๅขป้ ้ขๆœ‰้–‹ๅ•ŸๆŒ‰้ˆ•๏ผŒ้ปžๆ“Š่ƒฝๆญฃๅธธๆ‰“้–‹ๅ—Ž๏ผŸ

image ๆˆ‘็š„ ufw ๆœฌไพ†ๅฐฑๆ˜ฏ้–‹ๅ•Ÿ็š„็‹€ๆ…‹๏ผŒ้ปžไธ‹ๅพŒๅฅฝๅƒๅชๆ˜ฏๅ–ฎ็ด”็š„้‡ๅ•Ÿไบ† 1Panelใ€‚

Wuchieh avatar Dec 23 '24 02:12 Wuchieh

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


Please take another screenshot and check the following command to return

ufw status | grep Status

There is an enable button on the firewall page. Can it be opened normally by clicking on it?

image My ufw is originally turned on, but after clicking it, it seems to simply restart 1Panel.

wanghe-fit2cloud avatar Dec 23 '24 02:12 wanghe-fit2cloud

v1.10.23-lts ็‰ˆๆœฌๅทฒๅ‘ๅธƒใ€‚

wanghe-fit2cloud avatar Jan 10 '25 07:01 wanghe-fit2cloud