change 0.0.0.0 to localhost
This commit is contained in:
@ -28,7 +28,7 @@ password_types = [
|
|||||||
# Hash Record Functions
|
# Hash Record Functions
|
||||||
#################################################
|
#################################################
|
||||||
HASH_FILE = Path("/opt/pwdgen/hash_record.txt")
|
HASH_FILE = Path("/opt/pwdgen/hash_record.txt")
|
||||||
# Create the file if it doesn’t exist
|
# Create the file if it doesn't exist
|
||||||
if not HASH_FILE.exists():
|
if not HASH_FILE.exists():
|
||||||
HASH_FILE.touch(exist_ok=True)
|
HASH_FILE.touch(exist_ok=True)
|
||||||
|
|
||||||
|
|||||||
12
nginx.conf
12
nginx.conf
@ -14,7 +14,7 @@ server_name pwdgwn_v2;
|
|||||||
# API Routes
|
# API Routes
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
location = /get_password {
|
location = /get_password {
|
||||||
proxy_pass http://0.0.0.0:5000/get_password;
|
proxy_pass http://localhost:5000/get_password;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
@ -22,7 +22,7 @@ server_name pwdgwn_v2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
location = /verbose_password {
|
location = /verbose_password {
|
||||||
proxy_pass http://0.0.0.0:5000/verbose_password;
|
proxy_pass http://localhost:5000/verbose_password;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
@ -30,7 +30,7 @@ server_name pwdgwn_v2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
location = /custom_password {
|
location = /custom_password {
|
||||||
proxy_pass http://0.0.0.0:5000/custom_password;
|
proxy_pass http://localhost:5000/custom_password;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
@ -38,7 +38,7 @@ server_name pwdgwn_v2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
location = /get_count {
|
location = /get_count {
|
||||||
proxy_pass http://0.0.0.0:5000/get_count;
|
proxy_pass http://localhost:5000/get_count;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
@ -46,7 +46,7 @@ server_name pwdgwn_v2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
location = /get_info {
|
location = /get_info {
|
||||||
proxy_pass http://0.0.0.0:5000/get_info;
|
proxy_pass http://localhost:5000/get_info;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
@ -57,7 +57,7 @@ server_name pwdgwn_v2;
|
|||||||
# All other paths → Apache (PHP)
|
# All other paths → Apache (PHP)
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://0.0.0.0:8080;
|
proxy_pass http://localhost:8080;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
[supervisord]
|
[supervisord]
|
||||||
nodaemon=true
|
nodaemon=true
|
||||||
logfile=/dev/stdout ; Supervisor itself → stdout
|
logfile=/dev/stdout ; Supervisor itself → stdout
|
||||||
logfile_maxbytes=0 ; (no rotation – keeps it simple)
|
logfile_maxbytes=0 ; (no rotation - keeps it simple)
|
||||||
logfile_backups=0
|
logfile_backups=0
|
||||||
loglevel=info
|
loglevel=info
|
||||||
|
|
||||||
|
|||||||
@ -92,7 +92,7 @@ function curlHelper($url, $APIKey){
|
|||||||
|
|
||||||
// Password Generator API Function
|
// Password Generator API Function
|
||||||
function getStandardPasswordFromAPI($passType){
|
function getStandardPasswordFromAPI($passType){
|
||||||
$apiUrl = "http://0.0.0.0:8189/get_password";
|
$apiUrl = "http://localhost:8189/get_password";
|
||||||
// Build the query string and full URL
|
// Build the query string and full URL
|
||||||
$query = http_build_query(['pwd_index' => $passType]);
|
$query = http_build_query(['pwd_index' => $passType]);
|
||||||
$url = rtrim($apiUrl, '?') . '?' . $query;
|
$url = rtrim($apiUrl, '?') . '?' . $query;
|
||||||
@ -101,7 +101,7 @@ function getStandardPasswordFromAPI($passType){
|
|||||||
|
|
||||||
// Password Generator API Function for Custom Password
|
// Password Generator API Function for Custom Password
|
||||||
function getCustomPasswordFromAPI($passType, $payload){
|
function getCustomPasswordFromAPI($passType, $payload){
|
||||||
$url = 'http://0.0.0.0:8189/custom_password';
|
$url = 'http://localhost:8189/custom_password';
|
||||||
|
|
||||||
// Initialise a cURL handle
|
// Initialise a cURL handle
|
||||||
$ch = curl_init($url);
|
$ch = curl_init($url);
|
||||||
@ -119,7 +119,7 @@ function getCustomPasswordFromAPI($passType, $payload){
|
|||||||
// We want the response body back, not the HTTP headers
|
// We want the response body back, not the HTTP headers
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|
||||||
// Optional: if you need to trust self‑signed certs (rare for production)
|
// Optional: if you need to trust self-signed certs (rare for production)
|
||||||
// curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
// curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||||
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ function getCustomPasswordFromAPI($passType, $payload){
|
|||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
if ($httpCode !== 200) {
|
if ($httpCode !== 200) {
|
||||||
// Non‑200 responses are treated as errors
|
// Non-200 responses are treated as errors
|
||||||
error_log("Password API returned HTTP {$httpCode}");
|
error_log("Password API returned HTTP {$httpCode}");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ function getCustomPasswordFromAPI($passType, $payload){
|
|||||||
|
|
||||||
// Password Count API Function
|
// Password Count API Function
|
||||||
function getPasswordCountFromAPI(){
|
function getPasswordCountFromAPI(){
|
||||||
$apiUrl = "http://0.0.0.0:8189/get_count";
|
$apiUrl = "http://localhost:8189/get_count";
|
||||||
// Build the query string and full URL
|
// Build the query string and full URL
|
||||||
$url = rtrim($apiUrl, '?') ;
|
$url = rtrim($apiUrl, '?') ;
|
||||||
return curlHelper($url, "total_passwords");
|
return curlHelper($url, "total_passwords");
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------
|
/* ------------------------------------------------------------------
|
||||||
Meter - dark‑mode look
|
Meter - dark-mode look
|
||||||
------------------------------------------------------------------ */
|
------------------------------------------------------------------ */
|
||||||
#meter {
|
#meter {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -31,16 +31,16 @@
|
|||||||
padding: 8px; /* doubled padding inside container */
|
padding: 8px; /* doubled padding inside container */
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
/* Card‑style background + border - same as before */
|
/* Card-style background + border - same as before */
|
||||||
background: var(--bg-card);
|
background: var(--bg-card);
|
||||||
border: 1px solid var(--clr-border);
|
border: 1px solid var(--clr-border);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
max-width: 420px; /* doubled max‑width */
|
max-width: 420px; /* doubled max-width */
|
||||||
box-shadow: 0 1px 3px rgba(0,0,0,.2);
|
box-shadow: 0 1px 3px rgba(0,0,0,.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------------
|
/* ------------------------------------------------------------------
|
||||||
Bar - light‑dark contrast
|
Bar - light-dark contrast
|
||||||
------------------------------------------------------------------ */
|
------------------------------------------------------------------ */
|
||||||
#meter div {
|
#meter div {
|
||||||
width: 36px; /* doubled width */
|
width: 36px; /* doubled width */
|
||||||
|
|||||||
Reference in New Issue
Block a user