Skip to content

Commit

Permalink
Merge pull request #192 from SFTtech/milo/misc-cleanup
Browse files Browse the repository at this point in the history
misc cleanup
  • Loading branch information
mikonse authored Jan 4, 2024
2 parents 5277382 + 1109ccf commit f1ed61d
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/push_on_master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,6 @@ Sessionx.vim
[._]*.un~

### Docker ###
.env
docker-compose.yaml
docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion docker/Dockerfile-api
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
ENTRYPOINT ["/opt/abrechnung-venv/bin/python3", "-u", "/entrypoint.py"]
11 changes: 5 additions & 6 deletions docker/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:])
1 change: 1 addition & 0 deletions frontend/apps/mobile/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assets
21 changes: 14 additions & 7 deletions frontend/apps/mobile/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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",
Expand All @@ -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": {
Expand All @@ -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": {
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/mobile/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/mobile/src/AppWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
2 changes: 0 additions & 2 deletions frontend/apps/mobile/src/hooks/useColorScheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ import { ColorSchemeName, useColorScheme as _useColorScheme } from "react-native
export const useColorScheme = (): NonNullable<ColorSchemeName> => {
return _useColorScheme() as NonNullable<ColorSchemeName>;
};

export default useColorScheme;
9 changes: 9 additions & 0 deletions frontend/apps/mobile/src/screens/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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" }),
Expand Down Expand Up @@ -66,6 +67,9 @@ export const LoginScreen: React.FC<RootDrawerScreenProps<"Login">> = ({ navigati
<Appbar.Header theme={{ colors: { primary: theme.colors.surface } }}>
<Appbar.Content title={t("app.name")} />
</Appbar.Header>
<View style={styles.logoContainer}>
<LogoSvg height="100%" />
</View>
<Formik
validationSchema={toFormikValidationSchema(validationSchema)}
initialValues={initialValues}
Expand Down Expand Up @@ -149,6 +153,11 @@ export const LoginScreen: React.FC<RootDrawerScreenProps<"Login">> = ({ navigati
};

const styles = StyleSheet.create({
logoContainer: {
alignItems: "center",
justifyContent: "center",
height: 100,
},
container: {
padding: 8,
},
Expand Down
13 changes: 8 additions & 5 deletions frontend/apps/mobile/src/screens/SplashScreen.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<View style={styles.container}>
<ActivityIndicator animating={true} />
<Text>Splash screen</Text>
<View style={styles.logoContainer}>
<LogoSvg height="100%" />
</View>
</View>
);
};

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
},
logoContainer: {
height: 150,
},
});

export default SplashScreen;
1 change: 1 addition & 0 deletions frontend/apps/web/src/pages/auth/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export const Register: React.FC = () => {
required
fullWidth
type="password"
name="password"
label={t("common.password")}
onBlur={handleBlur}
onChange={handleChange}
Expand Down

0 comments on commit f1ed61d

Please sign in to comment.