oraksoft-node-tools 0.1.18 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.orak-dist/app-deploy-info.jsn +4 -0
- package/.orak-dist/app-deploy-info.json +4 -0
- package/.orak-dist/deploy-0_1_29.tar.gz +0 -0
- package/.orak-dist/deploy-0_1_34.zip +0 -0
- package/.orak-dist/deploy-test-0_1_25.tar.gz +0 -0
- package/.orak-dist/deploy.tar.gz +0 -0
- package/.orak-dist/deploy.zip +0 -0
- package/.orak-dist/deploy_0_1_34.tar.gz +0 -0
- package/.orak-dist/deploy_0_1_34.zip +0 -0
- package/.orak-dist/deploy_0_1_37.tar.gz +0 -0
- package/.orak-dist/test1.txt +0 -0
- package/.orak-dist/test2.txt +0 -0
- package/README.md +52 -11
- package/bin/orak-deploy-ftp-files.js +5 -0
- package/bin/orak-zip-content.js +2 -2
- package/bin/orak-zip-package.js +2 -2
- package/jsconfig.json +18 -0
- package/lib/copy-deps.js +73 -67
- package/lib/deploy-ftp.js +85 -67
- package/lib/index.js +2 -2
- package/lib/osf-node-utils.js +104 -0
- package/lib/zip-content.js +86 -59
- package/lib/zip-package.js +165 -64
- package/package.json +5 -2
- package/test-archive.zip +0 -0
- package/.orak-dist/deploy-0_1_17.tar.gz +0 -0
- package/.orak-dist/deploy-test-0_1_17.tar.gz +0 -0
- package/.orak-dist/deploy-test.tar.gz +0 -0
- package/lib/deploy-ftp-secure.js +0 -79
- /package/.orak-dist/{test-0_1_17.txt → test-0_1_27.txt} +0 -0
package/lib/deploy-ftp-secure.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { Client } from "basic-ftp";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import fs from 'fs';
|
|
4
|
-
|
|
5
|
-
export async function deployFtp() {
|
|
6
|
-
const projectRoot = process.cwd();
|
|
7
|
-
|
|
8
|
-
// Önce environment variables'ı kontrol et
|
|
9
|
-
let ftpHost = process.env.ORAK_FTP_HOST;
|
|
10
|
-
let ftpUser = process.env.ORAK_FTP_USER;
|
|
11
|
-
let ftpPassword = process.env.ORAK_FTP_PASSWORD;
|
|
12
|
-
let ftpSecure = process.env.ORAK_FTP_SECURE === 'true';
|
|
13
|
-
let localFilePath = process.env.ORAK_LOCAL_FILE;
|
|
14
|
-
let remoteFilePath = process.env.ORAK_REMOTE_FILE;
|
|
15
|
-
|
|
16
|
-
// Eğer env variables yoksa, .env.oraksoft'a fallback et
|
|
17
|
-
if (!ftpHost || !ftpUser || !ftpPassword) {
|
|
18
|
-
const oraksoftJsonPath = path.join(projectRoot, '.env.oraksoft');
|
|
19
|
-
|
|
20
|
-
if (fs.existsSync(oraksoftJsonPath)) {
|
|
21
|
-
console.log("⚠️ Environment variables bulunamadı, .env.oraksoft dosyasından okuyorum...");
|
|
22
|
-
const oraksoftJson = JSON.parse(fs.readFileSync(oraksoftJsonPath, 'utf-8'));
|
|
23
|
-
|
|
24
|
-
ftpHost = ftpHost || oraksoftJson.osf_ftp_host;
|
|
25
|
-
ftpUser = ftpUser || oraksoftJson.osf_ftp_user;
|
|
26
|
-
ftpPassword = ftpPassword || oraksoftJson.osf_ftp_password;
|
|
27
|
-
ftpSecure = ftpSecure || oraksoftJson.osf_ftp_secure || false;
|
|
28
|
-
localFilePath = localFilePath || oraksoftJson.osf_ftp_local_file;
|
|
29
|
-
remoteFilePath = remoteFilePath || oraksoftJson.osf_remote_file;
|
|
30
|
-
}
|
|
31
|
-
} else {
|
|
32
|
-
console.log("✅ Environment variables kullanılıyor (güvenli)");
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (!ftpHost || !ftpUser || !ftpPassword) {
|
|
36
|
-
console.error(`
|
|
37
|
-
❌ FTP bilgileri bulunamadı!
|
|
38
|
-
|
|
39
|
-
Güvenli yöntem (önerilen):
|
|
40
|
-
set ORAK_FTP_HOST=ftp.example.com
|
|
41
|
-
set ORAK_FTP_USER=username
|
|
42
|
-
set ORAK_FTP_PASSWORD=password
|
|
43
|
-
set ORAK_FTP_SECURE=false
|
|
44
|
-
set ORAK_LOCAL_FILE=deployphp25.tar.gz
|
|
45
|
-
set ORAK_REMOTE_FILE=/path/to/remote/file.tar.gz
|
|
46
|
-
|
|
47
|
-
Alternatif: .env.oraksoft dosyası oluşturun.
|
|
48
|
-
`);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const client = new Client();
|
|
53
|
-
client.ftp.verbose = true;
|
|
54
|
-
|
|
55
|
-
try {
|
|
56
|
-
await client.access({
|
|
57
|
-
host: ftpHost,
|
|
58
|
-
user: ftpUser,
|
|
59
|
-
password: ftpPassword,
|
|
60
|
-
secure: ftpSecure
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
const fullLocalPath = path.join(projectRoot, "dist", localFilePath);
|
|
64
|
-
|
|
65
|
-
if (!fs.existsSync(fullLocalPath)) {
|
|
66
|
-
console.error(`Error: Yerel dosya bulunamadı: ${fullLocalPath}`);
|
|
67
|
-
process.exit(1);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
console.log(`Yükleniyor: ${fullLocalPath} -> ${remoteFilePath}`);
|
|
71
|
-
await client.uploadFrom(fullLocalPath, remoteFilePath);
|
|
72
|
-
console.log("✅ FTP yükleme tamamlandı!");
|
|
73
|
-
}
|
|
74
|
-
catch(err) {
|
|
75
|
-
console.error("❌ FTP Hatası:", err);
|
|
76
|
-
process.exit(1);
|
|
77
|
-
}
|
|
78
|
-
client.close();
|
|
79
|
-
}
|
|
File without changes
|