mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect.git
synced 2024-11-22 03:51:27 +00:00
feat: Initialize server with binds and resizable volume activated
This commit is contained in:
parent
be3a8485f6
commit
eca6780983
31
nixos-infect
31
nixos-infect
|
@ -10,7 +10,7 @@ makeConf() {
|
||||||
if [[ $PASSWORD == null ]]; then
|
if [[ $PASSWORD == null ]]; then
|
||||||
export PASSWORD=$(printf $ENCODED_PASSWORD | base64 --decode)
|
export PASSWORD=$(printf $ENCODED_PASSWORD | base64 --decode)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export ESCAPED_PASSWORD=$(printf $ENCODED_PASSWORD | base64 --decode | jq -Rs .)
|
export ESCAPED_PASSWORD=$(printf $ENCODED_PASSWORD | base64 --decode | jq -Rs .)
|
||||||
export HASHED_PASSWORD=$( mkpasswd -m sha-512 "$PASSWORD" )
|
export HASHED_PASSWORD=$( mkpasswd -m sha-512 "$PASSWORD" )
|
||||||
|
|
||||||
|
@ -31,7 +31,8 @@ makeConf() {
|
||||||
cat > /etc/nixos/userdata/userdata.json << EOF
|
cat > /etc/nixos/userdata/userdata.json << EOF
|
||||||
{
|
{
|
||||||
"api": {
|
"api": {
|
||||||
"token": "$API_TOKEN"
|
"token": "$API_TOKEN",
|
||||||
|
"skippedMigrations": ["migrate_to_selfprivacy_channel", "mount_volume"]
|
||||||
},
|
},
|
||||||
"backblaze": {
|
"backblaze": {
|
||||||
"accountId": "$BACKBLAZE_KEY_ID",
|
"accountId": "$BACKBLAZE_KEY_ID",
|
||||||
|
@ -39,7 +40,8 @@ makeConf() {
|
||||||
"bucket": "$BACKBLAZE_BUCKET_NAME"
|
"bucket": "$BACKBLAZE_BUCKET_NAME"
|
||||||
},
|
},
|
||||||
"bitwarden": {
|
"bitwarden": {
|
||||||
"enable": true
|
"enable": true,
|
||||||
|
"location": "sdb"
|
||||||
},
|
},
|
||||||
"cloudflare": {
|
"cloudflare": {
|
||||||
"apiKey": "$CF_TOKEN"
|
"apiKey": "$CF_TOKEN"
|
||||||
|
@ -51,23 +53,34 @@ makeConf() {
|
||||||
"nextcloud": {
|
"nextcloud": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
"adminPassword": $ESCAPED_PASSWORD,
|
"adminPassword": $ESCAPED_PASSWORD,
|
||||||
"databasePassword": $ESCAPED_PASSWORD
|
"databasePassword": $ESCAPED_PASSWORD,
|
||||||
|
"location": "sdb"
|
||||||
},
|
},
|
||||||
"gitea": {
|
"gitea": {
|
||||||
"enable": true
|
"enable": true,
|
||||||
|
"location": "sdb"
|
||||||
},
|
},
|
||||||
"jitsi": {
|
"jitsi": {
|
||||||
"enable": true
|
"enable": true
|
||||||
},
|
},
|
||||||
"ocserv": {
|
"ocserv": {
|
||||||
"enable": true
|
"enable": false
|
||||||
},
|
},
|
||||||
"pleroma": {
|
"pleroma": {
|
||||||
"enable": true
|
"enable": false,
|
||||||
|
"location": "sdb"
|
||||||
},
|
},
|
||||||
"timezone": "Europe/Uzhgorod",
|
"timezone": "Europe/Uzhgorod",
|
||||||
"resticPassword": $ESCAPED_PASSWORD,
|
"resticPassword": $ESCAPED_PASSWORD,
|
||||||
"username": "$LUSER"
|
"username": "$LUSER",
|
||||||
|
"volumes": [
|
||||||
|
{
|
||||||
|
"device": "/dev/sdb",
|
||||||
|
"mountPoint": "/volumes/sdb",
|
||||||
|
"fsType": "ext4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"useBinds": true
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
chmod 0600 /etc/nixos/userdata/userdata.json
|
chmod 0600 /etc/nixos/userdata/userdata.json
|
||||||
|
@ -353,4 +366,4 @@ removeSwap
|
||||||
|
|
||||||
if [[ -z "$NO_REBOOT" ]]; then
|
if [[ -z "$NO_REBOOT" ]]; then
|
||||||
reboot
|
reboot
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue