database not stored on docker-image with shinyproxy - r

I have developed a solution and decided to use shinyproxy.
I have the following problem:
A user needs to capture data on the solution, which must be stored and updated on the database for all users accessing the solution, I used SQLite and with R for this.
Now when I log in and capture data, it saves, but when i log in with a different user I dont get to find the captured data.
The problem is that saving data doesnt seem to be saving on the docker image, why is this and how can I go about remedying it?
For problem testing purposes:
Solution link: https://xxasdfqexx.com
Data Capturer user:
username: xxxxx
password: Fxxxx
Admin user:
username: inxxx
password: prupxxxxx
Testing:
Inside the solution, if you go to the data management tab, data entry and then right click on an table and insert a new row, click save changes, it must safe new changes to the docker image but its only temporarily doing so, the other user cant see the changes made.

This is expected behavior. The SQLite DB is stored within the running container, not the image. It is therefore lost when the container is shut down. And shinyproxy starts a new container for every user. The general solution with docker is to use an external volume that is mounted into the running container and use that file/directory to store persistent data. Together with shinyproxy, you have to use docker-volumes, c.f.
https://www.shinyproxy.io/configuration/#apps.
Putting this together you can use in the shinyproxy config something like:
apps:
- name: ...
docker-cmd: ...
docker-image: ...
docker-volumes: /some/local/path/:/mnt/persistent
And in the shiny app something like:
dbConnect(RSQLite::SQLite(), "/mnt/persistent/my-db.sqlite")

Related

Azerothcore: Looping on Realm Selection List

I've set up Azerothcore for a friend. In attempting to access the server I get stuck at the Realm Selection list.
Worldserver conf extract:
LoginDatabaseInfo = "127.0.0.1;3306;acore;acore;acore_auth"
WorldDatabaseInfo = "127.0.0.1;3306;acore;acore;acore_world"
CharacterDatabaseInfo = "127.0.0.1;3306;acore;acore;acore_characters"
Authserver conf extract:
LoginDatabaseInfo = "127.0.0.1;3306;acore;acore;acore_auth"
SQLDatabase:
acore_auth/realmlist
address: 127.0.0.1
localaddress: 127.0.0.1
port: 8085
I built the same server on my own PC without any issue. I can connect to his server using his external IP and I can log in fine using the account I created in the worldserver console, but when I click on the "Azerothcore" realm listed in the Realm Selection list it briefly says "Logging in to game server" briefly before looping around to the same Realm Selection list.
Any help anyone could offer would be much appreciated. Thanks.
We've both been looking through other similar issues for other emulators but none of the fixes proposed for those apply to Azerothcore.
In the SQL acore_auth database realm list table the external address was still set to 127.0.0.1. Oddly I had absolutely changed this, but it didn't seem to stick, when my friend changed it again, the server worked and performed normally.
I ran in to this issue as well. I finally figured out that heidi initially opens the table in the tables tab, which can't edit persistently. Heidi will appear to do the edit. every time you open the table in heidi it will look edited, but if you open the table in comandline or sql work bench, the Database contains only the default values. The solution is to open the table in heidi then click the "Data" tab. Here, you can perform actual edits.

Allow the user to modify some parameters from .env Symfony

I have some config variables on the .env file. I want to create a page on my web application to allow the administrators to modify the value of some .env variables (for example the mail configured to send mails). For this purpose, I have:
MAILER_SENDER_ADDRESS=backoffice#example.com
MAILER_SENDER_NAME="Application Name"
MAILER_URL=gmail://firstname.lastname#gmail.com:ijfxxiencrrdqihe#localhost
I am able to read the current values on my controller but I don't know how to save back the values filled by the user on my form.
Please, any help would be really apreciated.
Environment variables are there to help you specify variables for the particular environment your application runs on, for example you could have your app sitting locally on your computer which you develop on, and you could have it in the cloud running the production version of your app, version which will actually send emails correctly using real data.
What you need to do is have somewhere to store the settings you let your users customise, for example in a database. When it comes to sending the emails, you will then have to do the following:
$message = (new Swift_Message())
->setFrom(['john#doe.com' => 'John Doe'])
...

create cluster for existing mariadb database

I have an existing database for which i was looking to create a new clustered environment. I tried the following steps:
Create a new database instance (OS & DB Server).
Take a backup / snapshot from existing database server for all the databases.
Import the snapshot to the new server.
Configure the cluster - referred to various sites but all giving same solution. Example reference site - https://vexxhost.com/resources/tutorials/how-to-configure-a-galera-cluster-with-mariadb-on-ubuntu-12-04/
Ran the command (sudo galera_new_cluster) on the primary server. (Primary server - no issue starting up). But when we tried starting the secondary server - it actually crashed for some reason.
Unfortunately at this point, dont have the logs stored / backed up with me where it failed. But it seemed like it tried to sync in with the primary server - had some failure with that.
As for additional part of the actions performed above. Both the server with same username / password - created a passwordless ssh connection between both the machines. Also, the method of syncing is set to rsync.
Am i missing something or doing it wrong? Is there a better way available on it?

Can you FTP into an EC2 instance if you opted out of creating a key pair when you generated it?

I followed this AWS tutorial to get a Wordpress site up and running but it instructed me not to use the keypair option so now I can not follow those instructions to FTP and make simple CSS etc. changes.
Before I blow up the whole instance, am I missing an approach that can make FTP possible?
If you skipped creating key pair during instance launch, you can't connect to it. The only way to connect to that instance with (S)FTP now is to put a working key on the disk:
Stop the instance.
Detach the EBS volume and attach it to the instance that you can connect to.
Mount the volume and put a public key in ./ssh folder in the home directory of the user named bitnami.
Dismount the volume, detach it and attach back to the original instance.
Seem like it's easier to just recreate the instance, this time with a private key.

Phonegap Sqlite Vacuum

We have an offline capable tablet app using VSNomad (through Phonegap) with Sqlite local database. One thing I've noticed is when we delete all data from tables and drop tables (doing an "app reset") on an iPad it doesn't reflect that space has been opened up.
I've come across "VACUUM" command for Sqlite however I am unsure how/if this can be used with our implementation. When I tried to run it I get an error saying cannot run within a transaction.
Here's examples of how we're implementing
http://docs.phonegap.com/en/2.7.0/cordova_storage_storage.md.html#Storage
app.shared.db().transaction(function (tx) {
tx.executeSql('VACUUM', [], function (tx, results) {
alert('done');
}, function (tx, error) {
alert('error');
alert(error.message);
});
});
Is it possible to run a vacuum like this?
I implemented your code and I get:
E/SQLiteQuery(18724): exception: not an error; query: VACUUM
Searching a bit further I found out that the vacuum sql command can not be given while connected to the database, so cannot be run from the database open and transaction from within javascript nor phonegap. Can only be given from command line.
But there must be another way... (looking in to that).
For now I have a few suggestions for database management:
Make sure you can delete the app and start with a fresh database (see below)
Prevent growing of the database: empty table and not drop table all the time (transaction.executeSql('DELETE FROM tablename;');) Note: don't use the '*' mark
Populate your database if it's the first run, see: http://mebefreelancer.wordpress.com/2012/08/14/phonegap-if-database-exists-do-something-else-populate-database/
Try to set up your app in a way the database is being migrated in a nice way: see enter link description here (a django /south kind of way for migrations)

Resources