diff --git a/.github/workflows/push_on_master.yaml b/.github/workflows/push_on_master.yaml index 2318966a..955dd063 100644 --- a/.github/workflows/push_on_master.yaml +++ b/.github/workflows/push_on_master.yaml @@ -31,10 +31,10 @@ jobs: run: | # if we're running from a tag, get the full list of distros; otherwise just use debian:sid dists='["debian:bookworm"]' - tags="latest $GITHUB_SHA" + tags="master $GITHUB_SHA" if [[ $GITHUB_REF == refs/tags/* ]]; then dists=$(tools/build_debian_packages.py --show-dists-json) - tags="latest $GITHUB_SHA latest-release $GITHUB_REF_NAME" + tags="master $GITHUB_SHA latest latest-release $GITHUB_REF_NAME" fi echo "::set-output name=distros::$dists" echo "::set-output name=tags::$tags" diff --git a/.gitignore b/.gitignore index 29d7a114..a4a00f37 100644 --- a/.gitignore +++ b/.gitignore @@ -123,5 +123,6 @@ Sessionx.vim [._]*.un~ ### Docker ### +.env docker-compose.yaml docker-compose.yml diff --git a/abrechnung/database/revisions/0017_clean_non_nullable_strings.sql b/abrechnung/database/revisions/0017_clean_non_nullable_strings.sql new file mode 100644 index 00000000..300e6c92 --- /dev/null +++ b/abrechnung/database/revisions/0017_clean_non_nullable_strings.sql @@ -0,0 +1,7 @@ +-- revision: 04424b59 +-- requires: a83f4798 + +alter table transaction_history alter column description set default ''; +alter table transaction_history alter column description set not null; + +alter table grp alter column created_by set not null; \ No newline at end of file diff --git a/docker/Dockerfile-api b/docker/Dockerfile-api index 4f379228..8a09fe39 100644 --- a/docker/Dockerfile-api +++ b/docker/Dockerfile-api @@ -12,4 +12,4 @@ ADD --chmod=644 --chown=abrechnung:abrechnung config/abrechnung.yaml /etc/abrech ADD --chmod=755 ./docker/entrypoint.py / COPY --chown=abrechnung:abrechnung ./docker/crontab /var/spool/cron/crontabs/abrechnung USER abrechnung -ENTRYPOINT ["/opt/abrechnung-venv/bin/python3", "/entrypoint.py"] \ No newline at end of file +ENTRYPOINT ["/opt/abrechnung-venv/bin/python3", "-u", "/entrypoint.py"] \ No newline at end of file diff --git a/docker/entrypoint.py b/docker/entrypoint.py index 47954135..09c51898 100644 --- a/docker/entrypoint.py +++ b/docker/entrypoint.py @@ -67,16 +67,15 @@ def to_bool(data: str): with open("/etc/abrechnung/abrechnung.yaml", "w", encoding="utf-8") as file: file.write(output) print("config done") -sys.stdout.flush() + if sys.argv[1] == "api": - print("migrating") - sys.stdout.flush() - subprocess.run([abrechnung_venv_python, "-m", "abrechnung", "db", "migrate"], shell=True, check=True) + print("migrating ...") + subprocess.run([abrechnung_venv_python, "-m", "abrechnung", "-vvv", "db", "migrate"], check=True, stdout=sys.stdout) print("migrated") + if sys.argv[1] == "cron": print("running cron...") - sys.stdout.flush() execlp("crond", "crond", "-f") + print(f"starting abrechnung with forwarded argv {sys.argv}") -sys.stdout.flush() execvp(abrechnung_venv_python, [abrechnung_venv_python, "-m", "abrechnung"] + sys.argv[1:]) diff --git a/frontend/apps/mobile/.gitignore b/frontend/apps/mobile/.gitignore index e69de29b..f40fe050 100644 --- a/frontend/apps/mobile/.gitignore +++ b/frontend/apps/mobile/.gitignore @@ -0,0 +1 @@ +assets \ No newline at end of file diff --git a/frontend/apps/mobile/project.json b/frontend/apps/mobile/project.json index 35a0d87f..010792e2 100644 --- a/frontend/apps/mobile/project.json +++ b/frontend/apps/mobile/project.json @@ -4,9 +4,16 @@ "sourceRoot": "apps/mobile/src", "projectType": "application", "targets": { + "collect-assets": { + "executor": "nx:run-commands", + "options": { + "commands": ["mkdir -p apps/mobile/src/assets", "cp -rf assets/* apps/mobile/src/assets/"], + "parallel": false + } + }, "start": { "executor": "@nx/react-native:start", - "dependsOn": ["ensure-symlink", "sync-deps", "pod-install"], + "dependsOn": ["ensure-symlink", "sync-deps", "pod-install", "collect-assets"], "options": { "port": 8081 } @@ -19,12 +26,12 @@ }, "run-ios": { "executor": "@nx/react-native:run-ios", - "dependsOn": ["ensure-symlink", "sync-deps", "pod-install"], + "dependsOn": ["ensure-symlink", "sync-deps", "pod-install", "collect-assets"], "options": {} }, "bundle-ios": { "executor": "@nx/react-native:bundle", - "dependsOn": ["ensure-symlink"], + "dependsOn": ["ensure-symlink", "collect-assets"], "outputs": ["{options.bundleOutput}"], "options": { "entryFile": "src/main.tsx", @@ -34,7 +41,7 @@ }, "run-android": { "executor": "@nx/react-native:run-android", - "dependsOn": ["ensure-symlink", "sync-deps"], + "dependsOn": ["ensure-symlink", "sync-deps", "collect-assets"], "options": {} }, "build-android": { @@ -43,13 +50,13 @@ "{projectRoot}/android/app/build/outputs/bundle", "{projectRoot}/android/app/build/outputs/apk" ], - "dependsOn": ["ensure-symlink", "sync-deps"], + "dependsOn": ["ensure-symlink", "sync-deps", "collect-assets"], "options": {} }, "build-ios": { "executor": "@nx/react-native:build-ios", "outputs": ["{projectRoot}/ios/build/Build"], - "dependsOn": ["ensure-symlink", "sync-deps", "pod-install"], + "dependsOn": ["ensure-symlink", "sync-deps", "pod-install", "collect-assets"], "options": {} }, "pod-install": { @@ -58,7 +65,7 @@ }, "bundle-android": { "executor": "@nx/react-native:bundle", - "dependsOn": ["ensure-symlink"], + "dependsOn": ["ensure-symlink", "collect-assets"], "outputs": ["{options.bundleOutput}"], "options": { "entryFile": "src/main.tsx", diff --git a/frontend/apps/mobile/src/App.tsx b/frontend/apps/mobile/src/App.tsx index 5238ae5a..6e5ef693 100644 --- a/frontend/apps/mobile/src/App.tsx +++ b/frontend/apps/mobile/src/App.tsx @@ -15,10 +15,10 @@ import { SafeAreaProvider } from "react-native-safe-area-context"; import MaterialIcons from "react-native-vector-icons/MaterialIcons"; import { ApiProvider } from "./core/ApiProvider"; import { createApi } from "./core/api"; -import useColorScheme from "./hooks/useColorScheme"; +import { useColorScheme } from "./hooks/useColorScheme"; import { Navigation } from "./navigation"; import { NotificationProvider } from "./notifications"; -import SplashScreen from "./screens/SplashScreen"; +import { SplashScreen } from "./screens/SplashScreen"; import { selectAuthSlice, selectSettingsSlice, diff --git a/frontend/apps/mobile/src/AppWrapper.tsx b/frontend/apps/mobile/src/AppWrapper.tsx index 039e0056..7a263e95 100644 --- a/frontend/apps/mobile/src/AppWrapper.tsx +++ b/frontend/apps/mobile/src/AppWrapper.tsx @@ -3,7 +3,7 @@ import "react-native-gesture-handler"; import { Provider } from "react-redux"; import { PersistGate } from "redux-persist/integration/react"; import { App } from "./App"; -import SplashScreen from "./screens/SplashScreen"; +import { SplashScreen } from "./screens/SplashScreen"; import { persistor, store } from "./store"; export const AppWrapper: React.FC = () => { diff --git a/frontend/apps/mobile/src/hooks/useColorScheme.ts b/frontend/apps/mobile/src/hooks/useColorScheme.ts index 7efaf238..814cb60f 100644 --- a/frontend/apps/mobile/src/hooks/useColorScheme.ts +++ b/frontend/apps/mobile/src/hooks/useColorScheme.ts @@ -6,5 +6,3 @@ import { ColorSchemeName, useColorScheme as _useColorScheme } from "react-native export const useColorScheme = (): NonNullable => { return _useColorScheme() as NonNullable; }; - -export default useColorScheme; diff --git a/frontend/apps/mobile/src/screens/Login.tsx b/frontend/apps/mobile/src/screens/Login.tsx index 37f5909a..b3029dca 100644 --- a/frontend/apps/mobile/src/screens/Login.tsx +++ b/frontend/apps/mobile/src/screens/Login.tsx @@ -12,6 +12,7 @@ import { RootDrawerScreenProps } from "../navigation/types"; import { notify } from "../notifications"; import { useAppDispatch } from "../store"; import { useTranslation } from "react-i18next"; +import LogoSvg from "../assets/logo.svg"; const validationSchema = z.object({ server: z.string({ required_error: "server is required" }).url({ message: "invalid server url" }), @@ -66,6 +67,9 @@ export const LoginScreen: React.FC> = ({ navigati + + + > = ({ navigati }; const styles = StyleSheet.create({ + logoContainer: { + alignItems: "center", + justifyContent: "center", + height: 100, + }, container: { padding: 8, }, diff --git a/frontend/apps/mobile/src/screens/SplashScreen.tsx b/frontend/apps/mobile/src/screens/SplashScreen.tsx index 27ac28e0..8e3cd931 100644 --- a/frontend/apps/mobile/src/screens/SplashScreen.tsx +++ b/frontend/apps/mobile/src/screens/SplashScreen.tsx @@ -1,21 +1,24 @@ import React from "react"; import { StyleSheet, View } from "react-native"; -import { ActivityIndicator, Text } from "react-native-paper"; +import LogoSvg from "../assets/logo.svg"; export const SplashScreen: React.FC = () => { return ( - - Splash screen + + + ); }; const styles = StyleSheet.create({ container: { + flex: 1, justifyContent: "center", alignItems: "center", }, + logoContainer: { + height: 150, + }, }); - -export default SplashScreen; diff --git a/frontend/apps/web/src/pages/auth/Register.tsx b/frontend/apps/web/src/pages/auth/Register.tsx index 40c5b739..6a191315 100644 --- a/frontend/apps/web/src/pages/auth/Register.tsx +++ b/frontend/apps/web/src/pages/auth/Register.tsx @@ -161,6 +161,7 @@ export const Register: React.FC = () => { required fullWidth type="password" + name="password" label={t("common.password")} onBlur={handleBlur} onChange={handleChange}