aboutsummaryrefslogtreecommitdiffstats
path: root/src/internal-server
diff options
context:
space:
mode:
authorLibravatar Aditya Mangalampalli <aditya.mangalampalli@gmail.com>2022-04-15 02:00:25 -0700
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2022-04-16 21:57:57 +0530
commit210131ca184c3aa043371857c022aa1aa149efbf (patch)
tree6bc4e10a1540e55a66146c099bc468a12287425e /src/internal-server
parentUpdate submodule url to ferdium-recipes (#1) (diff)
downloadferdium-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.js8
-rw-r--r--src/internal-server/app/Controllers/Http/StaticController.js2
-rw-r--r--src/internal-server/app/Controllers/Http/UserController.js12
-rw-r--r--src/internal-server/config/app.js2
-rw-r--r--src/internal-server/env.ini6
-rw-r--r--src/internal-server/resources/views/index.edge8
-rw-r--r--src/internal-server/resources/views/layouts/main.edge2
-rw-r--r--src/internal-server/resources/views/transfer.edge4
-rw-r--r--src/internal-server/start/migrate.js16
-rw-r--r--src/internal-server/start/routes.js8
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');
4const Env = use('Env'); 4const Env = use('Env');
5 5
6const fetch = require('node-fetch'); 6const fetch = require('node-fetch');
7const debug = require('debug')('Ferdi:internalServer:RecipeController'); 7const debug = require('debug')('Ferdium:internalServer:RecipeController');
8const { LIVE_FERDI_API } = require('../../../../config'); 8const { LIVE_FERDIUM_API } = require('../../../../config');
9const { API_VERSION } = require('../../../../environment-remote'); 9const { API_VERSION } = require('../../../../environment-remote');
10 10
11const RECIPES_URL = `${LIVE_FERDI_API}/${API_VERSION}/recipes`; 11const RECIPES_URL = `${LIVE_FERDIUM_API}/${API_VERSION}/recipes`;
12 12
13class RecipeController { 13class 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 @@
1HOST=localhost 1HOST=localhost
2PORT=45569 2PORT=45569
3NODE_ENV=development 3NODE_ENV=development
4APP_NAME=Ferdi Internal Server 4APP_NAME=Ferdium Internal Server
5APP_URL=http://${HOST}:${PORT} 5APP_URL=http://${HOST}:${PORT}
6CACHE_VIEWS=false 6CACHE_VIEWS=false
7APP_KEY=FERDIINTERNALSERVER 7APP_KEY=FERDIUMINTERNALSERVER
8DB_CONNECTION=sqlite 8DB_CONNECTION=sqlite
9DB_HOST=localhost 9DB_HOST=localhost
10DB_PORT=3306 10DB_PORT=3306
11DB_USER=root 11DB_USER=root
12DB_PASSWORD= 12DB_PASSWORD=
13DB_DATABASE=ferdi 13DB_DATABASE=ferdium
14HASH_DRIVER=bcrypt 14HASH_DRIVER=bcrypt
15IS_CREATION_ENABLED=true 15IS_CREATION_ENABLED=true
16CONNECT_WITH_FRANZ=true 16CONNECT_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 @@
1const { ferdiVersion } = require('../../environment-remote'); 1const { 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 */
6const Database = use('Database'); 6const Database = use('Database');
7const User = use('App/Models/User'); 7const User = use('App/Models/User');
8 8
9const migrateLog = text => { 9const 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
13module.exports = async () => { 13module.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
15migrate(); 15migrate();
16 16
17const OnlyAllowFerdi = async ({ request, response }, next) => { 17const 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
36Route.group(() => { 36Route.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
68Route.group(() => { 68Route.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
77Route.get('export', 'UserController.export'); 77Route.get('export', 'UserController.export');
78Route.post('transfer', 'UserController.importFerdi'); 78Route.post('transfer', 'UserController.importFerdium');
79Route.get('transfer', ({ view }) => view.render('transfer')); 79Route.get('transfer', ({ view }) => view.render('transfer'));
80 80
81// Index 81// Index