refactor: add logs volume to retrive logs as files
refactor(url-helper.ts): remove empty block statement
This commit is contained in:
parent
b5fdac47c8
commit
ddfc6eff34
9 changed files with 14 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,6 +1,7 @@
|
|||
*.swo
|
||||
*.swp
|
||||
|
||||
logs
|
||||
.pnpm-debug.log
|
||||
.env*
|
||||
github.secrets
|
||||
|
|
|
@ -55,6 +55,7 @@ services:
|
|||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- ${PWD}:/runtipi
|
||||
- ${PWD}/packages/system-api/src:/api/src
|
||||
- ${PWD}/logs:/api/logs
|
||||
# - /api/node_modules
|
||||
environment:
|
||||
INTERNAL_IP: ${INTERNAL_IP}
|
||||
|
|
|
@ -47,11 +47,11 @@ services:
|
|||
## Docker sock
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- ${PWD}:/runtipi
|
||||
- ${PWD}/logs:/api/logs
|
||||
environment:
|
||||
INTERNAL_IP: ${INTERNAL_IP}
|
||||
TIPI_VERSION: ${TIPI_VERSION}
|
||||
JWT_SECRET: ${JWT_SECRET}
|
||||
ROOT_FOLDER_HOST: ${ROOT_FOLDER_HOST}
|
||||
NGINX_PORT: ${NGINX_PORT}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_USERNAME: tipi
|
||||
|
|
|
@ -47,11 +47,11 @@ services:
|
|||
## Docker sock
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- ${PWD}:/runtipi
|
||||
- ${PWD}/logs:/api/logs
|
||||
environment:
|
||||
INTERNAL_IP: ${INTERNAL_IP}
|
||||
TIPI_VERSION: ${TIPI_VERSION}
|
||||
JWT_SECRET: ${JWT_SECRET}
|
||||
ROOT_FOLDER_HOST: ${ROOT_FOLDER_HOST}
|
||||
NGINX_PORT: ${NGINX_PORT}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_USERNAME: tipi
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
export const getUrl = (url: string) => {
|
||||
const domain = process.env.NEXT_PUBLIC_DOMAIN;
|
||||
let prefix = '';
|
||||
|
||||
prefix = 'dashboard';
|
||||
if (domain !== 'tipi.localhost') {
|
||||
}
|
||||
let prefix = 'dashboard';
|
||||
|
||||
return `/${prefix}/${url}`;
|
||||
};
|
||||
|
|
|
@ -70,7 +70,6 @@ export const updateV040 = async (): Promise<void> => {
|
|||
await Update.create({ name: UPDATE_NAME, status: UpdateStatusEnum.SUCCESS }).save();
|
||||
} catch (error) {
|
||||
logger.error(error);
|
||||
console.error(error);
|
||||
await Update.create({ name: UPDATE_NAME, status: UpdateStatusEnum.FAILED }).save();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
import Logger from '../config/logger/logger';
|
||||
import { runScript } from '../modules/fs/fs.helpers';
|
||||
|
||||
export const updateRepo = (repo: string): Promise<void> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
runScript('/scripts/git.sh', ['update', repo], (err: string, stdout: string) => {
|
||||
if (err) {
|
||||
Logger.error(`Error updating repo: ${err}`);
|
||||
reject(err);
|
||||
}
|
||||
|
||||
console.info('Update result', stdout);
|
||||
Logger.info(`Update resul: ${stdout}`);
|
||||
|
||||
resolve();
|
||||
});
|
||||
|
@ -18,10 +20,11 @@ export const cloneRepo = (repo: string): Promise<void> => {
|
|||
return new Promise((resolve, reject) => {
|
||||
runScript('/scripts/git.sh', ['clone', repo], (err: string, stdout: string) => {
|
||||
if (err) {
|
||||
Logger.error(`Error cloning repo: ${err}`);
|
||||
reject(err);
|
||||
}
|
||||
|
||||
console.info('Clone result', stdout);
|
||||
Logger.info(`Clone result ${stdout}`);
|
||||
|
||||
resolve();
|
||||
});
|
||||
|
|
|
@ -96,10 +96,9 @@ const main = async () => {
|
|||
startJobs();
|
||||
// Start apps
|
||||
appsService.startAllApps();
|
||||
console.info(`Server running on port ${port} 🚀 Production => ${__prod__}`);
|
||||
logger.info(`Server running on port ${port} 🚀 Production => ${__prod__}`);
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
logger.error(error);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -157,6 +157,9 @@ if [[ -f "/etc/resolv.conf" ]]; then
|
|||
TEMP=$(grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' /etc/resolv.conf | head -n 1)
|
||||
fi
|
||||
|
||||
# Clean logs folder
|
||||
rm -rf "${ROOT_FOLDER}/logs/*"
|
||||
|
||||
# Create seed file with cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
|
||||
if [[ ! -f "${STATE_FOLDER}/seed" ]]; then
|
||||
echo "Generating seed..."
|
||||
|
|
Loading…
Add table
Reference in a new issue