Update API Keys and fix frontend bugs
This commit is contained in:
@@ -132,6 +132,9 @@ exports.analyzeImage = async (req, res) => {
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error analyzing image:', error.response ? JSON.stringify(error.response.data) : error.message);
|
||||
res.status(500).json({ error: error.message || 'Failed to analyze image' });
|
||||
res.status(500).json({
|
||||
error: error.message || 'Failed to analyze image',
|
||||
details: error.response ? error.response.data : null
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,8 +7,8 @@ dotenv.config({ path: path.join(__dirname, '../.env') });
|
||||
const Config = require('../models/Config');
|
||||
const { encrypt } = require('../utils/crypto');
|
||||
|
||||
const PERFECT_CORP_API_KEY = 'sk-tHtPU8rst9cifrM6RhkjCKy9EpNfXBdcoCbzP0QDRhIkHr_InBYPS6g_6XGSumbm';
|
||||
const PERFECT_CORP_SECRET_KEY = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCKexD/nyLrGq7jXCxYi/Tjwr297cZS5EUFQbCV9NO2XQU/sJitsT2WBHHS8AYAQrzM56hPgnwpt/B+EuSuLfVbM/ympBUvSrULUNlrJF5lW96JMd1KF8RWC9fICZJuCE2iGpGAd0l9pOCUmYM4JZ/n26HxZxSSramkoOYxmhFYhQIDAQAB';
|
||||
const PERFECT_CORP_API_KEY = 'sk-cKf0TV79X6Fp3CZwKfsnHv1Rq9GOK6nFCAXyDG9CvnIFKGYiTtSdOnjyadBaYc5y';
|
||||
const PERFECT_CORP_SECRET_KEY = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCAiLqa5kyq7FR9WmK++HCPNjGLsljLfvJQq+JZzCx7pfLlVD5KzRb17iglHQJkFkSHxfqxtYNwosA54oT9uD1kA96TJy+uOLRwxry7BMPTFQyDdIoloJCI/Bl+SEnSxjDoYpU8zA3S4GDkmLH3A7vHkxhMydgB8B1EOxJahQsF7QIDAQAB';
|
||||
|
||||
async function seedKeys() {
|
||||
try {
|
||||
@@ -38,3 +38,10 @@ async function seedKeys() {
|
||||
}
|
||||
|
||||
module.exports = seedKeys;
|
||||
|
||||
if (require.main === module) {
|
||||
seedKeys().then(() => {
|
||||
console.log('Seeding complete. Exiting.');
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
const axios = require('axios');
|
||||
const API_KEY = 'sk-cKf0TV79X6Fp3CZwKfsnHv1Rq9GOK6nFCAXyDG9CvnIFKGYiTtSdOnjyadBaYc5y';
|
||||
const baseUrl = 'https://yce-api-01.makeupar.com/s2s/v2.0';
|
||||
const initPayload = {
|
||||
files: [
|
||||
{ content_type: 'image/jpeg', file_name: 'test.jpg', file_size: 100000 }
|
||||
]
|
||||
};
|
||||
axios.post(`${baseUrl}/file`, initPayload, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${API_KEY}`,
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(res => console.log('Init success:', JSON.stringify(res.data)))
|
||||
.catch(err => {
|
||||
console.error('Init failed:', err.response ? err.response.status : err.message);
|
||||
if(err.response) console.error(JSON.stringify(err.response.data));
|
||||
});
|
||||
@@ -0,0 +1,44 @@
|
||||
const axios = require('axios');
|
||||
const API_KEY = 'sk-cKf0TV79X6Fp3CZwKfsnHv1Rq9GOK6nFCAXyDG9CvnIFKGYiTtSdOnjyadBaYc5y';
|
||||
const baseUrl = 'https://yce-api-01.makeupar.com/s2s/v2.0';
|
||||
|
||||
async function test() {
|
||||
try {
|
||||
const initPayload = {
|
||||
files: [
|
||||
{ content_type: 'image/jpeg', file_name: 'test.jpg', file_size: 100000 }
|
||||
]
|
||||
};
|
||||
|
||||
console.log('Init...');
|
||||
const res = await axios.post(`${baseUrl}/file`, initPayload, {
|
||||
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
const fileId = res.data.data.files[0].file_id;
|
||||
console.log('File ID:', fileId);
|
||||
|
||||
console.log('Creating task...');
|
||||
const taskPayload = {
|
||||
src_file_id: fileId,
|
||||
dst_actions: [
|
||||
"wrinkle", "pore", "texture", "acne", "moisture", "eye_bag",
|
||||
"firmness", "age_spot", "radiance", "redness", "oiliness"
|
||||
],
|
||||
miniserver_args: {
|
||||
enable_mask_overlay: false
|
||||
},
|
||||
format: "json"
|
||||
};
|
||||
|
||||
const taskRes = await axios.post(`${baseUrl}/task/skin-analysis`, taskPayload, {
|
||||
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
console.log('Task success:', taskRes.data);
|
||||
} catch (err) {
|
||||
console.error('Failed:', err.response ? err.response.status : err.message);
|
||||
if(err.response) console.error(JSON.stringify(err.response.data, null, 2));
|
||||
}
|
||||
}
|
||||
test();
|
||||
@@ -178,7 +178,7 @@ const AnalysisResultPage = () => {
|
||||
// Generate a unique ID for this specific analysis report
|
||||
const reportId = Math.random().toString(36).substring(7);
|
||||
const currentUrl = window.location.origin + window.location.pathname;
|
||||
const verificationLink = `${currentUrl}?phone=${phone}&report=${reportId}`;
|
||||
let verificationLink = `${currentUrl}?phone=${phone}&report=${reportId}`;
|
||||
|
||||
let otpToUse = '';
|
||||
let isExisting = false;
|
||||
|
||||
@@ -200,9 +200,11 @@ const DashboardPage = () => {
|
||||
<td className="px-6 py-4 text-sm font-medium text-gray-700">{report.name}</td>
|
||||
<td className="px-6 py-4 text-sm text-gray-500">{report.phone}</td>
|
||||
<td className="px-6 py-4 text-sm text-limelite-red font-semibold truncate max-w-[200px]">
|
||||
<a href={report.link} target="_blank" rel="noopener noreferrer" className="hover:underline">
|
||||
{report.link ? report.link.substring(report.link.indexOf('result')) : '-'}
|
||||
{report.link ? (
|
||||
<a href={report.link.startsWith('http') ? report.link : `${API_BASE_URL}${report.link}`} target="_blank" rel="noopener noreferrer" className="hover:underline">
|
||||
View Report
|
||||
</a>
|
||||
) : '-'}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "limelite-backend",
|
||||
"build_pack": "dockerfile",
|
||||
"base_directory": "/backend",
|
||||
"dockerfile_location": "/Dockerfile",
|
||||
"ports_exposes": "5000",
|
||||
"git_repository": "https://mohanki:48d38a221949649fdf1b470bbd037de9a5e6c564@git.digifox.live/mohanki/limelite_faceanalyzer.git",
|
||||
"git_branch": "master",
|
||||
"custom_internal_name": "backend"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"docker_compose_raw": "version: '3.8'\n\nservices:\n frontend:\n build:\n context: ./frontend\n ports:\n - \"9500:80\"\n depends_on:\n - backend\n\n backend:\n build:\n context: ./backend\n ports:\n - \"9501:5000\"\n environment:\n - PORT=5000\n - MONGO_URI=mongodb://mongo:27017/limelite\n depends_on:\n - mongo\n\n mongo:\n image: mongo:latest\n ports:\n - \"9502:27017\"\n volumes:\n - mongo-data:/data/db\n\nvolumes:\n mongo-data: {}"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "limelite-frontend",
|
||||
"build_pack": "dockerfile",
|
||||
"base_directory": "/frontend",
|
||||
"dockerfile_location": "/Dockerfile",
|
||||
"ports_exposes": "80",
|
||||
"git_repository": "https://mohanki:48d38a221949649fdf1b470bbd037de9a5e6c564@git.digifox.live/mohanki/limelite_faceanalyzer.git",
|
||||
"git_branch": "master",
|
||||
"custom_internal_name": "frontend"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"fqdn": "http://limelite-faceanalyzer.houseofwebsites.ai"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"git_repository": "https://mohanki:48d38a221949649fdf1b470bbd037de9a5e6c564@git.digifox.live/mohanki/limelite_faceanalyzer.git"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"docker_compose_location": "docker-compose.yml"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "limelite-backend",
|
||||
"project_uuid": "kozt3dmpa63penhin84sb8r0",
|
||||
"server_uuid": "nt9z6kv7y3i644bzzsifjwnx",
|
||||
"environment_name": "production",
|
||||
"git_repository": "https://mohanki:48d38a221949649fdf1b470bbd037de9a5e6c564@git.digifox.live/mohanki/limelite_faceanalyzer.git",
|
||||
"git_branch": "master",
|
||||
"build_pack": "dockerfile",
|
||||
"base_directory": "/backend",
|
||||
"dockerfile_location": "/Dockerfile",
|
||||
"ports_exposes": "5000",
|
||||
"custom_internal_name": "backend"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "limelite-mongo",
|
||||
"project_uuid": "kozt3dmpa63penhin84sb8r0",
|
||||
"environment_name": "production",
|
||||
"server_uuid": "jrcjtobvncyba40v3vi6pzqe"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "limelite-mongo",
|
||||
"project_uuid": "kozt3dmpa63penhin84sb8r0",
|
||||
"environment_name": "production",
|
||||
"server_uuid": "nt9z6kv7y3i644bzzsifjwnx"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"key": "MONGO_URI",
|
||||
"value": "mongodb://root:8Oef5zsT9dsAEsVnfREj8763ZTtuTFcUglMEvg1QvQt2wlki0Li6Ynmxy7kcU6wZ@77ll26aup0vxgzxxhko2dxot:27017/limelite?authSource=admin&directConnection=true"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"key": "MONGO_URI",
|
||||
"value": "mongodb://root:TYXnbgf5b9uwaNRpeddIYx2B6ESSp7WLxCXaiSfLKayGhqwkgBDcR0p5HPRc9vGc@7jtniyem6lv8dlsex0c0ycv9:27017/limelite?authSource=admin&directConnection=true"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"key": "PORT",
|
||||
"value": "5000"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "limelite-frontend",
|
||||
"project_uuid": "kozt3dmpa63penhin84sb8r0",
|
||||
"server_uuid": "nt9z6kv7y3i644bzzsifjwnx",
|
||||
"environment_name": "production",
|
||||
"git_repository": "https://mohanki:48d38a221949649fdf1b470bbd037de9a5e6c564@git.digifox.live/mohanki/limelite_faceanalyzer.git",
|
||||
"git_branch": "master",
|
||||
"build_pack": "dockerfile",
|
||||
"base_directory": "/frontend",
|
||||
"dockerfile_location": "/Dockerfile",
|
||||
"ports_exposes": "80",
|
||||
"domains": "https://limelite-faceanalyzer.houseofwebsites.ai,https://www.limelite-faceanalyzer.houseofwebsites.ai",
|
||||
"custom_internal_name": "frontend"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "limelite-mongo-test",
|
||||
"project_uuid": "kozt3dmpa63penhin84sb8r0",
|
||||
"server_uuid": "jrcjtobvncyba40v3vi6pzqe",
|
||||
"environment_name": "production",
|
||||
"docker_registry_image_name": "mongo",
|
||||
"docker_registry_image_tag": "latest",
|
||||
"build_pack": "dockerimage",
|
||||
"ports_exposes": "27017"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "limelite-faceanalyzer-v3",
|
||||
"project_uuid": "kozt3dmpa63penhin84sb8r0",
|
||||
"server_uuid": "jrcjtobvncyba40v3vi6pzqe",
|
||||
"environment_name": "production",
|
||||
"git_repository": "https://git.digifox.live/mohanki/limelite_faceanalyzer.git",
|
||||
"git_branch": "master",
|
||||
"build_pack": "dockercompose",
|
||||
"docker_compose_location": "/docker-compose.yml",
|
||||
"ports_exposes": "9500"
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "limelite-faceanalyzer-v4",
|
||||
"project_uuid": "kozt3dmpa63penhin84sb8r0",
|
||||
"server_uuid": "jrcjtobvncyba40v3vi6pzqe",
|
||||
"environment_name": "production",
|
||||
"git_repository": "https://git.digifox.live/mohanki/limelite_faceanalyzer.git",
|
||||
"git_branch": "master",
|
||||
"build_pack": "dockercompose",
|
||||
"docker_compose_location": "/docker-compose.yml",
|
||||
"docker_compose_raw": "version: '3.8'\n\nservices:\n frontend:\n build:\n context: ./frontend\n ports:\n - \"9500:80\"\n depends_on:\n - backend\n\n backend:\n build:\n context: ./backend\n ports:\n - \"9501:5000\"\n environment:\n - PORT=5000\n - MONGO_URI=mongodb://mongo:27017/limelite\n depends_on:\n - mongo\n\n mongo:\n image: mongo:latest\n ports:\n - \"9502:27017\"\n volumes:\n - mongo-data:/data/db\n\nvolumes:\n mongo-data: {}",
|
||||
"ports_exposes": "9500"
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
const fs = require('fs');
|
||||
|
||||
async function run() {
|
||||
const res = await fetch('https://deploy.digifox.live/api/v1/projects/kozt3dmpa63penhin84sb8r0/ijga3o6m6arup69yohj2ecyw', {
|
||||
headers: {
|
||||
'Authorization': 'Bearer 4|lL3pgQVbfLb6KtUByDLaswjP4Jccny8HMj5jrs0v4ace4e78',
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
});
|
||||
const data = await res.json();
|
||||
for (const app of data.applications || []) {
|
||||
console.log(`App: ${app.name}, UUID: ${app.uuid}`);
|
||||
console.log(` Internal Name: ${app.settings?.custom_internal_name || 'NONE'}`);
|
||||
console.log(` FQDN: ${app.fqdn}`);
|
||||
console.log(` Repo: ${app.git_repository}#${app.git_branch}`);
|
||||
}
|
||||
}
|
||||
run();
|
||||
Reference in New Issue
Block a user