forked from clickvisual/clickvisual
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
442 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
logs | ||
ui/node_modules | ||
bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.ts linguist-detectable=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,42 @@ | ||
# UI build stage | ||
FROM node:16-alpine3.14 as js-builder | ||
|
||
ENV NODE_OPTIONS=--max_old_space_size=8000 | ||
WORKDIR /mogo | ||
COPY ui/package.json ui/package-lock.json ui/yarn.lock . | ||
|
||
RUN yarn install | ||
ENV NODE_ENV production | ||
COPY ui . | ||
RUN yarn build | ||
|
||
|
||
# # API build stage | ||
FROM golang:1.17.3-alpine3.14 as go-builder | ||
|
||
ENV GOPROXY=https://goproxy.cn,direct | ||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories | ||
RUN apk add --no-cache make bash git | ||
WORKDIR /mogo | ||
|
||
COPY go.mod go.sum . | ||
RUN go mod download -x | ||
COPY scripts scripts | ||
COPY api api | ||
COPY Makefile Makefile | ||
RUN ls -rlt && make build.api | ||
|
||
|
||
# # Fianl running stage | ||
FROM alpine:3.14.3 | ||
LABEL maintainer="[email protected]" | ||
|
||
WORKDIR /mogo | ||
|
||
COPY --from=go-builder /mogo/bin/mogo ./bin/ | ||
COPY --from=js-builder /mogo/dist ./public | ||
|
||
EXPOSE 9001 | ||
EXPOSE 9003 | ||
|
||
CMD ["sh", "-c", "./bin/mogo"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# mogo | ||
|
||
[](https://goreportcard.com/report/github.com/shimohq/mogo) | ||
[](https://github.com/shimohq/mogo) | ||
[](https://github.com/shimohq/mogo/blob/master/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
[logger.default] | ||
level = "debug" | ||
|
||
[server.http] | ||
host = "0.0.0.0" | ||
port = 9001 | ||
public="./public" | ||
|
||
[server.governor] | ||
host = "0.0.0.0" | ||
port = 9003 | ||
|
||
[permission] | ||
resourceFile = './config/resource.yaml' | ||
|
||
[mysql.default] | ||
connMaxLifetime = "300s" | ||
debug = true | ||
dsn = "root:123456@tcp(mysql:3307)/mocro?charset=utf8mb4&collation=utf8mb4_general_ci&parseTime=True&loc=Local&readTimeout=1s&timeout=1s&writeTimeout=3s" | ||
level = "panic" | ||
maxIdleConns = 50 | ||
maxOpenConns = 100 | ||
|
||
[redis.default] | ||
addr = "redis:6380" | ||
writeTimeout = "3s" | ||
password = "" | ||
|
||
[app] | ||
secretKey = "ASDFASDFASDF" # hashStatecode | ||
rootURL = "http://localhost:9001" | ||
baseURL = "/api/admin/login/" | ||
|
||
[auth] | ||
# Login cookie name | ||
loginCookieName = "mogo_session" | ||
# The lifetime (days) an authenticated user can be inactive before being required to login at next visit. Default is 7 days. | ||
loginMaximumInactiveLifetimeDays = 7 | ||
# The maximum lifetime (days) an authenticated user can be logged in since login time before being required to login. Default is 30 days. | ||
loginMaximumLifetimeDays = 30 | ||
# How often should auth tokens be rotated for authenticated users when being active. The default is each 10 minutes. | ||
tokenRotationIntervalMinutes = 10 | ||
# Set to true to disable (hide) the login form, useful if you use OAuth | ||
disableLoginForm = false | ||
# Set to true to disable the signout link in the side menu. useful if you use auth.proxy | ||
disableSignoutMenu = false | ||
# URL to redirect the user to after sign out | ||
signoutRedirectUrl = "" | ||
# Set to true to attempt login with OAuth automatically, skipping the login screen. | ||
# This setting is ignored if multiple OAuth providers are configured. | ||
oauthAutoLogin = false | ||
# OAuth state max age cookie duration. Defaults to 60 seconds. | ||
oauthStateCookieMaxAge = 60 | ||
# limit of api_key seconds to live before expiration | ||
apiKeyMaxSecondsToLive = -1 | ||
|
||
[[auth.tps]] | ||
typ = "github" | ||
enable = true | ||
allowSignUp = true | ||
clientId = "" | ||
clientSecret = "" | ||
scopes = ["user:email", "read:org"] | ||
authUrl = "https://github.com/login/oauth/authorize" | ||
tokenUrl = "https://github.com/login/oauth/access_token" | ||
apiUrl = "https://api.github.com/user" | ||
allowedDomains = [] | ||
teamIds = [] | ||
allowedOrganizations = [] | ||
|
||
[[auth.tps]] | ||
typ = "gitlab" | ||
enable = true | ||
allowSignUp = true | ||
clientId = "" | ||
clientSecret = "" | ||
scopes = ["api"] | ||
authUrl = "https://gitlab.com/oauth/authorize" | ||
tokenUrl = "https://gitlab.com/oauth/token" | ||
apiUrl = "https://gitlab.com/api/v4" | ||
allowedDomains = [] | ||
teamIds = [] | ||
allowedOrganizations = [] | ||
|
||
[session] | ||
mode = "redis" | ||
name = "mysession" | ||
size = 10 | ||
debug = true | ||
network = "tcp" | ||
addr = "redis:6380" | ||
password = "" | ||
keypairs = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
version: '3' | ||
|
||
networks: | ||
mogo-net: | ||
driver: bridge | ||
|
||
services: | ||
mysql: | ||
image: mysql:5.7.24 | ||
expose: | ||
- "3307" | ||
ports: | ||
- "3307:3307" | ||
command: [ | ||
'--character-set-server=utf8mb4', | ||
'--collation-server=utf8mb4_general_ci', | ||
'--port=3307', | ||
'--init-file=/data/migration/latest.sql', | ||
] | ||
volumes: | ||
- ./scripts/migration:/data/migration | ||
environment: | ||
MYSQL_ROOT_PASSWORD: 123456 | ||
MYSQL_ROOT_HOST: '%' | ||
restart: always | ||
networks: | ||
- mogo-net | ||
redis: | ||
image: redis:5.0.14-alpine | ||
expose: | ||
- "6380" | ||
ports: | ||
- "6380:6380" | ||
restart: always | ||
networks: | ||
- mogo-net | ||
command: [ '--port 6380' ] | ||
clickhouse: | ||
image: clickhouse/clickhouse-server:latest | ||
expose: | ||
- "8123" | ||
ports: | ||
- "8123:8123" | ||
# volumes: | ||
# - ./scripts/migration/latest.sql:/data/init.sql | ||
# environment: | ||
restart: always | ||
networks: | ||
- mogo-net | ||
api: | ||
image: mogo:latest | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
expose: | ||
- "9001" | ||
ports: | ||
- "9001:9001" | ||
depends_on: | ||
- mysql | ||
- redis | ||
- clickhouse | ||
networks: | ||
- mogo-net | ||
links: | ||
- mysql | ||
- redis | ||
- clickhouse | ||
restart: always | ||
environment: | ||
EGO_CONFIG_PATH: /mogo/config/default.toml | ||
EGO_LOG_WRITER: stderr | ||
volumes: | ||
- ./api/config:/mogo/config | ||
command: ['/bin/sh', '-c', './bin/mogo'] |
Oops, something went wrong.