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

[FEAT] SQLite #5

Closed
1 task done
modem7 opened this issue Nov 14, 2023 · 8 comments · Fixed by #6
Closed
1 task done

[FEAT] SQLite #5

modem7 opened this issue Nov 14, 2023 · 8 comments · Fixed by #6
Labels
enhancement New feature or request

Comments

@modem7
Copy link

modem7 commented Nov 14, 2023

Is this a new feature request?

  • I have searched the existing issues

Wanted change

Enable the use of SQLite within the image instead of having to spin up an extra DB container.

Reason for change

Ease of use, fewer containers.

Proposed code change

From https://github.com/ddworken/hishtory#advanced-features

A few configuration options:

If you want to use a SQLite backend, you can do so by setting the HISHTORY_SQLITE_DB environment variable to point to a file. It will then create a SQLite DB at the given location.
@modem7 modem7 added the enhancement New feature or request label Nov 14, 2023
@thespad
Copy link
Member

thespad commented Nov 14, 2023

Have you tried just setting HISHTORY_SQLITE_DB to a path you've mapped to the host? It's a Go app so it should be able to do it without any external deps, but we can always look to add any that turn out to be required.

@modem7
Copy link
Author

modem7 commented Nov 14, 2023

Have you tried just setting HISHTORY_SQLITE_DB to a path you've mapped to the host? It's a Go app so it should be able to do it without any external deps, but we can always look to add any that turn out to be required.

Good shout, I hadn't even considered that......blame the lack of coffee.

It looks like there's an issue upstream, and I've raised it in ddworken/hishtory#128

It merely shows No database configured, sleeping... in the logs.

@modem7 modem7 closed this as completed Nov 14, 2023
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Nov 14, 2023
@Roxedus
Copy link
Member

Roxedus commented Nov 14, 2023

Thats not a upstream error, thats our doing. https://github.com/linuxserver/docker-hishtory-server/blob/main/root/etc/s6-overlay/s6-rc.d/init-hishtory-config/run#L8

@Roxedus Roxedus reopened this Nov 14, 2023
@LinuxServer-CI LinuxServer-CI moved this from Done to Issues in Issue & PR Tracker Nov 14, 2023
@thespad
Copy link
Member

thespad commented Nov 14, 2023

I can fix that easily enough

@thespad thespad mentioned this issue Nov 14, 2023
1 task
@thespad
Copy link
Member

thespad commented Nov 14, 2023

Can you test with ghcr.io/linuxserver/lspipepr-hishtory-server:v0.251-pkg-fb5a6151-dev-7cd680f8c28ab4699e98ac8c8232432366fba732-pr-6 and see if that works for you.

@modem7
Copy link
Author

modem7 commented Nov 14, 2023

Whehei!

Looks like we're good!

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    999
───────────────────────────────────────

Using SQLite database, ensure you have mounted /squite/hishtory.sqlite into the container
[custom-init] No custom files found, skipping...
Opening DB
Connecting to DB
AutoMigrating DB tables
Pinging DB to confirm liveness
Done initializing DB
Listening on :8080
UnknownIp GET "/healthcheck"  13.904µs 2 B
[ls.io-init] done.
Found a valid version: v0.251
  hishtory-server:
    #image: lscr.io/linuxserver/hishtory-server:latest
    image: ghcr.io/linuxserver/lspipepr-hishtory-server:v0.251-pkg-fb5a6151-dev-7cd680f8c28ab4699e98ac8c8232432366fba732-pr-6
    container_name: Hishtory-Server
    environment:
      - PUID=$PUID
      - PGID=$PGID
      - TZ=$TZ
      - HISHTORY_SQLITE_DB=/squite/hishtory.sqlite
      # - HISHTORY_POSTGRES_DB=postgresql://${HISHTORY_DB_USER}:${HISHTORY_DB_PASS}@localhost:5432/hishtory?sslmode=disable
    network_mode: "host"
    volumes:
      - $USERDIR/HishtoryDB:/squite
#    ports:
#      - 24244:8080
    logging:
      driver: "local"
      options:
        max-size: 10m
        max-file: "3"
    # depends_on:
      # - hishtory-db
    restart: always

@thespad
Copy link
Member

thespad commented Nov 14, 2023

Cool, I'll get the PR merged in a little bit.

@modem7
Copy link
Author

modem7 commented Nov 14, 2023

I have also tested functionality with two clients, and they work as expected. No difference than if using postgres.

@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants