@lazycatcloud/lzc-cli 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/lib/api.js +123 -0
- package/lib/archiver.js +128 -0
- package/lib/builder.js +183 -0
- package/lib/dev.js +300 -0
- package/lib/docker/promise.js +91 -0
- package/lib/docker-compose.js +51 -0
- package/lib/env.js +104 -0
- package/lib/generator.js +115 -0
- package/lib/key.js +112 -0
- package/lib/sdk.js +129 -0
- package/lib/utils.js +349 -0
- package/package.json +53 -0
- package/scripts/cli.js +98 -0
- package/template/_lazycat/_gitignore +1 -0
- package/template/_lazycat/debug/devforward/50x.html +30 -0
- package/template/_lazycat/debug/devforward/Dockerfile +16 -0
- package/template/_lazycat/debug/devforward/docker-compose.override.yml.in +11 -0
- package/template/_lazycat/debug/devforward/entrypoint.sh +10 -0
- package/template/_lazycat/debug/devforward/nginx.conf.template +56 -0
- package/template/_lazycat/debug/devforward/sshd_config +116 -0
- package/template/_lazycat/debug/shell/50x.html +32 -0
- package/template/_lazycat/debug/shell/Dockerfile +16 -0
- package/template/_lazycat/debug/shell/build.sh +15 -0
- package/template/_lazycat/debug/shell/docker-compose.override.yml.in +23 -0
- package/template/_lazycat/debug/shell/entrypoint.sh +10 -0
- package/template/_lazycat/debug/shell/nginx.conf.template +64 -0
- package/template/_lazycat/debug/shell/sshd_config +117 -0
- package/template/_lazycat/docker-compose.yml.in +17 -0
- package/template/_lazycat/icon.svg +1 -0
- package/template/_lazycat/screenshot.png +0 -0
- package/template/golang/.godir +1 -0
- package/template/golang/README.md +13 -0
- package/template/golang/assets/css/bootstrap-responsive.css +1088 -0
- package/template/golang/assets/css/bootstrap-responsive.min.css +9 -0
- package/template/golang/assets/css/bootstrap.css +5893 -0
- package/template/golang/assets/css/bootstrap.min.css +9 -0
- package/template/golang/assets/css/rego.css +45 -0
- package/template/golang/assets/img/glyphicons-halflings-white.png +0 -0
- package/template/golang/assets/img/glyphicons-halflings.png +0 -0
- package/template/golang/assets/js/bootstrap.js +2025 -0
- package/template/golang/assets/js/bootstrap.min.js +6 -0
- package/template/golang/assets/js/rego.js +121 -0
- package/template/golang/go.mod +3 -0
- package/template/golang/index.html +267 -0
- package/template/golang/rego.go +83 -0
- package/template/release/golang/Dockerfile +18 -0
- package/template/release/golang/build.sh +14 -0
- package/template/release/vue/Dockerfile +9 -0
- package/template/release/vue/build.sh +9 -0
- package/template/release/vue/docker-compose.yml.in +8 -0
- package/template/vue/README.md +24 -0
- package/template/vue/_dockerignore +1 -0
- package/template/vue/babel.config.js +5 -0
- package/template/vue/package.json +43 -0
- package/template/vue/public/favicon.ico +0 -0
- package/template/vue/public/index.html +33 -0
- package/template/vue/src/App.vue +39 -0
- package/template/vue/src/lzc.js +110 -0
- package/template/vue/src/main.js +19 -0
- package/template/vue/src/todo.vue +640 -0
- package/template/vue/src/top-bar.vue +100 -0
- package/template/vue/src/webdav.vue +183 -0
- package/template/vue/vue.config.js +5 -0
package/scripts/cli.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import program from "commander";
|
|
4
|
+
import process from "process";
|
|
5
|
+
import path from "path";
|
|
6
|
+
import fs from "fs";
|
|
7
|
+
import { contextDirname, importDefault } from "../lib/utils.js";
|
|
8
|
+
import Env from "../lib/env.js";
|
|
9
|
+
|
|
10
|
+
const pkgInfo = JSON.parse(
|
|
11
|
+
fs.readFileSync(path.join(contextDirname(), "../package.json"))
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
program.usage("<command> [options]");
|
|
15
|
+
|
|
16
|
+
program
|
|
17
|
+
.version(`lzc-cli ${pkgInfo.version}`)
|
|
18
|
+
.usage("<command> [options]")
|
|
19
|
+
.command("create <name>")
|
|
20
|
+
.description("创建懒猫云应用")
|
|
21
|
+
.action(async (name, cmd) => {
|
|
22
|
+
let create = await importDefault("../cmds/create.js");
|
|
23
|
+
await create({ name });
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
program
|
|
27
|
+
.command("init")
|
|
28
|
+
.description("初始化懒猫云应用配置")
|
|
29
|
+
.action(async (options) => {
|
|
30
|
+
const { Init } = await import("../cmds/init.js");
|
|
31
|
+
new Init({ cwd: process.cwd() }).create();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
program
|
|
35
|
+
.command("uninstall")
|
|
36
|
+
.description("卸载应用")
|
|
37
|
+
.action(async (options) => {
|
|
38
|
+
const { uninstall } = await importDefault("../cmds/app.js");
|
|
39
|
+
await uninstall();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
program
|
|
43
|
+
.command("deploy")
|
|
44
|
+
.description("部署应用至设备")
|
|
45
|
+
.action(async (url, _options) => {
|
|
46
|
+
const { deploy } = await importDefault("../cmds/app.js");
|
|
47
|
+
await deploy();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
program
|
|
51
|
+
.command("build")
|
|
52
|
+
.argument("[context]", "integer argument")
|
|
53
|
+
.option("-f, --file <file>", "", "Dockerfile")
|
|
54
|
+
.action(async (context, options) => {
|
|
55
|
+
const builder = await importDefault("../lib/builder.js");
|
|
56
|
+
const b = builder({ env: Env(process.cwd()).all });
|
|
57
|
+
b.dockerRemoteBuildV2(context, options.file);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
let dev = program.command("dev").description("dev [forward [addr] | shell]");
|
|
61
|
+
|
|
62
|
+
dev
|
|
63
|
+
.command("forward [addr]")
|
|
64
|
+
.description("本地端口转发")
|
|
65
|
+
.action(async (addr) => {
|
|
66
|
+
const { dev } = await importDefault("../cmds/dev.js");
|
|
67
|
+
await dev(addr);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
dev
|
|
71
|
+
.command("shell")
|
|
72
|
+
.option("-b, --build", "重新部署应用")
|
|
73
|
+
.description("本地开发应用")
|
|
74
|
+
.action(async (options) => {
|
|
75
|
+
const { devShell } = await importDefault("../cmds/dev.js");
|
|
76
|
+
await devShell(options);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
program
|
|
80
|
+
.command("log [project]")
|
|
81
|
+
.description("查看应用日志")
|
|
82
|
+
.action(async (projectName) => {
|
|
83
|
+
const { monitor } = await importDefault("../cmds/log.js");
|
|
84
|
+
await monitor(projectName);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
program
|
|
88
|
+
.command("config")
|
|
89
|
+
.description("应用配置项")
|
|
90
|
+
.argument("[key]", "key argument")
|
|
91
|
+
.argument("[value]", "integer argument")
|
|
92
|
+
.option("-g, --global", "global config", false)
|
|
93
|
+
.action(async (key, value, options) => {
|
|
94
|
+
const { config } = await importDefault("../cmds/config.js");
|
|
95
|
+
await config([key, value, options]);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
program.parse(process.argv);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/output
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!DOCTYPE >
|
|
2
|
+
<html>
|
|
3
|
+
<meta charset="utf-8" />
|
|
4
|
+
<head>
|
|
5
|
+
<title>OMG!!</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<h1>错误,请检查相关的服务已经启动</h1>
|
|
9
|
+
<ul>
|
|
10
|
+
<li><code>lzc-cli dev forward</code> 会将本地的端口转发到app容器里面</li>
|
|
11
|
+
<li><code>lzc-cli dev shell</code> 进去app容器</li>
|
|
12
|
+
<li><code>lzc-cli deploy</code>部署app</li>
|
|
13
|
+
</ul>
|
|
14
|
+
</body>
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
li {
|
|
18
|
+
margin: 14px;
|
|
19
|
+
font-size: 1.5rem;
|
|
20
|
+
}
|
|
21
|
+
code {
|
|
22
|
+
color: rgb(115 193 153);
|
|
23
|
+
margin: 0px 14px;
|
|
24
|
+
}
|
|
25
|
+
.warning {
|
|
26
|
+
width: fit-content;
|
|
27
|
+
background-color: rgb(255 229 100 / 30%);
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
</html>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
FROM nginx:1.21.4-alpine
|
|
2
|
+
|
|
3
|
+
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
|
|
4
|
+
|
|
5
|
+
RUN apk add --no-cache openssh nginx \
|
|
6
|
+
&& echo "root:root" | chpasswd
|
|
7
|
+
|
|
8
|
+
EXPOSE 22
|
|
9
|
+
|
|
10
|
+
COPY sshd_config /etc/ssh/sshd_config
|
|
11
|
+
|
|
12
|
+
COPY entrypoint.sh /entrypoint.sh
|
|
13
|
+
|
|
14
|
+
RUN chmod +x /entrypoint.sh
|
|
15
|
+
|
|
16
|
+
ENTRYPOINT ["/entrypoint.sh"]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
services:
|
|
2
|
+
${APP_ID}:
|
|
3
|
+
pull_policy: build
|
|
4
|
+
build: .
|
|
5
|
+
environment:
|
|
6
|
+
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
|
|
7
|
+
- APP_PORT=${DEV_PORT}
|
|
8
|
+
volumes:
|
|
9
|
+
- ./debug/ssh:/root/.ssh
|
|
10
|
+
- ./nginx.conf.template:/etc/nginx/templates/nginx.conf.template
|
|
11
|
+
- ./50x.html:/etc/nginx/50x.html
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# need to use root permission to connect unix socket
|
|
2
|
+
user root;
|
|
3
|
+
worker_processes 1;
|
|
4
|
+
|
|
5
|
+
error_log /var/log/nginx/error.log info;
|
|
6
|
+
pid /var/run/nginx.pid;
|
|
7
|
+
|
|
8
|
+
events {
|
|
9
|
+
worker_connections 1024;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
http {
|
|
14
|
+
include /etc/nginx/mime.types;
|
|
15
|
+
default_type application/octet-stream;
|
|
16
|
+
|
|
17
|
+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
18
|
+
'$status $body_bytes_sent "$http_referer" '
|
|
19
|
+
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
20
|
+
|
|
21
|
+
access_log /var/log/nginx/access.log main;
|
|
22
|
+
|
|
23
|
+
sendfile on;
|
|
24
|
+
#tcp_nopush on;
|
|
25
|
+
|
|
26
|
+
keepalive_timeout 65;
|
|
27
|
+
|
|
28
|
+
map $http_upgrade $connection_upgrade {
|
|
29
|
+
default upgrade;
|
|
30
|
+
'' close;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#gzip on;
|
|
34
|
+
|
|
35
|
+
server {
|
|
36
|
+
listen ${APP_PORT};
|
|
37
|
+
server_name localhost;
|
|
38
|
+
error_page 502 503 504 /50x.html;
|
|
39
|
+
|
|
40
|
+
location = /50x.html {
|
|
41
|
+
root /etc/nginx;
|
|
42
|
+
internal;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
location / {
|
|
46
|
+
# sock name need to same with ssh -R
|
|
47
|
+
proxy_pass http://unix:/lazycat_cloud_debug.sock:/;
|
|
48
|
+
proxy_set_header Host $http_host;
|
|
49
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
50
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
51
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
52
|
+
proxy_set_header Connection $connection_upgrade;
|
|
53
|
+
proxy_next_upstream error timeout invalid_header http_502 http_503 http_504;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $
|
|
2
|
+
|
|
3
|
+
# This is the sshd server system-wide configuration file. See
|
|
4
|
+
# sshd_config(5) for more information.
|
|
5
|
+
|
|
6
|
+
# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
7
|
+
|
|
8
|
+
# The strategy used for options in the default sshd_config shipped with
|
|
9
|
+
# OpenSSH is to specify options with their default value where
|
|
10
|
+
# possible, but leave them commented. Uncommented options override the
|
|
11
|
+
# default value.
|
|
12
|
+
|
|
13
|
+
#Port 22
|
|
14
|
+
#AddressFamily any
|
|
15
|
+
#ListenAddress 0.0.0.0
|
|
16
|
+
#ListenAddress ::
|
|
17
|
+
|
|
18
|
+
#HostKey /etc/ssh/ssh_host_rsa_key
|
|
19
|
+
#HostKey /etc/ssh/ssh_host_ecdsa_key
|
|
20
|
+
#HostKey /etc/ssh/ssh_host_ed25519_key
|
|
21
|
+
|
|
22
|
+
# Ciphers and keying
|
|
23
|
+
#RekeyLimit default none
|
|
24
|
+
|
|
25
|
+
# Logging
|
|
26
|
+
#SyslogFacility AUTH
|
|
27
|
+
#LogLevel INFO
|
|
28
|
+
|
|
29
|
+
# Authentication:
|
|
30
|
+
|
|
31
|
+
#LoginGraceTime 2m
|
|
32
|
+
PermitRootLogin yes
|
|
33
|
+
#StrictModes yes
|
|
34
|
+
#MaxAuthTries 6
|
|
35
|
+
#MaxSessions 10
|
|
36
|
+
|
|
37
|
+
PubkeyAuthentication yes
|
|
38
|
+
|
|
39
|
+
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
|
|
40
|
+
# but this is overridden so installations will only check .ssh/authorized_keys
|
|
41
|
+
AuthorizedKeysFile .ssh/authorized_keys
|
|
42
|
+
|
|
43
|
+
#AuthorizedPrincipalsFile none
|
|
44
|
+
|
|
45
|
+
#AuthorizedKeysCommand none
|
|
46
|
+
#AuthorizedKeysCommandUser nobody
|
|
47
|
+
|
|
48
|
+
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
|
|
49
|
+
#HostbasedAuthentication no
|
|
50
|
+
# Change to yes if you don't trust ~/.ssh/known_hosts for
|
|
51
|
+
# HostbasedAuthentication
|
|
52
|
+
#IgnoreUserKnownHosts no
|
|
53
|
+
# Don't read the user's ~/.rhosts and ~/.shosts files
|
|
54
|
+
#IgnoreRhosts yes
|
|
55
|
+
|
|
56
|
+
# To disable tunneled clear text passwords, change to no here!
|
|
57
|
+
PasswordAuthentication no
|
|
58
|
+
PermitEmptyPasswords no
|
|
59
|
+
|
|
60
|
+
# Change to no to disable s/key passwords
|
|
61
|
+
#KbdInteractiveAuthentication yes
|
|
62
|
+
|
|
63
|
+
# Kerberos options
|
|
64
|
+
#KerberosAuthentication no
|
|
65
|
+
#KerberosOrLocalPasswd yes
|
|
66
|
+
#KerberosTicketCleanup yes
|
|
67
|
+
#KerberosGetAFSToken no
|
|
68
|
+
|
|
69
|
+
# GSSAPI options
|
|
70
|
+
#GSSAPIAuthentication no
|
|
71
|
+
#GSSAPICleanupCredentials yes
|
|
72
|
+
|
|
73
|
+
# Set this to 'yes' to enable PAM authentication, account processing,
|
|
74
|
+
# and session processing. If this is enabled, PAM authentication will
|
|
75
|
+
# be allowed through the KbdInteractiveAuthentication and
|
|
76
|
+
# PasswordAuthentication. Depending on your PAM configuration,
|
|
77
|
+
# PAM authentication via KbdInteractiveAuthentication may bypass
|
|
78
|
+
# the setting of "PermitRootLogin without-password".
|
|
79
|
+
# If you just want the PAM account and session checks to run without
|
|
80
|
+
# PAM authentication, then enable this but set PasswordAuthentication
|
|
81
|
+
# and KbdInteractiveAuthentication to 'no'.
|
|
82
|
+
#UsePAM no
|
|
83
|
+
|
|
84
|
+
#AllowAgentForwarding yes
|
|
85
|
+
# Feel free to re-enable these if your use case requires them.
|
|
86
|
+
AllowTcpForwarding yes
|
|
87
|
+
GatewayPorts yes
|
|
88
|
+
X11Forwarding no
|
|
89
|
+
#X11DisplayOffset 10
|
|
90
|
+
#X11UseLocalhost yes
|
|
91
|
+
#PermitTTY yes
|
|
92
|
+
#PrintMotd yes
|
|
93
|
+
#PrintLastLog yes
|
|
94
|
+
#TCPKeepAlive yes
|
|
95
|
+
#PermitUserEnvironment no
|
|
96
|
+
#Compression delayed
|
|
97
|
+
#ClientAliveInterval 0
|
|
98
|
+
#UseDNS no
|
|
99
|
+
#PidFile /run/sshd.pid
|
|
100
|
+
#MaxStartups 10:30:100
|
|
101
|
+
#PermitTunnel no
|
|
102
|
+
#ChrootDirectory none
|
|
103
|
+
#VersionAddendum none
|
|
104
|
+
|
|
105
|
+
# no default banner path
|
|
106
|
+
#Banner none
|
|
107
|
+
|
|
108
|
+
# override default of no subsystems
|
|
109
|
+
Subsystem sftp /usr/lib/ssh/sftp-server
|
|
110
|
+
|
|
111
|
+
# Example of overriding settings on a per-user basis
|
|
112
|
+
#Match User anoncvs
|
|
113
|
+
# X11Forwarding no
|
|
114
|
+
# AllowTcpForwarding no
|
|
115
|
+
# PermitTTY no
|
|
116
|
+
# ForceCommand cvs server
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!DOCTYPE >
|
|
2
|
+
<html>
|
|
3
|
+
<meta charset="utf-8" />
|
|
4
|
+
<head>
|
|
5
|
+
<title>OMG!!</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<h1>错误,请检查相关的服务已经启动</h1>
|
|
9
|
+
<ul>
|
|
10
|
+
<li>执行<code>lzc-cli dev shell</code>进去app容器</li>
|
|
11
|
+
<li>进去对应的项目路径启动相关的服务</li>
|
|
12
|
+
<li class="warning">
|
|
13
|
+
服务的端口需要与<code>.lazycat/app-config</code>中定义的<code>APP_PORT</code>一致
|
|
14
|
+
</li>
|
|
15
|
+
</ul>
|
|
16
|
+
</body>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
li {
|
|
20
|
+
margin: 14px;
|
|
21
|
+
font-size: 1.5rem;
|
|
22
|
+
}
|
|
23
|
+
code {
|
|
24
|
+
color: rgb(115 193 153);
|
|
25
|
+
margin: 0px 14px;
|
|
26
|
+
}
|
|
27
|
+
.warning {
|
|
28
|
+
width: fit-content;
|
|
29
|
+
background-color: rgb(255 229 100 / 30%);
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
32
|
+
</html>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
FROM node:16-alpine3.12
|
|
2
|
+
|
|
3
|
+
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
|
|
4
|
+
|
|
5
|
+
RUN apk add --no-cache openssh rsync \
|
|
6
|
+
&& echo "root:root" | chpasswd
|
|
7
|
+
|
|
8
|
+
EXPOSE 22
|
|
9
|
+
|
|
10
|
+
COPY sshd_config /etc/ssh/sshd_config
|
|
11
|
+
|
|
12
|
+
COPY entrypoint.sh /entrypoint.sh
|
|
13
|
+
|
|
14
|
+
RUN chmod +x /entrypoint.sh
|
|
15
|
+
|
|
16
|
+
ENTRYPOINT ["/entrypoint.sh"]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -ex
|
|
3
|
+
|
|
4
|
+
SHELLDIR="$(dirname "$(realpath "$0")")"
|
|
5
|
+
|
|
6
|
+
cd "$SHELLDIR"
|
|
7
|
+
|
|
8
|
+
mkdir -p debug/ssh
|
|
9
|
+
if [ -f debug/ssh/id_ed25519 ]; then
|
|
10
|
+
rm -f debug/ssh/id_ed25519
|
|
11
|
+
rm -f debug/ssh/id_ed25519.pub
|
|
12
|
+
fi
|
|
13
|
+
ssh-keygen -t ed25519 -f debug/ssh/id_ed25519 -q -P ""
|
|
14
|
+
chmod 0400 debug/ssh/id_ed25519
|
|
15
|
+
cat debug/ssh/id_ed25519.pub > debug/ssh/authorized_keys
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
services:
|
|
2
|
+
${APP_ID}:
|
|
3
|
+
image: nginx:1.21.4-alpine
|
|
4
|
+
volumes:
|
|
5
|
+
- ./nginx.conf.template:/etc/nginx/templates/nginx.conf.template
|
|
6
|
+
- ./50x.html:/etc/nginx/50x.html
|
|
7
|
+
environment:
|
|
8
|
+
- NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
|
|
9
|
+
- APP_DEBUG_PORT=${HTTP_SERVICE_PORT}
|
|
10
|
+
- APP_DEBUG_SHELL=debug-shell.${APP_ID}.lzcapp
|
|
11
|
+
command: [nginx, '-g', 'daemon off;']
|
|
12
|
+
depends_on:
|
|
13
|
+
- debug-shell
|
|
14
|
+
debug-shell:
|
|
15
|
+
image: ${APP_IMAGE_NAME}
|
|
16
|
+
pull_policy: build
|
|
17
|
+
build: .
|
|
18
|
+
volumes:
|
|
19
|
+
- ./debug/ssh:/root/.ssh
|
|
20
|
+
- project-data:/root/
|
|
21
|
+
|
|
22
|
+
volumes:
|
|
23
|
+
project-data:
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# need to use root permission to connect unix socket
|
|
2
|
+
user root;
|
|
3
|
+
worker_processes 1;
|
|
4
|
+
|
|
5
|
+
error_log /var/log/nginx/error.log info;
|
|
6
|
+
pid /var/run/nginx.pid;
|
|
7
|
+
|
|
8
|
+
events {
|
|
9
|
+
worker_connections 1024;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
stream {
|
|
13
|
+
upstream tunnel {
|
|
14
|
+
server ${APP_DEBUG_SHELL}:22;
|
|
15
|
+
}
|
|
16
|
+
server {
|
|
17
|
+
listen [::]:22 ipv6only=on;
|
|
18
|
+
proxy_pass tunnel;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
http {
|
|
24
|
+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
25
|
+
'$status $body_bytes_sent "$http_referer" '
|
|
26
|
+
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
27
|
+
|
|
28
|
+
access_log /var/log/nginx/access.log main;
|
|
29
|
+
|
|
30
|
+
sendfile on;
|
|
31
|
+
#tcp_nopush on;
|
|
32
|
+
|
|
33
|
+
keepalive_timeout 65;
|
|
34
|
+
|
|
35
|
+
map $http_upgrade $connection_upgrade {
|
|
36
|
+
default upgrade;
|
|
37
|
+
'' close;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#gzip on;
|
|
41
|
+
|
|
42
|
+
server {
|
|
43
|
+
listen *:${APP_DEBUG_PORT};
|
|
44
|
+
|
|
45
|
+
error_page 502 503 504 /50x.html;
|
|
46
|
+
|
|
47
|
+
large_client_header_buffers 4 32k;
|
|
48
|
+
|
|
49
|
+
location = /50x.html {
|
|
50
|
+
root /etc/nginx;
|
|
51
|
+
internal;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
location / {
|
|
55
|
+
proxy_pass http://${APP_DEBUG_SHELL}:${APP_DEBUG_PORT}/;
|
|
56
|
+
proxy_set_header Host localhost;
|
|
57
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
58
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
59
|
+
proxy_set_header Upgrade $http_upgrade;
|
|
60
|
+
proxy_set_header Connection $connection_upgrade;
|
|
61
|
+
proxy_next_upstream error timeout invalid_header http_502 http_503 http_504;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# $OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $
|
|
2
|
+
|
|
3
|
+
# This is the sshd server system-wide configuration file. See
|
|
4
|
+
# sshd_config(5) for more information.
|
|
5
|
+
|
|
6
|
+
# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
7
|
+
|
|
8
|
+
# The strategy used for options in the default sshd_config shipped with
|
|
9
|
+
# OpenSSH is to specify options with their default value where
|
|
10
|
+
# possible, but leave them commented. Uncommented options override the
|
|
11
|
+
# default value.
|
|
12
|
+
|
|
13
|
+
#Port 22
|
|
14
|
+
#AddressFamily any
|
|
15
|
+
#ListenAddress 0.0.0.0
|
|
16
|
+
#ListenAddress ::
|
|
17
|
+
|
|
18
|
+
#HostKey /etc/ssh/ssh_host_rsa_key
|
|
19
|
+
#HostKey /etc/ssh/ssh_host_ecdsa_key
|
|
20
|
+
#HostKey /etc/ssh/ssh_host_ed25519_key
|
|
21
|
+
|
|
22
|
+
# Ciphers and keying
|
|
23
|
+
#RekeyLimit default none
|
|
24
|
+
|
|
25
|
+
# Logging
|
|
26
|
+
#SyslogFacility AUTH
|
|
27
|
+
#LogLevel INFO
|
|
28
|
+
|
|
29
|
+
# Authentication:
|
|
30
|
+
|
|
31
|
+
#LoginGraceTime 2m
|
|
32
|
+
PermitRootLogin yes
|
|
33
|
+
#StrictModes yes
|
|
34
|
+
#MaxAuthTries 6
|
|
35
|
+
#MaxSessions 10
|
|
36
|
+
|
|
37
|
+
PubkeyAuthentication yes
|
|
38
|
+
|
|
39
|
+
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
|
|
40
|
+
# but this is overridden so installations will only check .ssh/authorized_keys
|
|
41
|
+
AuthorizedKeysFile .ssh/authorized_keys
|
|
42
|
+
|
|
43
|
+
#AuthorizedPrincipalsFile none
|
|
44
|
+
|
|
45
|
+
#AuthorizedKeysCommand none
|
|
46
|
+
#AuthorizedKeysCommandUser nobody
|
|
47
|
+
|
|
48
|
+
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
|
|
49
|
+
#HostbasedAuthentication no
|
|
50
|
+
# Change to yes if you don't trust ~/.ssh/known_hosts for
|
|
51
|
+
# HostbasedAuthentication
|
|
52
|
+
#IgnoreUserKnownHosts no
|
|
53
|
+
# Don't read the user's ~/.rhosts and ~/.shosts files
|
|
54
|
+
#IgnoreRhosts yes
|
|
55
|
+
|
|
56
|
+
# To disable tunneled clear text passwords, change to no here!
|
|
57
|
+
PasswordAuthentication no
|
|
58
|
+
PermitEmptyPasswords no
|
|
59
|
+
|
|
60
|
+
# Change to no to disable s/key passwords
|
|
61
|
+
#KbdInteractiveAuthentication yes
|
|
62
|
+
|
|
63
|
+
# Kerberos options
|
|
64
|
+
#KerberosAuthentication no
|
|
65
|
+
#KerberosOrLocalPasswd yes
|
|
66
|
+
#KerberosTicketCleanup yes
|
|
67
|
+
#KerberosGetAFSToken no
|
|
68
|
+
|
|
69
|
+
# GSSAPI options
|
|
70
|
+
#GSSAPIAuthentication no
|
|
71
|
+
#GSSAPICleanupCredentials yes
|
|
72
|
+
|
|
73
|
+
# Set this to 'yes' to enable PAM authentication, account processing,
|
|
74
|
+
# and session processing. If this is enabled, PAM authentication will
|
|
75
|
+
# be allowed through the KbdInteractiveAuthentication and
|
|
76
|
+
# PasswordAuthentication. Depending on your PAM configuration,
|
|
77
|
+
# PAM authentication via KbdInteractiveAuthentication may bypass
|
|
78
|
+
# the setting of "PermitRootLogin without-password".
|
|
79
|
+
# If you just want the PAM account and session checks to run without
|
|
80
|
+
# PAM authentication, then enable this but set PasswordAuthentication
|
|
81
|
+
# and KbdInteractiveAuthentication to 'no'.
|
|
82
|
+
#UsePAM no
|
|
83
|
+
|
|
84
|
+
#AllowAgentForwarding yes
|
|
85
|
+
# Feel free to re-enable these if your use case requires them.
|
|
86
|
+
AllowTcpForwarding yes
|
|
87
|
+
GatewayPorts yes
|
|
88
|
+
X11Forwarding no
|
|
89
|
+
#X11DisplayOffset 10
|
|
90
|
+
#X11UseLocalhost yes
|
|
91
|
+
#PermitTTY yes
|
|
92
|
+
#PrintMotd yes
|
|
93
|
+
#PrintLastLog yes
|
|
94
|
+
#TCPKeepAlive yes
|
|
95
|
+
#PermitUserEnvironment no
|
|
96
|
+
#Compression delayed
|
|
97
|
+
ClientAliveInterval 3
|
|
98
|
+
ClientAliveCountMax 0
|
|
99
|
+
#UseDNS no
|
|
100
|
+
#PidFile /run/sshd.pid
|
|
101
|
+
#MaxStartups 10:30:100
|
|
102
|
+
#PermitTunnel no
|
|
103
|
+
#ChrootDirectory none
|
|
104
|
+
#VersionAddendum none
|
|
105
|
+
|
|
106
|
+
# no default banner path
|
|
107
|
+
#Banner none
|
|
108
|
+
|
|
109
|
+
# override default of no subsystems
|
|
110
|
+
Subsystem sftp /usr/lib/ssh/sftp-server
|
|
111
|
+
|
|
112
|
+
# Example of overriding settings on a per-user basis
|
|
113
|
+
#Match User anoncvs
|
|
114
|
+
# X11Forwarding no
|
|
115
|
+
# AllowTcpForwarding no
|
|
116
|
+
# PermitTTY no
|
|
117
|
+
# ForceCommand cvs server
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
version: "3.9"
|
|
2
|
+
x-lazycat-app:
|
|
3
|
+
id: ${APP_ID}
|
|
4
|
+
title: ${APP_NAME}
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
description:
|
|
7
|
+
icon: icon.svg
|
|
8
|
+
categories:
|
|
9
|
+
screenshots:
|
|
10
|
+
- screenshot.png
|
|
11
|
+
ingress:
|
|
12
|
+
- service: ${APP_ID}
|
|
13
|
+
port: ${HTTP_SERVICE_PORT}
|
|
14
|
+
subdomain: ${APP_ID}
|
|
15
|
+
permissions:
|
|
16
|
+
- lzcapis
|
|
17
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><title>file_type_vue</title><path d="M24.4,3.925H30L16,28.075,2,3.925H12.71L16,9.525l3.22-5.6Z" style="fill:#41b883"/><path d="M2,3.925l14,24.15L30,3.925H24.4L16,18.415,7.53,3.925Z" style="fill:#41b883"/><path d="M7.53,3.925,16,18.485l8.4-14.56H19.22L16,9.525l-3.29-5.6Z" style="fill:#35495e"/></svg>
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rego
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
rego
|
|
2
|
+
====
|
|
3
|
+
|
|
4
|
+
Rego is an online Go regular expression tester
|
|
5
|
+
|
|
6
|
+
Inspired by [rubular](http://rubular.com/).
|
|
7
|
+
|
|
8
|
+
It's currently deployed on Heroku at [http://regoio.herokuapp.com/](http://regoio.herokuapp.com/)
|
|
9
|
+
|
|
10
|
+
## TODO
|
|
11
|
+
|
|
12
|
+
* Sharing (permalink)
|
|
13
|
+
* Add developer documentation
|