Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
client/node_modules
client/dist
npm-debug.log
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
directory: "/client"
schedule:
interval: "monthly"
groups:
Expand Down
44 changes: 21 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,88 +8,86 @@ on:
branches: [main]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20.x
- run: npm install
- run: npm run build:js

- name: Upload Linux executable
- uses: oven-sh/setup-bun@v2
- name: Install frontend deps
working-directory: ./client
run: bun install --frozen-lockfile
- name: Build frontend
working-directory: ./client
run: bun run build
- name: Upload frontend build
uses: actions/upload-artifact@v6
with:
name: public
path: dist
name: client-dist
path: client/dist
retention-days: 5

build-backend:
needs: [build-frontend]
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, windows, macos]
steps:
- uses: actions/checkout@v6
- name: Download frontend build
uses: actions/download-artifact@v6
with:
name: client-dist
path: client/dist
- uses: actions/setup-go@v6
with:
go-version: 1.24
- run: go test ./...
- run: go build -o ./build/ -v ./server

- name: Upload Linux executable
- name: Upload backend executable
uses: actions/upload-artifact@v6
with:
name: web-tail-${{ matrix.os }}
path: build
retention-days: 5

docker:
needs: [build-backend, build-frontend]
needs: [build-backend]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v6

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages.
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/node_modules/
/dist/*
!/dist/public
/dist/public/build
/client/node_modules/
/dist/
/client/dist/
*.zip
*.log
web-tail-*/
Expand Down
18 changes: 8 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
FROM oven/bun:1 AS buildjs
WORKDIR /app/client
COPY client/package.json client/bun.lock ./
RUN bun install --frozen-lockfile
COPY client/ ./
RUN bun run build

FROM golang:1.24 AS buildgo
WORKDIR /app
COPY . .
COPY --from=buildjs /app/client/dist /app/client/dist
RUN CGO_ENABLED=0 go build -o ./build/server ./server


FROM node:22 AS buildjs
WORKDIR /app
COPY . .
RUN npm ci
RUN npm run build:js


FROM alpine:3
WORKDIR /app
ENV ASSETS=/app/dist/public
COPY --from=buildgo /app/build/server /app/server
COPY --from=buildjs /app/dist /app/dist
EXPOSE 4444
ENTRYPOINT ["/app/server"]
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
[![CI](https://github.com/mishankov/web-tail/actions/workflows/ci.yml/badge.svg)](https://github.com/mishankov/web-tail/actions/workflows/ci.yml)
[![CodeFactor](https://www.codefactor.io/repository/github/mishankov/web-tail/badge)](https://www.codefactor.io/repository/github/mishankov/web-tail)

Web application to view lines from file on local system or on remote server built with [Svelte](https://github.com/sveltejs/svelte)
Web application to view lines from file on local system or on remote server built with [Svelte](https://github.com/sveltejs/svelte).

![](images/image-1.png)

## Installation

Download and unpack `web-tail-[platform].zip` from [latest release](https://github.com/mishankov/web-tail/releases/latest)
Download and unpack `web-tail-[platform].zip` from [latest release](https://github.com/mishankov/web-tail/releases/latest).

Docker image is also available [here](https://github.com/mishankov/web-tail/pkgs/container/web-tail)
Docker image is also available [here](https://github.com/mishankov/web-tail/pkgs/container/web-tail).

## Configuration

In unpacked folder edit `web-tail.config.toml` file
In unpacked folder edit `web-tail.config.toml` file.

- `port` - port that Web tail will run on. Defaults value is `4444`
- `allowedOrigins` - list of allowed origins for WebSocket connections. Defaults value is ["*"] which allows all origins
- `port` - port that Web tail will run on. Default value is `4444`
- `allowedOrigins` - list of allowed origins for WebSocket connections. Default value is `["*"]`
- `servers` - reusable servers configuration
- `name` - name of server to use in `sources` configs
- `host` - host of remote server. Mandatory field for source types `ssh:*`
Expand Down Expand Up @@ -52,7 +52,20 @@ Options from left to right:
- `Reverse` toggle. If enabled latest lines shown on top
- Max lines field. How much lines will be shown


## Development

Set environment variable `ASSETS=dist/public` before doing `go run ./server` to use preemtively compiled assets
Frontend app lives in `/client` and uses Bun + Vite.

1. Install frontend dependencies:
- `cd client && bun install`
2. Build frontend assets for Go embed:
- `cd client && bun run build`
3. Run backend:
- `go run ./server`

For frontend HMR in development, run both services:

- `go run ./server`
- `cd client && bun run dev`

Vite dev server proxies `/sources` and `/logstream` to `http://localhost:4444`.
24 changes: 24 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
27 changes: 0 additions & 27 deletions client/App.svelte

This file was deleted.

Loading