[Support] xthursdayx - Ferdi-server [archived]


Recommended Posts

** Container Depreciated and Archived **

Please switch to Ferdium-server:

 

Ferdi Icon

Application Name: Ferdi-server

Application Site: https://github.com/getferdi/server

Docker Hub: https://hub.docker.com/r/getferdi/ferdi-server

Github: https://github.com/getferdi/server


Ferdi is a hard-fork of Franz, a messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many more. Ferdi-server is an unofficial replacement of the Franz server for use with the Ferdi Client.

 

This is a docker image of Ferdi-server running on Alpine Linux and Node.js (v10.16.3).

 

Configuration
After the first run, Ferdi-server's configuration is saved inside the `config.txt` file inside your persistent data directory (`/config` in the container).

 

  • <port>:3333 - Will map the container's port 3333 to a port on the host, default is 3333.
  • NODE_ENV- for specifying Node environment, production or development, default is development currently this should not be changed.
  • APP_URL - for specifying the URL, local or external, of the Ferdi-server, including http or https as necessary.

  • DB_CONNECTION - for specifying the database being used, default is sqlite.

  • DB_HOST - for specifying the database host, default is 127.0.0.1
  • DB_PORT - for specifying the database port, default is 3306
  • DB_USER - for specifying the database user, default is root
  • DB_PASSWORD - for specifying the database password, default is password
  • DB_DATABASE - for specifying the database name to be used, default is ferdi
  • DB_SSL - true only if your database is postgres and it is hosted online, on platforms like GCP, AWS, etc
  • MAIL_CONNECTION - for specifying the mail sender to be used, default is smtp
  • SMPT_HOST - for specifying the mail host to be used, default is 127.0.0.1
  • SMTP_PORT - for specifying the mail port to be used, default is 2525
  • MAIL_SSL - for specifying SMTP mail security, default is false
  • MAIL_USERNAME - or specifying your mail username to be used, default is username
  • MAIL_PASSWORD - for specifying your mail password to be used, default is password
  • MAIL_SENDER - for specifying the mail sender address to be used, default is [email protected]
  • IS_CREATION_ENABLED - for specifying whether to enable the creation of custom recipes, default is true
  • IS_DASHBOARD_ENABLED - for specifying whether to enable the Ferdi-server dashboard, default is true
  • IS_REGISTRATION_ENABLED - for specifying whether to allow user registration, default is true
  • CONNECT_WITH_FRANZ - for specifying whether to enable connections to the Franz server, default is true
  • DATA_DIR=/data - for specifying the SQLite database folder, default is /data
  • <path to data on host>:/data - this will store Ferdi-server's data (its database, among other things) on the docker host for persistence.
  • <path to recipes on host>:/app/recipes - this will store Ferdi-server's recipes on the docker host for persistence

 

By enabling the `CONNECT_WITH_FRANZ` option, Ferdi-server can:
    - Show the full Franz recipe library instead of only custom recipes
    - Import Franz accounts
 
NGINX Config Block
To access Ferdi-server from outside of your home network on a subdomain use this server block:

# Ferdi-server
server {
        listen 443 ssl http2;
        server_name ferdi.my.website;

           # all ssl related config moved to ssl.conf
        include /config/nginx/ssl.conf;

        location / {
             proxy_pass              http://<SERVERIP>:3333;
             proxy_set_header        X-Real-IP            $remote_addr;
             proxy_set_header        X-Forwarded-For      $proxy_add_x_forwarded_for;
             proxy_set_header        Host                 $host;
             proxy_set_header        X-Forwarded-Proto    $scheme;
        }
}

 

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

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

 

** UPDATE 2021-11-17 **

 The new version of the Ferdi-server docker image has been pushed to Docker Hub.

 

Existing users, please note: The latest updates to Ferdi-server and the Ferdi-server Docker image introduce changes to the default SQLite database name and location, as well as the internal container port. The new container port is 3333. If you would like to keep your existing SQLite database, you will need to add the DATA_DIR variable and change it to /app/database, to match your existing data volume. You will also need to change the DB_DATABASE variable to development to match your existing database. Please see the parameters in the Migration section below.
 

Migrating from an existing Ferdi-server:

If you are an existing Ferdi-server user using the built-in `SQlite` database, you should include the following variables:

| -p 3333:3333 | existing Ferdi-server users will need to update their container port mappings from 80:3333 to `3333:3333` |
| -e DB_PASSWORD=development | existing Ferdi-server users who use the built-in sqlite database should use the database name development |
| -e DATA_DIR=/app/database | existing Ferdi-server users who use the built-in sqlite database should add this environmental variable to ensure data persistence |
| -v <path to data on host>=/app/databases | existing Ferdi-server users who use the built-in sqlite database should use the volume name /app/database |

 

