diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml new file mode 100644 index 000000000..b0c246ede --- /dev/null +++ b/.github/workflows/fly-deploy.yml @@ -0,0 +1,18 @@ +# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ + +name: Fly Deploy +on: + push: + branches: + - main +jobs: + deploy: + name: Deploy app + runs-on: ubuntu-latest + concurrency: deploy-group # optional: ensure only one action runs at a time + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/Dockerfile b/Dockerfile index ac4251e6c..99cbdb310 100644 --- a/Dockerfile +++ b/Dockerfile @@ -97,5 +97,6 @@ CMD echo "Listing contents of /app/app/mcp before starting server:" && \ cat /etc/proxychains.conf; \ proxychains -f $conf node server.js; \ else \ + export HOSTNAME="0.0.0.0"; \ node server.js; \ fi diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 828beabc9..c0d2580cd 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -25,7 +25,6 @@ import CancelIcon from "../icons/cancel.svg"; import StopIcon from "../icons/pause.svg"; import McpToolIcon from "../icons/tool.svg"; import { - BOT_HELLO, ChatMessage, createMessage, DEFAULT_TOPIC, @@ -1056,54 +1055,22 @@ function _Chat() { return session.mask.hideContext ? [] : session.mask.context.slice(); }, [session.mask.context, session.mask.hideContext]); - if ( - context.length === 0 && - session.messages.at(0)?.content !== BOT_HELLO.content - ) { - const copiedHello = Object.assign({}, BOT_HELLO); - if (!accessStore.isAuthorized()) { - copiedHello.content = Locale.Error.Unauthorized; - } - context.push(copiedHello); - } - // preview messages const renderMessages = useMemo(() => { - return context - .concat(session.messages as RenderMessage[]) - .concat( - isLoading - ? [ - { - ...createMessage({ - role: "assistant", - content: "……", - }), - preview: true, - }, - ] - : [], - ) - .concat( - userInput.length > 0 && config.sendPreviewBubble - ? [ - { - ...createMessage({ - role: "user", - content: userInput, - }), - preview: true, - }, - ] - : [], - ); - }, [ - config.sendPreviewBubble, - context, - isLoading, - session.messages, - userInput, - ]); + return context.concat(session.messages as RenderMessage[]).concat( + isLoading + ? [ + { + ...createMessage({ + role: "assistant", + content: "……", + }), + preview: true, + }, + ] + : [], + ); + }, [context, isLoading, session.messages, userInput]); const [msgRenderIndex, _setMsgRenderIndex] = useState( Math.max(0, renderMessages.length - CHAT_PAGE_SIZE), diff --git a/fly.toml b/fly.toml new file mode 100644 index 000000000..af3cca73a --- /dev/null +++ b/fly.toml @@ -0,0 +1,22 @@ +# fly.toml app configuration file generated for canyon-humctl-interface-aged-water-4445 on 2025-04-09T18:42:54+02:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'canyon-humctl-interface-aged-water-4445' +primary_region = 'ams' + +[build] + +[http_service] + internal_port = 3000 + force_https = true + auto_stop_machines = 'stop' + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '1gb' + cpu_kind = 'shared' + cpus = 1