Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically create new category when category in integrations is not found #11

Merged
merged 6 commits into from
Sep 19, 2021

Conversation

fdarveau
Copy link
Owner

No description provided.

@fdarveau
Copy link
Owner Author

@NoLooseEnds

Follow up to your comment in pawelmalak#7 : The way I first implemented the app categories for docker/kubernetes integrations assumed you already had categories set up before hand, which was my case since the integrations weren't in Flame when I initially forked it.

I have made a few changes to permanently add categories (they will be saved to the database, unlike docker/kubernetes apps) found in docker/kubernetes. If custom order is enabled, those categories will be added at the end, but can be re-ordered manually afterwards.

You can try those changes by using the create-docker-categories tag. Once you confirm it is working as you expect, I will merge this into the master branch and it will be available in the latest tag shortly afterwards.

@NoLooseEnds
Copy link

Thanks for the fast response! I just tested, but it seems like it treats every category as a new one – regardless if it's the same name or not.

image

@fdarveau
Copy link
Owner Author

The latest change should fix that for the next categories you add. You might have to force pull the new image since docker-compose doesn't always pick it up. I'm not sure about CLI, but if you are using Portainer, you can re-create the container manually :
image
image

Even with the old image, the extra categories should be gone once you refresh the page. You will also have to remove the extra "Download" categories manually, but they should not appear after a refresh since the apps they contain will all be grouped in the first "Download" category and categories without any apps are not shown.

@NoLooseEnds
Copy link

Yes, seems to work fine - without removing anything (I plan to do that, just because, but it was nice to test without).

In CLI you do: docker-compose pull docker-compose up (mostly with -d detached mode)

Thanks!

@NoLooseEnds
Copy link

I've finished moving all my containers into categories (I probably need to rethink some), but the default one "Docker" is still showing – even without any containers.

image

@fdarveau
Copy link
Owner Author

Can you try the new build?

Also, make sure you are on the home page, and not on "/applications", since that page always shows all categories, even if no pinned items are in it.

@NoLooseEnds
Copy link

I am on the home page, but unfortunately, it still shows a "Docker" category title, with no apps below.

@fdarveau
Copy link
Owner Author

fdarveau commented Sep 18, 2021

The fix applied only to non-default categories. I have now applied it to non-default categories as well.

@NoLooseEnds
Copy link

Works. Thanks alot! :)

@fdarveau fdarveau merged commit 5abe779 into master Sep 19, 2021
@fdarveau
Copy link
Owner Author

fdarveau commented Sep 19, 2021

Good to hear!

This should be available in the latest tag in a few minutes.

@fdarveau fdarveau deleted the create-docker-categories branch September 19, 2021 15:21
fdarveau added a commit that referenced this pull request Oct 11, 2021
…t found (#11)

automatically create new category when category in docker or kubernetes labels is not found
@christofkac
Copy link

christofkac commented Oct 17, 2021

Hi,
I tried this container as I'm also interested in the categories for apps.
Unfortunately, pulling the fresh image does not work.
Here my results:

root@DS218plus:~# docker run -p 5446:5005 -v /volume1/docker/FlameNew:/app/data
ghcr.io/fdarveau/flame:latest
[2021-10-17 10:00:54.331 UTC+0] [INFO] Connected to database
[2021-10-17 10:00:54.638 UTC+0] [INFO] Executing pending migrations
[2021-10-17 10:00:57.256 UTC+0] [INFO] Socket: listen
[2021-10-17 10:00:57.257 UTC+0] [INFO] Server is running on port 5005 in production mode
[2021-10-17 10:01:13.277 UTC+0] [ERROR] SQLITE_ERROR: no such column: Category.type
[2021-10-17 10:01:13.292 UTC+0] [ERROR] SQLITE_ERROR: no such column: categoryId[2021-10-17 10:01:18.774 UTC+0] [ERROR] SQLITE_ERROR: no such column: isPinned
[2021-10-17 10:01:18.784 UTC+0] [ERROR] SQLITE_ERROR: no such column: categoryId

The output of the webpage is broken, too:
Screenshot

I would like to add the categories via the webpage and not the docker-file, not sure if this is the problem.

Any idea how to fix this?
Thanks!
Christof

@fdarveau
Copy link
Owner Author

If you used the same database as the original repository, can you try with a new one? If that works, there may be an issue with the migration from the original repository to my fork.

Also, there are currently some broken features in my fork, such as adding bookmarks / bookmark categories.

I don't have much time to investigate these problems in the following weeks, but I should be able to take a look into it by the end of November (sorry, I know that's a long time to wait for a fix).

@christofkac
Copy link

Thanks for the feedback.....I only don't fully understand what you mean with "new database" as I took your docker container, i.e. I would have expected that it contains the new database.
Can you point me at the thing I need to change?
Thanks!

@fdarveau
Copy link
Owner Author

The database is saved in the volume you specified, so it should be in /volume1/docker/FlameNew. If you used the same volume when (and if ) you used the original repository, it contains the original repository's database, which may be incompatible with my version.

To create a new database, you should either move/rename the database file in /volume1/docker/FlameNew or change the path in the docker run command (ex: docker run -p 5446:5005 -v /volume1/docker/FlameNew2:/app/data ghcr.io/fdarveau/flame:latest)

@Desaydrone
Copy link

Desaydrone commented Oct 23, 2021

Hello,

Got the same problem than @christofkac , i don't use the original container, and got this in the logs

flame    | [2021-10-23 05:51:09.497 UTC+0] [ERROR] SQLITE_ERROR: no such column: isPinned
flame    | [2021-10-23 05:51:09.502 UTC+0] [ERROR] SQLITE_ERROR: no such column: categoryId
flame    | [2021-10-23 05:51:31.034 UTC+0] [ERROR] SQLITE_ERROR: no such column: Category.type
flame    | [2021-10-23 05:51:31.037 UTC+0] [ERROR] SQLITE_ERROR: no such column: categoryId
flame    | [2021-10-23 05:51:42.058 UTC+0] [ERROR] SQLITE_ERROR: table categories has no column named type

Here are the sqlite database schema

CREATE TABLE `SequelizeMeta` (`name` VARCHAR(255) NOT NULL UNIQUE PRIMARY KEY);
CREATE TABLE `config` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `key` VARCHAR(255) NOT NULL UNIQUE, `value` VARCHAR(255) NOT NULL, `valueType` VARCHAR(255) NOT NULL, `isLocked` TINYINT DEFAULT 0, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE `weather` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `externalLastUpdate` VARCHAR(255), `tempC` FLOAT, `tempF` FLOAT, `isDay` INTEGER, `cloud` INTEGER, `conditionText` TEXT, `conditionCode` INTEGER, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL);
CREATE TABLE `categories` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` VARCHAR(255) NOT NULL, `isPinned` TINYINT DEFAULT 0, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, `orderId` INTEGER DEFAULT NULL);
CREATE TABLE `bookmarks` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` VARCHAR(255) NOT NULL, `url` VARCHAR(255) NOT NULL, `categoryId` INTEGER NOT NULL, `icon` VARCHAR(255) DEFAULT '', `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL);
CREATE TABLE `apps` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` VARCHAR(255) NOT NULL, `url` VARCHAR(255) NOT NULL, `icon` VARCHAR(255) NOT NULL DEFAULT 'cancel', `isPinned` TINYINT DEFAULT 0, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, `orderId` INTEGER DEFAULT NULL);

and this is my docker compose file

version: '2.1'
services:
  flame:
    image: ghcr.io/fdarveau/flame:latest
    container_name: flame
    volumes:
      - /home/me/docker_compose/flame/data_flame:/app/data
    ports:
      - 80:5005
    restart: unless-stopped

Did i miss something in my conf ?

