修改配置

This commit is contained in:
05412 2024-08-16 11:53:48 +08:00
parent bce01535dd
commit c9df251998
6 changed files with 44 additions and 12 deletions

View File

@ -2,4 +2,4 @@ FROM alpine:latest
RUN sed -i 's@dl-cdn.alpinelinux.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apk/repositories \ RUN sed -i 's@dl-cdn.alpinelinux.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apk/repositories \
&& apk add --no-cache nginx && apk add --no-cache nginx
CMD ["nginx"] CMD ["nginx", "-g", "daemon off;"]

View File

@ -7,7 +7,8 @@ services:
- "127.0.0.1:80:11451" - "127.0.0.1:80:11451"
volumes: volumes:
- "./dist:/usr/share/nginx/html:ro" - "./dist:/usr/share/nginx/html:ro"
- "./nginx.conf:/etc/nginx/nginx.conf" - "./nginx.conf:/etc/nginx/nginx.conf:ro"
- "nginx_logs:/var/log/nginx:rw"
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/health"] test: ["CMD", "curl", "-f", "http://localhost/health"]
@ -20,3 +21,6 @@ services:
networks: networks:
surl-network: surl-network:
external: false external: false
volumes:
nginx_logs:
external: false

View File

@ -6,6 +6,8 @@
<link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="32x32" href="/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png"> <link rel="icon" type="image/png" sizes="16x16" href="/icons/favicon-16x16.png">
<link rel="manifest" href="manifest.json"> <link rel="manifest" href="manifest.json">
<!-- disable cache -->
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>S-URL services</title> <title>S-URL services</title>
</head> </head>

View File

@ -1,9 +1,9 @@
#user nobody; #user nobody;
worker_processes auto; worker_processes auto;
daemon off; # daemon off;
#error_log logs/error.log; error_log logs/error.log;
#error_log logs/error.log notice; #error_log logs/error.log notice;
#error_log logs/error.log info; #error_log logs/error.log info;
@ -19,11 +19,11 @@ http {
include mime.types; include mime.types;
default_type application/octet-stream; default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" ' log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" ' '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main; access_log logs/access.log main;
sendfile on; sendfile on;
#tcp_nopush on; #tcp_nopush on;
@ -41,8 +41,8 @@ http {
root /usr/share/nginx/html; root /usr/share/nginx/html;
#charset koi8-r; #charset koi8-r;
#access_log logs/host.access.log main; # access_log logs/host.access.log main;
access_log off; # access_log off;
location / { location / {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }

View File

@ -1,5 +1,19 @@
<script setup lang="ts"> <script setup lang="ts">
import { useLocale } from "vuetify"; import { useLocale } from "vuetify";
import { useUserinfoStore } from "../../stores/userinfo-store";
import { checkLogin } from "../../script/functions";
import { ref } from "vue";
const userinfoStore = useUserinfoStore()
const showLoginPrompt = ref(false)
!async function () {
showLoginPrompt.value = !await checkLogin()
if (showLoginPrompt.value) userinfoStore.clearToken()
}()
function jumpToHome() {
location.href = "/"
}
const { t } = useLocale() const { t } = useLocale()
</script> </script>
@ -38,6 +52,15 @@ const { t } = useLocale()
</v-sheet> </v-sheet>
</v-col> </v-col>
</v-row> </v-row>
<v-dialog v-model="showLoginPrompt" width="450">
<v-card>
<v-card-title> notice </v-card-title>
<v-card-text>you need to login</v-card-text>
<v-card-actions>
<v-btn @click="jumpToHome">ok</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template> </template>
<style scoped></style> <style scoped></style>

View File

@ -1,4 +1,4 @@
import {createRouter, createWebHistory} from "vue-router"; import {createRouter, createWebHistory, RouteRecordRaw} from "vue-router";
import Login from "./components/views/LoginView.vue"; import Login from "./components/views/LoginView.vue";
import InputBox from "./components/items/InputBox.vue"; import InputBox from "./components/items/InputBox.vue";
import IntroView from "./components/views/IntroView.vue"; import IntroView from "./components/views/IntroView.vue";
@ -11,7 +11,7 @@ import Security from "./components/items/Security.vue";
import UrlManagement from "./components/items/UrlManagement.vue"; import UrlManagement from "./components/items/UrlManagement.vue";
import UrlAdd from "./components/items/UrlAdd.vue"; import UrlAdd from "./components/items/UrlAdd.vue";
const routes = [ const routes: RouteRecordRaw[] = [
{ {
path: '/', path: '/',
component: IntroView component: IntroView
@ -47,6 +47,9 @@ const routes = [
}, { }, {
path: '/404', path: '/404',
component: NotFound component: NotFound
}, {
path: '/:pathMatch(.*)*',
redirect: '/404'
} }
] ]
export const router = createRouter({ export const router = createRouter({