I would like to get some help from you because I have reached the limits of my knowledge and can’t get any further.
When going through the AWS Hosting Guide AWS Hosting | Community Health Toolkit
I selected the following EC2 server in point 1:
- “Ubuntu Server 20.04 LTS (HVM), SSD Volume Type - ami-0629230e074c580f2 (64-bit x86) / ami-03b47d2d727e13114 (64-bit Arm)”, Family: t3, Type: t3.medium, vCPUs: 2, Memory (GiB): 4
- Instance Storage (GB): EBS only, Storage Size (Gib): 8, General Purpose SSD (gp2)
- In the Security Group I added the Types: HTTP and HTTPS
Then I created the Elastic IP and connected it to the EC2 instance. I set and successfully achieved the stated goal of connecting to an instance via SSH.
In step 2 (create or restore EBS volume) no problems occurred.
Step 3 went smoothly as well:
- For the sub-step 2: where we have to follow the instructions on
Make an Amazon EBS volume available for use on Linux - Amazon Elastic Compute Cloud, i figured out, that my EC2 Amazon Virtual Machine that runs with Ubuntu only has one disc partition that is formatted with ext4. Thus, I jumped right to the step, where I had to set /srv as mounting point and also where i had to edit /etc/fstab/ to set /srv as the mounting-point on autostart.
- For the sub-step 3 and then on the homepage cht-infrastructure/self-hosting/prepare-system at master · medic/cht-infrastructure · GitHub in step 3 I manually duplicated the ubuntu folder from cht-infrastructure/self-hosting/prepare-system/ubuntu at master · medic/cht-infrastructure · GitHub on the AWS EC2 Instance itself and then ran the script ./prepare-system.sh
So I finally achieved the goal of having the EBS volume mounted on /srv.
After that, I did not continue with the instructions from AWS Hosting for the time being because we lack a domain and do not currently have an SSL certificate.
However, my instance was now online and running. The next thing I wanted to do was :
- To “install” the CHT Project Configurer a.k.a cht-conf which is a command-line interface tool to manage and configure CHT apps.
- Populate my running instance with test data (using the reference project “Maternal & Newborn Health Reference Application”).
- Publish an Android app via Play-Store to be able to download it to a device and then use the URL of my running instance.
- I installed Cht-conf directly on the EC2 VM (not within any container that i had through running ./prepare-system.sh script) by following the instructions on CHT Local Environment Setup | Community Health Toolkit for the setup on Ubuntu.
- Npm was not yet available on my EC2 Amazon Ubuntu instance, so I had run “apt install npm” to be able to run “npm install -g cht-conf” according to the instructions in point 2.
- I was also able to install Pyxform
- Small sidenote: there is a type on your homepage: CHT Local Environment Setup | Community Health Toolkit. For Pyxform you write down that we should run the command: “sudo python -m pip install git+https://firstname.lastname@example.org#egg**=** pyxform-medic”, but it should not be @cht-conf-…, it should be @medic-conf-…)
- In order to execute the command sudo python -m pip install git+https://email@example.com#egg=pyxform-medic, I first had to install python and pip, because they were not available on the EC2 Amazzon Ubuntu instance either. I installed python with “sudo apt install python” and pip with " curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py # Fetch get-pip.py for python 2; python2 get-pip.py"
Getting the reference app and test-data:
However, since I now had a running instance due to going through the AWS hosting guide, where the images medicmobile/medic-os:cht-3.9.0-rc.2 and medicmobile/haproxy:rc-1.17 had been loaded there, because these images were written down in the docker-compose file, I did not have the “Maternal & Newborn Health Reference Application” reference application available.
Therefore, I wanted to adapt my instance so that I could have the reference application running and thus have test data.
For this, I executed the command git clone GitHub - medic/cht-core: The CHT Core Framework makes it faster to build responsive, offline-first digital health apps that equip health workers to provide better care in their communities. It is a central resource of the Community Health Toolkit. on my EC2 server to have the folder cht-core. Then I switched to the cht-core/config/default directory, where the reference application is, according to the instructions on CHT Local Environment Setup | Community Health Toolkit, and then executed the command according to the homepage: “cht --url=https://medic:password@localhost --accept-self-signed-certs csv-to-docs upload-docs”
- Small side note here: the command is given here with an error because at the end of the command there are the characters `. which do not belong there: “cht --url=https://medic:password@localhost --accept-self-signed-certs csv-to-docs upload-docs`.”
In this way, I had now managed to install cht-conf and import the reference app with the data on my AWS EC2 instance.
Now I also wanted to test this app with an Android phone and therefore also went through the optional step 5. I ran the command ./scripts/add-local-ip-certs-to-docker.sh in the cht-core folder on my AWS EC2 instance and then also set the command: cht --url=https://medic:firstname.lastname@example.org.
In order to have an Android version that I can connect to my EC2 instance, I wanted to load my first app in a “standard” version on the “Play-Store”. However, I did not understand the procedure at all.
What exactly do I have to do in order to be able to download the application to my mobile phone via the play store and connect it to my running instance on AWS?
I copied git clone --recurse-submodules GitHub - medic/cht-android: A native Android container for Community Health Toolkit (CHT) applications with the repository locally to my personal PC. Then I went to the directory “cht-android” and ran make bundle.
Then I went there and created a new tag (just increased the number by one: “git tag v.0.10.2-alpha.1” and then with “git push --tags” I got a “Permission to medic/cht-android.git denied” → it makes sense for me that I am not allowed to push to the master branch (since i am not a developer of this project), but i understood the manual that way, that i should do it like that.
So to find another solution, I tried to simply upload my own .aab files (which I had created with “make assemble”). But before that I went to the page Publishing | Community Health Toolkit and found the subcategory “New App in the Play Store”. There I followed the instructions and tried to create my own brand.
On Building CHT Android Flavors | Community Health Toolkit step 2 says at the end: “The variables in the env sections point to a keystore and the passwords to unlock the keystore that will be generated in the following steps, but it’s important to follow the name convention, in the example all the variables that are configured in Github Actions end with the suffix _NEW_BRAND, these variables need to be added in the cht-android repo settings by a manager of Medic.”
So would a manager of medic on the cht-android repo please record “COMBACAL” as “_NEW_BRAND” for me?
I think i will end my long text here and then continue with my diffuculties and questions, as soon as I have an answer to my two questions above:
- What exactly do I have to do in order to be able to download the application to my mobile phone via the play store and connect it to my running instance on AWS?
- Would a manager of medic on the cht-android repo please record “COMBACAL” as “_NEW_BRAND” for me?
Thank you very much in advance and best regards,