Wait4X is a cli tool to wait for everything! It can be wait for a port to open or enter to rquested state.

Wait4X

Build Status Coverage Status Go Report Card Docker Pulls Go Reference

Table of Contents

Introduction

Wait4X is a cli tool to wait for everything! It can be wait for a port to open or enter to rquested state.

Features:

  • Checking TCP connection
  • Checking HTTP connection and also status code and response body
  • Checking Redis connection (Ping request) and key existence
  • Checking MySQL connection
  • Checking PostgreSQL connection

Installation

There are many different methods to install Wait4X

with Docker

Wait4X provides automatically updated Docker images within Docker Hub. It is possible to always use the latest stable tag.

Pull the image from the docker index.

docker pull atkrad/wait4x:latest

then you can launch the wait4x container.

docker run --rm --name='wait4x' \
    atkrad/wait4x:latest --help

From binary

Choose the file matching the destination platform from the release page, copy the URL and replace the URL within the commands below:

curl -L https://github.com/atkrad/wait4x/releases/latest/download/wait4x-linux-amd64 -o /usr/local/bin/wait4x
chmod +x /usr/local/bin/wait4x

Verify SHA256 Checksum

Wait4X generates checksum for all binaries with sha256sum to prevent against unwanted modification of binaries. To validate the binary, download the checksum file which ends in .sha256sum for the binary you downloaded and use the sha256sum command line tool.

curl -SLO https://github.com/atkrad/wait4x/releases/latest/download/wait4x-linux-amd64.sha256sum
sha256sum --check wait4x-linux-amd64.sha256sum

From package

You can install Wait4X from package, currentlly we only support Alpine Linux.

Alpine Linux

Currently you can find it in edge repository so you have to ensure the repository has enabled. (Repository pinning)

