Compare commits
1 Commits
fix/ci
...
fix/repo-o
| Author | SHA1 | Date | |
|---|---|---|---|
| 34bc7b4d0c |
7
.github/workflows/backend.yml
vendored
7
.github/workflows/backend.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
target: [i686, x86_64, arm, armhf, aarch64, mips, mipsel, mips64, mips64el, s390x, win32]
|
target: [i686, x86_64, arm, armhf, aarch64, mips, mipsel, mips64, mips64el, s390x, win32]
|
||||||
steps:
|
steps:
|
||||||
- uses: https://devstar.cn/actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@@ -32,3 +32,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
BUILD_TARGET: ${{ matrix.target }}
|
BUILD_TARGET: ${{ matrix.target }}
|
||||||
run: ./scripts/cross-build.sh
|
run: ./scripts/cross-build.sh
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ttyd.${{ matrix.target }}
|
||||||
|
path: build/ttyd*
|
||||||
|
|
||||||
|
|||||||
27
.github/workflows/docker.yml
vendored
27
.github/workflows/docker.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
packages: write
|
packages: write
|
||||||
contents: read
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: https://devstar.cn/actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@@ -25,37 +25,32 @@ jobs:
|
|||||||
[ "$arch" = "armv7" ] && arch="arm"
|
[ "$arch" = "armv7" ] && arch="arm"
|
||||||
mkdir -p dist/$arch && cp build/ttyd dist/$arch/ttyd
|
mkdir -p dist/$arch && cp build/ttyd dist/$arch/ttyd
|
||||||
done
|
done
|
||||||
- uses: https://devstar.cn/alexios/setup-qemu-action@v3
|
- uses: docker/setup-qemu-action@v3
|
||||||
- uses: https://devstar.cn/alexios/setup-buildx-action@v3
|
- uses: docker/setup-buildx-action@v3
|
||||||
- uses: https://devstar.cn/alexios/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_HUB_USER }}
|
username: ${{ secrets.DOCKER_HUB_USER }}
|
||||||
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
password: ${{ secrets.DOCKER_HUB_TOKEN }}
|
||||||
- uses: alexios/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Determine docker tags
|
- name: Determine docker tags
|
||||||
id: docker_tag
|
id: docker_tag
|
||||||
env:
|
|
||||||
DOCKER_USER: ${{ vars.DOCKER_HUB_USERNAME }}
|
|
||||||
PROJECT: ${{ vars.PROJECT_NAME }}
|
|
||||||
run: |
|
run: |
|
||||||
FULL_IMAGE_NAME="${DOCKER_USER}/${PROJECT}"
|
|
||||||
|
|
||||||
case $GITHUB_REF in
|
case $GITHUB_REF in
|
||||||
refs/tags/*)
|
refs/tags/*)
|
||||||
TAG_NAME=${GITHUB_REF#refs/tags/}
|
TAG_NAME=${GITHUB_REF#refs/tags/}
|
||||||
echo "DOCKER_TAG=${FULL_IMAGE_NAME}:${TAG_NAME}" >> $GITHUB_ENV
|
echo "DOCKER_TAG=tsl0922/ttyd:${TAG_NAME}" >> $GITHUB_ENV
|
||||||
echo "ALPINE_TAG=${FULL_IMAGE_NAME}:${TAG_NAME}-alpine" >> $GITHUB_ENV
|
echo "ALPINE_TAG=tsl0922/ttyd:${TAG_NAME}-alpine" >> $GITHUB_ENV
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "DOCKER_TAG=${FULL_IMAGE_NAME}:latest" >> $GITHUB_ENV
|
echo "DOCKER_TAG=tsl0922/ttyd:latest" >> $GITHUB_ENV
|
||||||
echo "ALPINE_TAG=${FULL_IMAGE_NAME}:alpine" >> $GITHUB_ENV
|
echo "ALPINE_TAG=tsl0922/ttyd:alpine" >> $GITHUB_ENV
|
||||||
esac
|
esac
|
||||||
- name: build/push docker image
|
- name: build/push docker image
|
||||||
uses: https://devstar.cn/alexios/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
@@ -65,7 +60,7 @@ jobs:
|
|||||||
${{ env.DOCKER_TAG }}
|
${{ env.DOCKER_TAG }}
|
||||||
ghcr.io/${{ env.DOCKER_TAG }}
|
ghcr.io/${{ env.DOCKER_TAG }}
|
||||||
- name: build/push docker image (alpine)
|
- name: build/push docker image (alpine)
|
||||||
uses: https://devstar.cn/alexios/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile.alpine
|
file: ./Dockerfile.alpine
|
||||||
|
|||||||
7
.github/workflows/frontend.yml
vendored
7
.github/workflows/frontend.yml
vendored
@@ -14,16 +14,15 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: https://devstar.cn/actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: https://devstar.cn/actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
- name: Run yarn install, check and build
|
- name: Run yarn install, check and build
|
||||||
run: |
|
run: |
|
||||||
corepack enable
|
corepack enable
|
||||||
corepack prepare yarn@stable --activate
|
corepack prepare yarn@stable --activate
|
||||||
yarn install --no-immutable
|
yarn install
|
||||||
yarn add -D eslint-plugin-n
|
|
||||||
yarn run check
|
yarn run check
|
||||||
yarn run build
|
yarn run build
|
||||||
working-directory: html
|
working-directory: html
|
||||||
|
|||||||
@@ -35,7 +35,9 @@ export class Terminal extends Component<Props, State> {
|
|||||||
const options = new URLSearchParams(decodeURIComponent(window.location.search));
|
const options = new URLSearchParams(decodeURIComponent(window.location.search));
|
||||||
|
|
||||||
this.isDockerType = options.get('type') === 'docker';
|
this.isDockerType = options.get('type') === 'docker';
|
||||||
this.apiBaseUrl = `http://${options.get('domain')}:${options.get('port')}/${options.get('user')}/${options.get('repo')}`;
|
// Use repo_owner if available, otherwise fall back to user
|
||||||
|
const repoOwner = options.get('repo_owner') || options.get('user');
|
||||||
|
this.apiBaseUrl = `http://${options.get('domain')}:${options.get('port')}/${repoOwner}/${options.get('repo')}`;
|
||||||
this.apiParams = new URLSearchParams({
|
this.apiParams = new URLSearchParams({
|
||||||
repo: options.get('repoid') as string,
|
repo: options.get('repoid') as string,
|
||||||
user: options.get('userid') as string,
|
user: options.get('userid') as string,
|
||||||
|
|||||||
@@ -16,17 +16,9 @@ MBEDTLS_VERSION="${MBEDTLS_VERSION:-2.28.5}"
|
|||||||
LIBUV_VERSION="${LIBUV_VERSION:-1.44.2}"
|
LIBUV_VERSION="${LIBUV_VERSION:-1.44.2}"
|
||||||
LIBWEBSOCKETS_VERSION="${LIBWEBSOCKETS_VERSION:-4.3.3}"
|
LIBWEBSOCKETS_VERSION="${LIBWEBSOCKETS_VERSION:-4.3.3}"
|
||||||
|
|
||||||
BASE_URL="https://devstar.cn/alexios/zip-repo/releases/download"
|
|
||||||
URL_TOOLCHAIN="${BASE_URL}/v1.0/aarch64-linux-musl-cross.tgz"
|
|
||||||
URL_ZLIB="${BASE_URL}/v1.0/zlib-1.3.1.tar.gz"
|
|
||||||
URL_JSONC="${BASE_URL}/v1.0/json-c-0.17.tar.gz"
|
|
||||||
URL_MBEDTLS="${BASE_URL}/v1.0/mbedtls-2.28.5.tar.gz"
|
|
||||||
URL_LIBUV="${BASE_URL}/v1.0/libuv-v1.44.2.tar.gz"
|
|
||||||
URL_LWS="${BASE_URL}/v1.0/libwebsockets-4.3.3.tar.gz"
|
|
||||||
|
|
||||||
build_zlib() {
|
build_zlib() {
|
||||||
echo "=== Building zlib-${ZLIB_VERSION} (${TARGET})..."
|
echo "=== Building zlib-${ZLIB_VERSION} (${TARGET})..."
|
||||||
curl -kfSsLo- "$URL_ZLIB" | tar xz -C "${BUILD_DIR}"
|
curl -fSsLo- "https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz" | tar xz -C "${BUILD_DIR}"
|
||||||
pushd "${BUILD_DIR}"/zlib-"${ZLIB_VERSION}"
|
pushd "${BUILD_DIR}"/zlib-"${ZLIB_VERSION}"
|
||||||
env CHOST="${TARGET}" ./configure --static --archs="-fPIC" --prefix="${STAGE_DIR}"
|
env CHOST="${TARGET}" ./configure --static --archs="-fPIC" --prefix="${STAGE_DIR}"
|
||||||
make -j"$(nproc)" install
|
make -j"$(nproc)" install
|
||||||
@@ -35,7 +27,7 @@ build_zlib() {
|
|||||||
|
|
||||||
build_json-c() {
|
build_json-c() {
|
||||||
echo "=== Building json-c-${JSON_C_VERSION} (${TARGET})..."
|
echo "=== Building json-c-${JSON_C_VERSION} (${TARGET})..."
|
||||||
curl -kfSsLo- "$URL_JSONC" | tar xz -C "${BUILD_DIR}"
|
curl -fSsLo- "https://s3.amazonaws.com/json-c_releases/releases/json-c-${JSON_C_VERSION}.tar.gz" | tar xz -C "${BUILD_DIR}"
|
||||||
pushd "${BUILD_DIR}/json-c-${JSON_C_VERSION}"
|
pushd "${BUILD_DIR}/json-c-${JSON_C_VERSION}"
|
||||||
rm -rf build && mkdir -p build && cd build
|
rm -rf build && mkdir -p build && cd build
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE="${BUILD_DIR}/cross-${TARGET}.cmake" \
|
cmake -DCMAKE_TOOLCHAIN_FILE="${BUILD_DIR}/cross-${TARGET}.cmake" \
|
||||||
@@ -51,7 +43,7 @@ build_json-c() {
|
|||||||
|
|
||||||
build_mbedtls() {
|
build_mbedtls() {
|
||||||
echo "=== Building mbedtls-${MBEDTLS_VERSION} (${TARGET})..."
|
echo "=== Building mbedtls-${MBEDTLS_VERSION} (${TARGET})..."
|
||||||
curl -kfSsLo- "$URL_MBEDTLS" | tar xz -C "${BUILD_DIR}"
|
curl -fSsLo- "https://github.com/ARMmbed/mbedtls/archive/v${MBEDTLS_VERSION}.tar.gz" | tar xz -C "${BUILD_DIR}"
|
||||||
pushd "${BUILD_DIR}/mbedtls-${MBEDTLS_VERSION}"
|
pushd "${BUILD_DIR}/mbedtls-${MBEDTLS_VERSION}"
|
||||||
rm -rf build && mkdir -p build && cd build
|
rm -rf build && mkdir -p build && cd build
|
||||||
cmake -DCMAKE_TOOLCHAIN_FILE="${BUILD_DIR}/cross-${TARGET}.cmake" \
|
cmake -DCMAKE_TOOLCHAIN_FILE="${BUILD_DIR}/cross-${TARGET}.cmake" \
|
||||||
@@ -65,7 +57,7 @@ build_mbedtls() {
|
|||||||
|
|
||||||
build_libuv() {
|
build_libuv() {
|
||||||
echo "=== Building libuv-${LIBUV_VERSION} (${TARGET})..."
|
echo "=== Building libuv-${LIBUV_VERSION} (${TARGET})..."
|
||||||
curl -kfSsLo- "$URL_LIBUV" | tar xz -C "${BUILD_DIR}"
|
curl -fSsLo- "https://dist.libuv.org/dist/v${LIBUV_VERSION}/libuv-v${LIBUV_VERSION}.tar.gz" | tar xz -C "${BUILD_DIR}"
|
||||||
pushd "${BUILD_DIR}/libuv-v${LIBUV_VERSION}"
|
pushd "${BUILD_DIR}/libuv-v${LIBUV_VERSION}"
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
env CFLAGS=-fPIC ./configure --disable-shared --enable-static --prefix="${STAGE_DIR}" --host="${TARGET}"
|
env CFLAGS=-fPIC ./configure --disable-shared --enable-static --prefix="${STAGE_DIR}" --host="${TARGET}"
|
||||||
@@ -91,7 +83,7 @@ EOF
|
|||||||
|
|
||||||
build_libwebsockets() {
|
build_libwebsockets() {
|
||||||
echo "=== Building libwebsockets-${LIBWEBSOCKETS_VERSION} (${TARGET})..."
|
echo "=== Building libwebsockets-${LIBWEBSOCKETS_VERSION} (${TARGET})..."
|
||||||
curl -kfSsLo- "$URL_LWS" | tar xz -C "${BUILD_DIR}"
|
curl -fSsLo- "https://github.com/warmcat/libwebsockets/archive/v${LIBWEBSOCKETS_VERSION}.tar.gz" | tar xz -C "${BUILD_DIR}"
|
||||||
pushd "${BUILD_DIR}/libwebsockets-${LIBWEBSOCKETS_VERSION}"
|
pushd "${BUILD_DIR}/libwebsockets-${LIBWEBSOCKETS_VERSION}"
|
||||||
sed -i 's/ websockets_shared//g' cmake/libwebsockets-config.cmake.in
|
sed -i 's/ websockets_shared//g' cmake/libwebsockets-config.cmake.in
|
||||||
sed -i 's/ OR PC_OPENSSL_FOUND//g' lib/tls/CMakeLists.txt
|
sed -i 's/ OR PC_OPENSSL_FOUND//g' lib/tls/CMakeLists.txt
|
||||||
@@ -142,6 +134,7 @@ build() {
|
|||||||
ALIAS="$2"
|
ALIAS="$2"
|
||||||
STAGE_DIR="${STAGE_ROOT}/${TARGET}"
|
STAGE_DIR="${STAGE_ROOT}/${TARGET}"
|
||||||
BUILD_DIR="${BUILD_ROOT}/${TARGET}"
|
BUILD_DIR="${BUILD_ROOT}/${TARGET}"
|
||||||
|
MUSL_CC_URL="https://github.com/tsl0922/musl-toolchains/releases/download/2021-11-23"
|
||||||
COMPONENTS="1"
|
COMPONENTS="1"
|
||||||
SYSTEM="Linux"
|
SYSTEM="Linux"
|
||||||
|
|
||||||
@@ -151,12 +144,12 @@ build() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "=== Installing toolchain ${ALIAS} (${TARGET})..."
|
echo "=== Installing toolchain ${ALIAS} (${TARGET})..."
|
||||||
|
|
||||||
mkdir -p "${CROSS_ROOT}" && export PATH="${PATH}:${CROSS_ROOT}/bin"
|
mkdir -p "${CROSS_ROOT}" && export PATH="${PATH}:${CROSS_ROOT}/bin"
|
||||||
TOOLCHAIN_FILE="${TARGET}-cross.tgz"
|
curl -fSsLo- "${MUSL_CC_URL}/${TARGET}-cross.tgz" | tar xz -C "${CROSS_ROOT}" --strip-components=${COMPONENTS}
|
||||||
DOWNLOAD_URL="${BASE_URL}/v1.0/${TOOLCHAIN_FILE}"
|
|
||||||
|
echo "=== Building target ${ALIAS} (${TARGET})..."
|
||||||
echo "Downloading toolchain: $DOWNLOAD_URL"
|
|
||||||
curl -kfSsLo- "$DOWNLOAD_URL" | tar xz -C "${CROSS_ROOT}" --strip-components=${COMPONENTS}
|
|
||||||
rm -rf "${STAGE_DIR}" "${BUILD_DIR}"
|
rm -rf "${STAGE_DIR}" "${BUILD_DIR}"
|
||||||
mkdir -p "${STAGE_DIR}" "${BUILD_DIR}"
|
mkdir -p "${STAGE_DIR}" "${BUILD_DIR}"
|
||||||
export PKG_CONFIG_PATH="${STAGE_DIR}/lib/pkgconfig"
|
export PKG_CONFIG_PATH="${STAGE_DIR}/lib/pkgconfig"
|
||||||
|
|||||||
Reference in New Issue
Block a user