feat: add readme
This commit is contained in:
parent
0d3a68997a
commit
35a8b14af2
|
@ -0,0 +1,124 @@
|
|||
# Prosody Password Manager
|
||||
This project provides a web interface to change the password for XMPP accounts managed by Prosody. It interfaces with the Prosody server to securely handle password changes.
|
||||
|
||||
## Project Structure
|
||||
```bash
|
||||
.
|
||||
├── cmd
|
||||
│ └── http
|
||||
│ ├── main.go
|
||||
│ └── views
|
||||
│ ├── error.hbs
|
||||
│ ├── index.hbs
|
||||
│ ├── styles.hbs
|
||||
│ └── success.hbs
|
||||
├── go.mod
|
||||
├── go.sum
|
||||
├── internal
|
||||
│ ├── api
|
||||
│ │ ├── handler
|
||||
│ │ │ ├── helper.go
|
||||
│ │ │ └── prosody_hdl.go
|
||||
│ │ └── server.go
|
||||
│ └── services
|
||||
│ ├── fail2ban
|
||||
│ │ └── fail.go
|
||||
│ └── prosody
|
||||
│ ├── account.go
|
||||
│ ├── change_password.go
|
||||
│ ├── change_password_test.go
|
||||
│ └── prosody.go
|
||||
├── kit
|
||||
│ ├── config
|
||||
│ │ └── config.go
|
||||
│ └── path.go
|
||||
└── LICENSE
|
||||
```
|
||||
|
||||
## Key Files
|
||||
|
||||
- **logic** to change the password in the Prosody server. It interfaces with the Prosody server's command-line tools and verifies the current password before making any changes.
|
||||
|
||||
- **prosody.go**: Provides utility functions related to the Prosody server, including constructing paths to account data files.
|
||||
|
||||
- **account.go**: Contains utility functions to load account details from Prosody's data files.
|
||||
|
||||
- **server.go**: Sets up the web server, routes, and middleware for the application.
|
||||
|
||||
- **main.go**: The entry point of the application. It initializes the services and starts the web server.
|
||||
|
||||
Certainly! Here's the updated README.md with the "Requirements" section:
|
||||
Prosody Password Manager
|
||||
|
||||
This project provides a web interface to change the password for XMPP accounts managed by Prosody. It interfaces with the Prosody server to securely handle password changes.
|
||||
Project Structure
|
||||
|
||||
go
|
||||
|
||||
.
|
||||
├── cmd
|
||||
│ └── http
|
||||
│ ├── main.go
|
||||
│ └── views
|
||||
│ ├── error.hbs
|
||||
│ ├── index.hbs
|
||||
│ ├── styles.hbs
|
||||
│ └── success.hbs
|
||||
├── go.mod
|
||||
├── go.sum
|
||||
├── internal
|
||||
│ ├── api
|
||||
│ │ ├── handler
|
||||
│ │ │ ├── helper.go
|
||||
│ │ │ └── prosody_hdl.go
|
||||
│ │ └── server.go
|
||||
│ └── services
|
||||
│ ├── fail2ban
|
||||
│ │ └── fail.go
|
||||
│ └── prosody
|
||||
│ ├── account.go
|
||||
│ ├── change_password.go
|
||||
│ ├── change_password_test.go
|
||||
│ └── prosody.go
|
||||
├── kit
|
||||
│ ├── config
|
||||
│ │ └── config.go
|
||||
│ └── path.go
|
||||
└── LICENSE
|
||||
|
||||
Key Files
|
||||
|
||||
change_password.go: Contains the logic to change the password in the Prosody server. It interfaces with the Prosody server's command-line tools and verifies the current password before making any changes.
|
||||
|
||||
prosody.go: Provides utility functions related to the Prosody server, including constructing paths to account data files.
|
||||
|
||||
account.go: Contains utility functions to load account details from Prosody's data files.
|
||||
|
||||
server.go: Sets up the web server, routes, and middleware for the application.
|
||||
|
||||
main.go: The entry point of the application. It initializes the services and starts the web server.
|
||||
|
||||
## Requirements
|
||||
|
||||
- **Prosody Server**: Ensure that the Prosody server is installed and running on your machine. This application interfaces with Prosody's command-line tools to manage XMPP accounts.
|
||||
|
||||
- **Environment Variables**: The application requires certain environment variables to be set. These can be provided directly or through a **.env** file. The required variables are:
|
||||
- **DOMAIN**: The domain for the Prosody server (e.g., **xmpp.example.com**).
|
||||
- **API_PORT** (optional): The port on which the web server will run. Defaults to **8080** if not provided.
|
||||
- **VIEWS** (optional): The path to the directory containing view templates. Defaults to **./views** if not provided.
|
||||
|
||||
## Setup & Running
|
||||
|
||||
1. Ensure you have Go installed on your machine.
|
||||
2. Clone the repository.
|
||||
3. Navigate to the project directory.
|
||||
4. Run the application using:
|
||||
|
||||
```bash
|
||||
go run cmd/http/main.go
|
||||
```
|
||||
|
||||
Visit **http://localhost:<API_PORT>** in your browser to access the password change interface.
|
||||
|
||||
## Contributing
|
||||
If you'd like to contribute to this project, please fork the repository and submit a pull request.
|
Loading…
Reference in New Issue