Skip to content

Commit 46d1bdf

Browse files
fix: rename Settings/ to settings/ for consistency
All other pod directories are lowercase (public/, private/, inbox/, profile/). Settings/ was capitalised for historical mashlib compatibility. Fixes JavaScriptSolidServer#247
1 parent 2957230 commit 46d1bdf

4 files changed

Lines changed: 29 additions & 29 deletions

File tree

src/handlers/container.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ export async function createPodStructure(name, webId, podUri, issuer, defaultQuo
165165
const podPath = `/${name}/`;
166166

167167
// Create pod directory structure
168-
// Uses 'Settings' (capital S) for mashlib compatibility
168+
// Pod settings directory
169169
await storage.createContainer(podPath);
170170
await storage.createContainer(`${podPath}inbox/`);
171171
await storage.createContainer(`${podPath}public/`);
172172
await storage.createContainer(`${podPath}private/`);
173-
await storage.createContainer(`${podPath}Settings/`);
173+
await storage.createContainer(`${podPath}settings/`);
174174
await storage.createContainer(`${podPath}profile/`);
175175

176176
// Generate and write WebID profile at /profile/card (standard Solid location)
@@ -179,14 +179,14 @@ export async function createPodStructure(name, webId, podUri, issuer, defaultQuo
179179

180180
// Generate and write preferences (mashlib-compatible paths)
181181
const prefs = generatePreferences({ webId, podUri });
182-
await storage.write(`${podPath}Settings/Preferences.ttl`, serialize(prefs));
182+
await storage.write(`${podPath}settings/Preferences.ttl`, serialize(prefs));
183183

184184
// Generate and write type indexes with .ttl extension for mashlib
185-
const publicTypeIndex = generateTypeIndex(`${podUri}Settings/publicTypeIndex.ttl`);
186-
await storage.write(`${podPath}Settings/publicTypeIndex.ttl`, serialize(publicTypeIndex));
185+
const publicTypeIndex = generateTypeIndex(`${podUri}settings/publicTypeIndex.ttl`);
186+
await storage.write(`${podPath}settings/publicTypeIndex.ttl`, serialize(publicTypeIndex));
187187

188-
const privateTypeIndex = generateTypeIndex(`${podUri}Settings/privateTypeIndex.ttl`);
189-
await storage.write(`${podPath}Settings/privateTypeIndex.ttl`, serialize(privateTypeIndex));
188+
const privateTypeIndex = generateTypeIndex(`${podUri}settings/privateTypeIndex.ttl`);
189+
await storage.write(`${podPath}settings/privateTypeIndex.ttl`, serialize(privateTypeIndex));
190190

191191
// Create default ACL files
192192
// Pod root: owner full control, public read
@@ -197,9 +197,9 @@ export async function createPodStructure(name, webId, podUri, issuer, defaultQuo
197197
const privateAcl = generatePrivateAcl(`${podUri}private/`, webId);
198198
await storage.write(`${podPath}private/.acl`, serializeAcl(privateAcl));
199199

200-
// Settings folder: owner only
201-
const settingsAcl = generatePrivateAcl(`${podUri}Settings/`, webId);
202-
await storage.write(`${podPath}Settings/.acl`, serializeAcl(settingsAcl));
200+
// settings folder: owner only
201+
const settingsAcl = generatePrivateAcl(`${podUri}settings/`, webId);
202+
await storage.write(`${podPath}settings/.acl`, serializeAcl(settingsAcl));
203203

204204
// Inbox: owner full, public append
205205
const inboxAcl = generateInboxAcl(`${podUri}inbox/`, webId);

src/server.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ export function createServer(options = {}) {
571571
await storage.createContainer('/inbox/');
572572
await storage.createContainer('/public/');
573573
await storage.createContainer('/private/');
574-
await storage.createContainer('/Settings/');
574+
await storage.createContainer('/settings/');
575575
await storage.createContainer('/profile/');
576576

577577
// Generate profile
@@ -580,13 +580,13 @@ export function createServer(options = {}) {
580580

581581
// Preferences and type indexes
582582
const prefs = generatePreferences({ webId, podUri });
583-
await storage.write('/Settings/Preferences.ttl', serialize(prefs));
583+
await storage.write('/settings/Preferences.ttl', serialize(prefs));
584584

585-
const publicTypeIndex = generateTypeIndex(`${podUri}Settings/publicTypeIndex.ttl`);
586-
await storage.write('/Settings/publicTypeIndex.ttl', serialize(publicTypeIndex));
585+
const publicTypeIndex = generateTypeIndex(`${podUri}settings/publicTypeIndex.ttl`);
586+
await storage.write('/settings/publicTypeIndex.ttl', serialize(publicTypeIndex));
587587

588-
const privateTypeIndex = generateTypeIndex(`${podUri}Settings/privateTypeIndex.ttl`);
589-
await storage.write('/Settings/privateTypeIndex.ttl', serialize(privateTypeIndex));
588+
const privateTypeIndex = generateTypeIndex(`${podUri}settings/privateTypeIndex.ttl`);
589+
await storage.write('/settings/privateTypeIndex.ttl', serialize(privateTypeIndex));
590590

591591
// ACL files
592592
const rootAcl = generateOwnerAcl(podUri, webId, true);
@@ -595,8 +595,8 @@ export function createServer(options = {}) {
595595
const privateAcl = generatePrivateAcl(`${podUri}private/`, webId);
596596
await storage.write('/private/.acl', serializeAcl(privateAcl));
597597

598-
const settingsAcl = generatePrivateAcl(`${podUri}Settings/`, webId);
599-
await storage.write('/Settings/.acl', serializeAcl(settingsAcl));
598+
const settingsAcl = generatePrivateAcl(`${podUri}settings/`, webId);
599+
await storage.write('/settings/.acl', serializeAcl(settingsAcl));
600600

601601
const inboxAcl = generateInboxAcl(`${podUri}inbox/`, webId);
602602
await storage.write('/inbox/.acl', serializeAcl(inboxAcl));

src/webid/profile.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export function generateProfileJsonLd({ webId, name, podUri, issuer }) {
4545
'inbox': `${pod}inbox/`,
4646
'storage': pod,
4747
'oidcIssuer': issuer,
48-
'preferencesFile': `${pod}Settings/Preferences.ttl`,
49-
'publicTypeIndex': `${pod}Settings/publicTypeIndex.ttl`,
50-
'privateTypeIndex': `${pod}Settings/privateTypeIndex.ttl`
48+
'preferencesFile': `${pod}settings/Preferences.ttl`,
49+
'publicTypeIndex': `${pod}settings/publicTypeIndex.ttl`,
50+
'privateTypeIndex': `${pod}settings/privateTypeIndex.ttl`
5151
};
5252
}
5353

@@ -133,7 +133,7 @@ function escapeHtml(str) {
133133

134134
/**
135135
* Generate preferences file as JSON-LD
136-
* Uses mashlib-compatible paths (Settings/Preferences.ttl)
136+
* Uses mashlib-compatible paths (settings/Preferences.ttl)
137137
* @param {object} options
138138
* @param {string} options.webId - Full WebID URI
139139
* @param {string} options.podUri - Pod root URI
@@ -149,9 +149,9 @@ export function generatePreferences({ webId, podUri }) {
149149
'publicTypeIndex': { '@id': 'solid:publicTypeIndex', '@type': '@id' },
150150
'privateTypeIndex': { '@id': 'solid:privateTypeIndex', '@type': '@id' }
151151
},
152-
'@id': `${pod}Settings/Preferences.ttl`,
153-
'publicTypeIndex': `${pod}Settings/publicTypeIndex.ttl`,
154-
'privateTypeIndex': `${pod}Settings/privateTypeIndex.ttl`
152+
'@id': `${pod}settings/Preferences.ttl`,
153+
'publicTypeIndex': `${pod}settings/publicTypeIndex.ttl`,
154+
'privateTypeIndex': `${pod}settings/privateTypeIndex.ttl`
155155
};
156156
}
157157

test/pod.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,23 @@ describe('Pod Lifecycle', () => {
9696
assertStatus(priv, 200);
9797

9898
// Check Settings exists (needs auth)
99-
const settings = await request('/carol/Settings/', { auth: 'carol' });
99+
const settings = await request('/carol/settings/', { auth: 'carol' });
100100
assertStatus(settings, 200);
101101
});
102102

103103
it('should create settings files', async () => {
104104
await createTestPod('dan');
105105

106106
// Check Preferences.ttl (needs auth - Settings is private)
107-
const prefs = await request('/dan/Settings/Preferences.ttl', { auth: 'dan' });
107+
const prefs = await request('/dan/settings/Preferences.ttl', { auth: 'dan' });
108108
assertStatus(prefs, 200);
109109

110110
// Check public type index (needs auth)
111-
const pubIndex = await request('/dan/Settings/publicTypeIndex.ttl', { auth: 'dan' });
111+
const pubIndex = await request('/dan/settings/publicTypeIndex.ttl', { auth: 'dan' });
112112
assertStatus(pubIndex, 200);
113113

114114
// Check private type index (needs auth)
115-
const privIndex = await request('/dan/Settings/privateTypeIndex.ttl', { auth: 'dan' });
115+
const privIndex = await request('/dan/settings/privateTypeIndex.ttl', { auth: 'dan' });
116116
assertStatus(privIndex, 200);
117117
});
118118
});

0 commit comments

Comments
 (0)