Skip to content

Commit

Permalink
refactor: project maintenance
Browse files Browse the repository at this point in the history
- work in progress
  • Loading branch information
mcmxcdev committed Feb 11, 2024
1 parent dcaa296 commit 0300c85
Show file tree
Hide file tree
Showing 115 changed files with 5,991 additions and 12,095 deletions.
35 changes: 0 additions & 35 deletions .eslintignore

This file was deleted.

27 changes: 15 additions & 12 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,13 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
},
ignorePatterns: ['node_modules', 'build', 'recipes', '.eslintrc.js'],
extends: [
'plugin:adonis/typescriptApp',
'plugin:unicorn/recommended',
'prettier',
],
plugins: [],
globals: {
use: true,
},
extends: ['@adonisjs/eslint-config/app', 'plugin:unicorn/recommended', 'prettier'],
plugins: ['@adonisjs/eslint-plugin'],
env: {
es6: true,
node: true,
Expand All @@ -25,7 +18,7 @@ module.exports = {
{
files: ['**/*.ts'],
extends: [
'plugin:adonis/typescriptApp',
'@adonisjs/eslint-config/app',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/strict',
// TODO: Opt-in to a stricter ruleset in the future
Expand All @@ -47,6 +40,16 @@ module.exports = {
'@typescript-eslint/no-extraneous-class': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/prefer-ts-expect-error': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/no-shadow': 0,
'@typescript-eslint/prefer-nullish-coalescing': 0,

// @adonisjs/eslint-plugin
'@adonisjs/prefer-lazy-controller-import': 2,
'@adonisjs/prefer-lazy-listener-import': 2,

// eslint-plugin-unicorn
'unicorn/filename-case': 0,
},
},
],
Expand Down Expand Up @@ -83,4 +86,4 @@ module.exports = {
'unicorn/no-empty-file': 0,
'unicorn/prefer-top-level-await': 0,
},
};
}
2 changes: 1 addition & 1 deletion .prettierrc.js → .prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
module.exports = {
singleQuote: true,
arrowParens: 'avoid',
};
}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.11.0-alpine as build
FROM node:20.11.0-alpine AS build

WORKDIR /server-build

Expand All @@ -7,7 +7,7 @@ RUN apk add --no-cache python3 make gcc g++ libc-dev sqlite-dev
COPY . /server-build

ENV CI=true
RUN PNPM_VERSION=$(node -p 'require("./package.json").engines.pnpm'); npm i -g pnpm@$PNPM_VERSION
RUN PNPM_VERSION=$(node -p 'require("./package.json").engines.pnpm'); npm i -g pnpm@"$PNPM_VERSION"
RUN pnpm install --config.build-from-source=sqlite --config.sqlite=/usr/local
RUN pnpm build

Expand Down
100 changes: 56 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
</p>

# Server
[![Docker Build and Publish](https://github.com/ferdium/ferdium-server/actions/workflows/docker.yml/badge.svg)](https://github.com/ferdium/ferdium-server/actions/workflows/docker.yml)

[![Docker Build and Publish](https://github.com/ferdium/ferdium-server/actions/workflows/docker.yml/badge.svg)](https://github.com/ferdium/ferdium-server/actions/workflows/docker.yml)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

<a href='#contributors-'><img src='https://img.shields.io/badge/contributors-17-default.svg?logo=github' alt='Contributors'/></a>

<!-- ALL-CONTRIBUTORS-BADGE:END -->

> 👨🏾‍🍳 Server for [Ferdium](https://ferdium.org) that you can re-use to run your own
Expand All @@ -23,6 +26,7 @@ A custom server allows you to manage the data of all registered users yourself a
</details>

## Features

- [x] User registration and login
- [x] Service creation, download, listing and removing
- [x] Workspace support
Expand All @@ -45,47 +49,49 @@ After setting up the docker container we recommend you set up an NGINX reverse p

1. Pull the Docker image

```sh
docker pull ferdium/ferdium-server:latest
```
2. Create a *new* Docker container with your desired configuration **Existing users please seee the warning above.**

```sh
docker create \
--name=ferdium-server \
-e NODE_ENV=development \
-e APP_URL=<ferdium-server-url> \
-e DB_CONNECTION=<database> \
-e DB_HOST=<yourdbhost> \
-e DB_PORT=<yourdbport> \
-e DB_USER=<yourdbuser> \
-e DB_PASSWORD=<yourdbpass> \
-e DB_DATABASE=<yourdbdatabase> \
-e DB_SSL=false \
-e MAIL_CONNECTION=smtp \
-e SMTP_HOST=<smtpmailserver> \
-e SMTP_PORT=<smtpport> \
-e MAIL_SSL=true/false \
-e MAIL_USERNAME=<yourmailusername> \
-e MAIL_PASSWORD=<yourmailpassword> \
-e MAIL_SENDER=<sendemailaddress> \
-e IS_CREATION_ENABLED=true \
-e IS_DASHBOARD_ENABLED=true \
-e IS_REGISTRATION_ENABLED=true \
-e CONNECT_WITH_FRANZ=true \
-e DATA_DIR=data \
-p <port>:3333 \
-v <path to data>:/data \
-v <path to recipes>:/app/recipes \
--restart unless-stopped \
ferdium/ferdium-server:latest
```

Alternatively, you can also use docker-compose v2 schema. An example can be found [in the docker folder](./docker/docker-compose.yml).
```sh
docker pull ferdium/ferdium-server:latest
```

2. Create a _new_ Docker container with your desired configuration **Existing users please seee the warning above.**

```sh
docker create \
--name=ferdium-server \
-e NODE_ENV=development \
-e APP_URL=<ferdium-server-url> \
-e DB_CONNECTION=<database> \
-e DB_HOST=<yourdbhost> \
-e DB_PORT=<yourdbport> \
-e DB_USER=<yourdbuser> \
-e DB_PASSWORD=<yourdbpass> \
-e DB_DATABASE=<yourdbdatabase> \
-e DB_SSL=false \
-e MAIL_CONNECTION=smtp \
-e SMTP_HOST=<smtpmailserver> \
-e SMTP_PORT=<smtpport> \
-e MAIL_SSL=true/false \
-e MAIL_USERNAME=<yourmailusername> \
-e MAIL_PASSWORD=<yourmailpassword> \
-e MAIL_SENDER=<sendemailaddress> \
-e IS_CREATION_ENABLED=true \
-e IS_DASHBOARD_ENABLED=true \
-e IS_REGISTRATION_ENABLED=true \
-e CONNECT_WITH_FRANZ=true \
-e DATA_DIR=data \
-p <port>:3333 \
-v <path to data>:/data \
-v <path to recipes>:/app/recipes \
--restart unless-stopped \
ferdium/ferdium-server:latest
```

Alternatively, you can also use docker-compose v2 schema. An example can be found [in the docker folder](./docker/docker-compose.yml).

3. Optionally, you can [set up Nginx as a reverse proxy](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04#set-up-nginx-as-a-reverse-proxy-server).

For more information on configuring the Docker image, please read [the Ferdium docker documentation](./docker/README.md).

</details>
<details>
<summary>Manual setup</summary>
Expand All @@ -97,38 +103,43 @@ For more information on configuring the Docker image, please read [the Ferdium d
5. Run `npm install` to install local dependencies
6. Run the database migrations with

```js
node ace migration:run
```
```js
node ace migration:run
```

7. Start the server with

```js
npm start
```
```js
npm start
```

</details>
<details>
<summary>Configuration</summary>

Ferdium-server's configuration is saved inside an `.env` file. Besides AdonisJS's settings, Ferdium-server has the following custom settings:

- `IS_CREATION_ENABLED` (`true` or `false`, default: `true`): Whether to enable the [creation of custom recipes](#creating-and-using-custom-recipes)
- `IS_REGISTRATION_ENABLED` (`true` or `false`, default: `true`): Whether to enable the creation of new user accounts
- `IS_DASHBOARD_ENABLED` (`true` or `false`, default: `true`): Whether to enable the user dashboard
- `CONNECT_WITH_FRANZ` (`true` or `false`, default: `true`): Whether to enable connections to the Franz server. By enabling this option, Ferdium-server can:
- Show the full Franz recipe library instead of only custom recipes
- Import Franz accounts

</details>
<details>
<summary>Importing your Franz/Ferdi account</summary>

Ferdium-server allows you to import your full Franz/Ferdi account, including all its settings.

To import your Franz/Ferdi account, open `http://[YOUR FERDIUM-SERVER]/import` in your browser and login using your Franz/Ferdi account details. Ferdium-server will create a new user with the same credentials and copy your Franz/Ferdi settings, services and workspaces.

</details>
<details>
<summary>Transferring user data</summary>

Please refer to <https://github.com/getferdi/ferdi/wiki/Transferring-data-between-servers>

</details>
<details>
<summary>Creating and using custom recipes</summary>
Expand All @@ -149,6 +160,7 @@ To add your recipe to Ferdium-server, open `http://[YOUR FERDIUM-SERVER]/new` in
<summary>Listing custom recipes</summary>
Inside Ferdium, searching for `ferdium:custom` will list all of your custom recipes.
</details>
## Contributing
Expand Down
16 changes: 0 additions & 16 deletions ace

This file was deleted.

Loading

0 comments on commit 0300c85

Please sign in to comment.