If you are an existing Ferdi-server user who uses an external database or different variables for the built-in `SQlite` database, you should update your parameters accordingly. For example, if you are using an external MariaDB or MySql  database your unique parameters might look like this:
 

| -e DB_CONNECTION=mysql | for specifying the database being used |
| -e DB_HOST=192.168.10.1 | for specifying the database host machine IP |
| -e DB_PORT=3306 | for specifying the database port |
| -e DB_USER=ferdi | for specifying the database user |
| -e DB_PASSWORD=ferdipw | for specifying the database password |
| -e DB_DATABASE=adonis | for specifying the database to be used |
| -v <path to database>:/app/database | this will strore Ferdi-server's database on the docker host for persistence |
| -v <path to recipes>:/app/recipes | this will strore Ferdi-server's recipes on the docker host for persistence |

 

**In either case, please be sure to pass the correct variables to the new Ferdi-server container in order maintain access to your existing database.**

 

For more information please check out the Docker README.md on Github: https://github.com/getferdi/server/tree/master/docker

 

If you appreciate my work please consider buying me a coffee, cheers! 😁

btn_donate_SM.gif

 

Edited by xthursdayx
Image no longer maintained.
  • Like 1
Link to comment
  • 2 weeks later...
3 hours ago, DrAg0n141 said:

Hi, is it possible to lock the account creation? Now can everyone create accounts on my Ferdi server.

Yes, absolutely. Just edit your container in unRAID Docker and change the ENV setting IS_CREATION_ENABLED to false and then apply. 

Edited by xthursdayx
  • Like 1
Link to comment
  • 2 weeks later...

Hi,

 

I've just tried to setup this docker container, which seems to fail based on the user permissions for NPM.

 

npm ERR! code EUIDLOOKUP
npm ERR! lifecycle could not get uid/gid
npm ERR! lifecycle [ 'nobody', 0 ]
npm ERR! lifecycle

 

I've tried to set the container variables for PUID/PGID to 99/100 without any luck. Any suggestions on how to proceed?

 

Thanks,

Sebastian

Link to comment

Hi Sebastian. Please see this conversation: https://github.com/xthursdayx/ferdi-server-docker/issues/4

 

Are you using the default template from my unRAID templates repo? If so, you shouldn't have to add the PUID/PGID variables for it to work. 

 

This is what my template looks like:1163138160_ScreenShot2019-10-18at13_20_35.thumb.png.a0ec2d02a63de4501177c4edd0d66868.png

 

Can you try deleting your appdata folder and the container/image and then reinstall with these variables (set to correct settings for your server) and report back?

Link to comment
1 hour ago, xthursdayx said:

Hi Sebastian. Please see this conversation: https://github.com/xthursdayx/ferdi-server-docker/issues/4

 

Are you using the default template from my unRAID templates repo? If so, you shouldn't have to add the PUID/PGID variables for it to work. 

 

imageproxy.php?img=&key=e5eec7c5c933ca16This is what my template looks like:1163138160_ScreenShot2019-10-18at13_20_35.thumb.png.a0ec2d02a63de4501177c4edd0d66868.png

 

Can you try deleting your appdata folder and the container/image and then reinstall with these variables (set to correct settings for your server) and report back?


Hi again,

 

My setup is identical to yours, except for the IS_CREATION_ENABLED and CONNECT_WITH_FRANZ variables set to true. The reason I did try to add PUID/PGID was only due to the error message I ended up with and I've already fully removed the container, appdata-folder and re-added the container. I could try it again if you believe it would make any difference.

Run log (with modified PUID/PGID): https://wl7r.me/TIMnQA
Run log (as per standard container setup): https://wl7r.me/iRCmDH

Screenshot of container settings: https://wl7r.me/uLT2ou

EDIT:
So I did it again, I removed the container + image and deleted the appdata-folder agian. I just changed the DB string to correspond with my DB-server. 
New run log: https://wl7r.me/nkFjoD

 

I don't know if its relevant, but I do run Unraid v6.8.0 rc1, which have a newer docker version.

EDIT2:
I retried the recreation of the container as I noticed the search path for /config was "/mnt/user/appdata" instead of "/mnt/cache/appdata" like on the the /recipes and /database. No change in the error type though.

EDIT3:
Same error when changing search path for /config, /recipes, /database to "/mnt/user/appdata" in the beginning of the path.

EDIT4: 
I use your container that is provided in the Unraid CA repo (https://wl7r.me/EJaMD4)

Edited by sebstrgg
Link to comment

It looks like this issue is related to running Node in Docker with the version of NPM that was being installed in this container. With NPM:6 in Docker, UID/GID lookup works on some hosts and not on others. I believe that this has been resolved in later versions of NPM. See: https://github.com/npm/uid-number/issues/7

 

I have updated the version of NPM used in the container and have also changed the way S6 initializes the application to ensure that it is running with the correct UID/GID.

 

@sebstrgg please remove the container + image and appdata folder and try creating/running it again (without adding the PUID/PGID variables) and report back. I think it will work now (hopefully...). Thanks.

Edited by xthursdayx
Link to comment

You should edit the template to have the "<Volume type=“appdata”>", so that the volume mapping respects the user's choice of location for appdata:

 

So this:

<Data>
	<Volume>
		<HostDir>/mnt/cache/appdata/ferdi-server/recipes</HostDir>
		<ContainerDir>/usr/src/app/recipes</ContainerDir>
		<Mode>rw</Mode>
	</Volume>
	<Volume>
		<HostDir>/mnt/cache/appdata/ferdi-server</HostDir>
		<ContainerDir>/config</ContainerDir>
		<Mode>rw</Mode>
	</Volume>
	<Volume>
		<HostDir>/mnt/cache/appdata/ferdi-server/database</HostDir>
		<ContainerDir>/usr/src/app/database</ContainerDir>
		<Mode>rw</Mode>
	</Volume>
<Data>

would loook like this:

<Data>
	<Volume type=“appdata”>
		<HostDir>/mnt/cache/appdata/ferdi-server/recipes</HostDir>
		<ContainerDir>/usr/src/app/recipes</ContainerDir>
		<Mode>rw</Mode>
	</Volume>
	<Volume type=“appdata”>
		<HostDir>/mnt/cache/appdata/ferdi-server</HostDir>
		<ContainerDir>/config</ContainerDir>
		<Mode>rw</Mode>
	</Volume>
	<Volume type=“appdata”>
		<HostDir>/mnt/cache/appdata/ferdi-server/database</HostDir>
		<ContainerDir>/usr/src/app/database</ContainerDir>
		<Mode>rw</Mode>
	</Volume>
<Data>

 

Link to comment
59 minutes ago, ICDeadPpl said:

You should edit the template to have the "<Volume type=“appdata”>", so that the volume mapping respects the user's choice of location for appdata:

That doesn't actually work.  (Note also that the Volume section of the xml is completely ignored, and the system looks at the Config section instead)

 

The way that the system does work is that any container path of /config is automatically remapped over to the user's appdata.

 

Either way, the real problem here is that the default mapping for recipes and database explicitly references /mnt/cache/... instead of /mnt/user/...  Not a problem if the user has a cache drive, but since many don't this would wind up getting created into RAM which would then cause some weird issues with unRaid. 

Link to comment
7 hours ago, Squid said:

Either way, the real problem here is that the default mapping for recipes and database explicitly references /mnt/cache/... instead of /mnt/user/...  Not a problem if the user has a cache drive, but since many don't this would wind up getting created into RAM which would then cause some weird issues with unRaid

Right, I always mistakenly assume that everyone uses cache drives. 

 

Which would be a better solution, updating the template so that recipes and database referent /mnt/user/appdata/... or just leaving host directory location empty in the template so that people can just choose whatever they want?

Link to comment
17 hours ago, xthursdayx said:

It looks like this issue is related to running Node in Docker with the version of NPM that was being installed in this container. With NPM:6 in Docker, UID/GID lookup works on some hosts and not on others. I believe that this has been resolved in later versions of NPM. See: https://github.com/npm/uid-number/issues/7

 

I have updated the version of NPM used in the container and have also changed the way S6 initializes the application to ensure that it is running with the correct UID/GID.

 

@sebstrgg please remove the container + image and appdata folder and try creating/running it again (without adding the PUID/PGID variables) and report back. I think it will work now (hopefully...). Thanks.

Ok, so I just re-did the procedure and ended up with the same error as before, but now with an additional error. 

 

Full Run log: https://wl7r.me/KIBh8R

 

(This was tested just now, after your second update if I understood the previous posts correctly)

Edited by sebstrgg
Link to comment
3 hours ago, xthursdayx said:

@sebstrgg Just to update this, I've heard from someone else who was having the same problem you were that the problem has been fixed. 

 

On 10/20/2019 at 10:46 AM, xthursdayx said:

@sebstrgg  would you mind trying it again now with the updated image?

 

Sorry to keep asking you to try it out, but unfortunately I am unable to reproduce this issue on either my workstation or server. 

 

Thanks.

 

Not a problem at all! I'm happy to help :)


You're perfectly right (or rather the other user) and the inital problems with the containers is officially fixed! I got it working right away!

 

Thank you!

Link to comment
  • 3 months later...
  • 1 month later...

An idea from a novice unraid user, who wast sure what to do at first for the database and recipes blanks.

 

Since you have the appdata autofilled, you should provide some guidance on how to populate the database and recipes blanks.  Maybe something in the overview could help?  I filled them in as follows, but couldn't use the drop down menu since the folders didn't exist yet.  Also you may want to include an update image of the template with the correct blanks filled in the way Squid suggests, which i think ends up like the way below:

 

/mnt/user/appdata/ferdi-server/recipes

/mnt/user/appdata/ferdi-server/database

 

So far it looks like it ran and setup correctly.

Link to comment
4 hours ago, TheDon said:

Also you may want to include an update image of the template with the correct blanks filled in the way Squid suggests

Unfortunately, I think you misunderstood Squid's post. In this post Squid suggested that I leave the host directory location empty in the template, so that the user can select whatever location they want, since a default mapping for recipes and database that assumes the user uses a cache drive will create problems if they don't. 

 

My template actually does not have the appdata autofilled. As Squid notes, the way unRAID's Docker system works is that any template container path of /config is automatically remapped over to the user's appdata, which is what you see when you load the template. However, I have updated the first post to clarify that the user will have to select their own Database and Recipes directories and provides some guidance for doing so. 

 

I use a cache drive, so I use the following locations for my Database and Recipes directories:

/mnt/cache/appdata/ferdi-server/database
/mnt/cache/appdata/ferdi-server/recipes

If you don't use a cache drive, then the folder paths you listed should be correct. 

Edited by xthursdayx
  • Thanks 1
Link to comment
1 hour ago, xthursdayx said:

If you don't use a cache drive, then the folder paths you listed should be correct. 

I don't think this is necessarily true, since using the paths i stated, the locations should be on my cache drive in my appdata share, which i confirmed the directories did get created, but are empty ( i have only run the docker startup, so that might be normal if i have yet to import and account or anything like that).

 

My x2 512 nvme cache drives are pooled and contain all my appdata.  I don't recall where, but i think i have read that its better to use the file path /mnt/user/sharename rather than /mnt/cache or /mnt/disk?  I still may not be understanding Squid's post 100%.

Link to comment
2 hours ago, TheDon said:

I don't think this is necessarily true, since using the paths i stated, the locations should be on my cache drive in my appdata share, which i confirmed the directories did get created, but are empty ( i have only run the docker startup, so that might be normal if i have yet to import and account or anything like that).

 

My x2 512 nvme cache drives are pooled and contain all my appdata.  I don't recall where, but i think i have read that its better to use the file path /mnt/user/sharename rather than /mnt/cache or /mnt/disk?  I still may not be understanding Squid's post 100%.

Well, a lot depends on how you've set up your appdata user share. Hoewever, if you have your appdata user share set to anything other than cache "only" and mapped the database and recipes directories to /mnt/user/appdata/ferdi-server/recipes and /mnt/user/appdata/ferdi-server/database as you stated then they will write to your array, not your cache drives. You will still see the directories at /mnt/cache/appdata/ferdi-server/recipes and /mnt/user/appdata/ferdi-server/database, because your appdata file structure is mirrored at both /mnt/user and /mnt/cache, but they won't be written into. If you want your recipes and data base to be on your cache drive you'll need to correct your paths to /mnt/cache/appdata/ferdi-server/recipes and /mnt/cache/appdata/ferdi-server/recipes.

 

You will also want to go to your appdata user share and make sure that the setting "Use cache (for new files/directories)" is set to "Only", if you want it to only exist on your cache, or "Prefer" instead, which can help to avoid problems in the event that you run out of cache disk space. You will want to invoke the mover (on the main page) after making this change. If you find there are still things on your array instead of the cache after the mover runs, it might have been that the data was in use at the time. Stop all your docker containers, the docker itself, any vms, and then try running to mover.

Based on everything you've written, including the fact that you're a novice user, it might be worthwhile to continue reading up about using docker on unRAID, cache drives, disk shares vs user shares, and user share settings. Some good places to start are here in the unRAID documentation and here and here on the forum).

 

Edited by xthursdayx
Link to comment
  • xthursdayx changed the title to [Support] xthursdayx - Ferdi-server [archived]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.