diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 732eed875033a6e9bbb6f4cb6846513e88d8aba0..65d7e27ec8789c10e2ab2280b5e1880192fa8035 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -161,42 +161,6 @@ traefik: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: manual -################################################################################ -# Postal Images -################################################################################ -postal: - stage: "build" - image: - name: gcr.io/kaniko-project/executor:debug - entrypoint: [''] - tags: - - vocacity - script: - - echo - "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}, \"https://index.docker.io/v1/\":{\"auth\":\"$DOCKERHUB_AUTH\"}}}" - > /kaniko/.docker/config.json - - VERSION="${CI_COMMIT_TAG:-latest}" - - REG=$CI_REGISTRY_IMAGE - - CONTEXT="$CI_PROJECT_DIR/contrib/postal" - - REP_GRP="postal" - - /kaniko/executor - --use-new-run - --snapshot-mode=redo - --context "$CONTEXT" - --dockerfile "$CONTEXT/Dockerfile" - --destination $REG/$REP_GRP:$VERSION - --destination octree/voca-postal:$VERSION - --verbosity=error - rules: - - if: '$CI_PIPELINE_SOURCE == "schedule"' - when: always - - if: '$CI_COMMIT_BRANCH == "main"' - when: manual - - if: '$CI_COMMIT_TAG' - when: always - - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' - when: manual - ################################################################################ # Nginx Images ################################################################################ @@ -273,8 +237,6 @@ decidim_026: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: manual - - decidim_027: stage: "build" image: @@ -311,7 +273,6 @@ decidim_027: - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' when: manual - backup: stage: "deploy" image: octree/jelastic-cli diff --git a/README.md b/README.md index d90090ace77145f9425f2db2b98225d30f997c3a..b117b4b147eed93ba251c98cff82eeb013491074 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ Running locally is easy: docker-compose -f docker-compose.yml -f docker-compose.full.yml up ``` You will then have the following environments: -- [http://localhost:1337](strapi backend) -- [http://localhost:3000](frontend app) -- [http://localhost:1080](mailcatcher) +- [strapi backend](http://localhost:1337) +- [frontend app](http://localhost:3000) +- [mailcatcher](http://localhost:1080) ## Environment To run locally something nearer production, you can set additional environment values. @@ -64,6 +64,7 @@ JELASTIC_TOKEN=my_jelastic_token JELASTIC_UNSAFE_OPERATIONS=1 # To delete environments when they are deleted from your backend. VOCA_DEFAULT_ENVGROUP=voca/voca-dev # the tag that will be affected by default in your parked instance. ``` + ### Run jelastic script from a different branches. If you are changing jelastic scripts, you can rename the `JPS_BASE_URL` environment variable, that is by default on the main branch. If you work on a another branch, you can change this JPS_BASE_URL to take your updated scripts (like the park.yml script). @@ -77,7 +78,6 @@ JPS_BASE_URL=https://git.octree.ch/decidim/vocacity/system/-/raw/feat/test ``` # Run tests - Tests are mostly backend for now. You can run them in the `/backend` directory, after installing modules. ``` @@ -91,12 +91,11 @@ If you want to contribute, please [create an issue](https://git.octree.ch/decidi | repo | info | stable version | | -------------------------------------------------------- | --------------------------------------------------------------------------- | -------------- | | [voca-system](https://git.octree.ch/decidim/vocacity/system) | Install and manage decidim instances through a Dashboard | v0.1.0 | -| [voca-tasks](https://git.octree.ch/decidim/vocacity/tasks) | Gem embedded in our Decidim image. Manipulate and manage decidim instances. | v0.1.0 | -0 | +| [voca-tasks](https://git.octree.ch/decidim/vocacity/tasks) | Gem embedded in our Decidim image. Manipulate and manage decidim instances. | v0.1.0 | 0 | # Contributing -We are not open to contribution for now. But we are [working on it](CONTRIBUTING.md). +We are not open to contribution for now. But we are [working on it](./CONTRIBUTING.md). ## Local installation diff --git a/contrib/decidim-docker/01_copy_initializers b/contrib/decidim-docker/01_copy_initializers index 443807f22884d48e993c6fa5df910d8967e78596..f08b93865d035818b0827c910875e29b1c522004 100755 --- a/contrib/decidim-docker/01_copy_initializers +++ b/contrib/decidim-docker/01_copy_initializers @@ -1,11 +1,14 @@ #!/bin/sh set -e - # Check if the source directory exists and is a directory -if [ -d "$ROOT/voca/initializers" ]; then +if [ -d "$ROOT/voca/initializers" ] && [ -n "$(find "$ROOT/voca/initializers" -mindepth 1)" ]; then + export filelist=$(find "$ROOT/voca/initializers" -mindepth 1) + echo "Some initializers are generated from the $ROOT/voca/initializers directory. Do not edit these files: $filelist" > $ROOT/voca/initializers/README.md + # If it exists and is a directory, copy its contents to the destination directory - cp -f "$ROOT/voca/initializers/"* "$ROOT/config/initializers/" + cp -f "$ROOT/voca/initializers/*" "$ROOT/config/initializers/" else echo "The directory $ROOT/voca/initializers does not exist or is not a directory. creating it." mkdir -p $ROOT/voca/initializers -fi \ No newline at end of file +fi + diff --git a/contrib/postal/Dockerfile b/contrib/postal/Dockerfile deleted file mode 100644 index 852cdf7f775c7104cccee2a07ccc4cefcda86317..0000000000000000000000000000000000000000 --- a/contrib/postal/Dockerfile +++ /dev/null @@ -1,40 +0,0 @@ -FROM ghcr.io/postalserver/postal -LABEL org.label-schema.name="voca-postal" \ - org.label-schema.description="Docker image for decidim, by voca." \ - org.label-schema.url="https://github.com/octre-gva/voca-system" \ - org.label-schema.vendor="Voca Community" \ - org.opencontainers.image.title="voca-postal" \ - org.opencontainers.image.description="pPostal image for voca service" \ - org.opencontainers.image.url="https://github.com/octre-gva/voca-system" \ - org.opencontainers.image.source="https://github.com/octre-gva/voca-system" \ - org.opencontainers.image.vendor="Voca" \ - org.opencontainers.image.licenses="GPL-3.0" \ - maintainer="Hadrien Froger <hadrien@octree.ch>" \ - # Jelastic labels - nodeMission="cp" \ - appUser="decidim" \ - description="postal for voca" \ - jem="1" \ - singleContext="1" \ - cloudletsCount="4" \ - cloudletsMinCount="1" \ - logFolder="/home/decidim/app/log" \ - distrib="debian" \ - nodeType="postal" \ - nodeTypeAlias="voca-postal" \ - lastCompatibleVersion="8.2" - -ENV JELASTIC_EXPOSE="false" \ - GC="AUTO" \ - VERT_SCALING="TRUE" \ - XMAXF="0.7" \ - XMINF="0.5" \ - XMS="AUTO" \ - XMS_PERCENT="AUTO" \ - XMX="AUTO" \ - XMX_PERCENT="80" \ - UNLOCK_EXPERIMENTAL="TRUE" \ - ZCOLLECTION_INTERVAL="900" \ - WAIT_FOR_TARGETS="mariadb:3306" - -COPY ./postal.yml /opt/postal/config/postal.yml diff --git a/contrib/postal/postal.yml b/contrib/postal/postal.yml deleted file mode 100644 index 605b231d862425755b573ad7528d2fac85492a37..0000000000000000000000000000000000000000 --- a/contrib/postal/postal.yml +++ /dev/null @@ -1,258 +0,0 @@ -version: 2 - -postal: - # The hostname that the Postal web interface runs on - web_hostname: postal.example.com - # The HTTP protocol to use for the Postal web interface - web_protocol: https - # The hostname that the Postal SMTP server runs on - smtp_hostname: postal.example.com - # Should IP pools be enabled for this installation? - use_ip_pools: false - # The maximum number of delivery attempts - default_maximum_delivery_attempts: 18 - # The number of days to hold a message before they will be expired - default_maximum_hold_expiry_days: 7 - # The number of days an address will remain in a suppression list before being removed - default_suppression_list_automatic_removal_days: 30 - # The default threshold at which a message should be treated as spam - default_spam_threshold: 5 - # The default threshold at which a message should be treated as spam failure - default_spam_failure_threshold: 20 - # Domain verification and checking usually checks with a domain's nameserver. Enable this to check with the server's local nameservers. - use_local_ns_for_domain_verification: false - # Append a Resend-Sender header to all outgoing e-mails - use_resent_sender_header: true - # Path to the private key used for signing - signing_key_path: $config-file-root/signing.key - # An array of SMTP relays in the format of smtp://host:port - smtp_relays: [] - # An array of IP addresses to trust for proxying requests to Postal (in addition to localhost addresses) - trusted_proxies: [] - # The number of days after which to consider a lock as stale. Messages with stale locks will be removed and not retried. - queued_message_lock_stale_days: 1 - # When enabled queued messages will be de-queued in batches based on their destination - batch_queued_messages: true - -web_server: - # The default port the web server should listen on unless overriden by the PORT environment variable - default_port: 5000 - # The default bind address the web server should listen on unless overriden by the BIND_ADDRESS environment variable - default_bind_address: 127.0.0.1 - # The maximum number of threads which can be used by the web server - max_threads: 5 - -worker: - # The default port for the worker health server to listen on - default_health_server_port: 9090 - # The default bind address for the worker health server to listen on - default_health_server_bind_address: 127.0.0.1 - # The number of threads to execute within each worker - threads: 2 - -main_db: - # Hostname for the main MariaDB server - host: localhost - # The MariaDB port to connect to - port: 3306 - # The MariaDB username - username: postal - # The MariaDB password - password: - # The MariaDB database name - database: postal - # The maximum size of the MariaDB connection pool - pool_size: 5 - # The encoding to use when connecting to the MariaDB database - encoding: utf8mb4 - -message_db: - # Hostname for the MariaDB server which stores the mail server databases - host: localhost - # The MariaDB port to connect to - port: 3306 - # The MariaDB username - username: postal - # The MariaDB password - password: - # The encoding to use when connecting to the MariaDB database - encoding: utf8mb4 - # The MariaDB prefix to add to database names - database_name_prefix: postal - -logging: - # Enable the default Rails logger - rails_log_enabled: false - # A DSN which should be used to report exceptions to Sentry - sentry_dsn: - # Enable the Postal logger to log to STDOUT - enabled: true - # Enable highlighting of log lines - highlighting_enabled: false - -gelf: - # GELF-capable host to send logs to - host: - # GELF port to send logs to - port: 12201 - # The facility name to add to all log entries sent to GELF - facility: postal - -smtp_server: - # The default port the SMTP server should listen on unless overriden by the PORT environment variable - default_port: 25 - # The default bind address the SMTP server should listen on unless overriden by the BIND_ADDRESS environment variable - default_bind_address: '::' - # The default port for the SMTP server health server to listen on - default_health_server_port: 9091 - # The default bind address for the SMTP server health server to listen on - default_health_server_bind_address: 127.0.0.1 - # Enable TLS for the SMTP server (requires certificate) - tls_enabled: false - # The path to the SMTP server's TLS certificate - tls_certificate_path: $config-file-root/smtp.cert - # The path to the SMTP server's TLS private key - tls_private_key_path: $config-file-root/smtp.key - # Override ciphers to use for SSL - tls_ciphers: - # The SSL versions which are supported - ssl_version: SSLv23 - # Enable proxy protocol for use behind some load balancers (supports proxy protocol v1 only) - proxy_protocol: false - # Enable connection logging - log_connections: false - # The maximum message size to accept from the SMTP server (in MB) - max_message_size: 14 - # A regular expression to use to exclude connections from logging - log_ip_address_exclusion_matcher: - -dns: - # The names of the default MX records - mx_records: - - mx1.postal.example.com - - mx2.postal.example.com - # The location of the SPF record - spf_include: spf.postal.example.com - # The return path hostname - return_path_domain: rp.postal.example.com - # The domain to use for hosting route-specific addresses - route_domain: routes.postal.example.com - # The CNAME which tracking domains should be pointed to - track_domain: track.postal.example.com - # The hostname to use in HELO/EHLO when connecting to external SMTP servers - helo_hostname: - # The identifier to use for DKIM keys in DNS records - dkim_identifier: postal - # The prefix to add before TXT record verification string - domain_verify_prefix: postal-verification - # The domain to use on external domains which points to the Postal return path domain - custom_return_path_prefix: psrp - # The timeout to wait for DNS resolution - timeout: 5 - # The path to the resolv.conf file containing addresses for local nameservers - resolv_conf_path: /etc/resolv.conf - -smtp: - # The hostname to send application-level e-mails to - host: 127.0.0.1 - # The port number to send application-level e-mails to - port: 25 - # The username to use when authentication to the SMTP server - username: - # The password to use when authentication to the SMTP server - password: - # The type of authentication to use - authentication_type: login - # Use STARTTLS when connecting to the SMTP server and fail if unsupported - enable_starttls: false - # Detects if STARTTLS is enabled in the SMTP server and starts to use it - enable_starttls_auto: true - # When using TLS, you can set how OpenSSL checks the certificate. Use 'none' for no certificate checking - openssl_verify_mode: peer - # The name to use as the from name outgoing emails from Postal - from_name: Postal - # The e-mail to use as the from address outgoing emails from Postal - from_address: postal@example.com - -rails: - # The Rails environment to run the application in - environment: production - # The secret key used to sign and encrypt cookies and session data in the application - secret_key: - -rspamd: - # Enable rspamd for message inspection - enabled: false - # The hostname of the rspamd server - host: 127.0.0.1 - # The port of the rspamd server - port: 11334 - # Enable SSL for the rspamd connection - ssl: false - # The password for the rspamd server - password: - # Any flags for the rspamd server - flags: - -spamd: - # Enable SpamAssassin for message inspection - enabled: false - # The hostname for the SpamAssassin server - host: 127.0.0.1 - # The port of the SpamAssassin server - port: 783 - -clamav: - # Enable ClamAV for message inspection - enabled: false - # The host of the ClamAV server - host: 127.0.0.1 - # The port of the ClamAV server - port: 2000 - -smtp_client: - # The open timeout for outgoing SMTP connections - open_timeout: 30 - # The read timeout for outgoing SMTP connections - read_timeout: 30 - -migration_waiter: - # Wait for all migrations to run before starting a process - enabled: false - # The number of attempts to try waiting for migrations to complete before start - attempts: 120 - # The number of seconds to wait between each migration check - sleep_time: 2 - -oidc: - # Enable OIDC authentication - enabled: false - # When enabled, users with passwords will still be able to login locally. If disable, only OpenID Connect will be available. - local_authentication_enabled: true - # The name of the OIDC provider as shown in the UI - name: OIDC Provider - # The OIDC issuer URL - issuer: - # The client ID for OIDC - identifier: - # The client secret for OIDC - secret: - # Scopes to request from the OIDC server. - scopes: - - openid,email - # The field to use to determine the user's UID - uid_field: sub - # The field to use to determine the user's email address - email_address_field: email - # The field to use to determine the user's name - name_field: name - # Enable discovery to determine endpoints from .well-known/openid-configuration from the Issuer - discovery: true - # The authorize endpoint on the authorization server (only used when discovery is false) - authorization_endpoint: - # The token endpoint on the authorization server (only used when discovery is false) - token_endpoint: - # The user info endpoint on the authorization server (only used when discovery is false) - userinfo_endpoint: - # The JWKS endpoint on the authorization server (only used when discovery is false) - jwks_uri: diff --git a/docker-compose.full.yml b/docker-compose.full.yml index 7cb83b260690712971161648814f3220d7371f38..cdc39b11fd9cc86ec1c1ac7f9830aaf7af31d017 100644 --- a/docker-compose.full.yml +++ b/docker-compose.full.yml @@ -1,4 +1,5 @@ version: "3" +# Run backend and frontend # To run this docker-compose, docker-compose.yml is required # docker-compose -f docker-compose.yml -f docker-compose.full.yml up services: @@ -42,6 +43,7 @@ services: - POSTGRES_PASSWORD=unsecure-pwd - POSTGRES_USER=strapi - POSTGRES_DB=strapi + frontend: restart: on-failure:10 build: diff --git a/docker-compose.yml b/docker-compose.yml index 74d8100b0a7a36d46308cf44b2690990989c4de2..7481dbca719ce2425c305d7294ff3a67162f9e0a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,6 @@ +### +# Run all the services required for backend/frontend to work locally. + version: "3" services: @@ -9,7 +12,6 @@ services: - redis-conf:/usr/local/etc/redis/redis.conf environment: - REDIS_REPLICATION_MODE=master - ports: - 6379:6379 pg: @@ -22,8 +24,6 @@ services: - POSTGRES_DB=strapi ports: - 5432:5432 - - mailcatcher: restart: on-failure:10 image: dockage/mailcatcher:0.7.1 @@ -33,4 +33,4 @@ services: volumes: redis-data: redis-conf: - pg-data: + pg-data: \ No newline at end of file