@@ -1,59 +0,0 @@
|
|||||||
on:
|
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- "docker/**"
|
|
||||||
- ".gitea/**"
|
|
||||||
schedule:
|
|
||||||
- cron: "0 02 * * *"
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
ssh-client-container:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Log in to git.limbosolutions.com container registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: git.limbosolutions.com
|
|
||||||
username: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push ssh-client Docker images
|
|
||||||
id: push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ${{gitea.workspace}}/docker/ssh-client/Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: git.limbosolutions.com/kb/ssh-client
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ssh-server-container:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
|
|
||||||
- name: Log in to git.limbosolutions.com container registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: git.limbosolutions.com
|
|
||||||
username: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build ssh-server images
|
|
||||||
run: |
|
|
||||||
cd ${{gitea.workspace}}/docker/ssh-server
|
|
||||||
BUILD_ENV=prod ./scripts/build.sh
|
|
||||||
|
|
||||||
- name: Push image
|
|
||||||
run: docker push git.limbosolutions.com/kb/ssh-server
|
|
||||||
|
|
||||||
|
|
||||||
40
.gitea/workflows/ssh-client-build-deploy.yaml
Normal file
40
.gitea/workflows/ssh-client-build-deploy.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "docker/ssh-client/**"
|
||||||
|
- ".gitea/ssh-client**"
|
||||||
|
schedule:
|
||||||
|
- cron: "0 14 * * 6" #every Saturday at 2:00 PM,
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
ssh-client:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ${{gitea.workspace}}/docker/ssh-client
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Log in to git.limbosolutions.com container registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.limbosolutions.com
|
||||||
|
username: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push ssh-client Docker images
|
||||||
|
id: push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: git.limbosolutions.com/kb/ssh-client
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
36
.gitea/workflows/ssh-server-build-deploy.yaml
Normal file
36
.gitea/workflows/ssh-server-build-deploy.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "docker/ssh-server/**"
|
||||||
|
- ".gitea/ssh-server**"
|
||||||
|
schedule:
|
||||||
|
- cron: "0 14 * * 6" #every Saturday at 2:00 PM,
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
ssh-server:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: ${{gitea.workspace}}/docker/ssh-server
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Log in to git.limbosolutions.com container registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.limbosolutions.com
|
||||||
|
username: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build ssh-server images
|
||||||
|
run: BUILD_ENV=prod ./scripts/build.sh
|
||||||
|
|
||||||
|
- name: Push image
|
||||||
|
run: docker push git.limbosolutions.com/kb/ssh-server
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
#DEBUG_FILE="sshserver.py"
|
#DEBUG_FILE="sshserver.py"
|
||||||
#DEBUG_FILE="sshserver.py"
|
|
||||||
#DEBUG_FILE="users.py"
|
#DEBUG_FILE="users.py"
|
||||||
SSH_SERVER_ENABLED="true"
|
SSH_SERVER_ENABLED="true"
|
||||||
CONTAINER_TAG="ssh-server:dev"
|
CONTAINER_TAG="ssh-server:dev"
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ EXPOSE 5678
|
|||||||
# runtime environment
|
# runtime environment
|
||||||
ENV CONFIGURATION=Debug
|
ENV CONFIGURATION=Debug
|
||||||
ENV DEBUG=True
|
ENV DEBUG=True
|
||||||
|
ENV SSH_SERVER_ENABLED=False
|
||||||
|
|
||||||
# Default command for dev container
|
# Default command for dev container
|
||||||
CMD ["python3","-u", "/app/main.py"]
|
CMD ["python3","-u", "/app/main.py"]
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ users:
|
|||||||
- username: xx
|
- username: xx
|
||||||
password: "123456"
|
password: "123456"
|
||||||
public_keys: ## array with public keys
|
public_keys: ## array with public keys
|
||||||
- "ssh-ed25519 AsdfsdsZ6NGdssdsdfDsvxYDRiH7hXW/asus"
|
- "ssh-ed25519 ssdfdsxvxcsxdfrer"
|
||||||
uid: 1002
|
uid: 1002
|
||||||
server:
|
server:
|
||||||
options:
|
options:
|
||||||
@@ -18,11 +18,14 @@ server:
|
|||||||
## Podman
|
## Podman
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
|
podman pull git.limbosolutions.com/kb/ssh-server:latest
|
||||||
|
|
||||||
podman container run \
|
podman container run \
|
||||||
-p 2222:22 \
|
-p 2222:22 \
|
||||||
-p 5678:5678 \
|
-p 5678:5678 \
|
||||||
-v ./local/config:/etc/app/config \
|
-v ./local/config:/etc/app/config \
|
||||||
-v ./local/server-certs:/etc/ssh/certs \
|
-v ./local/server-certs:/etc/ssh/certs \
|
||||||
|
-v ./local/home:/home \
|
||||||
git.limbosolutions.com/kb/ssh-server:latest
|
git.limbosolutions.com/kb/ssh-server:latest
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -30,11 +33,14 @@ podman container run \
|
|||||||
## docker
|
## docker
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
|
docker pull git.limbosolutions.com/kb/ssh-server:latest
|
||||||
|
|
||||||
docker container run \
|
docker container run \
|
||||||
-p 2222:22 \
|
-p 2222:22 \
|
||||||
-p 5678:5678 \
|
-p 5678:5678 \
|
||||||
-v ./local/config:/etc/app/config \
|
-v ./local/config:/etc/app/config \
|
||||||
-v ./local/server-certs:/etc/ssh/certs \
|
-v ./local/server-certs:/etc/ssh/certs \
|
||||||
|
-v ./local/home:/home \
|
||||||
git.limbosolutions.com/kb/ssh-server:latest
|
git.limbosolutions.com/kb/ssh-server:latest
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import yaml
|
import yaml
|
||||||
def is_debugging(): return os.getenv("CONFIGURATION") == "Debug"
|
def is_debugging(): return os.getenv("CONFIGURATION", "").lower() == "debug"
|
||||||
|
|
||||||
|
|
||||||
file_path="/etc/app/config/config.yaml"
|
file_path="/etc/app/config/config.yaml"
|
||||||
@@ -10,7 +10,7 @@ def config_exits():
|
|||||||
return get_config() is not None
|
return get_config() is not None
|
||||||
|
|
||||||
def sshserver_enabled():
|
def sshserver_enabled():
|
||||||
return not is_debugging() or os.getenv("SSH_SERVER_ENABLED") == "true"
|
return not is_debugging() or os.getenv("SSH_SERVER_ENABLED", "false").lower() == "true"
|
||||||
|
|
||||||
def get_config():
|
def get_config():
|
||||||
global config
|
global config
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ podman container run -d --rm \
|
|||||||
-p 2222:22 \
|
-p 2222:22 \
|
||||||
-p 5678:5678 \
|
-p 5678:5678 \
|
||||||
-v ./app:/app \
|
-v ./app:/app \
|
||||||
|
-v ./local/home:/home \
|
||||||
-v ./local/config:/etc/app/config \
|
-v ./local/config:/etc/app/config \
|
||||||
-v ./local/server-certs:/etc/ssh/certs \
|
-v ./local/server-certs:/etc/ssh/certs \
|
||||||
${CONTAINER_TAG}
|
${CONTAINER_TAG}
|
||||||
|
|||||||
Reference in New Issue
Block a user