Skip to content

Commit

Permalink
Add public REST endpoint option to Advanced Settings (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
RCasatta authored Sep 20, 2023
1 parent 01ac643 commit be56622
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions logic/disk.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const DEFAULT_ADVANCED_SETTINGS = {
incomingConnections: false,
cacheSizeMB: 450,
mempoolFullRbf: false,
rest: false,
prune: {
enabled: false,
pruneSizeGB: 300,
Expand Down Expand Up @@ -108,6 +109,12 @@ function settingsToMultilineConfString(settings) {
umbrelBitcoinConfig.push('mempoolfullrbf=1');
}

// rest
if (settings.rest) {
umbrelBitcoinConfig.push("# Enable public REST endpoints.");
umbrelBitcoinConfig.push('rest=1');
}

// prune
if (settings.prune.enabled) {
umbrelBitcoinConfig.push("# Reduce disk space requirements to this many MiB by enabling pruning (deleting) of old blocks. This mode is incompatible with -txindex and -coinstatsindex. WARNING: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, greater than or equal to 550 = automatically prune blocks to stay under target size in MiB).");
Expand Down
22 changes: 22 additions & 0 deletions ui/src/components/AdvancedSettingsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,28 @@

<hr class="advanced-settings-divider" />

<div>
<div class="d-flex justify-content-between align-items-center">
<div class="w-75">
<label class="mb-0" for="rest">
<p class="font-weight-bold mb-0">Enable REST API</p>
</label>
</div>
<div>
<toggle-switch
id="rest"
class="align-self-center"
:on="settings.rest"
@toggle="status => (settings.rest = status)"
></toggle-switch>
</div>
</div>
<small class="w-sm-75 d-block text-muted mt-1">
Enable public REST endpoints.
</small>
</div>

<hr class="advanced-settings-divider" />

<div>
<div class="d-flex justify-content-between align-items-center">
Expand Down

0 comments on commit be56622

Please sign in to comment.