Git Product home page Git Product logo

spc-cloud's Introduction

spc-cloud

22.10.2023 manual

Live demo of the hosted container instance

- CURRENTLY DOWN TO REDUCE COSTS
  1. Visit http://spc-filetransfer.eastus.azurecontainer.io
  2. Try downloading the pre-stored "sample.jpg" file as an example
  3. Try uploading & downloading some files.

Run applicaton locally without container:

If you would like to run the server without using Docker container, please follow the below steps:

  1. Install sqlite3:
$ sudo apt-get install sqlite3
  1. Copy the spc-cloud/.env file into the spc-cloud/src/bin directory:
spc-cloud $ cp .env src/bin/
  1. Run spc-cloud/src $ npm install
  2. Run spc-cloud/src $ /bin/sh ./start.sh

The application server should now be running directly in the host OS, using the port specified in the .env file (80 by default)
If you encounter problems, please create an issue for this repository.

Run application locally using Docker Compose (recommended for development):

Always make sure using the correct Docker context, by executing:

spc-cloud $ docker context use default

Build the Docker image:

spc-cloud $ docker compose up --build -d 

Note 1: This will run the container as soon as the image is built.
Note 2: If you are building the image for the first time, you need to comment-out (using the '#' symbol) the last 4 lines of the docker-compose.yaml file, like this:

...
volumes:
  spc-db:
    #driver: azure_file
    #driver_opts:
    #  share_name: dnpacishare
    #  storage_account_name: spcvolumesstorage1

After running docker compose up --build -d for the first time, uncomment those 4 lines back, and leave them as they are.

If the image is already built, starting or stopping the container is as easy as running docker compose up or docker compose down.

Update the image in the Azure Container Registry (use to update the application hosted at Azure)

To update the production container image, first you need to install the Azure CLI. Then you can login into the ACR/container group:

$ az acr login --name spccloud

Note: Before trying to login, you should make sure the Docker context is set as "default"
Now you can push the current container image build into the ACR:

spc-cloud $ docker-compose push

After successful push, the image should have been successfully updated.
If you wish you can now proceed to starting the Azure Container Instance (ACI).

Run and stop the live remote container

In order to do that you first need to switch the Docker context from "default" to a context associated with Azure.
Check available Docker contexts by running: $ docker context ls The current context is always marked with the star "*" symbol. If you haven't yet created a context associated with Azure, then you can create one using docker context create aci myacicontext.
To switch the current context you need to run:

$ docker context use myacicontext

After that you can run or stop the production container by running

  $ docker compose up

or

  $ docker compose down

WARNING: This will change the state of the contaner, and affect the operating costs measured by Azure.

Change the network port used to access the application

To change the port used to access the application you need to modify the .env file.

Where do I learn more about the project technologies?

To learn more about the project, you can visit the repository community wiki: https://github.com/adameus03/spc-cloud/wiki If you feel like sharing the knowledge about the project technologies or have useful resources to include, feel free to contribute to the repository wiki.

What needs to be done?

Check the issue titled "TODO"

spc-cloud's People

Contributors

adameus03 avatar adamski234 avatar pavelradkevich avatar

Stargazers

Bartłomiej Czerwiński avatar

spc-cloud's Issues

TODO

Some of the issues to be resolved:

  • Configure HTTPS + forbid HTTP
  • Stopping the Azure container doesn't result in data loss (use Azure file storage?)
  • Integrate a PostreSQLSQLite database to store user authentication data (incorporate Docker Compose to upgrade the app into a multi-container app? to simplify the build process and enable File Share volume mount)
  • Make a good client GUI
  • Use an unique identifier as a filename for any file name for container directory for files uploaded by users
  • Store the file identifiers in the database and map them to user paths
  • Make files accessible only for the authorized users
  • Handle custom file permissions & file sharing
  • List user files
  • Bypass variable public IP (FQDN?)

WYMAGANIA SPC

Technologie projektowe

  • Microsoft Azure
  • Docker/Docker Compose
  • PostgreSQL SQLite
  • Node.js

Technologie Azure

  • ACR (Azure Container Registry)
  • ACI (Azure Container Instance)
  • File Share (Wolumen chmurowy montowany w kontenerze)

Wymagania projektowe

Wymagania użytkownika

  • Użytkownik może utworzyć konto
  • Użytkownik może zalogować się do swojego konta
  • Użytkownik może wylogować się ze swojego konta
  • Użytkownik może wgrać plik do systemu
  • Użytkownik może pobrać plik, którego jest właścicielem
  • Użytkownik może wyświetlić listę plików, których jest właścicielem
  • Użytkownik może wysłać jednocześnie wiele plików
  • Użytkownik może przeglądać historię dokonanych operacji plikowych
  • (Opcjonalnie) Użytkownik może udostnić plik innemu użytkownikowi/grupie użytkowników

Wymagania systemowe

Wymagania funkcjonalne

  • Możliwość przesyłania między klientem a serwerem/usługami chmurowymi plików po protokole HTTPS
  • Przechowywanie plików w chmurowym wolumenie Azure File Share
  • Możliwość wyboru prywatnego serwera aplikacji jako magazynu plików
  • Zapewnienie kontroli wersji plików (data, rozmiar, wersja)
  • Zapewnienie uwierzytelniania i autoryzacji w dostępie do plików
  • Obsługa uprawnień read-write dla plików i katalogów

Wymagania niefunkcjonalne

  • Konfiguracja połączenia zabezpieczonego kryptografią asymetryczną i uniemożliwienie połączenia clear-text
    Cel: Bezpieczeństwo danych w katalogach użytkownika
  • Zatrzymanie/Zresetowanie ACI nie powoduje utraty danych
    Cel: Bezpieczeństwo danych w katalogach użytkownika
  • Integracja projektu z bazą danych SQLite w celu przechowywania danych użytkowników
    Cel: Przechowywanie danych profilu użytkownika oraz danych o uprawnieniach w dostępie do katalogów i plików
  • Przechowywanie plików w wolumenie Azure File Share
    Cel: Umożliwia przechowywanie plików użytkownika bez ryzyka utraty danych związanego z zatrzymaniem kontenera aplikacji
  • Implementacja intuicyjnego w obsłudze GUI
    Cel: Szybkość obsługi i wygoda dla użytkownika
  • Stały adres IP lub przypisanie FQDN serwerowi aplikacji
    Cel: Jest niezbędne w celu przeniesienia systemu w tryb produkcyjny
  • Używanie unikalnego identyfikatora dla katalogu użytkownika w systemie plików wolumenu chmurowego
    Cel: Identyfikacja użytkownika systemu będącego właścicielem plików i katalogów
  • Przechowywanie plików użytkownika w katalogu o nazwie tożsamej z identyfikatorem użytkownika w bazie danych SQLite
    Cel: Powiązanie katalogów z danymi profilu użytkownika w bazie danych SQLite oraz zapobieganie interferencji między katalogami użytkowników
  • Odmowa dostępu użytkownikom nieautoryzowanym do odczytu/zapisu pliku
    Cel: Zapewnienie użytkownikom prywatności

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.