Skip to content

Commit

Permalink
pack and unpack database + readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfgebhardt committed Mar 14, 2024
1 parent 3646241 commit 56e947b
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 6 deletions.
5 changes: 0 additions & 5 deletions authentik/.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ PG_PASS=905d212ac491ab9bbacfaa2baa359a37ea065da9
AUTHENTIK_SECRET_KEY=905d212ac491ab9bbacfaa2baa359a37ea065da9
AUTHENTIK_ERROR_REPORTING__ENABLED=false

#user
# akadmin
# admin@dreammall.earth
# dreammall

# Use http & https ports
#COMPOSE_PORT_HTTP=80
#COMPOSE_PORT_HTTPS=443
4 changes: 3 additions & 1 deletion authentik/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
database/
database/
database.old/
database.old.7z
32 changes: 32 additions & 0 deletions authentik/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Authentik

This is an Authentik setup for development in order to make local testing for production behaviour as easy as possible including the authentication mechanisms.

## Preperation

This package comes with an preconfigured authentic - which has its data mainly residing in a postgress database. The contents of this database is available in packed form.

To extract the database use:
```bash
./database.unpack.sh
```
(Note: make sure the database is not running before executing this command)

## User Credentials

To login you can use the superadmins credentials:

| description | value |
|-------------|-----------------------|
| username | akadmin |
| email | admin@dreammall.earth |
| password | dreammall |

## Publish changes

If you want to publish changes to the database you can use the following command to pack the database:
```bash
./database.pack.sh
```
(Note: this assumes you are not root and sets the permissions of the database files via sudo)
(Note: make sure to shut down the database first before you run the script)
Binary file added authentik/database.7z
Binary file not shown.
12 changes: 12 additions & 0 deletions authentik/database.pack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
SCRIPT_PATH=$(realpath $0)
SCRIPT_DIR=$(dirname $SCRIPT_PATH)

# delete last backup & backup
rm -R $SCRIPT_DIR/database.old.7z || true
mv $SCRIPT_DIR/database.7z $SCRIPT_DIR/database.old.7z

# make the databse folder readable by everyone
sudo chmod 777 -R $SCRIPT_DIR/database

7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on $SCRIPT_DIR/database.7z $SCRIPT_DIR/database/{*,.[!.]*}
9 changes: 9 additions & 0 deletions authentik/database.unpack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
SCRIPT_PATH=$(realpath $0)
SCRIPT_DIR=$(dirname $SCRIPT_PATH)

# delete last backup & backup
rm -R $SCRIPT_DIR/database.old || true
mv $SCRIPT_DIR/database $SCRIPT_DIR/database.old

7z x $SCRIPT_DIR/database.7z -o$SCRIPT_DIR/database/

0 comments on commit 56e947b

Please sign in to comment.