tripweb/docs/assets/js/009f1e98.6f61e663.js
2025-11-04 23:33:29 +01:00

1 line
11 KiB
JavaScript

"use strict";(globalThis.webpackChunktripdocs=globalThis.webpackChunktripdocs||[]).push([[715],{3511:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>h,frontMatter:()=>o,metadata:()=>t,toc:()=>l});const t=JSON.parse('{"id":"getting-started/configuration","title":"Configuration","description":"Configure TRIP","source":"@site/docs/getting-started/configuration.md","sourceDirName":"getting-started","slug":"/getting-started/configuration","permalink":"/trip/docs/getting-started/configuration","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":2,"frontMatter":{"sidebar_position":2,"description":"Configure TRIP"},"sidebar":"docSidebar","previous":{"title":"Deployment","permalink":"/trip/docs/getting-started/deploy"},"next":{"title":"Map Tracker","permalink":"/trip/docs/category/map-tracker"}}');var s=i(4848),r=i(8453);const o={sidebar_position:2,description:"Configure TRIP"},c="Configuration",a={},l=[{value:"General",id:"general",level:2},{value:"Image default size",id:"image-default-size",level:3},{value:"Map defaults",id:"map-defaults",level:3},{value:"Attachment max size",id:"attachment-max-size",level:3},{value:"Files and folders",id:"files-and-folders",level:3},{value:"Authentication",id:"authentication",level:2},{value:"Token duration",id:"token-duration",level:3},{value:"OIDC Auth",id:"oidc-auth",level:3},{value:"Disable registration",id:"disable-registration",level:3},{value:"Troubleshoot SSL Error / Certificate <a></a>",id:"troubleshoot-ssl-error--certificate-",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"configuration",children:"Configuration"})}),"\n",(0,s.jsxs)(n.p,{children:["You can modify the configuration by setting values in the ",(0,s.jsx)(n.code,{children:"storage/config.yml"})," file."]}),"\n",(0,s.jsx)(n.admonition,{type:"warning",children:(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"config.yml"})," file is not created automatically because the server uses default values. After editing ",(0,s.jsx)(n.code,{children:"config.yml"}),", restart the container for the changes to take effect."]})}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsxs)(n.p,{children:["Setting environment variable in ",(0,s.jsx)(n.code,{children:"docker-compose.yml"})," also work. e.g."]}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",children:'environment:\n REGISTER_ENABLE: "false"\n'})})]}),"\n",(0,s.jsx)(n.h2,{id:"general",children:"General"}),"\n",(0,s.jsx)(n.h3,{id:"image-default-size",children:"Image default size"}),"\n",(0,s.jsxs)(n.p,{children:["By default, images are resized to ",(0,s.jsx)(n.code,{children:"500px"})," for places and ",(0,s.jsx)(n.code,{children:"600px"})," for trips. You can override these default values by setting them in the ",(0,s.jsx)(n.code,{children:"config.yml"}),":"]}),"\n",(0,s.jsx)(n.admonition,{type:"warning",children:(0,s.jsx)(n.p,{children:"Higher numbers will lead to higher disk usage."})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",metastring:'title="storage/config.yml"',children:"PLACE_IMAGE_SIZE=500\nTRIP_IMAGE_SIZE=600\n"})}),"\n",(0,s.jsx)(n.h3,{id:"map-defaults",children:"Map defaults"}),"\n",(0,s.jsxs)(n.p,{children:["You can configure the default values for new users with the following settings: ",(0,s.jsx)(n.code,{children:"DEFAULT_TILE"}),", ",(0,s.jsx)(n.code,{children:"DEFAULT_CURRENCY"}),", ",(0,s.jsx)(n.code,{children:"DEFAULT_MAP_LAT"}),", ",(0,s.jsx)(n.code,{children:"DEFAULT_MAP_LNG"}),"."]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"DEFAULT_TILE"}),": default map tile layer URL"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"DEFAULT_CURRENCY"}),": default currency symbol"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"DEFAULT_MAP_LAT"}),": default latitude when opening TRIP"]}),"\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.code,{children:"DEFAULT_MAP_LNG"}),": default longitude when opening TRIP"]}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"warning",children:(0,s.jsx)(n.p,{children:"Changing these values does not update settings for existing users, it only affects new users."})}),"\n",(0,s.jsx)(n.h3,{id:"attachment-max-size",children:"Attachment max size"}),"\n",(0,s.jsxs)(n.p,{children:["Trips hold attachments, the default size for them is ",(0,s.jsx)(n.em,{children:"10 MB"}),"."]}),"\n",(0,s.jsx)(n.admonition,{type:"warning",children:(0,s.jsxs)(n.p,{children:["You might need to change your webserver maximum body size as well (e.g. ",(0,s.jsx)(n.em,{children:"Nginx"}),": ",(0,s.jsx)(n.code,{children:"client_max_body_size"}),", ",(0,s.jsx)(n.em,{children:"Caddy"}),": ",(0,s.jsx)(n.code,{children:"request_body"}),", etc.)"]})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",metastring:'title="storage/config.yml"',children:"ATTACHMENT_MAX_SIZE=10485760 # 10 MB\n"})}),"\n",(0,s.jsx)(n.h3,{id:"files-and-folders",children:"Files and folders"}),"\n",(0,s.jsxs)(n.p,{children:["Inside your ",(0,s.jsx)(n.code,{children:"storage"})," directory, TRIP uses 4 folders: ",(0,s.jsx)(n.code,{children:"attachments"}),", ",(0,s.jsx)(n.code,{children:"backups"}),", ",(0,s.jsx)(n.code,{children:"assets"}),", ",(0,s.jsx)(n.code,{children:"frontend"})," and one file ",(0,s.jsx)(n.code,{children:"trip.sqlite"}),". Their path can be changed if needed:"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",metastring:'title="storage/config.yml"',children:'ATTACHMENTS_FOLDER="storage/attachments"\nBACKUPS_FOLDER="storage/backups"\nASSETS_FOLDER="storage/assets"\nFRONTEND_FOLDER="frontend"\nSQLITE_FILE="storage/trip.sqlite"\n'})}),"\n",(0,s.jsx)(n.h2,{id:"authentication",children:"Authentication"}),"\n",(0,s.jsx)(n.h3,{id:"token-duration",children:"Token duration"}),"\n",(0,s.jsxs)(n.p,{children:["To modify the token lifespan, edit ",(0,s.jsx)(n.code,{children:"ACCESS_TOKEN_EXPIRE_MINUTES"})," for the ",(0,s.jsx)(n.em,{children:"Access Token"})," and ",(0,s.jsx)(n.code,{children:"REFRESH_TOKEN_EXPIRE_MINUTES"})," for the ",(0,s.jsx)(n.em,{children:"Refresh Token"}),".\nBy default, the ",(0,s.jsx)(n.em,{children:"Refresh Token"})," expires after ",(0,s.jsx)(n.code,{children:"1440"})," minutes (24 hours), and the ",(0,s.jsx)(n.em,{children:"Access Token"})," after ",(0,s.jsx)(n.code,{children:"30"})," minutes."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",metastring:'title="storage/config.yml"',children:"ACCESS_TOKEN_EXPIRE_MINUTES=30\nREFRESH_TOKEN_EXPIRE_MINUTES=1440\n"})}),"\n",(0,s.jsx)(n.h3,{id:"oidc-auth",children:"OIDC Auth"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",metastring:'title="storage/config.yml"',children:'OIDC_DISCOVERY_URL="https://sso.yourdomain.lan/.well-known/openid-configuration"\nOIDC_CLIENT_ID="your-client-id"\nOIDC_CLIENT_SECRET="your-client-secret"\nOIDC_REDIRECT_URI="https://trip.yourdomain.lan/auth"\n'})}),"\n",(0,s.jsx)(n.admonition,{type:"warning",children:(0,s.jsxs)(n.p,{children:["You might face a ",(0,s.jsx)(n.code,{children:"SSLError"})," / ",(0,s.jsx)(n.code,{children:"CERTIFICATE_VERIFY_FAILED"}),". I invite you to check ",(0,s.jsx)(n.a,{href:"#tbshoot-cert",children:"Troubleshoot SSL Error"})," section"]})}),"\n",(0,s.jsx)(n.h3,{id:"disable-registration",children:"Disable registration"}),"\n",(0,s.jsxs)(n.p,{children:["The key ",(0,s.jsx)(n.code,{children:"REGISTER_ENABLE"})," can be configured to ",(0,s.jsx)(n.code,{children:"false"})," if you want to disable registration."]}),"\n",(0,s.jsxs)(n.p,{children:[(0,s.jsx)(n.strong,{children:"To disable"}),", add this in your ",(0,s.jsx)(n.code,{children:"config.yml"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-yaml",metastring:'title="storage/config.yml"',children:"REGISTER_ENABLE=false\n"})}),"\n",(0,s.jsxs)(n.h2,{id:"troubleshoot-ssl-error--certificate-",children:["Troubleshoot SSL Error / Certificate ",(0,s.jsx)("a",{name:"tbshoot-cert"})]}),"\n",(0,s.jsx)(n.p,{children:"One way to check if you're concerned by this is simply doing the following and checking the result:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-dockerfile",children:'$ docker run --rm -it ghcr.io/itskovacs/trip:1 /bin/bash\n$ python3\n>>> import httpx\n>>> httpx.get("https://sso.yourdomain.lan/")\n'})}),"\n",(0,s.jsx)(n.p,{children:"In case you're facing this issue, it's likely due to the fact that the container does not trust you custom certificate."}),"\n",(0,s.jsx)(n.p,{children:"To fix this, I recommend you to build your own image with the certificate, based on the latest package."}),"\n",(0,s.jsx)(n.p,{children:"Pull the latest TRIP image."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"docker pull ghcr.io/itskovacs/trip:1\n"})}),"\n",(0,s.jsxs)(n.p,{children:["Create a file named ",(0,s.jsx)(n.code,{children:"Dockerfile"})," in your TRIP directory to copy your CA certificate in a custom TRIP image."]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:"# Use latest TRIP image\nFROM ghcr.io/itskovacs/trip:1\n\n# Copy your CA certificate file in the image. Replace myCA.crt with your certificate name.\nCOPY myCA.crt /usr/local/share/ca-certificates/\nRUN update-ca-certificates\n"})}),"\n",(0,s.jsx)(n.p,{children:"Then, simply build the image:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"docker build -t trip-custom-cert .\n"})}),"\n",(0,s.jsxs)(n.p,{children:["When you want to run TRIP, you just have to use your newly created image ",(0,s.jsx)(n.code,{children:"trip-custom-cert"}),":"]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"docker run -p 8080:8000 -v ./storage:/app/storage trip-custom-cert\n"})}),"\n",(0,s.jsxs)(n.admonition,{type:"note",children:[(0,s.jsx)(n.p,{children:"On TRIP update, simply re-create your custom image:"}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{children:"docker pull ghcr.io/itskovacs/trip:1\ndocker build -t trip-custom-cert .\n"})})]})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>c});var t=i(6540);const s={},r=t.createContext(s);function o(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]);