diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..6a3dbf69467169e16a3264251a6269ec1b6e0521 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,12 @@ +.DS_Store +*.DS_Store +db +logs +webs +README.md +README.en-US.md +*.sh +sublink_amd64 +sublink_arm64 +sublink.exe +install.sh diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000000000000000000000000000000000000..053e31e200bf5c9d53ae378c03ad972e3458db7a --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,40 @@ +name: Build and Push Multi-Arch Docker Image + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # 检出代码 + - name: Checkout code + uses: actions/checkout@v2 + + # 设置 QEMU 以支持跨架构构建 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + # 设置 Docker Buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + # 登录到 Docker Hub + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + # 构建并推送多平台 Docker 镜像 + - name: Build and Push Multi-Arch Docker Image + run: | + docker buildx build --platform linux/amd64,linux/arm64 \ + -t jaaksi/sublinkx:latest \ + --push . diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..4ecfa82d38cdb6f30a52099d5b7e5973835ab910 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +*.DS_Store +db +logs +sublink_amd64 +sublink_arm64 +sublink.exe \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4e3a554e71dbc877a6ad27caf2fd05f41dcf314d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# Build stage +FROM golang:1.22.2-alpine AS builder +WORKDIR /app +COPY . . +RUN go mod download +RUN go build -o sublinkX + +# Final stage +FROM alpine:latest +WORKDIR /app + +# 设置时区为 Asia/Shanghai +ENV TZ=Asia/Shanghai + +COPY --from=builder /app/sublinkX /app/sublinkX +EXPOSE 8000 +CMD ["/app/sublinkX"] + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..2bb278c653572d2ccd39b6bc3ec4b3d998123ffa --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024-SublinkX + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.en-US.md b/README.en-US.md new file mode 100644 index 0000000000000000000000000000000000000000..e8fe3ee8f3e4e0890464d3bd536b39fbec32e4f2 --- /dev/null +++ b/README.en-US.md @@ -0,0 +1,56 @@ +

+
f)for(;u<=d;)G(e[u],a,l,!0),u++;else{const h=u,m=u,v=new Map;for(u=m;u<=f;u++){const e=t[u]=c?ea(t[u]):Qr(t[u]);null!=e.key&&v.set(e.key,u)}let w,b=0;const _=f-m+1;let y=!1,x=0;const C=new Array(_);for(u=0;u<_;u++)C[u]=0;for(u=h;u<=d;u++){const n=e[u];if(b>=_){G(n,a,l,!0);continue}let r;if(null!=n.key)r=v.get(n.key);else for(w=m;w<=f;w++)if(0===C[w-m]&&$r(n,t[w])){r=w;break}void 0===r?G(n,a,l,!0):(C[r-m]=u+1,r>=x?x=r:y=!0,g(n,t[r],o,null,a,l,s,i,c),b++)}const M=y?function(e){const t=e.slice(),n=[0];let o,r,a,l,s;const i=e.length;for(o=0;o>1,e[n[s]]0&&(t[o]=n[a-1]),n[a]=o)}}a=n.length,l=n[a-1];for(;a-- >0;)n[a]=l,l=t[l];return n}(C):n;for(w=M.length-1,u=_-1;u>=0;u--){const e=m+u,n=t[e],d=e+1
{const{el:l,type:s,transition:i,children:c,shapeFlag:u}=e;if(6&u)return void W(e.component.subTree,t,n,o);if(128&u)return void e.suspense.move(t,n,o);if(64&u)return void s.move(e,t,n,te);if(s===Ar){r(l,t,n);for(let e=0;e=0;o--){var a=t[o],s=void 0;if(a!==r&&!a.ignore&&(s=Te(a,n,i))&&(!e.topTarget&&(e.topTarget=a),s!==xe)){e.target=a;break}}}function De(t,e,n){var i=t.painter;return e<0||e>i.getWidth()||n<0||n>i.getHeight()}k(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){Ie.prototype[t]=function(e){var n,i,r=e.zrX,o=e.zrY,a=De(this,r,o);if("mouseup"===t&&a||(i=(n=this.findHover(r,o)).target),"mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Mt(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}}));function Ae(t,e,n,i){var r=e+1;if(r===n)return 1;if(i(t[r++],t[e])<0){for(;r0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}else{for(s=r+1;ls&&(l=s);var u=a;a=r-l,l=r-u}for(a++;as&&(l=s);var u=a;a=r-l,l=r-u}else{for(s=i-r;l=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=r,l+=r}for(a++;a=0;l--)t[d+l]=t[p+l];return void(t[c]=a[h])}var f=r;for(;;){var g=0,y=0,v=!1;do{if(e(a[h],t[u])<0){if(t[c--]=t[u--],g++,y=0,0==--i){v=!0;break}}else if(t[c--]=a[h--],y++,g=0,1==--s){v=!0;break}}while((g|y)1;){var t=o-2;if(t>=1&&i[t-1]<=i[t]+i[t+1]||t>=2&&i[t-2]<=i[t]+i[t-1])i[t-1]i[t+1])break;s(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&i[t-1]=32;)e|=1&t,t>>=1;return t+e}(r);do{if((o=Ae(t,n,i,e))s&&(l=s),ke(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),r-=o,n+=o}while(0!==r);a.forceMergeRuns()}}}var Ne=!1;function Ee(){Ne||(Ne=!0)}function ze(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var Ve,Be=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=ze}return t.prototype.traverse=function(t,e){for(var n=0;n0&&t.arc(u+Z.cx,h+Z.cy,U,tu(Z.y0,Z.x0),tu(Z.y1,Z.x1),!c),t.arc(u,h,r,tu(Z.cy+Z.y1,Z.cx+Z.x1),tu(j.cy+j.y1,j.cx+j.x1),c),X>0&&t.arc(u+j.cx,h+j.cy,X,tu(j.y1,j.x1),tu(j.y0,j.x0),!c))}else t.lineTo(u+P,h+O),t.arc(u,h,r,l,s,c);else t.lineTo(u+P,h+O)}else t.moveTo(u,h);t.closePath()}}}var lu=function(){return function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0}}(),uu=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultShape=function(){return new lu},n.prototype.buildPath=function(t,e){su(t,e)},n.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},n}(Qa);uu.prototype.type="sector";var hu=function(){return function(){this.cx=0,this.cy=0,this.r=0,this.r0=0}}(),cu=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultShape=function(){return new hu},n.prototype.buildPath=function(t,e){var n=e.cx,i=e.cy,r=2*Math.PI;t.moveTo(n+e.r,i),t.arc(n,i,e.r,0,r,!1),t.moveTo(n+e.r0,i),t.arc(n,i,e.r0,0,r,!0)},n}(Qa);function pu(t,e,n){var i=e.smooth,r=e.points;if(r&&r.length>=2){if(i){var o=function(t,e,n,i){var r,o,a,s,l=[],u=[],h=[],c=[];if(i){a=[Infinity,Infinity],s=[-Infinity,-Infinity];for(var p=0,d=t.length;pg[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var i=this._provider,r=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=L(o,(function(t){return t.property})),u=0;uy[1]&&(y[1]=g)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&eh[1]&&(h[1]=y),c[p++]=v}return r._count=p,r._indices=c,r._updateGetRawIdx(),r},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,i=this._chunks,r=0,o=this.count();r