BML Proxy Docker
On April 1, 2022 BML enabled Cloudflares Anti-bot features and all the existing scripts to interact with BML API stopped working. This repo contains build files for a proxy to bypass anti-bot.
Codebase repo:
Installation
- Install docker
curl -fsSL https://get.docker.com | sudo sh
- Give yourself docker group and relogin.
sudo usermod -aG docker $USER;sudo su - $USER
- Generate ssh key (if you havent already)
ssh-keygen
- Add your .pub key to my gitea server
cat ~/.ssh/id_*.pub
- Clone the repo
git clone git@git.shihaam.dev:shihaam/bml-proxy.git
- Go to cloned dir
cd bml-proxy
- Start the docker container
docker compose up -d
How to use
This docker image exposes a proxied BML API on localhost port 3030. Any and all requests to the BML API should instead be made to this proxy instead.
BML API URL = https://bankofmaldives.com.mv/internetbanking/api/
Docker Image URL = http://localhost:3030/api/
Best practices on usage:
It is recommded that you use nginx reverse proxy and cloudflare proxy with this for security and compatability reasons
- Install Nginx, Certbot, and Nginx Cerbot plugin
sudo apt install nginx python3-certbot python3-certbot-nginx
example nginx config: place this is in a file at "/etc/nginx/sites-enabled"
server {
server_name SUB.DOMAIN.COM;
listen 80;
location / {
proxy_pass http://localhost:3030;
}
}
- Point your sub.doman.com to server IP (its important you disable cloudflare proxy)
- Use certbot to get SSL
sudo certbot --nginx -d sub.domain.com
- Enable Cloudflare to fix encoding issue.
- Use your programs to request to request to this proxy URL instead of BML URL
Example
You would normally hit the following URL to retrieve today's transactions:
https://www.bankofmaldives.com.mv/internetbanking/api/account/{BML_ACCOUNT_NUMBER}/history/today
With this Docker image you will use the following:
https://sub.domain.com/account/{BML_ACCOUNT_NUMBER}/history/today
Disclaimer
This package is no way associated with Bank of Maldives.
I am not responsible for any losses incurred from the use of this package.
Use at your own risk.