Skip to content

Commit

Permalink
Fixes for onion rootpath
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNaif2018 committed Aug 14, 2022
1 parent 453278a commit 49c17da
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export const actions = {
SOCKS_PROXY: env.SOCKS_PROXY,
onionURL: env.ONION_API_URL || (onionURL ? onionURL.trim() : null),
onionHost: env.ONION_HOST,
rootPath: env.ROOTPATH,
})
if (req) {
commit("onion", req.headers.host.toLowerCase().endsWith(".onion"))
Expand Down Expand Up @@ -135,10 +136,14 @@ export const actions = {
}

export const getters = {
onionURL({ services, path, env }) {
if (env.onionHost) return env.onionHost + path
onionHost({ services, env }) {
if (env.onionHost) return env.onionHost
const service = services["BitcartCC Admin Panel"]
return service ? service.hostname + path : ""
return service ? service.hostname : ""
},
onionURL({ env, path }, { onionHost }) {
const rootPath = env.rootPath === "/" ? "" : env.rootPath
return onionHost ? onionHost + rootPath + path : ""
},
apiOnionURL({ services, env }) {
if (env.onionURL) return env.onionURL
Expand Down

0 comments on commit 49c17da

Please sign in to comment.