Skip to content

Commit

Permalink
Merge branch 'master' into attachIds
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfang97 authored Jan 29, 2025
2 parents b15f816 + d11ed61 commit 2521374
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/views/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const settingsSchema = Joi.object({
userPasswordConfirm: requiredString("Passwords didn't match", { trim: false }).valid(Joi.ref('userPassword')),
virtuosoINI: requiredString('Please enter your virtuoso INI location'),
virtuosoDB: requiredString('Please enter your virtuoso DB location'),
pluginLocalComposePrefix: Joi.string().allow(''),
googleClientId: Joi.when('authProvider', {
is: 'google',
then: requiredString('Please enter your Google Client ID')
Expand All @@ -46,6 +47,7 @@ const settingsSchema = Joi.object({
color: Joi.string().trim().allow(''),
allowPublicSignup: Joi.bool(),
requireLogin: Joi.bool(),
pluginsUseLocalCompose: Joi.bool(),
authProvider: Joi.string().allow('')
})

Expand All @@ -60,6 +62,7 @@ module.exports = function (req, res) {
frontendURL: '',
instanceUrl: req.protocol + '://' + req.get('Host') + '/',
uriPrefix: req.protocol + '://' + req.get('Host') + '/',
pluginLocalComposePrefix: '',
altHome: '',
userName: '',
affiliation: '',
Expand Down Expand Up @@ -112,6 +115,8 @@ async function setupPost (req, res, settings) {
virtuosoDB: req.body.virtuosoDB,
allowPublicSignup: !!req.body.allowPublicSignup,
requireLogin: !!req.body.requireLogin,
pluginsUseLocalCompose: !!req.body.pluginsUseLocalCompose,
pluginLocalComposePrefix: req.body.pluginLocalComposePrefix,
authProvider: req.body.authProvider,
googleClientId: req.body.googleClientId,
googleClientSecret: req.body.googleClientSecret,
Expand Down Expand Up @@ -168,6 +173,13 @@ async function setupPost (req, res, settings) {
config.set('databasePrefix', updatedSettings.uriPrefix)
config.set('altHome', updatedSettings.altHome)

config.set('pluginsUseLocalCompose', updatedSettings.pluginsUseLocalCompose)
if (updatedSettings.pluginsUseLocalCompose) {
config.set('pluginLocalComposePrefix', updatedSettings.pluginLocalComposePrefix)
} else {
config.set('pluginLocalComposePrefix', '')
}

config.set('triplestore', {
...config.get('triplestore'),
graphPrefix: updatedSettings.uriPrefix,
Expand Down
9 changes: 9 additions & 0 deletions templates/views/setup.jade
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ block body
|, but if this is incorrect, please change it here.
label Virtuoso Data Directory
input.form-control(name='virtuosoDB',value=config.triplestore.virtuosoDB)
div.checkbox
label
input(type="checkbox", name="pluginLocalComposePrefixBoolean", checked=config.pluginLocalComposePrefixBoolean)
| Use pluginLocalComposePrefix variable
br
label Plugin Local Compose Prefix
input.form-control(name='pluginLocalComposePrefix', value=settings.pluginLocalComposePrefix)
p
i Used only for local testing of plugins
br
h2 3. Create your first user account
div.form-group
Expand Down
16 changes: 16 additions & 0 deletions tests/previousresults/getrequest_setup_.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,22 @@ <h2>
Virtuoso Data Directory
<input class="form-control" name="virtuosoDB" value="/virtuoso"/>
</label>
<div class="checkbox">
</div>
<label>
<input name="pluginLocalComposePrefixBoolean" type="checkbox"/>
Use pluginLocalComposePrefix variable
</label>
<br/>
<label>
Plugin Local Compose Prefix
<input class="form-control" name="pluginLocalComposePrefix" value=""/>
</label>
<p>
<i>
Used only for local testing of plugins
</i>
</p>
</div>
<br/>
<h2>
Expand Down

0 comments on commit 2521374

Please sign in to comment.