@fdarveau
Copy link
Owner Author

fdarveau commented Dec 7, 2021

I started working on updating this fork with the latest changes up to v2.1.1.

Since there are a ton of changes, including some changes that I had implemented in this fork such as ordering bookmarks, I basically started from scratch to make it easier to maintain on my side by using pawelmalak's code instead of mine for those features.

You can check the progress in #12 and you can pull ghcr.io/fdarveau/flame:merge_upstream_2-1-1 to test it out. IMPORTANT : I have not fully tested that version. There may still be bugs, but the basic features (such as managing apps/bookmarks) seems to work well.

Also, I noticed the Issues section of the repository was disabled, so I enabled it for future issues users encounter with this fork.

@fdarveau
Copy link
Owner Author

fdarveau commented Dec 10, 2021

@christofkac @Desaydrone I finished updating this fork to the latest version and everything seems to work fine on my end.

If you still need this application, can you give it a try? If you encounter any problem, you can open a new issue to discuss specific problems.

Note that there are some breaking changes which require deleting/renaming the database file, as described in the updated README : https://github.com/fdarveau/flame#important-update-2021-12-10.

@christofkac
Copy link

Hi,
I used the latest version from docker and it works fine.
Now the only issue is, that I can't define any category for apps - I thought this was part of your rework, isn't it?
I used the latest container from 2021-12-02 17:02:27.
The version pawelmalak/flame:dev-alpha2 seems to not work at all, in the log I see only
standard_init_linux.go:228: exec user process caused: exec format error
Any hints?
Thanks
Christof

@NoLooseEnds
Copy link

Pulled the :latest image, and it works fine. I started with a new db and config. Enabled docker api and presto; all is back, categories and all.

@fdarveau
Copy link
Owner Author

Hi,
I used the latest version from docker and it works fine.
Now the only issue is, that I can't define any category for apps - I thought this was part of your rework, isn't it?
I used the latest container from 2021-12-02 17:02:27.
The version pawelmalak/flame:dev-alpha2 seems to not work at all, in the log I see only
standard_init_linux.go:228: exec user process caused: exec format error
Any hints?
Thanks
Christof

If you are using images from pawelmalak, you will have to open issues in his repository.

If you want to try or need features from my fork (such as app categories), you should use ghcr.io/fdarveau/flame:latest

@Desaydrone
Copy link

Hi,

I works fine for me now, i can create category for apps. Awesome job, thanks a lot !!

@christofkac
Copy link

Hi,
my bad, I lost track of the repositories ;-)
I created a container with the following compose file:

version: '3.6'

services:
  flame:
    image: ghcr.io/fdarveau/flame:latest
    hostname: flame
    container_name: flame
    volumes:
      - flame-data:/app/data
    ports:
      - 5005:5005
    environment:
      TZ: Europe/Berlin
    restart: unless-stopped
    network_mode: bridge

# Explicitly define the persistent volume for your data storage
volumes:
  flame-data:

Container starts, but when I click on /apps, I get simply a black screen.
/bookmarks works as expected

I also deleted the persistent volume from my previous installation, so there should not be any left overs.
Any idea?
Thanks
Christof

@christofkac
Copy link

I tired on another server to create the container from ghcr.io/fdarveau/flame:latest with the same result.
I logged in and when I click on /app, only a black screen is visible.

Any help is appreciated.
Bye
Christof

@NoLooseEnds
Copy link

What does the logs say?

@fdarveau
Copy link
Owner Author

I logged in and when I click on /app, only a black screen is visible.

@christofkac Found the issue. I accidentally changed one of the links to the applications page to /apps instead of /applications. It is now fixed in the latest tag.

I also added a new "Not found" page to handle that kind of error more gracefully, with a link to the homepage that makes the app work again instead of always being a blank page.

If you encounter any other problem, please open a new issue to make things easier to track.

@christofkac
Copy link

Cool, works. Thanks.
I like your solution as it is very lightweight.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants