Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: shellhub-io/shellhub
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.16.4
Choose a base ref
...
head repository: shellhub-io/shellhub
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jul 15, 2024

  1. ui: bump vue-tsc from 2.0.22 to 2.0.26 in /ui

    Bumps [vue-tsc](https://github.com/vuejs/language-tools/tree/HEAD/packages/tsc) from 2.0.22 to 2.0.26.
    - [Release notes](https://github.com/vuejs/language-tools/releases)
    - [Changelog](https://github.com/vuejs/language-tools/blob/master/CHANGELOG.md)
    - [Commits](https://github.com/vuejs/language-tools/commits/v2.0.26/packages/tsc)
    
    ---
    updated-dependencies:
    - dependency-name: vue-tsc
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and gustavosbarreto committed Jul 15, 2024
    Copy the full SHA
    433cd90 View commit details
  2. ui: bump sass from 1.77.6 to 1.77.8 in /ui

    Bumps [sass](https://github.com/sass/dart-sass) from 1.77.6 to 1.77.8.
    - [Release notes](https://github.com/sass/dart-sass/releases)
    - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
    - [Commits](sass/dart-sass@1.77.6...1.77.8)
    
    ---
    updated-dependencies:
    - dependency-name: sass
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and gustavosbarreto committed Jul 15, 2024
    Copy the full SHA
    27fbbba View commit details
  3. ui: bump vite from 5.3.2 to 5.3.3 in /ui

    Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.3.2 to 5.3.3.
    - [Release notes](https://github.com/vitejs/vite/releases)
    - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
    - [Commits](https://github.com/vitejs/vite/commits/v5.3.3/packages/vite)
    
    ---
    updated-dependencies:
    - dependency-name: vite
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and gustavosbarreto committed Jul 15, 2024
    Copy the full SHA
    018b967 View commit details
  4. ui: bump @types/node from 18.19.34 to 18.19.39 in /ui

    Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.34 to 18.19.39.
    - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
    - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)
    
    ---
    updated-dependencies:
    - dependency-name: "@types/node"
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and gustavosbarreto committed Jul 15, 2024
    Copy the full SHA
    1c177ea View commit details

Commits on Jul 16, 2024

  1. refactor(api): user detach info

    Renamed the store's method `UserDetachInfo` to `UserGetInfo`. Introduced
    a new type `UserInfo` to serve as the return type, replacing the
    previous map with "owned" and "members" attributes.
    heiytor authored and gustavosbarreto committed Jul 16, 2024
    Copy the full SHA
    74e81c9 View commit details
  2. ui: bump vuetify from 3.6.11 to 3.6.12 in /ui

    Bumps [vuetify](https://github.com/vuetifyjs/vuetify/tree/HEAD/packages/vuetify) from 3.6.11 to 3.6.12.
    - [Release notes](https://github.com/vuetifyjs/vuetify/releases)
    - [Commits](https://github.com/vuetifyjs/vuetify/commits/v3.6.12/packages/vuetify)
    
    ---
    updated-dependencies:
    - dependency-name: vuetify
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and gustavosbarreto committed Jul 16, 2024
    Copy the full SHA
    d900b01 View commit details
  3. Copy the full SHA
    9454dc0 View commit details

Commits on Jul 17, 2024

  1. fix(ui): adjust new user patch endpoint

    This commit adjusts the Profile Settings to use a new patch endpoint
    for the user info.
    luannmoreira authored and gustavosbarreto committed Jul 17, 2024
    Copy the full SHA
    64c985c View commit details

Commits on Jul 18, 2024

  1. Copy the full SHA
    a5f992b View commit details

Commits on Jul 19, 2024

  1. Copy the full SHA
    4483018 View commit details
  2. feat(ui): add namespace member identifier input

    This commit changes the username field on the namespace member add
    to a identifier field, meaning a more global approach that the input
    can receive an email or username identifier.
    luannmoreira authored and gustavosbarreto committed Jul 19, 2024
    Copy the full SHA
    599e713 View commit details
  3. Copy the full SHA
    9ef558e View commit details
  4. Copy the full SHA
    55161a8 View commit details
  5. feat(api,pkg)!: new jwt decoding implementation

    We’re refactoring the `AuthRequest` handler. The handler will no longer
    use the `AuthMiddleware`, and JWT decoding is now the responsibility of
    the `jwttoken` package, which already handles token encoding. The main
    reason for this change is the deprecation of
    `github.com/labstack/echo/v4/middleware.JWTWithConfig`.
    
    The `UserAuthClaims` and `DeviceAuthClaims` have also been moved to the
    `authorizer` package. The `jwttoken` package now uses these types to
    encode and decode tokens. Consequently, the `EncodeUserClaims` and
    `EncodeDeviceClaims` functions replace the old generic `Encode`
    function, which is now used only internally. The `ClaimsFromBearerToken`
    function is now responsible for decoding a token into either user or
    device claims.
    
    The handler’s documentation has been updated to describe its use as a
    "proxy-level" middleware, including a sequential diagram. All related
    tests have also been improved.
    heiytor authored and gustavosbarreto committed Jul 19, 2024
    Copy the full SHA
    839be80 View commit details

Commits on Jul 22, 2024

  1. ui: bump terser from 5.31.1 to 5.31.3 in /ui

    Bumps [terser](https://github.com/terser/terser) from 5.31.1 to 5.31.3.
    - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
    - [Commits](terser/terser@v5.31.1...v5.31.3)
    
    ---
    updated-dependencies:
    - dependency-name: terser
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and gustavosbarreto committed Jul 22, 2024
    Copy the full SHA
    dccd401 View commit details
  2. ui: bump @fortawesome/fontawesome-svg-core from 6.5.2 to 6.6.0 in /ui

    Bumps [@fortawesome/fontawesome-svg-core](https://github.com/FortAwesome/Font-Awesome) from 6.5.2 to 6.6.0.
    - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
    - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md)
    - [Commits](FortAwesome/Font-Awesome@6.5.2...6.6.0)
    
    ---
    updated-dependencies:
    - dependency-name: "@fortawesome/fontawesome-svg-core"
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and gustavosbarreto committed Jul 22, 2024
    Copy the full SHA
    e5666e0 View commit details
  3. ui: bump @fortawesome/free-regular-svg-icons from 6.5.2 to 6.6.0 in /ui

    Bumps [@fortawesome/free-regular-svg-icons](https://github.com/FortAwesome/Font-Awesome) from 6.5.2 to 6.6.0.
    - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
    - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md)
    - [Commits](FortAwesome/Font-Awesome@6.5.2...6.6.0)
    
    ---
    updated-dependencies:
    - dependency-name: "@fortawesome/free-regular-svg-icons"
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and gustavosbarreto committed Jul 22, 2024
    Copy the full SHA
    a404d66 View commit details
  4. ui: bump @fortawesome/free-brands-svg-icons from 6.5.2 to 6.6.0 in /ui

    Bumps [@fortawesome/free-brands-svg-icons](https://github.com/FortAwesome/Font-Awesome) from 6.5.2 to 6.6.0.
    - [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
    - [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/6.x/CHANGELOG.md)
    - [Commits](FortAwesome/Font-Awesome@6.5.2...6.6.0)
    
    ---
    updated-dependencies:
    - dependency-name: "@fortawesome/free-brands-svg-icons"
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and gustavosbarreto committed Jul 22, 2024
    Copy the full SHA
    5df5c5d View commit details
  5. Copy the full SHA
    437bbdd View commit details
  6. Copy the full SHA
    8e051c9 View commit details
  7. Copy the full SHA
    c448049 View commit details
  8. Copy the full SHA
    df46fed View commit details
  9. feat(api,pkg): add member status

    The member's status indicates whether the user has accepted or not the
    invite. The status can be "pending" or "accepted".
    
    A new migration has been added to ensure this attribute is present for
    every member who does not already have a status.
    
    For now, all added members will have the status "accepted".
    heiytor authored and gustavosbarreto committed Jul 22, 2024
    Copy the full SHA
    2e8c055 View commit details
  10. feat(api,pkg): add member added_at

    `added_at` indicates whether the member was added.
    
    A new migration has been added to ensure this attribute is present for
    every member who does not already have an added_at. The default value is
    the Go time.Time zeroer (0001-01-01T00:00:00Z).
    heiytor authored and gustavosbarreto committed Jul 22, 2024
    Copy the full SHA
    3d313bb View commit details
  11. Copy the full SHA
    f5f2fae View commit details
  12. Copy the full SHA
    1608a2d View commit details
  13. Copy the full SHA
    e495e07 View commit details
  14. Copy the full SHA
    5da34ab View commit details
  15. Copy the full SHA
    6f30372 View commit details
  16. Copy the full SHA
    0eaee90 View commit details
  17. Copy the full SHA
    a84c859 View commit details
  18. Copy the full SHA
    8889f5c View commit details

Commits on Jul 23, 2024

  1. Copy the full SHA
    c117627 View commit details
  2. Copy the full SHA
    5a911b2 View commit details

Commits on Jul 24, 2024

  1. Copy the full SHA
    cf5550c View commit details
  2. ui: bump vuetify from 3.6.12 to 3.6.13 in /ui

    Bumps [vuetify](https://github.com/vuetifyjs/vuetify/tree/HEAD/packages/vuetify) from 3.6.12 to 3.6.13.
    - [Release notes](https://github.com/vuetifyjs/vuetify/releases)
    - [Commits](https://github.com/vuetifyjs/vuetify/commits/v3.6.13/packages/vuetify)
    
    ---
    updated-dependencies:
    - dependency-name: vuetify
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and gustavosbarreto committed Jul 24, 2024
    Copy the full SHA
    471427d View commit details
  3. Copy the full SHA
    249a287 View commit details

Commits on Jul 25, 2024

  1. Copy the full SHA
    1ff0a9c View commit details
  2. feat(api): new worker pkg

    We're refactoring the old `api/workers` into a proper package under
    `pkg`. The new package includes two interfaces: `Server`, which
    registers for process events, and `Client`, which submits events.
    
    A server can listen for events by calling `HandleTask`. Cron jobs are
    also supported via `HandleCron`. Several structs and methods have been
    added to facilitate task and cron processing.
    
    The new `worker/asynq` package has been created to implement these
    interfaces. The package uses Asynq as the backend for the worker.
    Different implementations can be created to implement the interfaces.
    
    Example usage:
    ```go
    func main() {
        server := asynq.NewServer("...")
        defer server.Shutdown()
    
        server.HandleTask(
            "queue:kind",
            func(_ context.Context, payload []byte) error {
                fmt.Println("Executing task with payload "+string(payload))
                return nil
            },
        )
    
        if err := server.Start(); err != nil {
            panic(err)
        }
    
        client, err := asynq.NewClient("...")
        if err != nil {
            panic(err)
        }
        defer client.Close()
    
        if err := client.Submit(
            context.Background(),
            "queue:kind",
            []byte("payload"),
        ); err != nil {
            panic(err)
        }
    
        os.Exit(0)
    }
    ```
    heiytor authored and gustavosbarreto committed Jul 25, 2024
    Copy the full SHA
    82e415b View commit details
  3. fix(ui): changed the username error message to a identifier one

    This commit fixes an error message which showed the old username
    input.
    luannmoreira authored and gustavosbarreto committed Jul 25, 2024
    Copy the full SHA
    83904e9 View commit details
  4. Copy the full SHA
    e5a8224 View commit details
  5. feat(ui)!: added a premium paywall to ShellHub community edition

    This commit adds a premium label to items that are supposed to
    be marked as premium and a paywall dialog to block users from
    accessing items their plan does not allow them to use.
    luannmoreira authored and gustavosbarreto committed Jul 25, 2024
    Copy the full SHA
    526ec37 View commit details
  6. Copy the full SHA
    58ba93d View commit details
  7. feat(ui): status and date on namespace members listing

    This commit adds a status header to the namespace members table and
    a hover tooltip that contains the date in which the user was added
    to that namespace.
    luannmoreira authored and gustavosbarreto committed Jul 25, 2024
    Copy the full SHA
    2df2aaa View commit details

Commits on Jul 26, 2024

  1. Copy the full SHA
    9d76284 View commit details
  2. Copy the full SHA
    79f9cb1 View commit details
  3. Copy the full SHA
    446cfc8 View commit details
  4. refactor(api): remove deprecated workers

    The old `api/workers` has been removed in favor of the new worker
    package (#3979). The workers' initialization has also been moved to the
    `startServer` function to ensure proper shutdown within the router.
    heiytor authored and gustavosbarreto committed Jul 26, 2024
    Copy the full SHA
    f4c3992 View commit details
  5. refactor(api,ssh,pkg): abstract internal client's asynq.Client

    To support the new worker package, we are replacing the direct usage of
    `asynq.Client` with the new `worker.Client` (#3979). The client
    initialization process has also been updated to return an error if the
    worker cannot be created.
    heiytor authored and gustavosbarreto committed Jul 26, 2024
    Copy the full SHA
    8819a37 View commit details
  6. Copy the full SHA
    245199d View commit details
Showing 685 changed files with 52,042 additions and 24,204 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -4,3 +4,4 @@
./*.md
./bin
./ui/node_modules
./agent/tmp
174 changes: 98 additions & 76 deletions .env
Original file line number Diff line number Diff line change
@@ -1,126 +1,148 @@
# PLEASE DO NOT EDIT THIS FILE; modify '.env.override' file instead
# This is in order to avoid conflict with upstream code when updating to a newer version

# Automatically increased once a new release is out
SHELLHUB_VERSION=v0.16.0
# ShellHub version.
SHELLHUB_VERSION=v0.18.0

# This specification details the network interface to which the gateway container will be bound.
# The default log level for ShellHub.
# VALUES: https://pkg.go.dev/github.com/sirupsen/logrus#Level
SHELLHUB_LOG_LEVEL=info

# The log format for ShellHub.
# VALUES: json, text.
SHELLHUB_LOG_FORMAT=text

# The network interface to which the gateway container will bind.
# VALUES: Any valid IP address
SHELLHUB_BIND_ADDRESS=0.0.0.0

# The HTTP listen port for the ShellHub web-based GUI, API and Reverse SSH tunnel.
# Values: any free port on host
# The HTTP port for the ShellHub web-based UI, API, and Reverse SSH tunnel.
# VALUES: Any available port on the host
SHELLHUB_HTTP_PORT=80

# The HTTPS listen port for the ShellHub web-based GUI, API and Reverse SSH tunnel.
# Values: any free port on host
# The HTTPS port for the ShellHub web-based UI, API, and Reverse SSH tunnel.
# VALUES: Any available port on the host
SHELLHUB_HTTPS_PORT=443

# The SSH listen port for incoming SSH connections to devices
# Values: any free port on host
# The SSH port for incoming SSH connections to devices.
# VALUES: Any available port on the host
SHELLHUB_SSH_PORT=22

# Set this variable to true if you are running a Layer 4 load balancer with proxy protocol in front of ShellHub
# Set to true if using a Layer 4 load balancer with proxy protocol in front of ShellHub.
SHELLHUB_PROXY=false

# Automatic HTTPS with Let's Encrypt
# Enable automatic HTTPS with Let's Encrypt.
SHELLHUB_AUTO_SSL=false

# Domain of the server
# NOTICE: Only required if automatic HTTPS is enabled
# Values: a valid domain name
# The domain of the server.
# NOTICE: Required only if automatic HTTPS is enabled.
# VALUES: A valid domain name
SHELLHUB_DOMAIN=localhost

# Public URL domain
# It is used to generate the public URL for accessing devices via HTTP
SHELLHUB_PUBLIC_URL_DOMAIN=
# The network name used by Docker Compose to avoid port collisions when running multiple instances.
# VALUES: A valid network name
SHELLHUB_NETWORK=shellhub_network

# Enable tunnels feature.
SHELLHUB_TUNNELS=false

# The domain used to create the tunnels.
# NOTICE: If empty, the [SHELLHUB_DOMAIN] will be used.
SHELLHUB_TUNNELS_DOMAIN=

# The token used to generate wildcard SSL certificate using DNS method for tunnels' URL.
# Currently, only DigitalOcean is supported.
# NOTICE: Required if SHELLHUB_AUTO_SSL is defined.
SHELLHUB_TUNNELS_DNS_PROVIDER_TOKEN=

# Enable geoip (geolocation)
# NOTICE: When true, SHELLHUB_MAXMIND_LICENSE is required
SHELLHUB_GEOIP=false
# Specifies an alternative mirror URL for downloading the GeoIP databases. This
# field takes precedence over SHELLHUB_MAXMIND_LICENSE; when both are
# configured, SHELLHUB_MAXMIND_MIRROR will be used as the primary source for
# database downloads. Leave both blank to disable the feature.
SHELLHUB_MAXMIND_MIRROR=

# GeoLite2 Maxmind license
# Specifies a MaxMind license key used to authenticate requests for downloading
# the GeoIP database directly from MaxMind. If SHELLHUB_MAXMIND_MIRROR is not
# set, this license key will be used as the fallback method for fetching the
# database. Leave both blank to disable the feature.
SHELLHUB_MAXMIND_LICENSE=

# Set worker's schedule
# NOTICE: The format is the same as the Go implementation of https://pkg.go.dev/github.com/robfig/cron
# The schedule for worker tasks.
# NOTICE: Format follows Go's cron package (https://pkg.go.dev/github.com/robfig/cron).
SHELLHUB_WORKER_SCHEDULE=@daily

# Enable billing feature
SHELLHUB_BILLING=false
# Internal setting for our cloud service.
SHELLHUB_CLOUD=false

# Recording session host
# The URL for the session recording host.
SHELLHUB_RECORD_URL=api:8080

# Records retention time in days
SHELLHUB_RECORD_RETENTION=0

# Session record cleanup worker schedule
SHELLHUB_SESSION_RECORD_CLEANUP_SCHEDULE=@daily

# Enable ShellHub Enterprise features
# NOTE: You need a valid ShellHub Enterprise license file
# Enable ShellHub Enterprise features.
# NOTICE: Requires a valid ShellHub Enterprise license.
SHELLHUB_ENTERPRISE=false

# ShellHub Enterprise Admin Console username
# The username for the ShellHub Enterprise Admin Console.
SHELLHUB_ENTERPRISE_ADMIN_USERNAME=

# ShellHub Enterprise Admin Console password
# The password for the ShellHub Enterprise Admin Console.
SHELLHUB_ENTERPRISE_ADMIN_PASSWORD=

# Internal to our cloud service. - don't worry about it
SHELLHUB_CLOUD=false
# The URL for the Go modules proxy cache (development only).
# SHELLHUB_GOPROXY=http://localhost:3333

# Set Go modules proxy cache URL (development only)
#SHELLHUB_GOPROXY=http://localhost:3333
# The URL for the NPM proxy cache (development only).
# SHELLHUB_NPM_REGISTRY=http://localhost:4873

# Set NPM proxy cache URL (development only)
#SHELLHUB_NPM_REGISTRY=http://localhost:4873
# Enable billing features.
# NOTICE: Exclusive used by the UI.
SHELLHUB_BILLING=false

# Billing configs
STRIPE_PUBLISHABLE_KEY=
# Billing configuration
SHELLHUB_BILLING_URL=
STRIPE_PUBLISHABLE_KEY=

# Default log level for ShellHub
# Available levels: https://pkg.go.dev/github.com/sirupsen/logrus#Level
SHELLHUB_LOG_LEVEL="info"

# Set log format for ShellHub.
# Available levels are: "json" and "text". If an invalid value is provided, the "text" value will be used.
SHELLHUB_LOG_FORMAT=text

# Sentry DSN
# The Sentry DSN for error tracking.
SHELLHUB_SENTRY_DSN=

# Receive announcements about releases, new features, critical security issues
# and relevant news from ShellHub Community Team.
# Enable announcements about releases, new features, critical security issues, and relevant news from ShellHub Community Team.
SHELLHUB_ANNOUNCEMENTS=false

# Asynq configs
# Show features from Cloud/Enterprise versions in the ShellHub community edition.
SHELLHUB_PAYWALL=true

# Asynq configuration
# The maximum duration to wait before processing a group of tasks.
SHELLHUB_ASYNQ_GROUP_MAX_DELAY=1
# The grace period has configurable upper bound: you can set a maximum aggregation delay, after which Asynq server
# will aggregate the tasks regardless of the remaining grace period
SHELLHUB_ASNYQ_GROUP_GRACE_PERIOD=1
# The maximum number of tasks that can be aggregated together. If that number is reached, Asynq server will aggregate
# the tasks immediately.
SHELLHUB_ASYNQ_GROUP_MAX_SIZE=500

# Allows SSH to connect with an agent via a public key when the agent version is less than 0.6.0.
# Agents 0.5.x or earlier do not validate the public key request and may panic.
# Please refer to: https://github.com/shellhub-io/shellhub/issues/3453
SHELLHUB_ALLOW_PUBLIC_KEY_ACCESS_BELLOW_0_6_0=false

# Specifies the network name utilized by Docker Compose. As all services (except for the gateway and SSH) persistently operate
# on the port 8080, running multiple instances may result in collision errors.
# The grace period's upper bound for Asynq task aggregation. Must be greater than "SHELLHUB_ASYNQ_GROUP_MAX_DELAY"
SHELLHUB_ASYNQ_GROUP_GRACE_PERIOD=2

# The maximum number of tasks that can be aggregated together by Asynq.
SHELLHUB_ASYNQ_GROUP_MAX_SIZE=1000

# Defines the maximum duration, in hours, for which a unique job remains locked in the queue.
# If the job does not complete within this timeout, the lock is released, allowing a new instance
# of the job to be enqueued and executed.
#
# To illustrate, envision two distinct ShellHub instances denoted as "A" and "B". In instance "A", a gateway operates on port
# 11111, and in instance "B", a gateway operates on port 22222. Since both APIs function on port 8080 and both instances
# share the same network, gateway "A" might inadvertently request data from "B" (and vice versa) when the networks are identical.
SHELLHUB_NETWORK=shellhub_network
# A value lower than or equal to 0 disables the uniqueness.
SHELLHUB_ASYNQ_UNIQUENESS_TIMEOUT=24

# Allow SSH connections with an agent via a public key for versions below 0.6.0.
# Values: true, false
SHELLHUB_ALLOW_PUBLIC_KEY_ACCESS_BELLOW_0_6_0=false

# This variable controls the pool size of connections available for Redis cache.
# If not specified or set to 0, it will use the default value defined by the Redis Client.
# The pool size for Redis cache connections.
# NOTICE: Zero means the default value of the Redis driver.
# VALUES: A non-negative integer
SHELLHUB_REDIS_CACHE_POOL_SIZE=0

# Specifies the maximum duration in minutes for which a source can be blocked from login attempts. Set it to 0 to disable.
# The maximum duration (in minutes) for blocking a source from login attempts.
# NOTICE: Set to 0 to disable.
# VALUES: A non-negative integer
SHELLHUB_MAXIMUM_ACCOUNT_LOCKOUT=60

# Controls if the ShellHub community will show features from Cloud/Enterprise versions.
SHELLHUB_PAYWALL=true

# Enable Connector features on UI.
SHELLHUB_CONNECTOR=true
7 changes: 7 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -26,6 +26,13 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v4

- name: Login to Docker Registry
uses: docker/login-action@v2
with:
registry: registry.infra.ossystems.io
username: ${{ secrets.PORTUS_USERNAME }}
password: ${{ secrets.PORTUS_TOKEN }}

- name: Build '${{ matrix.project }}' Docker container
uses: docker/build-push-action@v6
with:
42 changes: 22 additions & 20 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -46,6 +46,13 @@ jobs:
- name: Check out code
uses: actions/checkout@v4

- name: Login to Docker Registry
uses: docker/login-action@v2
with:
registry: registry.infra.ossystems.io
username: ${{ secrets.PORTUS_USERNAME }}
password: ${{ secrets.PORTUS_TOKEN }}

- uses: dorny/paths-filter@v3
id: filter
with:
@@ -68,13 +75,6 @@ jobs:
go-version: "1.21"
id: go

- name: Cache Go files [Go]
uses: actions/cache@v3
if: matrix.project != 'ui' && steps.filter.outputs.go == 'true' && github.event.pull_request.draft == false
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

- name: Get Go dependencies [Go]
if: matrix.project != 'ui' && steps.filter.outputs.go == 'true' && github.event.pull_request.draft == false
working-directory: ${{ matrix.project }}
@@ -90,16 +90,6 @@ jobs:
exit 1
fi
- name: Unit test [Go]
if: matrix.project != 'ui' && steps.filter.outputs.go == 'true' && github.event.pull_request.draft == false
working-directory: ${{ matrix.project }}
run: go test -v ${{ matrix.extra_args }} -timeout 25m ./...

- name: Go build [Go]
if: matrix.project != 'ui' && matrix.project != 'tests' && steps.filter.outputs.go == 'true' && github.event.pull_request.draft == false
working-directory: ${{ matrix.project }}
run: go build -v ${{ matrix.extra_args }} ./...

- name: Code format [Go]
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
if: matrix.os == 'ubuntu-latest' && github.event.pull_request.draft == false
@@ -109,9 +99,21 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
working-directory: ${{ matrix.project }}
version: v1.54
args: ${{ matrix.lint_args }} ./...
skip-pkg-cache: true
version: v1.63.2
args: --timeout 2m ${{ matrix.lint_args }} ./...
skip-cache: true

- name: Unit test [Go]
if: matrix.project != 'ui' && steps.filter.outputs.go == 'true' && github.event.pull_request.draft == false
working-directory: ${{ matrix.project }}
run: go test -v ${{ matrix.extra_args }} -timeout 25m ./...
env:
TESTCONTAINERS_RYUK_DISABLED: true

- name: Go build [Go]
if: matrix.project != 'ui' && matrix.project != 'tests' && steps.filter.outputs.go == 'true' && github.event.pull_request.draft == false
working-directory: ${{ matrix.project }}
run: go build -v ${{ matrix.extra_args }} ./...

- name: Set up Node.JS 21.4.0 [UI]
if: matrix.project == 'ui' && steps.filter.outputs.ui == 'true' && github.event.pull_request.draft == false
28 changes: 17 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
.env.override
docker-compose.override.yml

*~
*/tmp
*/node_modules
*.orig

api_private_key
api_public_key
ssh_private_key
/go.sum
/ui/node_modules/
*.orig
.env.override
docker-compose.override.yml

go.work
go.work.sum
go.sum

# Docker binaries
agent/agent
api/api
cli/cli
gateway/gateway
ssh/ssh
agent/agent

agent/shellhub.key
cli/cli
go.work
go.work.sum
connector/.keys
connector/connector

# Directory used by devscripts/run-agent to store binaries
bin/agent
10 changes: 7 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
output:
format: colored-line-number
formats:
- format: colored-line-number
print-issued-lines: true
print-linter-name: true
uniq-by-line: true
sort-results: true

issues:
uniq-by-line: true

linters:
disable-all: true
enable:
@@ -13,7 +16,7 @@ linters:
- gosimple
- govet
- ineffassign
- exportloopref
- copyloopvar
- staticcheck
- unconvert
- unused
@@ -26,6 +29,7 @@ linters:
- stylecheck
- nlreturn
- nilerr
- gosec

linters-settings:
staticcheck:
Loading