Skip to content

Commit 175d19a

Browse files
committed
fix: server_name split issue in SAN cert
1 parent bf3edfa commit 175d19a

File tree

17 files changed

+601
-601
lines changed

17 files changed

+601
-601
lines changed

frontend/src/components/StdDataDisplay/StdTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ function initSortable() {
525525
:okText="$gettext('OK')"
526526
:title="$gettext('Are you sure you want to delete?')"
527527
@confirm="destroy(record[rowKey])">
528-
<a-button type="link" size="small" v-translate>Delete</a-button>
528+
<a-button type="link" size="small">{{ $gettext('Delete') }}</a-button>
529529
</a-popconfirm>
530530
</template>
531531
</template>

frontend/src/views/dashboard/DashBoard.vue

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function wsOnMessage(m: { data: any }) {
164164
</p>
165165
<p v-if="cpu_info">
166166
{{ $gettext('CPU:') + ' ' }}
167-
<span class="cpu-model">{{ cpu_info[0]?.modelName }}</span>
167+
<span class="cpu-model">{{ cpu_info[0]?.modelName || 'core' }}</span>
168168
<span class="cpu-mhz">{{ (cpu_info[0]?.mhz / 1000).toFixed(2) + 'GHz' }}</span>
169169
* {{ cpu_info.length }}
170170
</p>
@@ -303,10 +303,6 @@ function wsOnMessage(m: { data: any }) {
303303
}
304304
}
305305
306-
.os-platform {
307-
text-transform: capitalize;
308-
}
309-
310306
.load-avg-describe {
311307
@media (max-width: 1600px) and (min-width: 1200px) {
312308
display: none;

frontend/src/views/domain/DomainEdit.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ watch(route, () => {
2525
const update = ref(0)
2626
2727
const ngx_config = reactive({
28-
filename: '',
28+
name: '',
2929
upstreams: [],
3030
servers: []
3131
})

frontend/src/views/domain/cert/Cert.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import ChangeCert from '@/views/domain/cert/ChangeCert.vue'
77
88
const {$gettext} = useGettext()
99
10-
const props = defineProps(['directivesMap', 'current_server_directives', 'enabled', 'cert_info'])
10+
const props = defineProps(['config_name', 'directivesMap', 'current_server_directives', 'enabled', 'cert_info'])
1111
1212
const emit = defineEmits(['callback', 'update:enabled'])
1313
@@ -38,6 +38,7 @@ const enabled = computed({
3838
<change-cert :directives-map="props.directivesMap"/>
3939

4040
<issue-cert
41+
:config_name="config_name"
4142
:current_server_directives="props.current_server_directives"
4243
:directives-map="props.directivesMap"
4344
v-model:enabled="enabled"

frontend/src/views/domain/cert/IssueCert.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<script setup lang="ts">
22
import {useGettext} from 'vue3-gettext'
3-
import {computed, h, nextTick, onMounted, ref, VNode, watch} from 'vue'
3+
import {computed, nextTick, ref, watch} from 'vue'
44
import {message} from 'ant-design-vue'
55
import domain from '@/api/domain'
66
import websocket from '@/lib/websocket'
77
import Template from '@/views/template/Template.vue'
88
99
const {$gettext, interpolate} = useGettext()
1010
11-
const props = defineProps(['directivesMap', 'current_server_directives', 'enabled'])
11+
const props = defineProps(['config_name', 'directivesMap', 'current_server_directives', 'enabled'])
1212
1313
const emit = defineEmits(['changeEnabled', 'callback', 'update:enabled'])
1414
@@ -50,7 +50,7 @@ function job() {
5050
})
5151
}
5252
}).then(() => {
53-
issue_cert(name.value, callback)
53+
issue_cert(props.config_name, name.value, callback)
5454
})
5555
}
5656
@@ -61,13 +61,13 @@ function callback(ssl_certificate: string, ssl_certificate_key: string) {
6161
6262
function change_auto_cert(r: boolean) {
6363
if (r) {
64-
domain.add_auto_cert(name.value).then(() => {
64+
domain.add_auto_cert(props.config_name).then(() => {
6565
message.success(interpolate($gettext('Auto-renewal enabled for %{name}'), {name: name.value}))
6666
}).catch(e => {
6767
message.error(e.message ?? interpolate($gettext('Enable auto-renewal failed for %{name}'), {name: name.value}))
6868
})
6969
} else {
70-
domain.remove_auto_cert(name.value).then(() => {
70+
domain.remove_auto_cert(props.config_name).then(() => {
7171
message.success(interpolate($gettext('Auto-renewal disabled for %{name}'), {name: name.value}))
7272
}).catch(e => {
7373
message.error(e.message ?? interpolate($gettext('Disable auto-renewal failed for %{name}'), {name: name.value}))
@@ -86,7 +86,7 @@ function log(msg: string) {
8686
(logContainer.value as any as Element).scroll({top: 320, left: 0, behavior: 'smooth'})
8787
}
8888
89-
const issue_cert = async (server_name: string, callback: Function) => {
89+
const issue_cert = async (config_name: string, server_name: string, callback: Function) => {
9090
progressStatus.value = 'active'
9191
modalClosable.value = false
9292
modalVisible.value = true
@@ -95,7 +95,7 @@ const issue_cert = async (server_name: string, callback: Function) => {
9595
9696
log($gettext('Getting the certificate, please wait...'))
9797
98-
const ws = websocket('/api/cert/issue', false)
98+
const ws = websocket(`/api/domain/${config_name}/cert`, false)
9999
100100
ws.onopen = () => {
101101
ws.send(JSON.stringify({

frontend/src/views/domain/ngx_conf/NgxConfigEditor.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ watch(current_server_index, () => {
168168
<template v-if="current_support_ssl&&enabled">
169169
<cert
170170
v-if="current_support_ssl"
171+
:config_name="ngx_config.name"
171172
:cert_info="props.cert_info?.[k]"
172173
:current_server_directives="current_server_directives"
173174
:directives-map="directivesMap"

frontend/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default defineConfig({
6666
server: {
6767
proxy: {
6868
'/api': {
69-
target: 'https://nginx.jackyu.cn/',
69+
target: 'http://127.0.0.1:9001/',
7070
changeOrigin: true,
7171
secure: false,
7272
ws: true

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ require (
3939
github.com/jpillora/s3 v1.1.4 // indirect
4040
github.com/json-iterator/go v1.1.9 // indirect
4141
github.com/leodido/go-urn v1.2.0 // indirect
42+
github.com/lib/pq v1.10.7 // indirect
4243
github.com/mattn/go-isatty v0.0.12 // indirect
4344
github.com/mattn/go-sqlite3 v1.14.5 // indirect
4445
github.com/miekg/dns v1.1.40 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvf
280280
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
281281
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
282282
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
283+
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
284+
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
283285
github.com/linode/linodego v0.25.3/go.mod h1:GSBKPpjoQfxEfryoCRcgkuUOCuVtGHWhzI8OMdycNTE=
284286
github.com/liquidweb/go-lwApi v0.0.0-20190605172801-52a4864d2738/go.mod h1:0sYF9rMXb0vlG+4SzdiGMXHheCZxjguMq+Zb4S2BfBs=
285287
github.com/liquidweb/go-lwApi v0.0.5/go.mod h1:0sYF9rMXb0vlG+4SzdiGMXHheCZxjguMq+Zb4S2BfBs=

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func prog(state overseer.State) {
5454
}
5555

5656
s := gocron.NewScheduler(time.UTC)
57-
job, err := s.Every(1).Hour().SingletonMode().Do(cert.AutoCert)
57+
job, err := s.Every(1).Minute().SingletonMode().Do(cert.AutoObtain)
5858

5959
if err != nil {
6060
log.Fatalf("AutoCert Job: %v, Err: %v\n", job, err)

0 commit comments

Comments
 (0)