-
Notifications
You must be signed in to change notification settings - Fork 75
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
Support for command line of dart at Linux #146
Comments
Can you please help us with which command to run and get the libsqlcipher.so file or provide us libsqlcipher.so file to include it with our command line. |
Could you post the |
Here is my dockerfile:
|
After not getting able to get a good result from Dockerfile so tried to install Kali-Linux arm64 on my M1
But I am still getting the error of file is not database which is because of sqlcipher not exists.
did double checked by hasCipherDb(db) it still return false |
Our encrypted sqlcipher db work all good in: Android, Windows, iOS and MacOS We really need it to work on Dockerfile so we can host our db in serverless platform. thank you. |
This works for me (note the FROM dart:stable AS build
# Install sqlcipher
RUN apt update; \
apt install -y sqlcipher-dev
# Resolve app dependencies.
WORKDIR /app
... In the container, I'm just using this override: open.overrideForAll(() {
return DynamicLibrary.open('libsqlcipher.so');
}); If you want to make the image smaller at runtime, you can also use the recommended FROM dart:stable AS build
# Install sqlcipher
RUN apt update; \
apt install -y libsqlcipher-dev
# Resolve app dependencies.
WORKDIR /app
COPY pubspec.* ./
RUN dart pub get
# Copy app source code and AOT compile it.
COPY . .
# Ensure packages are still up-to-date if anything has changed
# RUN dart pub get
RUN dart pub get --offline
RUN dart compile exe bin/main.dart -o bin/server
FROM scratch
COPY --from=build /runtime/ /
COPY --from=build /app/bin/server /app/bin/
COPY --from=build /usr/lib/x86_64-linux-gnu/libsqlcipher.so /lib/
COPY --from=build /usr/lib/x86_64-linux-gnu/libcrypto.so.* /lib/
# Changing current directry to /app/bin
WORKDIR /app/bin
# Runing Dart Server
CMD ["./server"]
|
Thank you so much for your contribution, it worked all good thank you so much. |
@simolus3 I am using the drift package and have a very amazing experience with it. |
@simolus3 The good news is that libsqlcipher.so exists and the function of:
Return true when opening a new or old database which is good news and sqlcipher exists. but Now here is one more issue with opening the old database:
|
This my new Dockerfile
|
I did try opening the database with 'DB Browser for SQLite' So I am thinking that which version of the sqlcipher: |
I have tried to check the version of sqlcipher in my local directory and container by calling: |
Can you with how can I download the new version sqlcipher and share dockerfile back? |
Seems like you'll have to download and compile SQLCipher yourself then. You can take a look at my CMakeLists.txt for inspiration - you'll also have to install OpenSSL and a compiler toolchain. I'm not sure if you want to do this in the container, you can probably also compile a I can't give you a fully working solution here unfortunately - but if you compile SQLCipher on an x64 machine (if the container runtime is x64 as well), it should work. |
Thank you @simolus3.
As you can see above I have commented the
I have tried to connect to the docker container with ssh and downloaded the libsqlciopher.so and a couple of other files associated with it but From scratch still not able to load sqlcipher but the dart image where I installed the sqlcipher by compiling works all good. |
Please help me tell me which files are required for sqlcipher.so to work fine. so I will download these needed file by ssh scp and place it in the repo docker file and will not needed to always compile sqlcipher. |
I have downloaded the following files from the docker server by remote ssh scp:
|
Hello Simolus,
We want to run our server which has a database of sqlitecipher in the server with dart command line
https://dart.dev/tutorials/server/cmdline
When we run our app with flutter as the flutter repository contains sqlcipher_flutter_libs: ^0.5.4 in .yaml file, our flatter app works all good with the local flutter server.
Now we want to run our server in a container with Dockerfile so we need command line capability at pure dart code.
You can look at the command line simple here: (https://dart.dev/tutorials/server/cmdline)
Please help us how we can have sqlcipher in our command line dart app.
The text was updated successfully, but these errors were encountered: