This application is a simple API server for automatically updating client applications. It allows you to upload your application to S3 and set the version number. The client application can then check the version number against the auto updater service API. If the service has a newer version, it will return a link to the updated service, and the client application will show an alert.
The API server is designed for straightforward and intuitive application management. It supports updating client applications both in the background and on-demand, depending on how it's implemented in the client application. This provides flexibility in choosing the update method that best suits your needs.
The documentation is available in this repository faynoSync-site and at this link faynoSync Documentation.
The repository with the available frontend is available in this repository faynoSync-dashboard.
You can find examples of client applications here.
You can find the Postman template here, or you can check available API requests here.
To use this application, you will need to have Golang installed on your machine. You can install it from the official website.
Once you have installed Golang, clone this repository to your local machine:
To configure the faynoSync, you will need to set the following environment variables:
You can set these environment variables in a .env file in the root directory of the application. You can use the .env.local file, which contains all filled variables.
To build and run the API with all dependencies, you can use the following command:
You can now run tests using this command (please wait until the s3-service successfully creates the bucket):
If you only want to run dependency services (for local development without Docker), use this command:
To use the auto updater service, follow these steps:
- Build the application:
- Start the auto updater service with migrations:
Note: To rollback your migrations run:
-
Upload your application to S3 and set the version number in faynoSync-dashboard or using API.
-
In your client application, make a GET request to the auto updater service API, passing the current version number as a query parameter:
The auto updater service will return a JSON response with the following structure:
If an update is available, the update_available field will be true, and the update_url field will contain a link to the updated application.
- In your client application, show an alert to the user indicating that an update is available and provide a link to download the updated application.
Run e2e tests:
Build test binary file:
Test Descriptions
To successfully run the tests and have them pass, you need to populate the .env file.
The tests verify the implemented API using a test database and an existing S3 bucket.
List of Tests- TestHealthCheck
- TestLogin
- TestFailedLogin (expected result from API "401")
- TestListApps
- TestListAppsWithInvalidToken (expected result from API "401")
- TestAppCreate
- TestSecondaryAppCreate (expected result from API "failed")
- TestUploadApp
- TestUploadDuplicateApp (expected result from API "failed")
- TestDeleteApp
- TestChannelCreateNightly
- TestChannelCreateStable
- TestUploadAppWithoutChannel (expected result from API "failed")
- TestMultipleUploadWithChannels
- TestSearchApp
- TestCheckVersionLatestVersion
- TestFetchkLatestVersionOfApp
- TestMultipleDelete
- TestDeleteNightlyChannel
- TestDeleteStableChannel
- TestPlatformCreate
- TestUploadAppWithoutPlatform
- TestArchCreate
- TestUploadAppWithoutArch
- TestDeletePlatform
- TestDeleteArch
- TestListArchs
- TestListPlatforms
- TestListChannels
- TestListArchsWhenExist
- TestListPlatformsWhenExist
- TestListChannelsWhenExist
- TestSignUp
- TestFailedSignUp (expected result from API "401")
- TestUpdateSpecificApp
- TestListAppsWhenExist
- TestDeleteAppMeta
- TestUpdateChannel
- TestUpdateApp
- TestUpdatePlatform
- TestUpdateArch
- TestFailedUpdatePlatform (expected result from API "400")
- TestChannelCreateWithWrongName (expected result from API "400")
- TestCreateSecondPlatform
- TestCreateSecondArch
- TestMultipleUploadWithSameExtension
- TestCheckVersionWithSameExtensionArtifactsAndDiffPlatformsArchs
- TestMultipleDeleteWithSameExtensionArtifactsAndDiffPlatformsArchs
- TestDeleteSecondPlatform
- TestDeleteSecondArch
- TestCreatePublicApp
- TestDeletePublicAppMeta
- TestUpdateSpecificAppWithSecondUser (expected result from API "500")
- TestListAppsWithSecondUser
- TestListChannelsWithSecondUser
- TestListPlatformsWithSecondUser
- TestListArchsWithSecondUser
- TestUpdateAppWithSecondUser (expected result from API "500")
- TestUpdateChannelWithSecondUser (expected result from API "500")
- TestUpdatePlatformWithSecondUser (expected result from API "500")
- TestUpdateArchWithSecondUser (expected result from API "500")
- TestMultipleDeleteWithSameExtensionArtifactsAndDiffPlatformsArchsWithSecondUser (expected result from API "500")
- TestDeleteNightlyChannelWithSecondUser (expected result from API "500")
- TestDeletePlatformWithSecondUser (expected result from API "500")
- TestDeleteArchWithSecondUser (expected result from API "500")
- TestDeleteAppMetaWithSecondUser (expected result from API "500")
- TestCreateTeamUser
- TestTeamUserLogin
- TestFailedUploadAppUsingTeamUser (expected result from API "403")
- TestFailedUpdateAppUsingTeamUser (expected result from API "403")
- TestFailedUpdateChannelUsingTeamUser (expected result from API "403")
- TestFailedUpdatePlatformUsingTeamUser (expected result from API "403")
- TestFailedUpdateArchUsingTeamUser (expected result from API "403")
- TestListAppsUsingTeamUserBeforeCreate
- TestListChannelsUsingTeamUserBeforeCreate
- TestListPlatformsUsingTeamUserBeforeCreate
- TestListArchsUsingTeamUserBeforeCreate
- TestAppCreateTeamUser
- TestListAppsUsingTeamUser
- TestFailedDeleteTeamUserApp (expected result from API "403")
- TestChannelCreateTeamUser
- TestListChannelsUsingTeamUser
- TestFailedDeleteTeamUserChannel (expected result from API "403")
- TestPlatformCreateTeamUser
- TestListPlatformsUsingTeamUser
- TestFailedDeleteTeamUserPlatform (expected result from API "403")
- TestArchCreateTeamUser
- TestListArchsUsingTeamUser
- TestFailedDeleteTeamUserArch (expected result from API "403")
- TestFailedUpdateTeamUser (expected result from API "403")
- TestUpdateTeamUser
- TestUpdateAppUsingTeamUser
- TestUpdateChannelUsingTeamUser
- TestUpdatePlatformUsingTeamUser
- TestUpdateArchUsingTeamUser
- TestFailedAppCreateTeamUser (expected result from API "403")
- TestDeleteTeamUserApp
- TestDeleteTeamUserChannel
- TestDeleteTeamUserPlatform
- TestDeleteTeamUserArch
- TestListTeamUsers
- TestDeleteTeamUser
- TestWhoAmIAdmin
- TestWhoAmITeamUser
- TestFailedUpdateAdminUser
- TestUpdateAdminUser
- TestFailedLoginWithOldPassword
- TestSuccessfulLoginWithNewPassword
- TestFailedUpdateAdminUserUsingTeamUser
- TestFilterSearchWithChannel
- TestFilterSearchWithChannelAndPublished
- TestFilterSearchWithChannelAndPublishedAndCritical
- TestFilterSearchWithChannelAndPublishedAndCriticalAndPlatform
- TestFilterSearchWithChannelAndPublishedAndCriticalAndPlatformAndArch
- TestSearchOnlyPublished
- TestSearchOnlyCritical
- TestSearchOnlyUniversalPlatform
- TestMultipleUploadWithIntermediate
- TestUpdateSpecificAppWithIntermediate
- TestCheckVersionWithIntermediate
- TestMultipleDeleteWithIntermediate
- TestTelemetryWithVariousParams
Install migrate tool here.
Then run the migrations again.
This application is licensed under the Apache license. See the LICENSE file for more details
.png)


