Bladeren bron

add full reset script and instructions

tags/v1.2.3
Jonathan Cobb 4 jaren geleden
bovenliggende
commit
8d21047740
5 gewijzigde bestanden met toevoegingen van 71 en 2 verwijderingen
  1. +49
    -0
      bin/reset_bubble_full
  2. +1
    -0
      bubble-server/src/main/java/bubble/ApiConstants.java
  3. +2
    -1
      bubble-server/src/main/java/bubble/dao/account/AccountOwnedEntityDAO.java
  4. +9
    -0
      docs/dev.md
  5. +10
    -1
      docs/local-launcher.md

+ 49
- 0
bin/reset_bubble_full Bestand weergeven

@@ -0,0 +1,49 @@
#!/bin/bash
#
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
#
#
# Perform a full reset of Bubble. Removes the database and all locally stored files
#
# Usage: reset_bubble_full
#
SCRIPT="${0}"
SCRIPT_DIR=$(cd $(dirname ${SCRIPT}) && pwd)
. ${SCRIPT_DIR}/bubble_common

SELF_NODE_JSON="${HOME}/self_node.json"
BUBBLE_VERSIONS_FILE="${HOME}/bubble_versions.properties"

BUBBLE_LOCAL_STORAGE_DIR_DEFAULT=".bubble_local_storage"
BUBBLE_LOCAL_STORAGE_DIR=$(${SCRIPT_DIR}/bin/bconst bubble.cloud.storage.local.LocalStorageDriver.BUBBLE_LOCAL_STORAGE_DIR)
if [[ -z ${BUBBLE_LOCAL_STORAGE_DIR} ]] ; then
echo "Error determining Bubble LocalStorage directory, using default: ${BUBBLE_LOCAL_STORAGE_DIR_DEFAULT}"
BUBBLE_LOCAL_STORAGE_DIR=${BUBBLE_LOCAL_STORAGE_DIR_DEFAULT}
fi
BUBBLE_LOCAL_STORAGE_DIR="${HOME}/${BUBBLE_LOCAL_STORAGE_DIR}"

BUBBLE_CLOUD_DATA_DIR_DEFAULT="bubble_cloudServiceData"
BUBBLE_CLOUD_DATA_DIR=$(${SCRIPT_DIR}/bin/bconst bubble.ApiConstants.BUBBLE_CLOUD_SERVICE_DATA)
if [[ -z ${BUBBLE_CLOUD_DATA_DIR} ]] ; then
echo "Error determining Bubble Cloud Service Data directory, using default: "
BUBBLE_CLOUD_DATA_DIR=${BUBBLE_CLOUD_DATA_DIR_DEFAULT}
fi
BUBBLE_CLOUD_DATA_DIR="${HOME}/${BUBBLE_CLOUD_DATA_DIR}"


rm -f ${SELF_NODE_JSON} || die "Error removing ${SELF_NODE_JSON}"
echo "> removed: ${SELF_NODE_JSON}"

rm -f ${BUBBLE_VERSIONS_FILE} || die "Error removing ${BUBBLE_VERSIONS_FILE}"
echo "> removed: ${BUBBLE_VERSIONS_FILE}"

rm -rf ${BUBBLE_LOCAL_STORAGE_DIR} || die "Error removing ${BUBBLE_LOCAL_STORAGE_DIR}"
echo "> removed: ${BUBBLE_LOCAL_STORAGE_DIR}"

rm -rf ${BUBBLE_CLOUD_DATA_DIR} || die "Error removing ${BUBBLE_CLOUD_DATA_DIR}"
echo "> removed: ${BUBBLE_CLOUD_DATA_DIR}"

dropdb bubble || die "Error dropping bubble database"
echo "> dropped database: bubble"

echo "+++ Bubble Reset Complete"

+ 1
- 0
bubble-server/src/main/java/bubble/ApiConstants.java Bestand weergeven

@@ -127,6 +127,7 @@ public class ApiConstants {
}
}

public static final String BUBBLE_CLOUD_SERVICE_DATA = "bubble_cloudServiceData";
public static final File CACERTS_DIR = new File(HOME_DIR, "cacerts");
public static final File MITMPROXY_CERT_DIR = new File(HOME_DIR, "mitm_certs");



+ 2
- 1
bubble-server/src/main/java/bubble/dao/account/AccountOwnedEntityDAO.java Bestand weergeven

@@ -20,6 +20,7 @@ import java.io.File;
import java.util.Collection;
import java.util.List;

import static bubble.ApiConstants.BUBBLE_CLOUD_SERVICE_DATA;
import static bubble.ApiConstants.HOME_DIR;
import static org.cobbzilla.util.reflect.ReflectionUtil.getFirstTypeParam;
import static org.cobbzilla.util.security.ShaUtil.sha256_hex;
@@ -79,7 +80,7 @@ public abstract class AccountOwnedEntityDAO<E extends HasAccount>
pathMiddle = cloudServiceUuid;
}
return new File(HOME_DIR + File.separator
+ "bubble_cloudServiceData" + File.separator
+ BUBBLE_CLOUD_SERVICE_DATA + File.separator
+ pathMiddle + File.separator
+ sha.substring(0, 2) + File.separator
+ sha.substring(2, 4) + File.separator


+ 9
- 0
docs/dev.md Bestand weergeven

@@ -59,3 +59,12 @@ This will update and rebuild all submodules, and the main bubble jar file.

## Running in development
Run the `bin/run.sh` script to start the Bubble server.

## Resetting everything
If you want to "start over", run:

./bin/reset_bubble_full

This will remove local files stored by Bubble, and drop the bubble database.

If you run `./bin/run.sh` again, it will be like running it for the first time.

+ 10
- 1
docs/local-launcher.md Bestand weergeven

@@ -24,12 +24,21 @@ Make a copy of the file `config/activation.json` and edit the copy. There are co

To activate your Local Launcher Bubble, run this command:

`./bin/bactivate /path/to/activation.json`
./bin/bactivate /path/to/activation.json

After running the above, refresh the web page that opened when the server started. You should see a login page.

You can now login as the admin user using the email address `root@local.local` and the password from your `activation.json` file.

### Resetting everything
If you want to "start over", run:

./bin/reset_bubble_full

This will remove local files stored by Bubble, and drop the bubble database.

If you run `./bin/run.sh` again, it will be like running it for the first time.

## Next Steps
You are now read to launch a new Bubble in [Bubble Mode](launch-node.md), or
a Remote Launcher via [Remote Launcher Mode](remote-launcher.md)

Laden…
Annuleren
Opslaan