Skip to content

Commit

Permalink
Merge pull request #3 from DVKunion/feat/v1.1.0
Browse files Browse the repository at this point in the history
feat: v1.1.0
  • Loading branch information
DVKunion authored Mar 31, 2023
2 parents a46455f + 835d8ed commit ab0ce49
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 14 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# entry
name: example
on: [ push, pull_request ]
on:
workflow_dispatch:
inputs:
token:
description: 'chaitin rivers token'
required: true
type:
description: 'your host type'
required: true

jobs:
runner:
runs-on: ubuntu-latest # 选择你想要的主机系统如:ubuntu:20.04
steps:
- uses: actions/checkout@v3
- name: collie
uses: dvkunion/collie_tricker@main
if: ${{ inputs.token != '' && inputs.type != '' }}
uses: dvkunion/CollieTrickster@main
with:
token: ${{ secrets.token }} # your token
token: ${{ inputs.token }}
host_type: ${{ inputs.type }}
58 changes: 49 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,38 @@
# Collie-Trickster
<h1 align="center"> Collie-Trickster </h1>

通过 GitHub Action 白嫖国外主机。
<p align="center">通过 GitHub Action 白嫖国外主机。[狗头] </p>

## 使用方式
<p align="center"> 中文文档 | <a href="README_EN.md">English</a> </p>

<p align="center"> <b>Collie-Trickster 简介</b> </p>

Collie-Trickster 基于 牧云主机助手 (Collie) 实现的Github Action。主要用于更便捷的使用和Debug Github Action。

## 🧑‍🤝‍🧑 友情提示

**关于风险**

> 其实大家都知道所谓 "白嫖国外主机" 不过是个噱头 -_-
>
> 首先持续的时常只有 6小时,当然你也可以自己进行一些自动化开发来保持一个持久化的状态,但是不鼓励这样使用,毕竟官方的action说明中提出了明令禁止的用法。
>
> 其次,该工具的目的在于开启`github action`调试的方案。
> 用过`gitlab-ci`的人可能会知道,`debug`模式可以直接进入到ci环境中的终端进行人工`debug`,在一些复杂的ci运行出现错误时十分有效。
> 因此,`Collie-Trickster` 提供给你了一种方案,让你能够获取到一个可调式的环境,方便进行调试。
>
> 说到底,和大家开了个玩笑,`Collie-Trickster`的目的从一开始就是一个debug工具的定位。
> 任何使用`Collie-Trickster`作恶而导致可能面临的风险,包括github封号的情况,`Collie-Trickster`不承担任何责任。
**一些其他的声音**
<details><summary>See More</summary>

</details>

## 🎮 快速开始

### 基础使用

<details><summary>CLICK ME</summary>

1. 注册百川-使用牧云主机管理助手

Expand All @@ -16,6 +46,9 @@

![](https://cdn.dvkunion.cn/tricker/09d9e9ee0809482faf54b491e42ae7d8.png)

为了方便,可以选择长期使用的token

![](https://cdn.dvkunion.cn/tricker/c63a06e23805430781cc42fc485d8f79.png)

4. 在github创建一个空的仓库,clone到本地,并创建`.github/workflows/workflow.yml`文件,写入一下参考内容:

Expand All @@ -34,18 +67,25 @@ jobs:
token: xxxxxx # your token, It will be safer to use ${{ secrets.token }}, see [https://docs.github.com/actions/security-guides/encrypted-secrets]
```
5. git push 上去代码,触发action。
5. 推送代码到仓库,触发action。
```shell
git push
```

6. 返回百川界面,已获取到主机。

![](https://cdn.dvkunion.cn/tricker/4f8e7c5ea2234135b6f57de12a115f30.png)

7. 后续使用时可以通过手动触发action的方式。

## 一些更有趣的玩法
</details>

### 高级模版: 通过http触发器自动触发

<details><summary>CLICK ME</summary>
</details>

一些更便捷的方式,如果需求的人多会逐步加入到demo。
## 🎈 更有趣的玩法

+ 可以使用github action 的`on:workflow_dispatch`,通过http请求触发ci,来实现主机上线控制。
+ 也可以将token参数作为input。在每次http请求时动态带上token, 方便操作。
+
如果你有什么更加有趣的想法或建议,欢迎提交 Issue/Pr
96 changes: 96 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<h1 align="center"> Collie-Trickster </h1>

<p align="center">Get An Free foreign hosts through GitHub Action [doge] </ p>

<p align="center"> <a href="README_EN. md">Chinese Documents</a> | English</p>

<p align="center"> <b>Collie-Trickster introduction</b> </p>

Collie Trickster is based on the MuYun Virtual Machine Assistant (Collie), Github Action implemented. Mainly used for more convenient use and Debug Github Action.

## 🧑‍🤝‍🧑 Friendly reminder

**About Risk**

> Actually, everyone knows that the so-called "Get An Free foreign hosts" is just a gimmick -_-
>
> First of all, the duration is usually only 6 hours. Of course, you can also conduct some automated development yourself to maintain a persistent state, but this use is not encouraged. After all, the official action description proposes explicitly prohibited usage.
>
> Secondly, the purpose of this tool is to enable the `github action` debugging scheme.
> People who have used `gittab ci` may know that the `debug` mode can directly access terminals in the ci environment for manual `debug`, which is very effective when some complex ci operations encounter errors.
> Therefore, `Collie Trickster` provides you with a solution that allows you to obtain an adjustable environment for debugging.
>
> After all, I made a joke with everyone that the purpose of `Collie Trickster` was to locate a debugging tool from the beginning.
>
> `Collie Trickster` does not assume any responsibility for any possible risks that may arise from using `Collie Strickster` to commit crimes, including the Github seal.".
**Some other sounds**

<details><summary>See More</summary>
</details>


## 🎮 Quick Start

### Basic usage

<details><summary>CLICK ME</summary>

1. Register for Rivers Platform - Use MuYun Virtual Machine Management Assistant

![](https://cdn.dvkunion.cn/tricker/46fd1775808c4411b8c2f1225641289f.png)

2. Click Bind Host

![](https://cdn.dvkunion.cn/tricker/b61fa3cb6f0f4069b60c99a48be599aa.png)

3. Obtain token

![](https://cdn.dvkunion.cn/tricker/09d9e9ee0809482faf54b491e42ae7d8.png)

For convenience, you can choose a token for long-term use

![](https://cdn.dvkunion.cn/tricker/c63a06e23805430781cc42fc485d8f79.png)

4. Create an empty project at Github, clone it locally, and create a `.github/workflows/workflow.yml` file. Write
the following reference content:

```yml
name: example
on: [ push, pull_request ]

jobs:
runner:
runs-on: ubuntu-latest # select your host system like:ubuntu:20.04
steps:
- uses: actions/checkout@v3
- name: collie
uses: dvkunion/collie_tricker@main
with:
token: xxxxxx # your token, It will be safer to use ${{ secrets.token }}, see [https://docs.github.com/actions/security-guides/encrypted-secrets]
```
5. Push the code to trigger the action.
```shell
git push

```

6. Return to the Rivers interface and obtain the host.

![](https://cdn.dvkunion.cn/tricker/4f8e7c5ea2234135b6f57de12a115f30.png)

7. During subsequent use, you can manually trigger an action.

</details>

### Advanced template: Automatically triggered through http triggers

<details><summary>CLICK ME</summary>

</details>

## 🎈 More fun ways to play

If you have any more interesting ideas or suggestions, Welcome to submit an Issue/Pr.
20 changes: 18 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,26 @@ inputs:
token:
description: 'your collie token'
default: ''
host_type:
description: 'your host type like: linux/windows'
default: 'linux'
time:
description: 'continue time, min'
default: '360'

runs:
using: 'composite'
steps:
- run: curl -kfsSL 'http://collie-agent.chaitin.com:1443/api/v1/host/install_script?os_type=linux' | sudo bash -s -- --token=${{ inputs.token }}
- name: regist-linux-host
if: ${{ inputs.host_type != 'linux'}}
run: curl -kfsSL 'http://collie-agent.chaitin.com:1443/api/v1/host/install_script?os_type=linux' | sudo bash -s -- --token=${{ inputs.token }}
shell: bash
- run: sleep 360m
- name: regist-windows-host
if: ${{ inputs.host_type != 'windows'}}
run: |
Invoke-WebRequest -Uri 'http://collie-agent.chaitin.com:1443/api/v1/lighter/installer?arch=x86_64&os_type=windows&token=${{ inputs.token }}' -OutFile "install.exe"
Start-Process install.exe -Wait
shell: powershell
- name: kepp
run: sleep ${{ inputs.time }}m
shell: bash

0 comments on commit ab0ce49

Please sign in to comment.