diff options
author | Aditya Mangalampalli <aditya.mangalampalli@gmail.com> | 2022-04-15 02:00:25 -0700 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2022-04-16 21:57:57 +0530 |
commit | 210131ca184c3aa043371857c022aa1aa149efbf (patch) | |
tree | 6bc4e10a1540e55a66146c099bc468a12287425e /src/internal-server | |
parent | Update submodule url to ferdium-recipes (#1) (diff) | |
download | ferdium-app-210131ca184c3aa043371857c022aa1aa149efbf.tar.gz ferdium-app-210131ca184c3aa043371857c022aa1aa149efbf.tar.zst ferdium-app-210131ca184c3aa043371857c022aa1aa149efbf.zip |
Matched casing for almost all replacements
Diffstat (limited to 'src/internal-server')
-rw-r--r-- | src/internal-server/app/Controllers/Http/RecipeController.js | 8 | ||||
-rw-r--r-- | src/internal-server/app/Controllers/Http/StaticController.js | 2 | ||||
-rw-r--r-- | src/internal-server/app/Controllers/Http/UserController.js | 12 | ||||
-rw-r--r-- | src/internal-server/config/app.js | 2 | ||||
-rw-r--r-- | src/internal-server/env.ini | 6 | ||||
-rw-r--r-- | src/internal-server/resources/views/index.edge | 8 | ||||
-rw-r--r-- | src/internal-server/resources/views/layouts/main.edge | 2 | ||||
-rw-r--r-- | src/internal-server/resources/views/transfer.edge | 4 | ||||
-rw-r--r-- | src/internal-server/start/migrate.js | 16 | ||||
-rw-r--r-- | src/internal-server/start/routes.js | 8 |
10 files changed, 34 insertions, 34 deletions
diff --git a/src/internal-server/app/Controllers/Http/RecipeController.js b/src/internal-server/app/Controllers/Http/RecipeController.js index 37a62e2fa..474ffadb4 100644 --- a/src/internal-server/app/Controllers/Http/RecipeController.js +++ b/src/internal-server/app/Controllers/Http/RecipeController.js | |||
@@ -4,11 +4,11 @@ const { validateAll } = use('Validator'); | |||
4 | const Env = use('Env'); | 4 | const Env = use('Env'); |
5 | 5 | ||
6 | const fetch = require('node-fetch'); | 6 | const fetch = require('node-fetch'); |
7 | const debug = require('debug')('Ferdi:internalServer:RecipeController'); | 7 | const debug = require('debug')('Ferdium:internalServer:RecipeController'); |
8 | const { LIVE_FERDI_API } = require('../../../../config'); | 8 | const { LIVE_FERDIUM_API } = require('../../../../config'); |
9 | const { API_VERSION } = require('../../../../environment-remote'); | 9 | const { API_VERSION } = require('../../../../environment-remote'); |
10 | 10 | ||
11 | const RECIPES_URL = `${LIVE_FERDI_API}/${API_VERSION}/recipes`; | 11 | const RECIPES_URL = `${LIVE_FERDIUM_API}/${API_VERSION}/recipes`; |
12 | 12 | ||
13 | class RecipeController { | 13 | class RecipeController { |
14 | // List official and custom recipes | 14 | // List official and custom recipes |
@@ -47,7 +47,7 @@ class RecipeController { | |||
47 | // Get results | 47 | // Get results |
48 | let results; | 48 | let results; |
49 | 49 | ||
50 | if (needle === 'ferdi:custom') { | 50 | if (needle === 'ferdium:custom') { |
51 | const allRecipes = await Recipe.all(); | 51 | const allRecipes = await Recipe.all(); |
52 | const dbResults = allRecipes.toJSON(); | 52 | const dbResults = allRecipes.toJSON(); |
53 | results = dbResults.map(recipe => ({ | 53 | results = dbResults.map(recipe => ({ |
diff --git a/src/internal-server/app/Controllers/Http/StaticController.js b/src/internal-server/app/Controllers/Http/StaticController.js index 99723940a..ac6f89008 100644 --- a/src/internal-server/app/Controllers/Http/StaticController.js +++ b/src/internal-server/app/Controllers/Http/StaticController.js | |||
@@ -14,7 +14,7 @@ class StaticController { | |||
14 | isSettingsWSEnabled: false, | 14 | isSettingsWSEnabled: false, |
15 | isMagicBarEnabled: true, | 15 | isMagicBarEnabled: true, |
16 | isTodosEnabled: true, | 16 | isTodosEnabled: true, |
17 | subscribeURL: 'https://getferdi.com', | 17 | subscribeURL: 'https://ferdium.org', |
18 | hasInlineCheckout: true, | 18 | hasInlineCheckout: true, |
19 | }); | 19 | }); |
20 | } | 20 | } |
diff --git a/src/internal-server/app/Controllers/Http/UserController.js b/src/internal-server/app/Controllers/Http/UserController.js index abfbc2470..6bd4f85a7 100644 --- a/src/internal-server/app/Controllers/Http/UserController.js +++ b/src/internal-server/app/Controllers/Http/UserController.js | |||
@@ -38,7 +38,7 @@ const DEFAULT_USER_DATA = { | |||
38 | email: '', | 38 | email: '', |
39 | emailValidated: true, | 39 | emailValidated: true, |
40 | features: {}, | 40 | features: {}, |
41 | firstname: 'Ferdi', | 41 | firstname: 'Ferdium', |
42 | id: '82c1cf9d-ab58-4da2-b55e-aaa41d2142d8', | 42 | id: '82c1cf9d-ab58-4da2-b55e-aaa41d2142d8', |
43 | isSubscriptionOwner: true, | 43 | isSubscriptionOwner: true, |
44 | lastname: 'Application', | 44 | lastname: 'Application', |
@@ -221,7 +221,7 @@ class UserController { | |||
221 | } | 221 | } |
222 | 222 | ||
223 | return response.send( | 223 | return response.send( |
224 | 'Your account has been imported. You can now use your Franz account in Ferdi.', | 224 | 'Your account has been imported. You can now use your Franz account in Ferdium.', |
225 | ); | 225 | ); |
226 | } | 226 | } |
227 | 227 | ||
@@ -237,19 +237,19 @@ class UserController { | |||
237 | const workspaces = allWorkspaces.toJSON(); | 237 | const workspaces = allWorkspaces.toJSON(); |
238 | 238 | ||
239 | const exportData = { | 239 | const exportData = { |
240 | username: 'Ferdi', | 240 | username: 'Ferdium', |
241 | mail: 'internal@getferdi.com', | 241 | mail: 'internal@ferdium.org', |
242 | services, | 242 | services, |
243 | workspaces, | 243 | workspaces, |
244 | }; | 244 | }; |
245 | 245 | ||
246 | return response | 246 | return response |
247 | .header('Content-Type', 'application/force-download') | 247 | .header('Content-Type', 'application/force-download') |
248 | .header('Content-disposition', 'attachment; filename=export.ferdi-data') | 248 | .header('Content-disposition', 'attachment; filename=export.ferdium-data') |
249 | .send(exportData); | 249 | .send(exportData); |
250 | } | 250 | } |
251 | 251 | ||
252 | async importFerdi({ request, response }) { | 252 | async importFerdium({ request, response }) { |
253 | const validation = await validateAll(request.all(), { | 253 | const validation = await validateAll(request.all(), { |
254 | file: 'required', | 254 | file: 'required', |
255 | }); | 255 | }); |
diff --git a/src/internal-server/config/app.js b/src/internal-server/config/app.js index 379190734..303e1290c 100644 --- a/src/internal-server/config/app.js +++ b/src/internal-server/config/app.js | |||
@@ -13,7 +13,7 @@ module.exports = { | |||
13 | | | 13 | | |
14 | */ | 14 | */ |
15 | 15 | ||
16 | name: Env.get('APP_NAME', 'Ferdi Internal Server'), | 16 | name: Env.get('APP_NAME', 'Ferdium Internal Server'), |
17 | 17 | ||
18 | /* | 18 | /* |
19 | |-------------------------------------------------------------------------- | 19 | |-------------------------------------------------------------------------- |
diff --git a/src/internal-server/env.ini b/src/internal-server/env.ini index 8df57db66..87a347921 100644 --- a/src/internal-server/env.ini +++ b/src/internal-server/env.ini | |||
@@ -1,16 +1,16 @@ | |||
1 | HOST=localhost | 1 | HOST=localhost |
2 | PORT=45569 | 2 | PORT=45569 |
3 | NODE_ENV=development | 3 | NODE_ENV=development |
4 | APP_NAME=Ferdi Internal Server | 4 | APP_NAME=Ferdium Internal Server |
5 | APP_URL=http://${HOST}:${PORT} | 5 | APP_URL=http://${HOST}:${PORT} |
6 | CACHE_VIEWS=false | 6 | CACHE_VIEWS=false |
7 | APP_KEY=FERDIINTERNALSERVER | 7 | APP_KEY=FERDIUMINTERNALSERVER |
8 | DB_CONNECTION=sqlite | 8 | DB_CONNECTION=sqlite |
9 | DB_HOST=localhost | 9 | DB_HOST=localhost |
10 | DB_PORT=3306 | 10 | DB_PORT=3306 |
11 | DB_USER=root | 11 | DB_USER=root |
12 | DB_PASSWORD= | 12 | DB_PASSWORD= |
13 | DB_DATABASE=ferdi | 13 | DB_DATABASE=ferdium |
14 | HASH_DRIVER=bcrypt | 14 | HASH_DRIVER=bcrypt |
15 | IS_CREATION_ENABLED=true | 15 | IS_CREATION_ENABLED=true |
16 | CONNECT_WITH_FRANZ=true | 16 | CONNECT_WITH_FRANZ=true |
diff --git a/src/internal-server/resources/views/index.edge b/src/internal-server/resources/views/index.edge index b01bd7569..c6afcc14e 100644 --- a/src/internal-server/resources/views/index.edge +++ b/src/internal-server/resources/views/index.edge | |||
@@ -8,12 +8,12 @@ | |||
8 | } | 8 | } |
9 | 9 | ||
10 | </style> | 10 | </style> |
11 | <h1>Internal Ferdi Server</h1> | 11 | <h1>Internal Ferdium Server</h1> |
12 | <p>You are accessing the local server instance of your Ferdi application. This server is used to enable Ferdi's "Use without an Account" feature.</p> | 12 | <p>You are accessing the local server instance of your Ferdium application. This server is used to enable Ferdium's "Use without an Account" feature.</p> |
13 | <p> | 13 | <p> |
14 | To use Ferdi without an account, log out of your current account (if you are already logged in) and choose "Use Ferdi without an Account". | 14 | To use Ferdium without an account, log out of your current account (if you are already logged in) and choose "Use Ferdium without an Account". |
15 | </p> | 15 | </p> |
16 | <p> | 16 | <p> |
17 | Alternatively, you can <a href="/import">import your account from a remote server</a> or <a href="/transfer">import your data from a ".ferdi-data" file</a> or <a href="/transfer">export your data to a ".ferdi-data" file</a>. | 17 | Alternatively, you can <a href="/import">import your account from a remote server</a> or <a href="/transfer">import your data from a ".ferdium-data" file</a> or <a href="/transfer">export your data to a ".ferdium-data" file</a>. |
18 | </p> | 18 | </p> |
19 | @endsection | 19 | @endsection |
diff --git a/src/internal-server/resources/views/layouts/main.edge b/src/internal-server/resources/views/layouts/main.edge index 8856b5d1e..f9d5bf1de 100644 --- a/src/internal-server/resources/views/layouts/main.edge +++ b/src/internal-server/resources/views/layouts/main.edge | |||
@@ -5,7 +5,7 @@ | |||
5 | <meta charset="UTF-8"> | 5 | <meta charset="UTF-8"> |
6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
7 | <meta http-equiv="X-UA-Compatible" content="ie=edge"> | 7 | <meta http-equiv="X-UA-Compatible" content="ie=edge"> |
8 | <title>ferdi-internal-server</title> | 8 | <title>ferdium-internal-server</title> |
9 | 9 | ||
10 | {{ style('css/vanilla') }} | 10 | {{ style('css/vanilla') }} |
11 | {{ style('css/main') }} | 11 | {{ style('css/main') }} |
diff --git a/src/internal-server/resources/views/transfer.edge b/src/internal-server/resources/views/transfer.edge index 58febb24b..34fd75d97 100644 --- a/src/internal-server/resources/views/transfer.edge +++ b/src/internal-server/resources/views/transfer.edge | |||
@@ -1,7 +1,7 @@ | |||
1 | @layout('layouts.main') | 1 | @layout('layouts.main') |
2 | 2 | ||
3 | @section('content') | 3 | @section('content') |
4 | <h2>Import/Export data from another Ferdi server</h2> | 4 | <h2>Import/Export data from another Ferdium server</h2> |
5 | @if(success === true) | 5 | @if(success === true) |
6 | <div class="alert" style="background-color:#28C76F;"> | 6 | <div class="alert" style="background-color:#28C76F;"> |
7 | Sucessfully imported your account data | 7 | Sucessfully imported your account data |
@@ -12,7 +12,7 @@ | |||
12 | <div> | 12 | <div> |
13 | <label>Account data</label> | 13 | <label>Account data</label> |
14 | <div> | 14 | <div> |
15 | <input type="file" name="file" id="file" value="" accept=".json,.ferdi-data" required> | 15 | <input type="file" name="file" id="file" value="" accept=".json,.ferdium-data" required> |
16 | </div> | 16 | </div> |
17 | </div> | 17 | </div> |
18 | 18 | ||
diff --git a/src/internal-server/start/migrate.js b/src/internal-server/start/migrate.js index 97cefcc54..403f7cb86 100644 --- a/src/internal-server/start/migrate.js +++ b/src/internal-server/start/migrate.js | |||
@@ -1,13 +1,13 @@ | |||
1 | const { ferdiVersion } = require('../../environment-remote'); | 1 | const { ferdiumVersion } = require('../../environment-remote'); |
2 | 2 | ||
3 | /** | 3 | /** |
4 | * Migrate server database to work with current Ferdi version | 4 | * Migrate server database to work with current Ferdium version |
5 | */ | 5 | */ |
6 | const Database = use('Database'); | 6 | const Database = use('Database'); |
7 | const User = use('App/Models/User'); | 7 | const User = use('App/Models/User'); |
8 | 8 | ||
9 | const migrateLog = text => { | 9 | const migrateLog = text => { |
10 | console.log('\u001B[36m%s\u001B[0m', 'Ferdi Migration:', '\u001B[0m', text); | 10 | console.log('\u001B[36m%s\u001B[0m', 'Ferdium Migration:', '\u001B[0m', text); |
11 | }; | 11 | }; |
12 | 12 | ||
13 | module.exports = async () => { | 13 | module.exports = async () => { |
@@ -21,7 +21,7 @@ module.exports = async () => { | |||
21 | const user = await User.find(1); | 21 | const user = await User.find(1); |
22 | let settings; | 22 | let settings; |
23 | if (!user) { | 23 | if (!user) { |
24 | migrateLog("🎩 Migrating from old Ferdi version as user doesn't exist"); | 24 | migrateLog("🎩 Migrating from old Ferdium version as user doesn't exist"); |
25 | 25 | ||
26 | // Create new user | 26 | // Create new user |
27 | await Database.raw('INSERT INTO "users" ("id") VALUES (\'1\');'); | 27 | await Database.raw('INSERT INTO "users" ("id") VALUES (\'1\');'); |
@@ -35,18 +35,18 @@ module.exports = async () => { | |||
35 | if ( | 35 | if ( |
36 | !settings || | 36 | !settings || |
37 | !settings.db_version || | 37 | !settings.db_version || |
38 | settings.db_version !== ferdiVersion | 38 | settings.db_version !== ferdiumVersion |
39 | ) { | 39 | ) { |
40 | const srcVersion = | 40 | const srcVersion = |
41 | settings && settings.db_version ? settings.db_version : '5.4.0-beta.2'; | 41 | settings && settings.db_version ? settings.db_version : '5.4.0-beta.2'; |
42 | migrateLog(`🔮 Migrating table from ${srcVersion} to ${ferdiVersion}`); | 42 | migrateLog(`🔮 Migrating table from ${srcVersion} to ${ferdiumVersion}`); |
43 | 43 | ||
44 | // Migrate database to current Ferdi version | 44 | // Migrate database to current Ferdium version |
45 | // Currently no migrations | 45 | // Currently no migrations |
46 | 46 | ||
47 | // Update version number in database | 47 | // Update version number in database |
48 | if (!settings) settings = {}; | 48 | if (!settings) settings = {}; |
49 | settings.db_version = ferdiVersion; | 49 | settings.db_version = ferdiumVersion; |
50 | const newUser = await User.find(1); // Fetch user again as we might have only just created it | 50 | const newUser = await User.find(1); // Fetch user again as we might have only just created it |
51 | newUser.settings = JSON.stringify(settings); | 51 | newUser.settings = JSON.stringify(settings); |
52 | await newUser.save(); | 52 | await newUser.save(); |
diff --git a/src/internal-server/start/routes.js b/src/internal-server/start/routes.js index c8cab2164..63d0876e3 100644 --- a/src/internal-server/start/routes.js +++ b/src/internal-server/start/routes.js | |||
@@ -14,7 +14,7 @@ const migrate = require('./migrate'); | |||
14 | 14 | ||
15 | migrate(); | 15 | migrate(); |
16 | 16 | ||
17 | const OnlyAllowFerdi = async ({ request, response }, next) => { | 17 | const OnlyAllowFerdium = async ({ request, response }, next) => { |
18 | const version = request.header('X-Franz-Version'); | 18 | const version = request.header('X-Franz-Version'); |
19 | if (!version) { | 19 | if (!version) { |
20 | return response.status(403).redirect('/'); | 20 | return response.status(403).redirect('/'); |
@@ -30,7 +30,7 @@ Route.get('health', ({ response }) => | |||
30 | api: 'success', | 30 | api: 'success', |
31 | db: 'success', | 31 | db: 'success', |
32 | }), | 32 | }), |
33 | ).middleware(OnlyAllowFerdi); | 33 | ).middleware(OnlyAllowFerdium); |
34 | 34 | ||
35 | // API is grouped under '/v1/' route | 35 | // API is grouped under '/v1/' route |
36 | Route.group(() => { | 36 | Route.group(() => { |
@@ -63,7 +63,7 @@ Route.group(() => { | |||
63 | Route.get('workspace', 'WorkspaceController.list'); | 63 | Route.get('workspace', 'WorkspaceController.list'); |
64 | }) | 64 | }) |
65 | .prefix(API_VERSION) | 65 | .prefix(API_VERSION) |
66 | .middleware(OnlyAllowFerdi); | 66 | .middleware(OnlyAllowFerdium); |
67 | 67 | ||
68 | Route.group(() => { | 68 | Route.group(() => { |
69 | Route.get('icon/:id', 'ServiceController.icon'); | 69 | Route.get('icon/:id', 'ServiceController.icon'); |
@@ -75,7 +75,7 @@ Route.get('import', ({ view }) => view.render('import')); | |||
75 | 75 | ||
76 | // Account transfer | 76 | // Account transfer |
77 | Route.get('export', 'UserController.export'); | 77 | Route.get('export', 'UserController.export'); |
78 | Route.post('transfer', 'UserController.importFerdi'); | 78 | Route.post('transfer', 'UserController.importFerdium'); |
79 | Route.get('transfer', ({ view }) => view.render('transfer')); | 79 | Route.get('transfer', ({ view }) => view.render('transfer')); |
80 | 80 | ||
81 | // Index | 81 | // Index |