Rust 语言编写的登录界面服务器。包含一个最小网页服务器和内置的登录页面
|
|
hai 1 ano | |
|---|---|---|
| .github | hai 1 ano | |
| doc | hai 1 ano | |
| src | hai 1 ano | |
| .gitignore | hai 1 ano | |
| CONTRIBUTING.md | hai 1 ano | |
| Cargo.lock | hai 1 ano | |
| Cargo.toml | hai 1 ano | |
| LICENSE.md | hai 1 ano | |
| README.en.md | hai 1 ano | |
| README.md | hai 1 ano |
简体中文 | English
A login interface server written in Rust. Includes a minimal web server and built-in login page.
This project is a subproject of pageos.
Core principles:
This project depends on greetd, and may require additional components like a desktop environment (e.g. cage) and browser (e.g. Firefox) depending on your needs.
Available command line arguments (excluding help):
--port: Listening port, defaults to 12801--page: Path to custom login HTML file (recommended to store in /usr/local/lib/pageos-greet/).
If not specified, uses the built-in HTML from src/server.rs (HTML)--launch-command: Command to run when starting pageos-greet, typically used to launch a kiosk browser to display the login page.
This command will be terminated when pageos-greet exits.--session-command: Command to execute after successful login, defaults to $SHELL or /usr/bin/bashExample:
pageos-greet \
--port 12801 \
--page /path/to/login.html \
--launch-command "cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12801" \
--session-command "pageos-core -p 12800 --command \"cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12800\""
When configuring /etc/greetd/greetd.toml, add commands to set up a temporary Home directory to prevent Firefox startup issues:
[default_session]
command = "bash -c 'mkdir -p /tmp/pageos-greet; export HOME=/tmp/pageos-greet; pageos-greet --launch-command \"cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12801\" --session-command \"pageos-core -p 12800 --command \\"cage -s -- firefox --kiosk --no-remote http://127.0.0.1:12800\\"\"'"
See CONTRIBUTING.md for contribution guidelines.```markdown
Ey bro, how do I adapt my page or Scratch to use the pageos-greet login manager?
Yes! Bro! You just need to do these two things:
Mode Detection: Determine whether currently in login state. Can use PageOS environment extension.
Check the domain and port at the very beginning of page initialization. If matched, initialize and enter the login page.
For example, if your OS specifies the login page at 127.0.0.1:12801, the condition would be:
if (
(window.location.hostname === "127.0.0.1" ||
window.location.hostname === "localhost") &&
window.location.port === "12801"
) {
// Initialize login page
}
Interface Adaptation: Ensure your page/project contains all display (output) and input controls, and adapts to the login logic/message format. Reference: