Go to file
Urko 35a8b14af2 feat: add readme 2023-08-09 20:33:48 +02:00
cmd/http fix remove fail2ban 2023-07-23 11:13:32 +02:00
internal fix: get user account 2023-08-09 20:07:49 +02:00
kit init app 2023-07-05 22:07:10 +02:00
.gitignore gitignore and license 2023-07-05 21:51:39 +02:00
LICENSE fix: license and refactor call to post 2023-07-20 11:31:10 +02:00
README.md feat: add readme 2023-08-09 20:33:48 +02:00
go.mod feat: add test forpassword hash 2023-08-09 20:03:29 +02:00
go.sum feat: add test forpassword hash 2023-08-09 20:03:29 +02:00

README.md

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

.
├── 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:
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.