fix: various small bugs

This commit is contained in:
Nicolas Meienberger 2022-09-06 13:52:19 +02:00
parent 655096a77f
commit 8ed04f07f4
7 changed files with 15 additions and 11 deletions

View file

@ -18,7 +18,7 @@
Tipi is a personal homeserver orchestrator. It is running docker containers under the hood and provides a simple web interface to manage them. Every service comes with an opinionated configuration in order to remove the need for manual configuration and network setup.
Check our demo instance : **95.179.210.152** / username: **user@runtipi.com** / password: **runtipi**
Check our demo instance : **[demo.runtipi.com](https://demo.runtipi.com)** / username: **user@runtipi.com** / password: **runtipi**
## Apps available
- [Adguard Home](https://github.com/AdguardTeam/AdGuardHome) - Adguard Home DNS adblocker

View file

@ -7,6 +7,7 @@ import { theme } from '../styles/theme';
import AuthWrapper from '../modules/Auth/containers/AuthWrapper';
import { ApolloProvider } from '@apollo/client';
import useCachedResources from '../hooks/useCachedRessources';
import Head from 'next/head';
function MyApp({ Component, pageProps }: AppProps) {
const { client } = useCachedResources();
@ -18,6 +19,9 @@ function MyApp({ Component, pageProps }: AppProps) {
return (
<ApolloProvider client={client}>
<ChakraProvider theme={theme}>
<Head>
<title>Tipi</title>
</Head>
<AuthWrapper>
<Component {...pageProps} />
</AuthWrapper>

View file

@ -8,7 +8,6 @@ export default function MyDocument() {
return (
<Html lang="en">
<Head>
<title>Tipi - Dashboard</title>
<link rel="apple-touch-icon" sizes="180x180" href={getUrl('apple-touch-icon.png')} />
<link rel="icon" type="image/png" sizes="32x32" href={getUrl('favicon-32x32.png')} />
<link rel="icon" type="image/png" sizes="16x16" href={getUrl('favicon-16x16.png')} />

View file

@ -6,12 +6,10 @@ import { COOKIE_MAX_AGE, __prod__ } from '../../config/constants/constants';
const getSessionMiddleware = () => {
const FileStore = SessionFileStore(session);
const sameSite = __prod__ ? 'lax' : 'none';
return session({
name: 'qid',
store: new FileStore(),
cookie: { maxAge: COOKIE_MAX_AGE, secure: false, sameSite, httpOnly: true },
cookie: { maxAge: COOKIE_MAX_AGE, secure: false, sameSite: 'none', httpOnly: true },
secret: config.JWT_SECRET,
resave: false,
saveUninitialized: false,

View file

@ -59,13 +59,13 @@ class App extends BaseEntity {
@Column({ type: 'boolean', default: false })
exposed!: boolean;
@Field(() => String)
@Field(() => String, { nullable: true })
@Column({ type: 'varchar', nullable: true })
domain?: string;
@Field(() => AppInfo, { nullable: true })
info(): AppInfo | null {
return getAppInfo(this.id);
return getAppInfo(this.id, this.status);
}
@Field(() => UpdateInfo, { nullable: true })

View file

@ -3,7 +3,7 @@ import { fileExists, getSeed, readdirSync, readFile, readJsonFile, runScript, wr
import InternalIp from 'internal-ip';
import crypto from 'crypto';
import config from '../../config';
import { AppInfo } from './apps.types';
import { AppInfo, AppStatusEnum } from './apps.types';
import logger from '../../config/logger/logger';
import App from './app.entity';
@ -131,11 +131,14 @@ export const getAvailableApps = async (): Promise<string[]> => {
return apps;
};
export const getAppInfo = (id: string): AppInfo | null => {
export const getAppInfo = (id: string, status?: AppStatusEnum): AppInfo | null => {
try {
const repoId = config.APPS_REPO_ID;
if (fileExists(`/apps/${id}/config.json`)) {
// Check if app is installed
const installed = typeof status !== 'undefined' && status !== AppStatusEnum.MISSING;
if (installed && fileExists(`/apps/${id}/config.json`)) {
const configFile: AppInfo = readJsonFile(`/apps/${id}/config.json`);
configFile.description = readFile(`/apps/${id}/metadata/description.md`).toString();
return configFile;

View file

@ -11,7 +11,7 @@ TIPI_VERSION=<tipi_version>
JWT_SECRET=<jwt_secret>
ROOT_FOLDER_HOST=<root_folder>
NGINX_PORT=<nginx_port>
NGINX_PORT=<nginx_port_ssl>
NGINX_PORT_SSL=<nginx_port_ssl>
PROXY_PORT=<proxy_port>
POSTGRES_PASSWORD=<postgres_password>
DOMAIN=<domain>