Language: English | Русский
Python script for GitHub Actions that keeps an OptikLink free server alive (control.optiklink.net).
Using Playwright, the script:
- Restores a saved browser session (or logs in with panel credentials if needed)
- Visits
optiklink.net/authto refresh the 3-day activity timer - Opens the server page and clicks START if the server is stopped
This prevents the free server from shutting down due to inactivity.
Works with Optiklink-VLESS or standalone.
| File | Purpose |
|---|---|
generate_state.py |
One-time local script to create a browser session |
autologin.py |
Main script run by GitHub Actions |
.github/workflows/keepalive.yml |
Schedule and workflow |
Click Fork.
pip install playwright
playwright install chromium
python generate_state.pyThe script may ask about a proxy if the site is blocked.
After a successful login it prints a long string — use it as the STATE_JSON_BASE64 secret.
Settings → Secrets and variables → Actions:
| Secret | Required | Description |
|---|---|---|
SERVER_ID |
Yes | Server ID from URL /server/XXXX |
STATE_JSON_BASE64 |
Yes | String from generate_state.py |
PANEL_USER |
Recommended | Panel login (if session expires) |
PANEL_PASSWORD |
Recommended | Panel password (if session expires) |
ENABLE_SCREENSHOTS |
No | true — save screenshots on errors |
- Automatically every day at 12:00 UTC (cron)
- Manually: Actions → OptikLink KeepAlive → Run workflow
export SERVER_ID=your_server_id
export STATE_JSON_BASE64=your_string_from_generate_state
# optional:
export PANEL_USER=...
export PANEL_PASSWORD=...
export ENABLE_SCREENSHOTS=true
python autologin.pyAutomating login and actions on a control panel may violate the service terms of use.
Use this script at your own risk.