mirror of
https://github.com/pockethost/pockethost.git
synced 2026-03-13 20:05:10 +00:00
fix: use internal mothership address for FTP
This commit is contained in:
@@ -47,6 +47,7 @@ export const SETTINGS = {
|
||||
|
||||
MOTHERSHIP_URL: mkString(`https://pockethost-central.pockethost.io`),
|
||||
MOTHERSHIP_NAME: mkString(`pockethost-central`),
|
||||
MOTHERSHIP_INTERNAL_HOST: mkString(`localhost`),
|
||||
MOTHERSHIP_ADMIN_USERNAME: mkString(),
|
||||
MOTHERSHIP_ADMIN_PASSWORD: mkString(),
|
||||
MOTHERSHIP_MIGRATIONS_DIR: mkPath(
|
||||
@@ -168,6 +169,8 @@ export const DAEMON_PB_PORT_BASE = () => settings().DAEMON_PB_PORT_BASE
|
||||
export const DAEMON_PB_IDLE_TTL = () => settings().DAEMON_PB_IDLE_TTL
|
||||
|
||||
export const MOTHERSHIP_URL = () => settings().MOTHERSHIP_URL
|
||||
export const MOTHERSHIP_INTERNAL_HOST = () =>
|
||||
settings().MOTHERSHIP_INTERNAL_HOST
|
||||
export const MOTHERSHIP_NAME = () => settings().MOTHERSHIP_NAME
|
||||
export const MOTHERSHIP_ADMIN_USERNAME = () =>
|
||||
settings().MOTHERSHIP_ADMIN_USERNAME
|
||||
@@ -206,6 +209,8 @@ export const INSTANCE_APP_MIGRATIONS_DIR = () =>
|
||||
* Helpers
|
||||
*/
|
||||
export const MOTHERSHIP_DATA_ROOT = () => INSTANCE_DATA_ROOT(MOTHERSHIP_NAME())
|
||||
export const MOTHERSHIP_INTERNAL_URL = () =>
|
||||
`http://${MOTHERSHIP_INTERNAL_HOST()}:${MOTHERSHIP_PORT()}`
|
||||
export const INSTANCE_DATA_ROOT = (id: InstanceId) => join(DATA_ROOT(), id)
|
||||
export const INSTANCE_DATA_DB = (id: InstanceId) =>
|
||||
join(DATA_ROOT(), id, `pb_data`, `data.db`)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
MOTHERSHIP_URL,
|
||||
MOTHERSHIP_INTERNAL_URL,
|
||||
PH_FTP_PASV_IP,
|
||||
PH_FTP_PASV_PORT_MAX,
|
||||
PH_FTP_PASV_PORT_MIN,
|
||||
@@ -61,7 +61,7 @@ export const ftpService = mkSingleton((config: FtpConfig) => {
|
||||
ftpServer.on(
|
||||
'login',
|
||||
async ({ connection, username, password }, resolve, reject) => {
|
||||
const client = new pocketbaseEs(MOTHERSHIP_URL())
|
||||
const client = new pocketbaseEs(MOTHERSHIP_INTERNAL_URL())
|
||||
try {
|
||||
await client.collection('users').authWithPassword(username, password)
|
||||
dbg(`Logged in`)
|
||||
|
||||
Reference in New Issue
Block a user