Go to file
Urko. ff1c51c723 feat: do log ips 2024-02-22 19:10:27 +01:00
cmd/http feat: add makefile 2024-02-22 18:59:28 +01:00
internal feat: do log ips 2024-02-22 19:10:27 +01:00
kit init app 2023-07-05 22:07:10 +02:00
.gitignore feat: add makefile 2024-02-22 18:59:28 +01:00
LICENSE fix: license and refactor call to post 2023-07-20 11:31:10 +02:00
Makefile feat: add makefile 2024-02-22 18:59:28 +01:00
README.md fix readme 2023-08-09 20:34:39 +02:00
go.mod feat: add makefile 2024-02-22 18:59:28 +01: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.

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.