apk add wait4x@edgecommunity
Owner
Mohammad Abdolirad
I :heart: Open Source.
Mohammad Abdolirad
Comments
  • Wait indefinitely

    Wait indefinitely

    The --timeout command-line parameter allows to set a timeout (10s by default). But I have some cases where I'd like to wait for ever.

    Maybe a value of zero could be considered as "for ever"? (It's not the case currently). Or any other suitable command-line parameter to do that?

  • Adjust pipeline to output .exe for Windows instead of file without extension

    Adjust pipeline to output .exe for Windows instead of file without extension

    If one wants to use Wait4X on Windows or with Windows Containers the current output of the github pipeline cannot be used directly and must be renamed to wait4x.exe to become available in both Powershell and CMD. Is it possible to change the pipeline output to reflect this requirement already?

    PS. If needed I can adjust the stuff myself, just wanted to start a discussion about it first.

  • Please provide arm images, too

    Please provide arm images, too

    I really like this tool, and use it in Kubernetes initContainers.

    But the docker hub images (and release binaries) are only for amd64 architecture. Would it be possible to provide images for arm architecture, too?

    It would allow to use them on RaspberryPi-like devices, and also on Apple M1/M2 CPUs

  • Multiple Address Support Request

    Multiple Address Support Request

    What do you think about adding multiple addresses support? For example for HTTP it can be something like this:

    wait4x http http://srv1:8080,http://srv2:8080
    

    If both http://srv1:8080 and http://srv2:8080 return the expected result, wait4x exits successfully and otherwise it should be failed.

    Maybe we can use comma separated string that is mentioned above or split strings like this:

    wait4x http http://srv1:8080  http://srv1:8080
    

    It can help us a lot to improve our deployment process.

  • Bump github.com/go-sql-driver/mysql from 1.5.0 to 1.6.0

    Bump github.com/go-sql-driver/mysql from 1.5.0 to 1.6.0

    Bumps github.com/go-sql-driver/mysql from 1.5.0 to 1.6.0.

    Release notes

    Sourced from github.com/go-sql-driver/mysql's releases.

    Version 1.6.0

    Major Release

    • Migrate the CI service from travis-ci to GitHub Actions (#1176, #1183, #1190)
    • NullTime is deprecated (#960, #1144)
    • Reduce allocations when building SET command (#1111)
    • Performance improvement for time formatting (#1118)
    • Performance improvement for time parsing (#1098, #1113)

    See CHANGELOG.md for full details

    Changelog

    Sourced from github.com/go-sql-driver/mysql's changelog.

    Version 1.6 (2021-04-01)

    Changes:

    • Migrate the CI service from travis-ci to GitHub Actions (#1176, #1183, #1190)
    • NullTime is deprecated (#960, #1144)
    • Reduce allocations when building SET command (#1111)
    • Performance improvement for time formatting (#1118)
    • Performance improvement for time parsing (#1098, #1113)

    New Features:

    • Implement driver.Validator interface (#1106, #1174)
    • Support returning uint64 from Valuer in ConvertValue (#1143)
    • Add json.RawMessage for converter and prepared statement (#1059)
    • Interpolate json.RawMessage as string (#1058)
    • Implements CheckNamedValue (#1090)

    Bugfixes:

    • Stop rounding times (#1121, #1172)
    • Put zero filler into the SSL handshake packet (#1066)
    • Fix checking cancelled connections back into the connection pool (#1095)
    • Fix remove last 0 byte for mysql_old_password when password is empty (#1133)

    Version 1.5 (2020-01-07)

    Changes:

    • Dropped support Go 1.9 and lower (#823, #829, #886, #1016, #1017)
    • Improve buffer handling (#890)
    • Document potentially insecure TLS configs (#901)
    • Use a double-buffering scheme to prevent data races (#943)
    • Pass uint64 values without converting them to string (#838, #955)
    • Update collations and make utf8mb4 default (#877, #1054)
    • Make NullTime compatible with sql.NullTime in Go 1.13+ (#995)
    • Removed CloudSQL support (#993, #1007)
    • Add Go Module support (#1003)

    New Features:

    Bugfixes:

    • Mark connections as bad on error during ping (#875)
    • Mark connections as bad on error during dial (#867)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.

    Dependabot will merge this PR once it's up-to-date and CI passes on it, as requested by @atkrad.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Alpine Linux version don't support Command Execution

    Alpine Linux version don't support Command Execution

    ➜  dockerProjects docker exec -it 265f808d5b08 sh
    / # apk add wait4x
    fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
    fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
    (1/1) Installing wait4x (0.4.0-r7)
    Executing busybox-1.35.0-r15.trigger
    OK: 33 MiB in 43 packages
    / # wait4x version
    Version:           v0.4.0
    Go version:        go1.18.4
    Git commit:        9fcfdc13
    Built:             2020-12-21T19:05:13Z
    OS/Arch:           linux/amd64
    / # wait4x http http://www.baidu.com http://www.qq.com -- echo "The api is up! Let's use it"
    INFO[0000] Checking HTTP connection ...
    / # wait4x http http://www.baidu.com http://www.qq.com -- echo "The api is up! Let's use it"
    INFO[0000] Checking HTTP connection ...
    / # wait4x http http://www.baidu.com http://www.qq.com -- echo "The api is up! Let's use it"
    INFO[0000] Checking HTTP connection ...
    / # wait4x http http://www.baidu.com http://www.qq.com -- echo "The api is up! Let's use it"
    INFO[0000] Checking HTTP connection ...
    / # exit
    ➜  dockerProjects
    
  • Bump github.com/lib/pq from 1.10.4 to 1.10.5

    Bump github.com/lib/pq from 1.10.4 to 1.10.5

    Bumps github.com/lib/pq from 1.10.4 to 1.10.5.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/sirupsen/logrus from 1.4.2 to 1.8.1

    Bump github.com/sirupsen/logrus from 1.4.2 to 1.8.1

    Bumps github.com/sirupsen/logrus from 1.4.2 to 1.8.1.

    Release notes

    Sourced from github.com/sirupsen/logrus's releases.

    v1.8.1

    No release notes provided.

    v1.8.0

    Correct versioning number replacing v1.7.1

    v1.7.1

    Code quality:

    • use go 1.15 in travis
    • use magefile as task runner

    Fixes:

    • small fixes about new go 1.13 error formatting system
    • Fix for long time race condiction with mutating data hooks

    Features:

    • build support for zos

    Add new BufferPool and LogFunction APIs

    • a new buffer pool management API has been added
    • a set of <LogLevel>Fn() functions have been added
    • the dependency toward a windows terminal library has been removed

    Release v1.6.0

    v1.5.0

    This new release introduces:

    • Ability to DisableHTMLEscape when using the JSON formatter: sirupsen/logrus#524
    • Support/fixes for go 1.14
    • Many many bugfixes
    Changelog

    Sourced from github.com/sirupsen/logrus's changelog.

    1.8.1

    Code quality:

    • move magefile in its own subdir/submodule to remove magefile dependency on logrus consumer
    • improve timestamp format documentation

    Fixes:

    • fix race condition on logger hooks

    1.8.0

    Correct versioning number replacing v1.7.1.

    1.7.1

    Beware this release has introduced a new public API and its semver is therefore incorrect.

    Code quality:

    • use go 1.15 in travis
    • use magefile as task runner

    Fixes:

    • small fixes about new go 1.13 error formatting system
    • Fix for long time race condiction with mutating data hooks

    Features:

    • build support for zos

    1.7.0

    Fixes:

    • the dependency toward a windows terminal library has been removed

    Features:

    • a new buffer pool management API has been added
    • a set of <LogLevel>Fn() functions have been added

    1.6.0

    Fixes:

    • end of line cleanup
    • revert the entry concurrency bug fix whic leads to deadlock under some circumstances
    • update dependency on go-windows-terminal-sequences to fix a crash with go 1.14

    Features:

    • add an option to the TextFormatter to completely disable fields quoting

    1.5.0

    Code quality:

    • add golangci linter run on travis

    Fixes:

    ... (truncated)

    Commits
    • bdc0db8 Merge pull request #1244 from sirupsen/dbd-release
    • 1bfef4b update changelog
    • 7a997b9 improve documentation about timestamp format
    • f104497 Merge pull request #1238 from thaJeztah/move_mage
    • 1d8091a move "mage" to a separate module
    • feebf74 travis: run mage with -v to not discard output
    • 6cff360 Merge pull request #1234 from sirupsen/dbd-cleanup
    • d172886 fix race condition AddHook and traces
    • d59e561 Merge pull request #1231 from sirupsen/dbd-cleanup
    • 35ab8d8 update changelog
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Update MySQL section of the README

    Update MySQL section of the README

    I removed the tls parameter in the MySQL example, because it only works on databases that implement tls, which can be a trap (it has been for me)

    I also added a reference for the syntax of MySQL connection string

  • Honor a TZ env var to set the timezone of the docker image

    Honor a TZ env var to set the timezone of the docker image

    Logs of docker images are currently in UTC timezone. In most docker images, it's possible to choose a different timezone by passing a "TZ" environment variable. Could it be also supported in wait4x docker image?

    From what I read, it might be as simple as adding the "tzdata" package in the Dockerfile (as your docker image is based on Alpine). See https://jakeroid.com/blog/how-to-set-timezone-in-your-docker-image/

  • Bump github.com/stretchr/testify from 1.7.2 to 1.7.3

    Bump github.com/stretchr/testify from 1.7.2 to 1.7.3

    Bumps github.com/stretchr/testify from 1.7.2 to 1.7.3.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • ASDF Plugin

    ASDF Plugin

    This is a request to add asdf as a method for installing. Here's a bunch of other plugins that you can look at: https://github.com/asdf-community. Making a plugin is pretty simple.

Go driver for PostgreSQL over SSH. This driver can connect to postgres on a server via SSH using the local ssh-agent, password, or private-key.

pqssh Go driver for PostgreSQL over SSH. This driver can connect to postgres on a server via SSH using the local ssh-agent, password, or private-key.

Nov 6, 2022
An open-source graph database
An open-source graph database

Cayley is an open-source database for Linked Data. It is inspired by the graph database behind Google's Knowledge Graph (formerly Freebase). Documenta

Dec 31, 2022
Open source Firebase + Heroku to develop, scale and secure serverless apps on Kubernetes

Develop, Deploy and Secure Serverless Apps on Kubernetes. Website • Docs • Support Space Cloud is a Kubernetes based serverless platform that provides

Dec 29, 2022
logical is tool for synchronizing from PostgreSQL to custom handler through replication slot

logical logical is tool for synchronizing from PostgreSQL to custom handler through replication slot Required Postgresql 10.0+ Howto Download Choose t

Sep 2, 2022
Bxd redis benchmark - Redis benchmark tool for golang

使用 redis benchmark 工具, 测试 10 20 50 100 200 1k 5k 字节 value 大小,redis get set 性能。 r

Jan 22, 2022
A golang tool to view Redis data in terminal
A golang tool to view Redis data in terminal

Redis Viewer A tool to view Redis data in terminal. Usage: KeyBoard Description ctrl+c exit redis viewer ↑ previous key ↓ next key ← previous page → n

Dec 26, 2022
gopsa is a CLI tool to enter timecard entries to the Salesforce PSA platform.
gopsa is a CLI tool to enter timecard entries to the Salesforce PSA platform.

gopsa Overview gopsa is a CLI tool to enter timecard entries to the Salesforce PSA platform. Credit This project is a rewrite of the excellent work fr

Nov 22, 2021
Go library to wait for the detached/unmounted state of a path.

Unmountpoint Unmountpoint is Go library to wait for the detached/unmounted state of a path. DISCLAIMER: This project is under development and fully ex

Oct 19, 2022
Prompts users to enter values for required flags in Cobra CLI applications

Cobra Flag Prompt Cobra Flag Prompt prompts users to enter values for required flags. It is an extension of Cobra, and requires that you use Cobra to

Nov 13, 2021
cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resource objects related of Kubernetes Cluster API.

Overview cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resou

Oct 27, 2022
Us-api: a simple service that returns the US state code based on the state

us-api us-api is a simple service that returns the US state code based on the state. It does not support creating, updating nor deleting data. Local D

Dec 13, 2021
sail is an operation framework based on Ansible/Helm. sail follows the principles of Infrastructure as Code (IaC), Operation as Code (OaC), and Everything as Code. So it is a tool for DevOps.

sail 中文文档 sail is an operation framework based on Ansible/Helm. sail follows the principles of Infrastructure as Code (IaC), Operation as Code (OaC),a

Dec 16, 2021
ORBOS - GitOps everything
ORBOS - GitOps everything

ORBOS - GitOps everything ORBOS explained ORBITER BOOM Getting Started on Google Compute Engine In the following example we will create a kubernetes c

Dec 31, 2022
The lazier way to manage everything docker
The lazier way to manage everything docker

A simple terminal UI for both docker and docker-compose, written in Go with the gocui library. This Just In: Github Sponsors is matching every donatio

Jan 8, 2023
Example golang using gin framework everything you need, i create this tutorial special for beginner.

Golang Gin Framework Fundamental Example golang using gin framework everything you need, i create this tutorial special for beginner. Feature Containe

Dec 16, 2022
Everything a semantic desktop search engine combined with a single-user document management system

Everything will be a semantic desktop search engine combined with a single-user document management system. It will apply ideas of the semantic web and knowledge graphs to organize your data, allowing you to maintain private knowledge graphs as well as make use of public knowledge graphs, such as Wikidata.

May 21, 2022
🚀‏‏‎ ‎‏‏‎‏‏‎‎‎‎‎‎Copper is a Go toolkit complete with everything you need to build web apps.

Copper Copper is a Go toolkit complete with everything you need to build web apps. It focuses on developer productivity and makes building web apps in

Jan 7, 2023
Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.

Project X Project X originates from XTLS protocol, provides a set of network tools such as Xray-core and Xray-flutter. License Mozilla Public License

Jan 7, 2023
CLI tool that can execute SQL queries on CSV, LTSV, JSON and TBLN. Can output to various formats.
CLI tool that can execute SQL queries on CSV, LTSV, JSON and TBLN. Can output to various formats.

trdsql CLI tool that can execute SQL queries on CSV, LTSV, JSON and TBLN. It is a tool like q, textql and others. The difference from these tools is t

Jan 1, 2023
a distributed chat system which can be used as chat rooms or state synchronization
a distributed chat system which can be used as chat rooms or state synchronization

unitalk is a distributed chat system which can be used as chat rooms or state synchronization. unitalk registers itself on zookeeper when it start up, use redis cluster to broadcast messages or state, and permanent messages or state to kafka and then save to db.

Aug 5, 2021