├── .editorconfig ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── dependabot.yml ├── .gitignore ├── .gitmessage ├── .tx └── config ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── COPYING ├── ChangeLog.md ├── README.md ├── SECURITY.md ├── admin ├── about.php ├── deploymentserver_extrafields.php ├── setup.php ├── setup_automation.php ├── setup_deploy_server.php ├── setup_endpoints.php ├── setup_other.php ├── setup_register_security.php ├── setup_reseller.php └── setup_supervision.php ├── backoffice ├── deployment_servers.php ├── dolicloud_logo.png ├── dolicloud_logo_white.png ├── index.php ├── instance_backup.php ├── instance_links.php ├── instance_users.php ├── lib │ ├── backoffice.lib.php │ └── refresh.lib.php ├── newcustomerinstance.php ├── notes.php ├── refresh_action.inc.php └── setup_antispam.php ├── blacklistcontent_card.php ├── blacklistcontent_list.php ├── blacklistdir_card.php ├── blacklistdir_list.php ├── blacklistfrom_card.php ├── blacklistfrom_list.php ├── blacklistip_card.php ├── blacklistip_list.php ├── blacklistmail_card.php ├── blacklistmail_list.php ├── blacklistto_card.php ├── blacklistto_list.php ├── class ├── actions_sellyoursaas.class.php ├── api_sellyoursaas.class.php ├── blacklistcontent.class.php ├── blacklistdir.class.php ├── blacklistfrom.class.php ├── blacklistip.class.php ├── blacklistmail.class.php ├── blacklistto.class.php ├── deploymentserver.class.php ├── packages.class.php ├── sellyoursaascontract.class.php ├── sellyoursaasutils.class.php ├── whitelistemail.class.php └── whitelistip.class.php ├── core ├── boxes │ └── box_sellyoursaas_backup_errors.php ├── includes │ └── php-datadogstatsd │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── composer.json │ │ ├── examples │ │ ├── example.php │ │ └── expandedExample.php │ │ ├── phpunit.xml │ │ ├── src │ │ ├── BatchedDogStatsd.php │ │ └── DogStatsd.php │ │ └── tests │ │ ├── TestHelpers │ │ ├── CurlSpy.php │ │ ├── CurlSpyTestCase.php │ │ ├── SocketSpy.php │ │ └── SocketSpyTestCase.php │ │ ├── UnitTests │ │ ├── BatchedDogStatsdTest.php │ │ └── DogStatsd │ │ │ ├── CurlTest.php │ │ │ └── SocketsTest.php │ │ ├── curl_and_error_log_function_stubs.php │ │ ├── mt_rand_function_stubs.php │ │ └── socket_function_stubs.php ├── lib │ └── sellyoursaas.lib.php ├── login │ └── functions_sellyoursaas.php ├── modules │ ├── bank │ │ └── doc │ │ │ └── pdf_sepamandate_sellyoursaas.modules.php │ ├── facture │ │ └── doc │ │ │ └── pdf_sellyoursaas.modules.php │ ├── mailings │ │ ├── mailinglist_contrat_sellyoursaas.modules.php │ │ ├── mailinglist_sellyoursaas.modules.php │ │ └── resellers_sellyoursaas.modules.php │ └── modSellYourSaas.class.php ├── substitutions │ └── functions_sellyoursaas.lib.php └── triggers │ ├── README.md │ └── interface_99_modSellYourSaas_SellYourSaasTriggers.class.php ├── deploymentserver_card.php ├── deploymentserver_list.php ├── deploymentserver_note.php ├── dev ├── setup │ └── codesniffer │ │ ├── README │ │ ├── php.ini │ │ ├── ruleset.dtd │ │ └── ruleset.xml ├── tools │ ├── fixaltlanguages.sh │ ├── fixdosfiles.sh │ ├── fixduplicatelangkey.sh │ ├── fixduplicatelanglines.sh │ ├── fixperms.sh │ ├── fixutf8bomfiles.sh │ └── rector │ │ ├── .gitignore │ │ ├── README.md │ │ ├── composer.json │ │ ├── composer.lock │ │ ├── rector.php │ │ └── src │ │ └── Renaming │ │ ├── EmptyGlobalToFunction.php │ │ ├── EmptyUserRightsToFunction.php │ │ ├── GlobalToFunction.php │ │ ├── UsePositiveExit.php │ │ └── UserRightsToFunction.php └── translation │ ├── README │ ├── autotranslator.class.php │ ├── autotranslator.php │ ├── sanity_check_en_langfiles.php │ ├── strip_language_file.php │ ├── txpull.sh │ └── txpush.sh ├── doc ├── .gitignore ├── Documentation SellYourSaas - Developer station - EN.asciidoc ├── Documentation SellYourSaas - Master and Deployment Servers - EN.asciidoc ├── Documentation SellYourSaas - Remote Backup server - EN.asciidoc ├── Documentation SellYourSaas - Supervision - EN.asciidoc ├── Documentation SellYourSaas - Web portal - EN.asciidoc ├── README ├── howto.txt ├── img │ ├── Config openstack horizon.png │ ├── Config printers.png │ ├── Example_screen_datadog.png │ ├── Example_service_application.png │ ├── Example_service_metric_USER.png │ ├── Example_service_option_GO.png │ ├── Example_setup_security_group_horizon.png │ ├── architecture.odg │ ├── config_jailkit_contrat.png │ └── config_jailkit_service.png ├── organizational or legal │ ├── Acceptable Use Policy for IT Resources │ └── ISO 27001.asciidoc ├── prototypes │ ├── Project-submission_readme_en_US.md │ ├── Project-submission_readme_fr_FR.md │ ├── project-auto-migrate │ │ ├── Auto-migration readme.pdf │ │ ├── Wireframe │ │ │ ├── Resources │ │ │ │ ├── script.js │ │ │ │ └── style.css │ │ │ ├── index.html │ │ │ └── pages │ │ │ │ ├── mainpage.png │ │ │ │ ├── mainpage_error.png │ │ │ │ ├── mainpage_migration.png │ │ │ │ ├── mainpage_migration_text.png │ │ │ │ ├── mainpage_success.png │ │ │ │ ├── migration_page.png │ │ │ │ ├── migration_success.png │ │ │ │ ├── upload_verification_page_error.png │ │ │ │ └── upload_verification_page_success.png │ │ └── mainpage.epgz │ ├── project-auto-upgrade │ │ ├── README.md │ │ ├── TODO.md │ │ ├── Wireframe │ │ │ ├── Resources │ │ │ │ ├── script.js │ │ │ │ └── style.css │ │ │ ├── index.html │ │ │ └── pages │ │ │ │ ├── autoupdate_page_1.png │ │ │ │ ├── autoupgrade_page_2_verification_error.png │ │ │ │ ├── autoupgrade_page_2_verification_success.png │ │ │ │ ├── supportpage.png │ │ │ │ ├── supportpage_autoupgrade.png │ │ │ │ ├── supportpage_text.png │ │ │ │ ├── upgrade_error.png │ │ │ │ └── upgrade_sucess.png │ │ └── autoupgrade.epgz │ ├── project-co2-impact-of-my-saas │ │ └── website-co2-impact-of-my-saas.epgz │ └── project-roi-of-my-saas │ │ └── my-roi-flowcharrt.epgz ├── repository_root └── sellyoursaas-theme.yml ├── doctemplates └── contract │ ├── README.md │ └── attestation_loi_finance.odt ├── etc ├── afick.conf ├── apache2 │ ├── conf-available │ │ └── custom-server-tokens.conf │ └── sites-available │ │ ├── 000-default-ssl.conf │ │ ├── 000-default.conf │ │ └── portal.mysellyoursaasdomain.com-le-ssl.conf ├── apparmor.d │ ├── local │ │ ├── usr.sbin.apache2-deployment │ │ ├── usr.sbin.apache2-master │ │ └── usr.sbin.apache2-web │ ├── php-fpm │ ├── usr.bin.secureBash │ ├── usr.sbin.apache2 │ └── usr.sbin.apache2-deployment-oldubuntu ├── datadog-agent │ └── conf.d │ │ ├── disk.d │ │ └── conf.yaml │ │ ├── http_check.d │ │ └── conf.yaml │ │ ├── mcache.d │ │ └── conf.yaml │ │ ├── postfix.d │ │ └── conf.yaml │ │ └── process.d │ │ └── conf.yaml ├── fail2ban │ ├── filter.d │ │ ├── email-dolibarr-rulesadmin.conf │ │ ├── email-dolibarr-rulesall.conf │ │ ├── email-dolibarr-rulesko.conf │ │ ├── email-dolibarr-ruleskoblacklist.conf │ │ ├── email-dolibarr-ruleskoquota.conf │ │ ├── web-accesslog-limit401.conf │ │ ├── web-accesslog-limit403.conf │ │ ├── web-accesslog-limit404.conf │ │ ├── web-accesslog-limitapi.conf │ │ ├── web-accesslog-limitapipermin.conf │ │ ├── web-dolibarr-rulesbruteforce.conf │ │ ├── web-dolibarr-ruleslimitpublic.conf │ │ ├── web-dolibarr-rulespassforgotten.conf │ │ └── web-dolibarr-rulesregisterinstance.conf │ ├── jail.d │ │ ├── email-dolibarr-rulesadmin.conf │ │ ├── email-dolibarr-rulesall.conf │ │ ├── email-dolibarr-rulesko.conf │ │ ├── email-dolibarr-ruleskoblacklist.conf │ │ ├── email-dolibarr-ruleskoquota.conf │ │ ├── web-accesslog-limit401.conf │ │ ├── web-accesslog-limit403.conf │ │ ├── web-accesslog-limit404.conf │ │ ├── web-accesslog-limitapi.conf │ │ ├── web-accesslog-limitapipermin.conf │ │ ├── web-dolibarr-rulesbruteforce.conf │ │ ├── web-dolibarr-ruleslimitpublic.conf │ │ ├── web-dolibarr-rulespassforgotten.conf │ │ └── web-dolibarr-rulesregisterinstance.conf │ └── jail.local ├── php │ └── sellyoursaas.ini ├── sellyoursaas-public.conf ├── sellyoursaas.conf ├── sellyoursaas.d │ ├── sellyousaas-allowed-ip-mysql.conf │ ├── sellyousaas-allowed-ip-ssh.conf │ └── sellyousaas-allowed-ip.conf ├── ssh │ └── sshd_config.d │ │ ├── sellyoursaas-users.conf │ │ └── sellyoursaas.conf ├── sudoers.d │ └── myadminunixlogin ├── systemd │ └── journald.conf └── watchdog.conf ├── img ├── dolicloud_logo.png ├── dolidroid_512x512_en.png ├── gfdl.png ├── gplv3.png ├── logo_sellyoursaas.png ├── logo_sellyoursaas.svg ├── object_cancellation.png ├── object_packages.png ├── object_sellyoursaas.gif ├── object_sellyoursaas.png ├── object_sellyoursaas.svg ├── sellyoursaas-banner.png ├── sellyoursaas-banner.svg ├── sellyoursaas.gif └── sellyoursaas.png ├── langs ├── cs_CZ │ └── sellyoursaas.lang ├── de_DE │ └── sellyoursaas.lang ├── el_GR │ └── sellyoursaas.lang ├── en_US │ └── sellyoursaas.lang ├── es_ES │ └── sellyoursaas.lang ├── fr_FR │ └── sellyoursaas.lang ├── it_IT │ └── sellyoursaas.lang ├── nl_NL │ └── sellyoursaas.lang ├── pl_PL │ └── sellyoursaas.lang ├── pt_BR │ └── sellyoursaas.lang ├── pt_PT │ └── sellyoursaas.lang ├── ro_RO │ └── sellyoursaas.lang ├── ru_RU │ └── sellyoursaas.lang └── uk_UA │ └── sellyoursaas.lang ├── lib ├── packages.lib.php ├── sellyoursaas.lib.php ├── sellyoursaas_blacklistcontent.lib.php ├── sellyoursaas_blacklistdir.lib.php ├── sellyoursaas_blacklistfrom.lib.php ├── sellyoursaas_blacklistip.lib.php ├── sellyoursaas_blacklistmail.lib.php ├── sellyoursaas_blacklistto.lib.php ├── sellyoursaas_deploymentserver.lib.php └── sellyoursaas_whitelistip.lib.php ├── modulebuilder.txt ├── myaccount ├── .gitignore ├── README.txt ├── ajax-loader.gif ├── ajax │ ├── ajaxdiscount.php │ └── fetchKnowledgeRecord.php ├── antispamimage.php ├── dist │ ├── css │ │ ├── alt-myaccount-example.css │ │ ├── bootstrap.css │ │ ├── myaccount.css │ │ └── stripe.css │ └── js │ │ ├── bootstrap.min.js │ │ ├── flowJs │ │ ├── flow.js │ │ └── flow.min.js │ │ └── popper.min.js ├── forbidden.php ├── img │ ├── american_express.png │ ├── dolicloud.png │ ├── dolicloud_logo.png │ ├── dolicloud_logo_white.png │ ├── favicon.ico │ ├── flyve-mdm.png │ ├── glpi-network.png │ ├── mastercard.png │ ├── novafirstcloud.png │ ├── paypal.png │ ├── sellyoursaas_automigration_step1.png │ ├── sellyoursaas_automigration_step2.png │ ├── sepa.png │ └── visa.png ├── index.php ├── mainmyaccount.inc.php ├── maintenance.php ├── offline.php ├── passwordforgotten.php ├── public │ ├── localdata.js │ └── test.php ├── register.php ├── register_instance.php ├── robots.txt ├── status.php ├── styles.css.php ├── suspended.php └── tpl │ ├── action_create_recinvoice_after_payment_creation.tpl.php │ ├── automigration.tpl.php │ ├── autoupgrade.tpl.php │ ├── becomereseller.tpl.php │ ├── billing.tpl.php │ ├── dashboard.tpl.php │ ├── instances.tpl.php │ ├── loginmyaccount.tpl.php │ ├── myaccount.tpl.php │ ├── mycustomerbilling.tpl.php │ ├── mycustomerinstances.tpl.php │ ├── passwordforgotten.tpl.php │ ├── registerpaymentmode.tpl.php │ └── support.tpl.php ├── packages_agenda.php ├── packages_card.php ├── packages_document.php ├── packages_list.php ├── packages_note.php ├── packages_services.php ├── public └── spamreport.php ├── registrationlinks_list.php ├── scripts ├── .gitignore ├── action_after_instance.sh ├── action_customurl_instance.sh ├── action_deploy_undeploy.sh ├── action_migrate_instance.sh ├── action_suspend_unsuspend.sh ├── action_upgrade_instance.sh ├── action_website_instance.sh ├── ansible │ ├── .gitignore │ ├── README.md │ ├── bannedip_ban.yml │ ├── bannedip_list.yml │ ├── bannedip_unban.yml │ ├── change_config_dolibarr.yml │ ├── change_config_sellyoursaas.yml │ ├── change_crontab_server.yml │ ├── change_password.yml │ ├── demo.yml │ ├── hosts.example │ ├── info_users.php │ ├── launch_apt_upgrade.yml │ ├── launch_clean.yml │ ├── launch_git_update_sellyoursaas.yml │ ├── launch_install_check.yml │ ├── user_create.yml │ ├── user_deactivate.yml │ ├── user_reactivate.yml │ └── user_remove.yml ├── apache_watchdog_daemon1.sh ├── apache_watchdog_daemon2.sh ├── apache_watchdog_daemon3.sh ├── apache_watchdog_launcher1.sh ├── apache_watchdog_launcher2.sh ├── apache_watchdog_launcher3.sh ├── backup_backups.exclude ├── backup_backups.php ├── backup_instance.exclude ├── backup_instance.php ├── backup_mysql_system.sh ├── backup_pull_backups.sh ├── batch_customers.php ├── batch_detect_evil_instances.php ├── clean.sh ├── deployment_update_dnszone.php ├── deployment_update_virtual_hosts.php ├── desktop_admin_users.php ├── desktop_apt_upgrade.sh ├── desktop_bannedip.sh ├── desktop_clean.sh ├── desktop_config_dolibarr.sh ├── desktop_config_sellyoursaas.sh ├── desktop_crontab_server.sh ├── desktop_fix_unzip.php ├── desktop_install_check.sh ├── desktop_switchipv6.sh ├── desktop_update_sellyoursaas.sh ├── disk_used_per_instance.sh ├── firewallsellyoursaasufw.sh ├── git_update_sellyoursaas.sh ├── git_update_sources.exclude ├── git_update_sources.sh ├── letsencrypt_authenticator.sh ├── make_instances_offlineonline.sh ├── make_instances_relink_cert.sh ├── master_build_sql_for_instances.php ├── master_check_safe_bowsing.php ├── master_create_missing_payment_from_log.php ├── master_deploy_sshkey.php ├── master_move_instance.php ├── master_move_several_instances.php ├── master_redeploy_instances.php ├── old │ ├── firewallsellyoursaas.sh │ ├── old_backup_instance-swift-v2.sh │ ├── old_backup_system.php │ ├── old_migrate_v1v2.php │ ├── old_migrate_v1v2.sh │ ├── renamesymblinks.sh │ └── update_price.php ├── perms.sh ├── phpsendmail.php ├── phpsendmailprepend.php ├── post_inst_script.sh ├── remote_server │ └── index.php ├── remote_server_launcher.sh ├── repair.ksh ├── restore_instance.php ├── rsync_instance.php ├── smtp_watchdog_daemon1.php ├── smtp_watchdog_launcher1.sh ├── templates │ ├── osuxxx.conf │ ├── phppool-phpfpm.template │ ├── poolservice-phpfpm.template │ ├── vhostHttps-phpfpm-sellyoursaas-maintenance.template │ ├── vhostHttps-phpfpm-sellyoursaas-suspended.template │ ├── vhostHttps-phpfpm-sellyoursaas.template │ ├── vhostHttps-sellyoursaas-dolibarrwebsite.template │ ├── vhostHttps-sellyoursaas-maintenance.template │ ├── vhostHttps-sellyoursaas-offline.template │ ├── vhostHttps-sellyoursaas-suspended.template │ └── vhostHttps-sellyoursaas.template ├── test.php ├── testremoteaction.php └── testssh.php ├── sql ├── data.sql ├── dolibarr_allversions.sql ├── llx_packages.key.sql ├── llx_packages.sql ├── llx_packages_extrafields.sql ├── llx_sellyoursaas_blacklistcontent.key.sql ├── llx_sellyoursaas_blacklistcontent.sql ├── llx_sellyoursaas_blacklistdir.key.sql ├── llx_sellyoursaas_blacklistdir.sql ├── llx_sellyoursaas_blacklistfrom.key.sql ├── llx_sellyoursaas_blacklistfrom.sql ├── llx_sellyoursaas_blacklistip.key.sql ├── llx_sellyoursaas_blacklistip.sql ├── llx_sellyoursaas_blacklistmail.key.sql ├── llx_sellyoursaas_blacklistmail.sql ├── llx_sellyoursaas_blacklistto.key.sql ├── llx_sellyoursaas_blacklistto.sql ├── llx_sellyoursaas_clean_dbnotindisk.sql ├── llx_sellyoursaas_deploymentserver.key.sql ├── llx_sellyoursaas_deploymentserver.sql ├── llx_sellyoursaas_stats.key.sql ├── llx_sellyoursaas_stats.sql ├── llx_sellyoursaas_whitelistemail.key.sql ├── llx_sellyoursaas_whitelistemail.sql ├── llx_sellyoursaas_whitelistip.key.sql ├── llx_sellyoursaas_whitelistip.sql └── sql_maintenance.sql ├── test ├── .gitignore ├── perf │ ├── test_create_instances.sh │ ├── test_delete_instances.sh │ └── test_instances.sh ├── phpunit │ ├── CancellationTest.php │ ├── CompanyPaymentModeTest.php │ ├── SellYourSaasLibTest.php │ ├── SellYourSaasUtilsTest.php │ └── deploymentserverTest.php ├── test.php └── testsmtp.php ├── whitelistemail_card.php ├── whitelistemail_list.php ├── whitelistip_card.php └── whitelistip_list.php /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://editorconfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | charset = utf-8 9 | end_of_line = lf 10 | insert_final_newline = true 11 | 12 | [*.php] 13 | indent_style = tab 14 | indent_size = 4 15 | trim_trailing_whitespace = true 16 | insert_final_newline = true 17 | [*.js] 18 | indent_style = tab 19 | [*.css] 20 | indent_style = tab 21 | [*.xml] 22 | indent_style = tab 23 | [*.md] 24 | trim_trailing_whitespace = false 25 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: eldy # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: 'Bug' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: 'Feature request' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .buildpath 2 | .project 3 | .settings/ 4 | .idea 5 | .vscode 6 | /.asciidoctorconfig.adoc 7 | -------------------------------------------------------------------------------- /.gitmessage: -------------------------------------------------------------------------------- 1 | [KEYWORD] [ISSUENUM] DESC 2 | New/NEW #3456 New feature... 3 | 4 | LONGDESC 5 | -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | lang_map = uz: uz_UZ, sw: sw_SW, sr@latin: sr_RS 4 | 5 | [o:dolicloud:p:sellyoursaas-application:r:sellyoursaas] 6 | file_filter = langs//sellyoursaas.lang 7 | source_file = langs/en_US/sellyoursaas.lang 8 | source_lang = en_US 9 | type = MOZILLAPROPERTIES 10 | 11 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------------ | ------------------ | 10 | | master | :white_check_mark: | 11 | | past version | :x: | 12 | 13 | ## Reporting a Vulnerability 14 | 15 | Use the [following link to report a vulnerability](https://github.com/DoliCloud/SellYourSaas/security/advisories) 16 | 17 | Tell them where to go, how often they can expect to get an update on a 18 | reported vulnerability, what to expect if the vulnerability is accepted or 19 | declined, etc. 20 | -------------------------------------------------------------------------------- /backoffice/dolicloud_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/backoffice/dolicloud_logo.png -------------------------------------------------------------------------------- /backoffice/dolicloud_logo_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/backoffice/dolicloud_logo_white.png -------------------------------------------------------------------------------- /backoffice/lib/backoffice.lib.php: -------------------------------------------------------------------------------- 1 | 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | /** 19 | * \file htdocs/sellyoursaas/backoffice/lib/backoffice.lib.php 20 | * \ingroup sellyoursaas 21 | * \brief Library for sellyoursaas backoffice lib 22 | */ 23 | 24 | 25 | /** 26 | * Build tabs for admin page 27 | * 28 | * @return array 29 | */ 30 | function sellYourSaasBackofficePrepareHead() 31 | { 32 | global $langs; 33 | 34 | $h = 0; 35 | $head = array(); 36 | 37 | $head[$h][0] = dol_buildpath('/sellyoursaas/backoffice/index.php', 1); 38 | $head[$h][1] = $langs->trans("Home"); 39 | $head[$h][2] = 'home'; 40 | $h++; 41 | 42 | if (!getDolGlobalString("SELLYOURSAAS_OBJECT_DEPLOYMENT_SERVER_MIGRATION")) { 43 | $head[$h][0] = dol_buildpath('/sellyoursaas/backoffice/deployment_servers.php', 1); 44 | $head[$h][1] = $langs->trans("DeploymentServers"); 45 | $head[$h][2] = 'deploymentservers'; 46 | $h++; 47 | } else { 48 | $head[$h][0] = '/custom/sellyoursaas/deploymentserver_list.php'; 49 | $head[$h][0] = dol_buildpath('/sellyoursaas/deploymentserver_list.php', 1); 50 | $head[$h][1] = $langs->trans("DeploymentServers"); 51 | $head[$h][2] = 'deploymentservers'; 52 | $h++; 53 | } 54 | 55 | $head[$h][0] = dol_buildpath('/sellyoursaas/backoffice/setup_antispam.php', 1); 56 | $head[$h][1] = $langs->trans("AntiSpam"); 57 | $head[$h][2] = 'antispam'; 58 | $h++; 59 | 60 | $head[$h][0] = DOL_URL_ROOT.'/core/customreports.php?objecttype=contract&tabfamily=sellyoursaas'; 61 | $head[$h][1] = $langs->trans("CustomReports"); 62 | $head[$h][2] = 'customreports'; 63 | $h++; 64 | 65 | $head[$h][0] = dol_buildpath('/sellyoursaas/backoffice/notes.php', 1); 66 | $head[$h][1] = $langs->trans("Notes"); 67 | $head[$h][2] = 'notes'; 68 | $h++; 69 | 70 | return $head; 71 | } 72 | -------------------------------------------------------------------------------- /class/sellyoursaascontract.class.php: -------------------------------------------------------------------------------- 1 | 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | /** 19 | * \file sellyoursaas/class/sellyoursaascontract.class.php 20 | * \ingroup sellyoursaas 21 | * \brief This file is a CRUD class file for SellYourSaas contract (Create/Read/Update/Delete) 22 | */ 23 | 24 | // Put here all includes required by your class file 25 | include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; 26 | 27 | /** 28 | * Class for SellYourSaasContract 29 | */ 30 | class SellYourSaasContract extends Contrat 31 | { 32 | public $instance; 33 | public $username_web; 34 | public $password_web; 35 | public $hostname_os; 36 | public $username_os; 37 | public $password_os; 38 | public $hostname_db; 39 | public $port_db; 40 | public $username_db; 41 | public $password_db; 42 | public $database_db; 43 | public $deployment_host; 44 | public $latestbackup_date_ok; 45 | public $backup_frequency; 46 | 47 | public $lastpass; 48 | public $lastpass_admin; 49 | 50 | public $date_lastlogin; 51 | public $lastlogin; 52 | public $lastlogin_admin; 53 | public $date_lastcheck; 54 | public $lastcheck; 55 | 56 | public $modulesenabled; 57 | public $version; 58 | public $nbofusers; 59 | } 60 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | .settings 3 | .idea 4 | /vendor/ 5 | /composer.lock 6 | 7 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 5.4 5 | - 5.5 6 | - 5.6 7 | - 7.0 8 | - 7.1 9 | - 7.2 10 | 11 | cache: 12 | directories: 13 | - $HOME/.composer/cache 14 | 15 | # http://docs.travis-ci.com/user/build-configuration/#Rows-That-are-Allowed-To-Fail 16 | matrix: 17 | fast_finish: true 18 | include: 19 | - php: 5.3 20 | dist: precise 21 | 22 | script: 23 | # Check syntax all PHP files, redirect stderr to file and return 0 if file is empty 24 | - find . -name '*.php' -exec php -l {} > /dev/null \; 2> /tmp/lint.err ; test ! -s /tmp/lint.err 25 | 26 | # Execute PHPUnit tests 27 | - composer install --prefer-dist 28 | - vendor/bin/phpunit --coverage-text 29 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Datadog 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Datadog nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "datadog/php-datadogstatsd", 3 | "type": "library", 4 | "description": "This is an extremely simple PHP datadogstatsd client", 5 | "keywords": ["DataDog", "PHP"], 6 | "homepage": "https://www.datadoghq.com/", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Alex Corley", 11 | "email": "anthroprose@gmail.com", 12 | "role": "Developer" 13 | }, 14 | { 15 | "name": "Datadog", 16 | "email": "dev@datadoghq.com", 17 | "role": "Developer" 18 | } 19 | ], 20 | "require": { 21 | "php": ">=5.3.0", 22 | "ext-curl": "*", 23 | "lib-curl": "*" 24 | }, 25 | "support": { 26 | "email": "package@datadoghq.com", 27 | "irc": "irc://irc.freenode.net/datadog", 28 | "issues": "https://github.com/DataDog/php-datadogstatsd/issues", 29 | "source": "https://github.com/DataDog/php-datadogstatsd" 30 | }, 31 | "autoload": { 32 | "psr-4": { 33 | "DataDog\\": "src/" 34 | } 35 | }, 36 | "autoload-dev": { 37 | "files": [ 38 | "tests/curl_and_error_log_function_stubs.php", 39 | "tests/mt_rand_function_stubs.php", 40 | "tests/socket_function_stubs.php" 41 | ], 42 | "psr-4": { 43 | "DataDog\\": "tests/" 44 | } 45 | }, 46 | "config": { 47 | "sort-packages": true 48 | }, 49 | "require-dev": { 50 | "phpunit/phpunit": "4.8.36" 51 | }, 52 | "scripts": { 53 | "test": "vendor/bin/phpunit" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/examples/example.php: -------------------------------------------------------------------------------- 1 | increment('web.page_views'); 10 | $statsd->histogram('web.render_time', 15); 11 | $statsd->distribution('web.render_time', 15); 12 | $statsd->set('web.uniques', 3 /* a unique user id */); 13 | $statsd->service_check('my.service.check', DogStatsd::CRITICAL); 14 | $statsd->event("Event title", array("text"=>"Event text")); 15 | 16 | //All the following metrics will be sent in a single UDP packet to the statsd server 17 | $batchedStatsd = new BatchedDogStatsd(); 18 | $batchedStatsd->increment('web.page_views'); 19 | $batchedStatsd->histogram('web.render_time', 15); 20 | $batchedStatsd->set('web.uniques', 3 /* a unique user id */); 21 | $batchedStatsd->flush_buffer(); // Necessary 22 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/examples/expandedExample.php: -------------------------------------------------------------------------------- 1 | '046a22167c96272932f7f95753ceb81013e1fcac', 10 | 'app_key' => '2167c96272932f013e1fcac7f95753ceb81046a2', 11 | ) 12 | ); 13 | 14 | $runFor = 5; // Set to five minutes. Increase or decrease to have script run longer or shorter. 15 | $scriptStartTime = time(); 16 | 17 | echo "Script starting.\n"; 18 | 19 | // Send metrics and events for 5 minutes. 20 | while (time() < $scriptStartTime + ($runFor * 60)) { 21 | $startTime1 = microtime(true); 22 | $statsd->increment('web.page_views'); 23 | $statsd->histogram('web.render_time', 15); 24 | $statsd->distribution('web.render_time', 15); 25 | $statsd->set('web.uniques', 3); // A unique user id 26 | 27 | runFunction($statsd); 28 | $statsd->timing('test.data.point', microtime(true) - $startTime1, 1, array('tagname' => 'php_example_tag_1')); 29 | 30 | sleep(1); // Sleep for one second 31 | } 32 | 33 | echo "Script has completed.\n"; 34 | 35 | function runFunction($statsd) 36 | { 37 | $startTime = microtime(true); 38 | 39 | $testArray = array(); 40 | for ($i = 0; $i < rand(1, 1000000000); $i++) { 41 | $testArray[$i] = $i; 42 | 43 | // Simulate an event at every 1000000th element 44 | if ($i % 1000000 == 0) { 45 | echo "Event simulated.\n"; 46 | $statsd->event('A thing broke!', array( 47 | 'alert_type' => 'error', 48 | 'aggregation_key' => 'test_aggr' 49 | )); 50 | $statsd->event('Now it is fixed.', array( 51 | 'alert_type' => 'success', 52 | 'aggregation_key' => 'test_aggr' 53 | )); 54 | } 55 | } 56 | unset($testArray); 57 | $statsd->timing('test.data.point', microtime(true) - $startTime, 1, array('tagname' => 'php_example_tag_2')); 58 | } 59 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | tests/UnitTests 14 | 15 | 16 | 17 | 18 | src 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/src/BatchedDogStatsd.php: -------------------------------------------------------------------------------- 1 | static::$maxBufferLength) { 16 | $this->flush_buffer(); 17 | } 18 | } 19 | 20 | public function flush_buffer() 21 | { 22 | $this->flush(join("\n", static::$buffer)); 23 | static::$buffer = array(); 24 | static::$bufferLength = 0; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/tests/TestHelpers/CurlSpyTestCase.php: -------------------------------------------------------------------------------- 1 | argsFromSocketCreateCalls[] = array( 48 | $domain, 49 | $type, 50 | $protocol 51 | ); 52 | } 53 | 54 | /** 55 | * @param resource $socket 56 | */ 57 | public function socketCreateDidReturn($socket) 58 | { 59 | $this->socketCreateReturnValues[] = $socket; 60 | } 61 | 62 | /** 63 | * @param resource $socket 64 | */ 65 | public function socketSetNonblockWasCalledWithArg($socket) 66 | { 67 | $this->argsFromSocketSetNonblockCalls[] = $socket; 68 | } 69 | 70 | /** 71 | * @param resource $socket 72 | * @param string $buf 73 | * @param int $len 74 | * @param int $flags 75 | * @param string $addr 76 | * @param int $port 77 | */ 78 | public function socketSendtoWasCalledWithArgs( 79 | $socket, 80 | $buf, 81 | $len, 82 | $flags, 83 | $addr, 84 | $port 85 | ) { 86 | $this->argsFromSocketSendtoCalls[] = array( 87 | $socket, 88 | $buf, 89 | $len, 90 | $flags, 91 | $addr, 92 | $port 93 | ); 94 | } 95 | 96 | /** 97 | * @param resource $socket 98 | */ 99 | public function socketCloseWasCalled($socket) 100 | { 101 | $this->argsFromSocketCloseCalls[] = $socket; 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/tests/TestHelpers/SocketSpyTestCase.php: -------------------------------------------------------------------------------- 1 | flush_buffer(); 19 | 20 | // Reset the SocketSpy state to get clean assertions. 21 | // @see \DataDog\SocketSpy 22 | global $socketSpy; 23 | $socketSpy = new SocketSpy(); 24 | } 25 | 26 | public function testReportDoesNotSendIfBufferNotFilled() 27 | { 28 | $batchedDog = new BatchedDogStatsd(array()); 29 | 30 | $batchedDog->report('some fake UDP message'); 31 | 32 | $spy = $this->getSocketSpy(); 33 | 34 | $this->assertSame( 35 | 0, 36 | count($spy->argsFromSocketSendtoCalls), 37 | 'Should not send UDP message until buffer is filled' 38 | ); 39 | } 40 | 41 | public function testReportSendsOnceBufferIsFilled() 42 | { 43 | $batchedDog = new BatchedDogStatsd(array()); 44 | 45 | $batchedDog::$maxBufferLength = 2; 46 | 47 | $udpMessage = 'some fake UDP message'; 48 | $expectedUdpMessageOnceSent = $udpMessage . "1\n" 49 | . $udpMessage . "2\n" 50 | . $udpMessage . "3"; 51 | 52 | $batchedDog->report($udpMessage . '1'); 53 | $batchedDog->report($udpMessage . '2'); 54 | $batchedDog->report($udpMessage . '3'); 55 | 56 | $spy = $this->getSocketSpy(); 57 | 58 | $this->assertSame( 59 | 1, 60 | count($spy->argsFromSocketSendtoCalls), 61 | 'Should send all buffered UDP messages once buffer is filled' 62 | ); 63 | 64 | $this->assertSame( 65 | $expectedUdpMessageOnceSent, 66 | $spy->argsFromSocketSendtoCalls[0][1], 67 | 'Should concatenate UDP messages with newlines' 68 | ); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/tests/curl_and_error_log_function_stubs.php: -------------------------------------------------------------------------------- 1 | curlInitWasCalledWithArg($url); 26 | 27 | $resource = fopen('/dev/null', 'r'); 28 | 29 | $curlSpy->curlInitDidReturn($resource); 30 | 31 | return $resource; 32 | } 33 | 34 | /** 35 | * Stub of built in global PHP function curl_setopt 36 | * 37 | * @param resource $ch 38 | * @param int $option 39 | * @param mixed $value 40 | */ 41 | function curl_setopt($ch, $option, $value) 42 | { 43 | global $curlSpy; 44 | 45 | $curlSpy->curlSetoptWasCalledWithArgs($ch, $option, $value); 46 | } 47 | 48 | /** 49 | * Stub of built in global PHP function curl_exec 50 | * 51 | * @param resource $ch 52 | * @return mixed 53 | */ 54 | function curl_exec($ch) 55 | { 56 | global $curlSpy; 57 | 58 | $curlSpy->curlExecCalledWithArg($ch); 59 | 60 | return $curlSpy->responseBody; 61 | } 62 | 63 | /** 64 | * Stub of built in global PHP function curl_getinfo 65 | * 66 | * @param resource $ch 67 | * @param int $opt 68 | * @return int 69 | */ 70 | function curl_getinfo($ch, $opt) 71 | { 72 | global $curlSpy; 73 | 74 | $curlSpy->curlGetinfoCalledWithArgs($ch, $opt); 75 | 76 | return $curlSpy->responseCode; 77 | } 78 | 79 | /** 80 | * Stub of built in global PHP function curl_errno 81 | * 82 | * @param resource $ch 83 | * @return int 84 | */ 85 | function curl_errno($ch) 86 | { 87 | global $curlSpy; 88 | 89 | $curlSpy->curlErrnoCalledWithArg($ch); 90 | 91 | return $curlSpy->errorNumber; 92 | } 93 | 94 | /** 95 | * Stub of built in global PHP function curl_close 96 | * 97 | * @param resource $ch 98 | */ 99 | function curl_close($ch) 100 | { 101 | global $curlSpy; 102 | 103 | $curlSpy->curlCloseCalledWithArg($ch); 104 | } 105 | 106 | /** 107 | * Stub of built in global PHP function curl_error 108 | * 109 | * @param resource $ch 110 | * @return string 111 | */ 112 | function curl_error($ch) 113 | { 114 | global $curlSpy; 115 | 116 | $curlSpy->curlErrorCalledWithArg($ch); 117 | 118 | return $curlSpy->curlError; 119 | } 120 | 121 | /** 122 | * @param string $message 123 | */ 124 | function error_log($message) 125 | { 126 | global $curlSpy; 127 | 128 | $curlSpy->errorLogCallsWithArg($message); 129 | } -------------------------------------------------------------------------------- /core/includes/php-datadogstatsd/tests/mt_rand_function_stubs.php: -------------------------------------------------------------------------------- 1 | socketCreateWasCalledWithArgs($domain, $type, $protocol); 29 | 30 | // A PHP resource of unimportance, useful primarily to assert that our stubs 31 | // of the global socket functions return or take a deterministic value. 32 | $resource = fopen('/dev/null', 'r'); 33 | 34 | $socketSpy->socketCreateDidReturn($resource); 35 | 36 | return $resource; 37 | } 38 | 39 | /** 40 | * Stub of built in global PHP function socket_set_nonblock 41 | * 42 | * @param resource $socket 43 | */ 44 | function socket_set_nonblock($socket) 45 | { 46 | global $socketSpy; 47 | 48 | $socketSpy->socketSetNonblockWasCalledWithArg($socket); 49 | } 50 | 51 | /** 52 | * Stub of built in global PHP function socket_sendto 53 | * 54 | * @param resource $socket 55 | * @param string $buf 56 | * @param int $len 57 | * @param int $flags 58 | * @param string $addr 59 | * @param int $port 60 | */ 61 | function socket_sendto($socket, $buf, $len, $flags, $addr, $port=null) 62 | { 63 | global $socketSpy; 64 | 65 | $socketSpy->socketSendtoWasCalledWithArgs($socket, $buf, $len, $flags, $addr, $port); 66 | } 67 | 68 | /** 69 | * Stub of built in global PHP function socket_close 70 | * 71 | * @param resource $socket 72 | */ 73 | function socket_close($socket) 74 | { 75 | global $socketSpy; 76 | 77 | $socketSpy->socketCloseWasCalled($socket); 78 | } 79 | -------------------------------------------------------------------------------- /core/triggers/README.md: -------------------------------------------------------------------------------- 1 | Directory where triggers files are stored. -------------------------------------------------------------------------------- /dev/setup/codesniffer/README: -------------------------------------------------------------------------------- 1 | README (English) 2 | -------------------------------- 3 | 4 | This directory contains ruleset files to use to develop Dolibarr EPR & CRM. 5 | 6 | To install/upgrade phpcs: 7 | > sudo pear upgrade PHP_CodeSniffer 8 | 9 | To run phpcs: 10 | > cd dolibarrgitrepo 11 | > phpcs --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 . 12 | 13 | To fix with phpcbf: 14 | > cd dolibarrgitrepo 15 | > phpcbf --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 . 16 | 17 | 18 | Note with Eclipse: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with: 19 | * tab value to 4 20 | * path of code sniffer standard to dev/codesniffer 21 | 22 | -------------------------------------------------------------------------------- /dev/setup/codesniffer/ruleset.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /dev/tools/fixaltlanguages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Recursively deduplicate file lines on a per file basis 3 | # Useful to deduplicate language files 4 | # 5 | # Needs awk 4.0 for the inplace fixing command 6 | # 7 | # Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr 8 | 9 | # Syntax 10 | if [ "x$1" != "xlist" -a "x$1" != "xfix" ] 11 | then 12 | echo "Scan alternate language files and remove entries found into parent file" 13 | echo "Usage: fixaltlanguages.sh (list|fix) (all|file.lang) [xx_XX]" 14 | exit 15 | fi 16 | if [ "x$2" = "x" ] 17 | then 18 | echo "Scan alternate language files and remove entries found into parent file" 19 | echo "Usage: fixaltlanguages.sh (list|fix) (all|file.lang) [xx_XX]" 20 | exit 21 | fi 22 | 23 | # To detect 24 | if [ "x$1" = "xlist" ] 25 | then 26 | echo Feature not available 27 | fi 28 | 29 | # To fix 30 | if [ "x$1" = "xfix" ] 31 | then 32 | for dir in `find langs/$3* -type d` 33 | do 34 | dirshort=`basename $dir` 35 | 36 | #echo $dirshort 37 | 38 | export aa=`echo $dirshort | nawk -F"_" '{ print $1 }'` 39 | export bb=`echo $dirshort | nawk -F"_" '{ print $2 }'` 40 | aaupper=`echo $dirshort | nawk -F"_" '{ print toupper($1) }'` 41 | if [ $aaupper = "EN" ] 42 | then 43 | aaupper="US" 44 | fi 45 | if [ $aaupper = "EL" ] 46 | then 47 | aaupper="GR" 48 | fi 49 | if [ $bb = "EG" ] 50 | then 51 | aaupper="SA" 52 | fi 53 | 54 | bblower=`echo $dirshort | nawk -F"_" '{ print tolower($2) }'` 55 | 56 | echo "***** Process language "$aa"_"$bb 57 | if [ "$aa" != "$bblower" -a "$dirshort" != "en_US" ] 58 | then 59 | reflang="langs/"$aa"_"$aaupper 60 | if [ -d $reflang -a $aa"_"$bb != $aa"_"$aaupper ] 61 | then 62 | echo "***** Search original into "$reflang 63 | echo $dirshort is an alternative language of $reflang 64 | echo ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2 65 | ./dev/translation/strip_language_file.php $aa"_"$aaupper $aa"_"$bb $2 66 | for fic in `ls langs/${aa}_${bb}/*.delta`; do f=`echo $fic | sed -e 's/\.delta//'`; echo $f; mv $f.delta $f; done 67 | for fic in `ls langs/${aa}_${bb}/*.lang`; 68 | do f=`cat $fic | wc -l`; 69 | #echo $f lines into file $fic; 70 | if [ $f = 1 ] 71 | then 72 | echo Only one line remainging into file $fic, we delete it; 73 | rm $fic 74 | fi; 75 | done 76 | fi 77 | fi 78 | done; 79 | fi 80 | -------------------------------------------------------------------------------- /dev/tools/fixdosfiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #------------------------------------------------------ 3 | # Script to find files that are not Unix encoded 4 | # 5 | # Laurent Destailleur - eldy@users.sourceforge.net 6 | #------------------------------------------------------ 7 | # Usage: fixdosfiles.sh [list|fix] 8 | #------------------------------------------------------ 9 | 10 | # Syntax 11 | if [ "x$1" != "xlist" -a "x$1" != "xfix" ] 12 | then 13 | echo "This script detect or clean files with CR+LF into files with LF only. All source files are included, also files into includes." 14 | echo "Usage: fixdosfiles.sh [list|fix]" 15 | fi 16 | 17 | # To detec 18 | if [ "x$1" = "xlist" ] 19 | then 20 | find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'documents\/mdedias' | grep CRLF 21 | # find . \( -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'documents\/mdedias' | grep -v 'htdocs\/includes' | grep CRLF 22 | fi 23 | 24 | # To convert 25 | if [ "x$1" = "xfix" ] 26 | then 27 | for fic in `find . \( -iname "functions" -o -iname "*.md" -o -iname "*.html" -o -iname "*.htm" -o -iname "*.php" -o -iname "*.sh" -o -iname "*.cml" -o -iname "*.css" -o -iname "*.js" -o -iname "*.lang" -o -iname "*.pl" -o -iname "*.sql" -o -iname "*.txt" -o -iname "*.xml" -o -iname "*.pml" \) -exec file "{}" + | grep -v 'documents\/website' | grep -v 'documents\/mdedias' | grep CRLF | awk -F':' '{ print $1 }' ` 28 | do 29 | echo "Fix file $fic" 30 | dos2unix "$fic" 31 | done; 32 | fi 33 | -------------------------------------------------------------------------------- /dev/tools/fixduplicatelangkey.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Helps find duplicate translation keys in language files 3 | # 4 | # Copyright (C) 2014 Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr 5 | 6 | 7 | # Syntax 8 | if [ "x$1" != "xlist" -a "x$1" != "xfix" ] 9 | then 10 | echo "Detect duplicate translation keys inside a file (there is no cross file check)." 11 | echo "Usage: detectduplicatelangkey.sh (list|fix)" 12 | fi 13 | 14 | 15 | if [ "x$1" = "xlist" ] 16 | then 17 | echo "Search duplicate keys into en_US lang files (there is no cross file check)" 18 | for file in `find htdocs/langs/en_US -name *.lang -type f` 19 | do 20 | dupes=$( 21 | sed "s/^\s*//" "$file" | # Remove any leading whitespace 22 | sed "s/\s*\=/=/" | # Remove any whitespace before = 23 | grep -Po "(^.*?)=" | # Non greedeely match everything before = 24 | sed "s/\=//" | # Remove trailing = so we get the key 25 | sort | uniq -d # Find duplicates 26 | ) 27 | 28 | if [ -n "$dupes" ] 29 | then 30 | echo "Duplicates found in $file" 31 | echo "$dupes" 32 | fi 33 | done 34 | fi 35 | 36 | # To convert 37 | if [ "x$1" = "xfix" ] 38 | then 39 | echo Feature not implemented. Please fix files manually. 40 | fi 41 | -------------------------------------------------------------------------------- /dev/tools/fixduplicatelanglines.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Recursively deduplicate file lines on a per file basis 3 | # Useful to deduplicate language files 4 | # 5 | # Needs awk 4.0 for the inplace fixing command 6 | # 7 | # Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr 8 | 9 | # Syntax 10 | if [ "x$1" != "xlist" -a "x$1" != "xfix" ] 11 | then 12 | echo "Find exact duplicated lines into file (not cross file checking)" 13 | echo "Usage: deduplicatefilelinesrecursively.sh [list|fix]" 14 | fi 15 | 16 | # To detect 17 | if [ "x$1" = "xlist" ] 18 | then 19 | echo "Search duplicate line for lang en_US" 20 | for file in `find htdocs/langs/en_US -type f -name *.lang` 21 | do 22 | if [ `sort "$file" | grep -v '^$' | uniq -d | wc -l` -gt 0 ] 23 | then 24 | echo "***** $file" 25 | sort "$file" | grep -v '^$' | uniq -d 26 | fi 27 | done 28 | fi 29 | 30 | # To fix 31 | if [ "x$1" = "xfix" ] 32 | then 33 | echo "Fix duplicate line for lang en_US" 34 | for file in `find htdocs/langs/en_US -type f -name *.lang` 35 | do 36 | awk -i inplace ' !x[$0]++' "$file" 37 | done; 38 | fi 39 | -------------------------------------------------------------------------------- /dev/tools/fixperms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #------------------------------------------------------ 3 | # Script to set/fix permissions on files 4 | # 5 | # Laurent Destailleur - eldy@users.sourceforge.net 6 | #------------------------------------------------------ 7 | # Usage: fixperms.sh (list|fix) 8 | #------------------------------------------------------ 9 | 10 | # Syntax 11 | if [ "x$1" != "xlist" -a "x$1" != "xfix" ] 12 | then 13 | echo "Fix permissions of files" 14 | echo "Usage: fixperms.sh (list|fix)" 15 | fi 16 | 17 | # To detect 18 | if [ "x$1" = "xlist" ] 19 | then 20 | echo Feature not yet available 21 | fi 22 | 23 | # To convert 24 | if [ "x$1" = "xfix" ] 25 | then 26 | find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \; 27 | chmod a+x ./scripts/*/*.php 28 | chmod a+x ./scripts/*/*.sh 29 | chmod g-w ./scripts/*/*.php 30 | chmod g-w ./scripts/*/*.sh 31 | fi 32 | -------------------------------------------------------------------------------- /dev/tools/fixutf8bomfiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Checks of fix files contains UTF-8 BOM in dolibarr source tree, 4 | # excluding git repository, custom modules and included libraries. 5 | # 6 | # Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr 7 | # Laurent Destailleur eldy@users.sourceforge.net 8 | #------------------------------------------------------ 9 | # Usage: fixutf8bomfiles.sh [list|fix] 10 | #------------------------------------------------------ 11 | 12 | # Syntax 13 | if [ "x$1" != "xlist" -a "x$1" != "xfix" ] 14 | then 15 | echo "Detect and fix bad UTF8 encoded files (UTF8 must not use BOM char)" 16 | echo "Usage: fixutf8bomfiles.sh (list|fix) [addincludes]" 17 | fi 18 | 19 | if [ "x$2" != "xaddincludes" ] 20 | then 21 | export moreoptions="--exclude-dir='includes'" 22 | fi 23 | 24 | # To detec 25 | if [ "x$1" = "xlist" ] 26 | then 27 | #find . \( -iname '*.php' -print0 -o -iname '*.sh' -print0 -o -iname '*.pl' -print0 -o -iname '*.lang' -print0 -o -iname '*.txt' \) -print0 | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}' 28 | echo "grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='.tx' $moreoptions --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'" 29 | grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='.tx' $moreoptions --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}' 30 | fi 31 | 32 | # To convert 33 | if [ "x$1" = "xfix" ] 34 | then 35 | for fic in `grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='.tx' $moreoptions --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'` 36 | do 37 | echo "Fixing $fic" 38 | sed -i '1s/^\xEF\xBB\xBF//' $fic 39 | done; 40 | fi 41 | -------------------------------------------------------------------------------- /dev/tools/rector/.gitignore: -------------------------------------------------------------------------------- 1 | /test.php 2 | /vendor -------------------------------------------------------------------------------- /dev/tools/rector/README.md: -------------------------------------------------------------------------------- 1 | ### Refactoring code with [rector](https://getrector.com) 2 | 3 | 4 | #### Installation 5 | 6 | Run in this folder 7 | ```shell 8 | cd dev/tools/rector 9 | ``` 10 | 11 | Install rector with composer 12 | ```shell 13 | composer install 14 | ``` 15 | 16 | 17 | #### Usage 18 | 19 | ##### To make changes (Add --dry-run for test mode only) 20 | ```shell 21 | cd dev/tools/rector 22 | ./vendor/bin/rector process --dry-run 23 | ``` 24 | 25 | ##### To make changes on a given directory 26 | 27 | ```shell 28 | cd dev/tools/rector 29 | ./vendor/bin/rector process [--dry-run] [--clear-cache] ../../../htdocs/core/ 30 | ``` 31 | -------------------------------------------------------------------------------- /dev/tools/rector/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dolibarr/rector", 3 | "type": "project", 4 | "license": "GplV3", 5 | "authors": [ 6 | { 7 | "name": "Dev2a", 8 | "email": "contact@dev2a.pro" 9 | } 10 | ], 11 | "require-dev": { 12 | "rector/rector": "^0.18.5" 13 | }, 14 | "autoload-dev": { 15 | "psr-4": { 16 | "Dolibarr\\Rector\\": "./src" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /dev/translation/README: -------------------------------------------------------------------------------- 1 | README (English) 2 | -------------------------------- 3 | This directory contains tools to generate translation files for a new 4 | languages or to update translation files for existing languages. 5 | See Dolibarr Wiki page: 6 | http://wiki.dolibarr.org/index.php/Translator_documentation 7 | For more informations on how to use them. 8 | 9 | To install transifex client: 10 | sudo pip install --upgrade transifex-client 11 | 12 | To update transifex client: 13 | sudo pip install --upgrade transifex-client -------------------------------------------------------------------------------- /dev/translation/txpull.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #------------------------------------------------------ 3 | # Script to pull language files to Transifex 4 | # 5 | # Laurent Destailleur - eldy@users.sourceforge.net 6 | #------------------------------------------------------ 7 | # Usage: txpull.sh (all|xx_XX) [-r sellyoursaas-application.file] [-f] 8 | #------------------------------------------------------ 9 | 10 | 11 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 12 | cd $DIR/../.. 13 | 14 | # Syntax 15 | if [ "x$1" = "x" ] 16 | then 17 | echo "This pull remote transifex files to local dir." 18 | echo "Note: If you pull a language file (not source), file will be skipped if local file is newer." 19 | echo " Using -f will overwrite local file (does not work with 'all')." 20 | echo "Usage: ./dev/translation/txpull.sh (all|xx_XX) [-r sellyoursaas-application.file] [-f] [-s]" 21 | exit 22 | fi 23 | 24 | if [ ! -d ".tx" ] 25 | then 26 | echo "Script must be ran from root directory of project with command ./dev/translation/txpull.sh" 27 | exit 28 | fi 29 | 30 | 31 | if [ "x$1" = "xall" ] 32 | then 33 | for dir in `find langs/* -type d` 34 | do 35 | fic=`basename $dir` 36 | if [ $fic != "en_US" ] 37 | then 38 | echo "tx pull -l $fic $2 $3" 39 | tx pull -l $fic $2 $3 40 | fi 41 | done 42 | cd - 43 | else 44 | echo "tx pull -l $1 $2 $3 $4 $5" 45 | tx pull -l $1 $2 $3 $4 $5 46 | fi 47 | 48 | echo Think to launch also: 49 | echo "> dev/tools/fixaltlanguages.sh fix all" 50 | -------------------------------------------------------------------------------- /dev/translation/txpush.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #------------------------------------------------------ 3 | # Script to push language files to Transifex 4 | # 5 | # Laurent Destailleur (eldy) - eldy@users.sourceforge.net 6 | #------------------------------------------------------ 7 | # Usage: txpush.sh (source|xx_XX) [-r sellyoursaas-application.file] [-f] 8 | #------------------------------------------------------ 9 | 10 | 11 | export project='sellyoursaas-application' 12 | 13 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 14 | cd $DIR/../.. 15 | 16 | # Syntax 17 | if [ "x$1" = "x" ] 18 | then 19 | echo "This push local files to transifex." 20 | echo "Note: If you push a language file (not source), file will be skipped if transifex file is newer." 21 | echo " Using -f will overwrite translation but not memory." 22 | echo "Usage: ./dev/translation/txpush.sh (source|xx_XX) [-r $project.file] [-f] [--no-interactive]" 23 | exit 24 | fi 25 | 26 | if [ ! -d ".tx" ] 27 | then 28 | echo "Script must be ran from the root directory of the project with command ./dev/translation/txpush.sh" 29 | exit 30 | fi 31 | 32 | if [ "x$1" = "xsource" ] 33 | then 34 | echo "tx push -s $2 $3" 35 | tx push -s $2 $3 36 | else 37 | for file in `find langs/$1/*.lang -type f` 38 | do 39 | export basefile=`basename $file | sed -s s/\.lang//g` 40 | echo "tx push --skip -r $project.$basefile -t -l $1 $2 $3 $4" 41 | tx push --skip -r $project.$basefile -t -l $1 $2 $3 $4 42 | done 43 | fi 44 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | /temp/ 2 | /sellyoursaas.html 3 | /*.html 4 | /*.pdf 5 | -------------------------------------------------------------------------------- /doc/README: -------------------------------------------------------------------------------- 1 | To generate PDF: 2 | 3 | gem install asciidoctor 4 | gem install asciidoctor-pdf 5 | gem install rouge 6 | 7 | 8 | cd sellyoursaas/doc 9 | asciidoctor-pdf -a pdf-themesdir=. -a pdf-theme=sellyoursaas 'Name of file.asciidoc' 10 | 11 | -------------------------------------------------------------------------------- /doc/howto.txt: -------------------------------------------------------------------------------- 1 | 2 | ***** Migration PHP 7.0/7.1 -> 7.3 ***** 3 | 4 | sudo add-apt-repository ppa:ondrej/php 5 | 6 | sudo apt-get update 7 | 8 | apt install php7.3 php7.3-bz2 php7.3-cli php7.3-gd php7.3-intl php7.3-curl php7.3-imap php7.3-json php7.3-ldap php7.3-mbstring php7.3-mysql php7.3-soap php7.3-xml php7.3-xmlrpc php7.3-zip 9 | 10 | sudo vi /etc/apparmor.d/bin.secureBash 11 | 12 | Remplacer 7.0 par 7.* et ajouter 13 | /home/admin/wwwroot/dolibarr_documents/sellyoursaas_local/spam/ rw, 14 | /home/admin/wwwroot/dolibarr_documents/sellyoursaas_local/spam/** rw, 15 | 16 | aa-enforce bin.secureBash 17 | 18 | a2enmod php7.3; a2dismod php7.2 19 | 20 | systemctl restart apache2 21 | 22 | 23 | edit php.ini to set session.xxx vars with new recommended values. 24 | -------------------------------------------------------------------------------- /doc/img/Config openstack horizon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/img/Config openstack horizon.png -------------------------------------------------------------------------------- /doc/img/Config printers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/img/Config printers.png -------------------------------------------------------------------------------- /doc/img/Example_screen_datadog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/img/Example_screen_datadog.png -------------------------------------------------------------------------------- /doc/img/Example_service_application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/img/Example_service_application.png -------------------------------------------------------------------------------- /doc/img/Example_service_metric_USER.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/img/Example_service_metric_USER.png -------------------------------------------------------------------------------- /doc/img/Example_service_option_GO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/img/Example_service_option_GO.png -------------------------------------------------------------------------------- /doc/img/Example_setup_security_group_horizon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/img/Example_setup_security_group_horizon.png -------------------------------------------------------------------------------- /doc/img/architecture.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/img/architecture.odg -------------------------------------------------------------------------------- /doc/img/config_jailkit_contrat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/img/config_jailkit_contrat.png -------------------------------------------------------------------------------- /doc/img/config_jailkit_service.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/img/config_jailkit_service.png -------------------------------------------------------------------------------- /doc/organizational or legal/ISO 27001.asciidoc: -------------------------------------------------------------------------------- 1 | = Sell-Your-Saas ISO27001 2 | This document is a document to provide all information required to show your ISO27001 compliance when using SellYourSaas 3 | :source-highlighter: red 4 | :title: ISO 27001 compliance 5 | :subject: This document is a document to provide all information required to show your ISO27001 compliance when using SellYourSaas 6 | :keywords: sellyoursaas, saas, dolibarr, wamp, glpi, webserver 7 | :toc: manual 8 | :toclevels: 3 9 | :toc-title: Table of contents 10 | :toc-placement: preamble 11 | 12 | <<<< 13 | 14 | == Introduction == 15 | 16 | This document provides all information required by the ISO27001 requirements. 17 | It describes the security expected, the existing tools and processes to reach this security goal. 18 | 19 | *Historic of version:* 20 | 21 | The historic of the versions of this documents is available on github. 22 | 23 | 24 | 25 | <<<<<<< 26 | 27 | == Organisation the company Organization 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | <<<<<<< 36 | 37 | == About People 38 | 39 | === Employees 40 | 41 | 42 | 43 | === Rules 44 | 45 | Employees must agree with all the terms defined into the "Acceptable Use Policy for IT resources" 46 | 47 | This document is the file "Acceptable Use Policy for IT Resources". 48 | 49 | 50 | 51 | 52 | <<<<<<< 53 | 54 | == About physical access 55 | 56 | === Situation === 57 | 58 | The company is a full remote company. Any employee access the internal tool of the company from home. 59 | 60 | Because any access to any tools need a password (never stored, or stored into a Password Manager where ) + a physical device (Multi Factor Authentication), risk is very loow. 61 | 62 | 63 | 64 | 65 | <<<<<<< 66 | 67 | == About technologies 68 | 69 | === Situation === 70 | 71 | 72 | 73 | 74 | === 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | <<<<<<< 84 | 85 | == Annexes 86 | -------------------------------------------------------------------------------- /doc/prototypes/Project-submission_readme_en_US.md: -------------------------------------------------------------------------------- 1 | # Project or prototypes submission 2 | 3 | Each project specification or prototype is stored into a dedicated directory. 4 | GUI prototypes need to be composed of 3 files : 5 | - a Wireframe pencil project (file .epgz) 6 | - an Explanation PDF of the Wireframe 7 | - a Wireframe export 8 | 9 | ## 1. Wireframe creation : 10 | 11 | To submit a project you need to create a wireframe. This 12 | wireframe needs to be created with the software 13 | [Pencil project](https://pencil.evolus.vn/). 14 | 15 | 16 | ## 2. Explanation PDF creation : 17 | 18 | The project submission wireframe needs to be accompanied 19 | by a PDF file which explain the different pages of the 20 | wireframe. 21 | 22 | 23 | ## 3.Export du wireframe : 24 | 25 | Finaly, you need to create the export of the wireframe in a folder named Wireframe. 26 | The prototype can then be executed by clicking on the file index.html 27 | -------------------------------------------------------------------------------- /doc/prototypes/Project-submission_readme_fr_FR.md: -------------------------------------------------------------------------------- 1 | # Soumission de projets ou prototypes 2 | 3 | Chaque projet ou prototypes est stocké dans un répertoire dédié. 4 | Les prototypes sont composés de trois fichiers: 5 | - un Wireframe du logiciel pencil project (file .epgz) 6 | - un PDF d’explication du Wireframe 7 | - une exportation du Wireframe 8 | 9 | 10 | ## 1. Création du wireframe : 11 | 12 | Pour soumettre un projet, vous devez créer un wireframe. Ce wireframe doit être créé avec le logiciel 13 | [Pencil project](https://pencil.evolus.vn/). 14 | 15 | 16 | ## 2. Explication création PDF : 17 | 18 | Le Wireframe soumis pour ce projet doit être accompagnée d’un fichier PDF qui explique les différentes pages de la maquette. 19 | 20 | 21 | ## 3. Export wireframe : 22 | 23 | Enfin, vous devez créer l’exportation de la wireframe dans un dossier nommé Wireframe. 24 | Le prototype pourra alors être exécuté en cliquant le fichier index.html 25 | -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Auto-migration readme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/Auto-migration readme.pdf -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Wireframe/Resources/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | place extra stylesheet here 3 | */ 4 | 5 | body, html { 6 | margin: 0px; 7 | padding: 0px; 8 | overflow: hidden; 9 | font-family: "Product Sans", "Liberation Sans", Arial, sans-serif; 10 | } 11 | 12 | #documentMetadata, 13 | #documentTitle { 14 | display: none; 15 | } 16 | 17 | .Page { 18 | position: absolute; 19 | left: 230px; 20 | top: 0px; 21 | right: 0px; 22 | bottom: 0px; 23 | 24 | display: flex; 25 | align-items: center; 26 | justify-content: center; 27 | background: #00000077; 28 | } 29 | .Page:not(:target) { 30 | display: none; 31 | } 32 | 33 | .Page > h2 { 34 | display: none; 35 | } 36 | .Page .ImageContainer { 37 | box-shadow: 0px 0px 1em #00000077; 38 | } 39 | 40 | .Page .ImageContainer { 41 | position: relative; 42 | } 43 | .Page .ImageContainer > .Links > a { 44 | position: absolute; 45 | background-color: transparent; 46 | transition: background-color 0.2s ease; 47 | } 48 | body.Active .Page .ImageContainer > .Links > a { 49 | background-color: #E79A0F11; 50 | } 51 | .Page .ImageContainer > .Links > a:hover { 52 | background-color: #FFFFFF55 !important; 53 | } 54 | 55 | .TOC { 56 | position: absolute; 57 | top: 0px; 58 | left: 0px; 59 | bottom: 0px; 60 | width: 230px; 61 | display: flex; 62 | flex-direction: column; 63 | 64 | overflow-y: auto; 65 | overflow-x: visible; 66 | z-index: 2; 67 | background: #444; 68 | } 69 | .TOC > div { 70 | display: flex; 71 | flex-direction: column; 72 | align-items: center; 73 | padding: 1em; 74 | background: transparent; 75 | transition: background 0.2s ease; 76 | } 77 | .TOC > div.Focused { 78 | background: #5294E2; 79 | } 80 | .TOC > div:not(.Focused):hover { 81 | background: #5294E266; 82 | } 83 | .TOC > div + div { 84 | margin-top: 1em; 85 | } 86 | 87 | .TOC > div > a { 88 | display: block; 89 | border: solid 2px #FFF; 90 | box-shadow: 0px 0px 5px #000; 91 | } 92 | 93 | .TOC > div > strong { 94 | display: block; 95 | text-align: center; 96 | color: #FFF; 97 | font-weight: normal; 98 | margin-top: 0.3em; 99 | } 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Wireframe/pages/mainpage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/Wireframe/pages/mainpage.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Wireframe/pages/mainpage_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/Wireframe/pages/mainpage_error.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Wireframe/pages/mainpage_migration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/Wireframe/pages/mainpage_migration.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Wireframe/pages/mainpage_migration_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/Wireframe/pages/mainpage_migration_text.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Wireframe/pages/mainpage_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/Wireframe/pages/mainpage_success.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Wireframe/pages/migration_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/Wireframe/pages/migration_page.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Wireframe/pages/migration_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/Wireframe/pages/migration_success.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Wireframe/pages/upload_verification_page_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/Wireframe/pages/upload_verification_page_error.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/Wireframe/pages/upload_verification_page_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/Wireframe/pages/upload_verification_page_success.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-migrate/mainpage.epgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-migrate/mainpage.epgz -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/README.md: -------------------------------------------------------------------------------- 1 | # Projet de création d’auto-upgrade d’une instance pour la solution DoliCloud 2 | 3 | Suite à la demande de création d’une fonction d’auto-migration d’instances pour la solution DoliCloud. J’ai modélisé cette fonctionnalité à l’aide d’un logiciel de wireframe. Celui-ci m’a permis d’exporter une version HTML du modèle qui peut être utilisée comme maquette. 4 | ___ 5 | Nous allons donc suivre le modèle pour essayer de voir comment celle-ci fonctionne : 6 | 7 | ## Main page : 8 | 9 | Cette page correspond à la page template support. Il suffit de cliquer sur la combobox pour y mettre Migration. 10 | 11 | ## Main page auto-upgrade : 12 | 13 | Cette page est la même que la précédente mais avec une fonction Javascript qui vérifie le code de ticket dans la combobox Category, si le code de ticket est celui pour l'upgrade alors la fonction Javascript affiche comme présenté sur la page Mainpage auto-upgrade. 14 | 15 | Deux choix sont alors possibles : 16 | * Le bouton de gauche permet de continue vers l’auto-upgrade de l’instance 17 | 18 | * Celui de droite permet de revenir à l’affichage normal de la template support avec des informations pour le support. 19 | 20 | ## Auto-upgrade page 1 : 21 | 22 | Cette page contient des informations nécessaires à l'auto-upgrade 23 | 24 | * Step 1 : Dans cette étape l'utilisateur doit choisir entre toutes ces instances pour être sur de l'instance sur laquelle pratiquer l'auto-upgrade 25 | 26 | * Step 2 : Dans cette étape on trouve un tableau similaire à la page migration de Dolibarr mais adapté à l'auto-upgrade des instances. 27 | 28 | Pour lancer l'auto-upgrade vers la version voulue, il suffit de cliquer sur le bouton de la version voulu. 29 | 30 | ## Auto-upgrade page 2 verification succes & erreur : 31 | 32 | ### Succès 33 | 34 | Lorsque la vérification se passe sans erreur alors 2 boutons apparaitront sur la page: 35 | * Le premier pour procéder à l'auto-migration 36 | * Le second pour annuler l'auto-upgrade et revenir au formulaire d'envoi de tickets préremplis. 37 | 38 | ### Erreur 39 | 40 | Lorsque la verification se solde par un echec un encars s'affiche avec la liste des erreurs. En plus un bouton pour revenir au support s'affiche. 41 | 42 | ## Upgrade success/error 43 | 44 | ### Succès 45 | 46 | Lorsque la vérification se passe sans erreur alors un lien vers l'instance de l'utilisateur est disponible pour qu'il puisse se connecter. 47 | 48 | ### Erreur 49 | 50 | Lorsqu'une erreur est levée, un bouton s'affiche pour renvoyer vers la page de support et remplit l'encart de texte du formulaire. 51 | 52 | -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/TODO.md: -------------------------------------------------------------------------------- 1 | TODO 2 | Create the pencil frame for the auto-upgrade feature. -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/Wireframe/Resources/style.css: -------------------------------------------------------------------------------- 1 | /* 2 | place extra stylesheet here 3 | */ 4 | 5 | body, html { 6 | margin: 0px; 7 | padding: 0px; 8 | overflow: hidden; 9 | font-family: "Product Sans", "Liberation Sans", Arial, sans-serif; 10 | } 11 | 12 | #documentMetadata, 13 | #documentTitle { 14 | display: none; 15 | } 16 | 17 | .Page { 18 | position: absolute; 19 | left: 230px; 20 | top: 0px; 21 | right: 0px; 22 | bottom: 0px; 23 | 24 | display: flex; 25 | align-items: center; 26 | justify-content: center; 27 | background: #00000077; 28 | } 29 | .Page:not(:target) { 30 | display: none; 31 | } 32 | 33 | .Page > h2 { 34 | display: none; 35 | } 36 | .Page .ImageContainer { 37 | box-shadow: 0px 0px 1em #00000077; 38 | } 39 | 40 | .Page .ImageContainer { 41 | position: relative; 42 | } 43 | .Page .ImageContainer > .Links > a { 44 | position: absolute; 45 | background-color: transparent; 46 | transition: background-color 0.2s ease; 47 | } 48 | body.Active .Page .ImageContainer > .Links > a { 49 | background-color: #E79A0F11; 50 | } 51 | .Page .ImageContainer > .Links > a:hover { 52 | background-color: #FFFFFF55 !important; 53 | } 54 | 55 | .TOC { 56 | position: absolute; 57 | top: 0px; 58 | left: 0px; 59 | bottom: 0px; 60 | width: 230px; 61 | display: flex; 62 | flex-direction: column; 63 | 64 | overflow-y: auto; 65 | overflow-x: visible; 66 | z-index: 2; 67 | background: #444; 68 | } 69 | .TOC > div { 70 | display: flex; 71 | flex-direction: column; 72 | align-items: center; 73 | padding: 1em; 74 | background: transparent; 75 | transition: background 0.2s ease; 76 | } 77 | .TOC > div.Focused { 78 | background: #5294E2; 79 | } 80 | .TOC > div:not(.Focused):hover { 81 | background: #5294E266; 82 | } 83 | .TOC > div + div { 84 | margin-top: 1em; 85 | } 86 | 87 | .TOC > div > a { 88 | display: block; 89 | border: solid 2px #FFF; 90 | box-shadow: 0px 0px 5px #000; 91 | } 92 | 93 | .TOC > div > strong { 94 | display: block; 95 | text-align: center; 96 | color: #FFF; 97 | font-weight: normal; 98 | margin-top: 0.3em; 99 | } 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/Wireframe/pages/autoupdate_page_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-upgrade/Wireframe/pages/autoupdate_page_1.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/Wireframe/pages/autoupgrade_page_2_verification_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-upgrade/Wireframe/pages/autoupgrade_page_2_verification_error.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/Wireframe/pages/autoupgrade_page_2_verification_success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-upgrade/Wireframe/pages/autoupgrade_page_2_verification_success.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/Wireframe/pages/supportpage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-upgrade/Wireframe/pages/supportpage.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/Wireframe/pages/supportpage_autoupgrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-upgrade/Wireframe/pages/supportpage_autoupgrade.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/Wireframe/pages/supportpage_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-upgrade/Wireframe/pages/supportpage_text.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/Wireframe/pages/upgrade_error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-upgrade/Wireframe/pages/upgrade_error.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/Wireframe/pages/upgrade_sucess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-upgrade/Wireframe/pages/upgrade_sucess.png -------------------------------------------------------------------------------- /doc/prototypes/project-auto-upgrade/autoupgrade.epgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-auto-upgrade/autoupgrade.epgz -------------------------------------------------------------------------------- /doc/prototypes/project-co2-impact-of-my-saas/website-co2-impact-of-my-saas.epgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-co2-impact-of-my-saas/website-co2-impact-of-my-saas.epgz -------------------------------------------------------------------------------- /doc/prototypes/project-roi-of-my-saas/my-roi-flowcharrt.epgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doc/prototypes/project-roi-of-my-saas/my-roi-flowcharrt.epgz -------------------------------------------------------------------------------- /doc/repository_root: -------------------------------------------------------------------------------- 1 | .. -------------------------------------------------------------------------------- /doc/sellyoursaas-theme.yml: -------------------------------------------------------------------------------- 1 | extends: default 2 | page: 3 | layout: portrait 4 | margin: [0.4in, 0.6in, 0.4in, 0.6in] 5 | # size: A4 6 | # size: Letter 7 | base: 8 | font-color: #000000 9 | #font-family: Times-Roman 10 | #font-size: 12 11 | #line-height-length: 16 12 | #line-height: $base-line-height-length / $base-font-size 13 | #vertical-spacing: $base-line-height-length 14 | heading: 15 | font-color: #b37d25 16 | font-size: 16 17 | font-style: bold 18 | line-height: 1.05 19 | margin-bottom: $vertical-spacing 20 | link: 21 | font-color: #002FA7 22 | #outline-list: 23 | # indent: $base-font-size * 1.5 24 | footer: 25 | height: $base-line-height-length * 2.5 26 | line-height: 1 27 | recto: 28 | right: 29 | content: '{page-number}' 30 | verso: 31 | left: 32 | content: $footer-recto-right-content -------------------------------------------------------------------------------- /doctemplates/contract/README.md: -------------------------------------------------------------------------------- 1 | # Directory with samples of hosting contracts documents -------------------------------------------------------------------------------- /doctemplates/contract/attestation_loi_finance.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/doctemplates/contract/attestation_loi_finance.odt -------------------------------------------------------------------------------- /etc/afick.conf: -------------------------------------------------------------------------------- 1 | ########## put your local config below #################### 2 | 3 | /snap/bin all 4 | 5 | !/var/log/mysql 6 | !/var/log/letsencrypt 7 | !/var/log/datadog 8 | !/var/log/clamav 9 | 10 | !/etc/apache2/sellyoursaas-available 11 | !/etc/apache2/sellyoursaas-online 12 | !/etc/bind/archives 13 | !/etc/bind/ 14 | !/etc/group 15 | !/etc/group- 16 | !/etc/gshadow 17 | !/etc/gshadow- 18 | !/etc/passwd 19 | !/etc/passwd- 20 | !/etc/shadow 21 | !/etc/shadow- 22 | !/etc/subgid 23 | !/etc/subgid- 24 | !/etc/subuid 25 | !/etc/subuid- 26 | 27 | /home MyRule 28 | /home/admin/logs Logs 29 | !/home/admin/backup 30 | !/home/jail/home 31 | !/home/admin/wwwroot/dolibarr_documents 32 | !/home/admin/wwwroot/dolibarr/.git 33 | !/home/admin/wwwroot/dolibarr_sellyoursaas/.git 34 | 35 | !/home/admin/.bash_history 36 | !/home/admin/.viminfo 37 | !/home/admin/.mysql_history 38 | !/home/myunixlogin/.bash_history 39 | !/home/myunixlogin/.viminfo 40 | !/home/myunixlogin/.mysql_history 41 | !/root/.bash_history 42 | !/root/.viminfo 43 | !/root/.mysql_history 44 | 45 | exclude_suffix := cache 46 | -------------------------------------------------------------------------------- /etc/apache2/conf-available/custom-server-tokens.conf: -------------------------------------------------------------------------------- 1 | # Show a generic Apache version. 2 | # File can be enabled with: 3 | # a2enconf custom-server-tokens 4 | # systemctl reload apache2 5 | ServerTokens Prod 6 | -------------------------------------------------------------------------------- /etc/apache2/sites-available/000-default-ssl.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ServerAdmin webmaster@localhost 4 | 5 | DocumentRoot /var/www/html 6 | 7 | ErrorLog ${APACHE_LOG_DIR}/error_ssl.log 8 | CustomLog ${APACHE_LOG_DIR}/access_ssl.log combined 9 | 10 | # SSL Engine Switch: 11 | # Enable/Disable SSL for this virtual host. 12 | SSLEngine on 13 | 14 | # A self-signed (snakeoil) certificate can be created by installing 15 | # the ssl-cert package. See 16 | # /usr/share/doc/apache2/README.Debian.gz for more info. 17 | # If both key and certificate are stored in the same file, only the 18 | # SSLCertificateFile directive is needed. 19 | SSLCertificateFile /etc/apache2/with.sellyoursaas.com.crt 20 | SSLCertificateKeyFile /etc/apache2/with.sellyoursaas.com.key 21 | SSLCertificateChainFile /etc/apache2/with.sellyoursaas.com-intermediate.crt 22 | SSLCACertificateFile /etc/apache2/with.sellyoursaas.com-intermediate.crt 23 | 24 | 25 | SSLOptions +StdEnvVars 26 | 27 | 28 | # 29 | # Allow server status reports generated by mod_status, 30 | # THIS IS REQUIRED FOR /usr/sbin/apachectl fullstatus 31 | # 32 | 33 | SetHandler server-status 34 | Order allow,deny 35 | Deny from env=bad_bots 36 | Allow from all 37 | Require local 38 | #Require ip x.y.z.w xxx::yyyy 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /etc/apache2/sites-available/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | # The ServerName directive sets the request scheme, hostname and port that 3 | # the server uses to identify itself. This is used when creating 4 | # redirection URLs. In the context of virtual hosts, the ServerName 5 | # specifies what hostname must appear in the request's Host: header to 6 | # match this virtual host. For the default virtual host (this file) this 7 | # value is not decisive as it is used as a last resort host regardless. 8 | # However, you must set it for any further virtual host explicitly. 9 | #ServerName www.example.com 10 | 11 | ServerAdmin webmaster@localhost 12 | DocumentRoot /var/www/html 13 | 14 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 15 | # error, crit, alert, emerg. 16 | # It is also possible to configure the loglevel for particular 17 | # modules, e.g. 18 | #LogLevel info ssl:warn 19 | 20 | ErrorLog ${APACHE_LOG_DIR}/error.log 21 | CustomLog ${APACHE_LOG_DIR}/access.log combined 22 | 23 | # For most configuration files from conf-available/, which are 24 | # enabled or disabled at a global level, it is possible to 25 | # include a line for only one particular virtual host. For example the 26 | # following line enables the CGI configuration for this host only 27 | # after it has been globally disabled with "a2disconf". 28 | #Include conf-available/serve-cgi-bin.conf 29 | 30 | 31 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet -------------------------------------------------------------------------------- /etc/apache2/sites-available/portal.mysellyoursaasdomain.com-le-ssl.conf: -------------------------------------------------------------------------------- 1 | 2 | ... 3 | # Add this to use a custom apparmor profile when using apache php handler 4 | 5 | 6 | AADefaultHatName sellyoursaas-instances 7 | 8 | 9 | 10 | # Add this in your virtual host to support php-fpm on a custom pool "myfpmpool" 11 | # It may be added globally into the conf-enabled/php-fpm.conf 12 | 13 | 14 | 15 | SetHandler "proxy:unix:/run/php/php-fpm-myfpmpool.sock|fcgi://localhost" 16 | 17 | 18 | 19 | ... 20 | 21 | -------------------------------------------------------------------------------- /etc/datadog-agent/conf.d/http_check.d/conf.yaml: -------------------------------------------------------------------------------- 1 | init_config: 2 | ## @param ca_certs - string - optional 3 | ## Change default path of trusted certificates 4 | # 5 | ## ca_certs: /etc/ssl/certs/ca-certificates.crt 6 | 7 | instances: 8 | 9 | - name: SellYourSaas customers instances (withX) 10 | url: https://supervision.withX.mysaasdomain.org 11 | disable_ssl_validation: false 12 | min_collection_interval: 86400 13 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/email-dolibarr-rulesadmin.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to catch known spambots and software alike. Please verify 4 | # that it is your intent to block IPs which were driven by 5 | # above mentioned bots. 6 | 7 | # To restrict number of emails sent from the admin/mails.php page 8 | 9 | 10 | [Definition] 11 | 12 | # To test, you can inject this example into /var/log/phpsendmail.log 13 | # echo `date +'%Y-%m-%d %H:%M:%S'`" 1.2.3.4 sellyoursaas rules ok ( <10 : 1 0 1 - /admin/mails.php )" >> /var/log/phpsendmail.log 14 | # 15 | # then 16 | # fail2ban-client status email-dol-perhouradmin 17 | # 18 | # To test rule file on a existing log file 19 | # fail2ban-regex /var/log/phpsendmail.log /etc/fail2ban/filter.d/email-dolibarr-rulesadmin.conf 20 | 21 | failregex = sellyoursaas rules.*\/admin\/mails\.php 22 | ignoreregex = 23 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/email-dolibarr-rulesall.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to catch known spambots and software alike. Please verify 4 | # that it is your intent to block IPs which were driven by 5 | # above mentioned bots. 6 | 7 | # To restrict attempt to send more than default limit of X emails per day. 8 | # Note: The regex is not found (different) when user limit is a custom limit higher than default limit 9 | 10 | 11 | [Definition] 12 | 13 | # To test, you can inject this example into /var/log/phpsendmail.log 14 | # echo `date +'%Y-%m-%d %H:%M:%S'`" 1.2.3.4 sellyoursaas rules ok ( <10 : 1 0 1 - /admin/mails.php )" >> /var/log/phpsendmail.log 15 | # or this is enough 16 | # echo `date +'%Y-%m-%d %H:%M:%S'`" 1.2.3.4 sellyoursaas rules" >> /var/log/phpsendmail.log 17 | # 18 | # then 19 | # fail2ban-client status email-dol-perday 20 | # 21 | # To test rule file on a existing log file 22 | # fail2ban-regex /var/log/phpsendmail.log /etc/fail2ban/filter.d/email-dolibarr-rulesall.conf 23 | 24 | failregex = sellyoursaas rules ok 25 | ignoreregex = 26 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/email-dolibarr-rulesko.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to catch known spambots and software alike. Please verify 4 | # that it is your intent to block IPs which were driven by 5 | # above mentioned bots. 6 | 7 | # To restrict attempt to send email with too many recipient in same hour 8 | 9 | 10 | [Definition] 11 | 12 | # To test, you can inject this example into /var/log/phpsendmail.log 13 | # echo `date +'%Y-%m-%d %H:%M:%S'`" 1.2.3.4 sellyoursaas rules ko toomanyrecipient - exit 2 ( >10 : 8 5 3 - /admin/mails.php )" >> /var/log/phpsendmail.log 14 | # 15 | # then 16 | # fail2ban-client status email-dol-perhour 17 | # 18 | # To test rule file on a existing log file 19 | # fail2ban-regex /var/log/phpsendmail.log /etc/fail2ban/filter.d/email-dolibarr-rulesko.conf 20 | 21 | failregex = sellyoursaas rules ko toomanyrecipient 22 | ignoreregex = 23 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/email-dolibarr-ruleskoblacklist.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to catch known spambots and software alike. Please verify 4 | # that it is your intent to block IPs which were driven by 5 | # above mentioned bots. 6 | 7 | 8 | [Definition] 9 | 10 | # To test, you can inject this example into /var/log/phpsendmail.log 11 | # echo `date +'%Y-%m-%d %H:%M:%S'`" 1.2.3.4 sellyoursaas rules ko blacklist - exit 2. Blacklisted ip 1.2.3.4 found into file blacklistip" >> /var/log/phpsendmail.log 12 | # 13 | # then 14 | # fail2ban-client status email-dol-blacklist 15 | # 16 | # To test rule file on a existing log file 17 | # fail2ban-regex /var/log/phpsendmail.log /etc/fail2ban/filter.d/email-dolibarr-ruleskoblacklist.conf 18 | 19 | failregex = sellyoursaas rules ko blacklist 20 | ignoreregex = 21 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/email-dolibarr-ruleskoquota.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to catch known spambots and software alike. Please verify 4 | # that it is your intent to block IPs which were driven by 5 | # above mentioned bots. 6 | 7 | 8 | [Definition] 9 | 10 | # To test, you can inject this example into /var/log/phpsendmail.log 11 | # echo `date +'%Y-%m-%d %H:%M:%S'`" 1.2.3.4 sellyoursaas rules ko quota ..." >> /var/log/phpsendmail.log 12 | # 13 | # then 14 | # fail2ban-client status email-dol-quota 15 | # 16 | # To test rule file on a existing log file 17 | # fail2ban-regex /var/log/phpsendmail.log /etc/fail2ban/filter.d/email-dolibarr-ruleskoquota.conf 18 | 19 | failregex = sellyoursaas rules ko quota 20 | ignoreregex = 21 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/web-accesslog-limit401.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to detect forbidden access on pages (public or not) so we can add mitigation on IP making too much 4 | # access to a Dolibarr instance. 5 | 6 | 7 | [Definition] 8 | 9 | # To test, you can inject this example into log 10 | # echo myvirtualhost.com:443 1.2.3.4 - - [15/Dec/2022:09:57:47 +0000] "GET /public/abc HTTP/1.1" 401 123 "-" "Mozilla" >> /var/log/apache2/other_vhosts_access.log 11 | # 12 | # then 13 | # fail2ban-client status web-accesslog-limit401 14 | # 15 | # To test rule file on a existing log file 16 | # fail2ban-regex /var/log/apache2/other_vhosts_access.log /etc/fail2ban/filter.d/web-accesslog-limit401.conf 17 | 18 | failregex = - - .*HTTP/[0-9]+(.[0-9]+)?" 401 19 | ignoreregex = 20 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/web-accesslog-limit403.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to detect forbidden access on pages (public or not) so we can add mitigation on IP making too much 4 | # access to a Dolibarr instance. 5 | 6 | 7 | [Definition] 8 | 9 | # To test, you can inject this example into log 10 | # echo 'myvirtualhost.com:443 1.2.3.4 - - [15/Dec/2022:09:57:47 +0000] "GET /public/abc HTTP/1.1" 403 123 "-" "Mozilla"' >> /var/log/apache2/other_vhosts_access.log 11 | # WARNING: Set the date in log that is current date 12 | # 13 | # then 14 | # fail2ban-client status web-accesslog-limit403 15 | # 16 | # To test rule file on a existing log file 17 | # fail2ban-regex /var/log/apache2/other_vhosts_access.log /etc/fail2ban/filter.d/web-accesslog-limit403.conf 18 | 19 | failregex = - - .*HTTP/[0-9]+(.[0-9]+)?" 403 20 | ignoreregex = 21 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/web-accesslog-limit404.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to detect not found access on pages (public or not) so we can add mitigation on IP making too much 4 | # access to a Dolibarr instance. 5 | 6 | 7 | [Definition] 8 | 9 | # To test, you can inject this example into log 10 | # echo 'myvirtualhost.com:443 1.2.3.4 - - [15/Dec/2022:09:57:47 +0000] "GET /attemptedpage HTTP/1.1" 404 123 "-" "Mozilla"' >> /var/log/apache2/other_vhosts_access.log 11 | # echo '1.2.3.4 - - [18/Jul/2024:00:17:15 +0000] "GET /attemptedpage HTTP/1.1" 404 4142 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0"' >> /var/log/apache2/access_ssl.log 12 | # WARNING: Set the date in log that is current date 13 | # 14 | # then 15 | # fail2ban-client status web-accesslog-limit404 16 | # 17 | # To test rule file on a existing log file 18 | # fail2ban-regex /var/log/apache2/other_vhosts_access.log /etc/fail2ban/filter.d/web-accesslog-limit404.conf 19 | 20 | failregex = - - .*HTTP/[0-9]+(.[0-9]+)?" 404 21 | ignoreregex = 22 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/web-accesslog-limitapi.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to detect forbidden access on pages (public or not) so we can add mitigation on IP making too much 4 | # access to a Dolibarr instance. 5 | 6 | 7 | [Definition] 8 | 9 | # To test, you can inject this example into log 10 | # echo myvirtualhost.com:443 1.2.3.4 - - [15/Dec/2022:09:57:47 +0000] "GET /api/index.php HTTP/1.1" 200 123 "-" "Symfony HttpClient/Curl" >> /var/log/apache2/other_vhosts_access.log 11 | # WARNING: Set the date in log that is current date 12 | # 13 | # then 14 | # fail2ban-client status web-accesslog-api 15 | # 16 | # To test rule file on a existing log file 17 | # fail2ban-regex /var/log/apache2/other_vhosts_access.log /etc/fail2ban/filter.d/web-accesslog-limitapi.conf 18 | 19 | failregex = - - .* /api/index.php/ 20 | ignoreregex = 21 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/web-accesslog-limitapipermin.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to detect forbidden access on pages (public or not) so we can add mitigation on IP making too much 4 | # access to a Dolibarr instance. 5 | 6 | 7 | [Definition] 8 | 9 | # To test, you can inject this example into log 10 | # echo myvirtualhost.com:443 1.2.3.4 - - [15/Dec/2022:09:57:47 +0000] "GET /api/index.php HTTP/1.1" 200 123 "-" "Symfony HttpClient/Curl" >> /var/log/apache2/other_vhosts_access.log 11 | # WARNING: Set the date in log that is current date 12 | # 13 | # then 14 | # fail2ban-client status web-accesslog-apipermin 15 | # 16 | # To test rule file on a existing log file 17 | # fail2ban-regex /var/log/apache2/other_vhosts_access.log /etc/fail2ban/filter.d/web-accesslog-limitapipermin.conf 18 | 19 | failregex = - - .* /api/index.php/ 20 | ignoreregex = 21 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to catch known spambots and software alike. Please verify 4 | # that it is your intent to block IPs which were driven by 5 | # above mentioned bots. 6 | 7 | 8 | [Definition] 9 | 10 | # To test, you can inject this example into log 11 | # echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 functions_dolibarr::check_user_password_abcd Authentication KO" >> /home/admin/wwwroot/dolibarr_documents/dolibarr.log 12 | # echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 1234567 33 functions_dolibarr::check_user_password_abcd Authentication KO" >> /home/admin/wwwroot/dolibarr_documents/dolibarr.log 13 | # 14 | # then 15 | # fail2ban-client status web-dolibarr-bruteforce 16 | # 17 | # To test rule file on a existing log file 18 | # fail2ban-regex /home/admin/wwwroot/dolibarr_documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf --print-all-matched 19 | 20 | failregex = ^ [A-Z\s]+ \s.*functions_.*::check_user_.* Authentication KO 21 | ignoreregex = 22 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/web-dolibarr-ruleslimitpublic.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to catch DOS attacks on public pages. 4 | 5 | 6 | [Definition] 7 | 8 | # To test, you can inject this example into log 9 | # echo `date +'%Y-%m-%d %H:%M:%S'`" NOTICE 1.2.3.4 --- Access to GET /public/clicktodial/cidlookup.php" >> /home/admin/wwwroot/dolibarr_documents/dolibarr.log 10 | # echo `date +'%Y-%m-%d %H:%M:%S'`" NOTICE 1.2.3.4 1234567 33 --- Access to GET /public/clicktodial/cidlookup.php" >> /home/admin/wwwroot/dolibarr_documents/dolibarr.log 11 | # 12 | # then 13 | # fail2ban-client status web-dolibarr-limitpublic 14 | # 15 | # To test rule file on a existing log file 16 | # fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-ruleslimitpublic.conf --print-all-matched 17 | 18 | failregex = ^ [A-Z\s]+ \s.*--- Access to .*/public/ 19 | ignoreregex = 20 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to catch known spambots and software alike. Please verify 4 | # that it is your intent to block IPs which were driven by 5 | # above mentioned bots. 6 | 7 | 8 | [Definition] 9 | 10 | # To test, you can inject this example into log 11 | # echo `date +'%Y-%m-%d %H:%M:%S'`" NOTICE 1.2.3.4 --- Access to GET /passwordforgotten.php" >> /home/admin/wwwroot/dolibarr_documents/dolibarr.log 12 | # echo `date +'%Y-%m-%d %H:%M:%S'`" NOTICE 1.2.3.4 1234567 33 --- Access to GET /passwordforgotten.php" >> /home/admin/wwwroot/dolibarr_documents/dolibarr.log 13 | # 14 | # then 15 | # fail2ban-client status web-dol-passforgotten 16 | # 17 | # To test rule file on a existing log file 18 | # fail2ban-regex /home/admin/wwwroot/dolibarr_documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulespassforgotten.conf --print-all-matched 19 | 20 | failregex = ^ [A-Z\s]+ \s.*--- Access to .*/passwordforgotten.php 21 | ignoreregex = 22 | -------------------------------------------------------------------------------- /etc/fail2ban/filter.d/web-dolibarr-rulesregisterinstance.conf: -------------------------------------------------------------------------------- 1 | # Fail2Ban configuration file 2 | # 3 | # Regexp to catch known spambots and software alike. Please verify 4 | # that it is your intent to block IPs which were driven by 5 | # above mentioned bots. 6 | 7 | 8 | [Definition] 9 | 10 | # To test, you can inject this example into log 11 | # echo `date +'%Y-%m-%d %H:%M:%S'`" WARNING 1.2.3.4 Instance creation blocked for 1.2.3.4" >> /home/admin/wwwroot/dolibarr_documents/dolibarr_register.log 12 | # echo `date +'%Y-%m-%d %H:%M:%S'`" WARNING 1.2.3.4 1234567 33 Instance creation blocked for 1.2.3.4" >> /home/admin/wwwroot/dolibarr_documents/dolibarr_register.log 13 | # 14 | # then 15 | # fail2ban-client status web-dol-registerinstance 16 | # 17 | # To test rule file on a existing log file 18 | # fail2ban-regex /home/admin/wwwroot/dolibarr_documents/dolibarr_register.log /etc/fail2ban/filter.d/web-dolibarr-rulesregisterinstance.conf --print-all-matched 19 | 20 | failregex = ^ [A-Z\s]+ \s.*Instance creation blocked for 21 | ignoreregex = 22 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/email-dolibarr-rulesadmin.conf: -------------------------------------------------------------------------------- 1 | 2 | [email-dol-perhouradmin] 3 | 4 | ; rule against out of limit emails (max 10 from admin) 5 | enabled = true 6 | port = http,https 7 | filter = email-dolibarr-rulesadmin 8 | logpath = /var/log/phpsendmail.log 9 | action = %(action_mw)s 10 | bantime = 4320000 ; 50 days 11 | findtime = 60 ; 1 minute 12 | maxretry = 10 13 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/email-dolibarr-rulesall.conf: -------------------------------------------------------------------------------- 1 | 2 | [email-dol-perday] 3 | 4 | ; rule against out of limit emails (max 500 emails per day) 5 | ; Note: The regex is not found (different) when user limit is a custom limit higher than default limit 6 | enabled = true 7 | port = http,https 8 | filter = email-dolibarr-rulesall 9 | logpath = /var/log/phpsendmail.log 10 | action = %(action_mw)s 11 | bantime = 86400 ; 1 day 12 | findtime = 86400 ; 1 day 13 | maxretry = 500 14 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/email-dolibarr-rulesko.conf: -------------------------------------------------------------------------------- 1 | 2 | [email-dol-perhour] 3 | 4 | ; rule against intensive email ko - too high number of recipient 5 | enabled = true 6 | port = http,https 7 | filter = email-dolibarr-rulesko 8 | logpath = /var/log/phpsendmail.log 9 | action = %(action_mw)s 10 | bantime = 7200 ; 2 hour 11 | findtime = 3600 ; 1 hour 12 | maxretry = 5 13 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/email-dolibarr-ruleskoblacklist.conf: -------------------------------------------------------------------------------- 1 | 2 | [email-dol-blacklist] 3 | 4 | ; rule against email ko - blacklist ip, email or content 5 | enabled = true 6 | port = http,https 7 | filter = email-dolibarr-ruleskoblacklist 8 | logpath = /var/log/phpsendmail.log 9 | action = %(action_mw)s 10 | bantime = 4320000 ; 50 days 11 | findtime = 86400 ; 1 day 12 | maxretry = 1 13 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/email-dolibarr-ruleskoquota.conf: -------------------------------------------------------------------------------- 1 | 2 | [email-dol-quota] 3 | 4 | ; rule against email ko - quota reached 5 | enabled = true 6 | port = http,https 7 | filter = email-dolibarr-ruleskoquota 8 | logpath = /var/log/phpsendmail.log 9 | action = %(action_mw)s 10 | bantime = 86400 ; 1 day 11 | findtime = 86400 ; 1 day 12 | maxretry = 1 13 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/web-accesslog-limit401.conf: -------------------------------------------------------------------------------- 1 | 2 | [web-accesslog-limit401] 3 | 4 | ; rule against call of 401 forbidden access (for all servers) 5 | enabled = true 6 | port = http,https 7 | filter = web-accesslog-limit401 8 | logpath = /var/log/apache2/other_vhosts_access.log 9 | action = %(action_mw)s 10 | bantime = 4320000 ; 50 days 11 | findtime = 86400 ; 1 day 12 | maxretry = 100 13 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/web-accesslog-limit403.conf: -------------------------------------------------------------------------------- 1 | 2 | [web-accesslog-limit403] 3 | 4 | ; rule against call of 403 forbidden access (for all servers) 5 | enabled = true 6 | port = http,https 7 | filter = web-accesslog-limit403 8 | logpath = /var/log/apache2/other_vhosts_access.log 9 | action = %(action_mw)s 10 | bantime = 4320000 ; 50 days 11 | findtime = 86400 ; 1 day 12 | maxretry = 200 13 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/web-accesslog-limit404.conf: -------------------------------------------------------------------------------- 1 | 2 | [web-accesslog-limit404] 3 | 4 | ; rule against call of 404 forbidden access (for all servers) 5 | enabled = true 6 | port = http,https 7 | filter = web-accesslog-limit404 8 | logpath = /var/log/apache2/*access*.log 9 | action = %(action_mw)s 10 | bantime = 86400 ; 1 day 11 | findtime = 60 ; 1mn 12 | maxretry = 1000 13 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/web-accesslog-limitapi.conf: -------------------------------------------------------------------------------- 1 | 2 | [web-accesslog-api] 3 | 4 | ; rule against call of api (for all servers) 5 | enabled = true 6 | port = http,https 7 | filter = web-accesslog-limitapi 8 | logpath = /var/log/apache2/other_vhosts_access.log 9 | action = %(action_mw)s 10 | bantime = 2592000 ; 1 month 11 | findtime = 2592000 ; 1 month 12 | maxretry = 25000 13 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/web-accesslog-limitapipermin.conf: -------------------------------------------------------------------------------- 1 | 2 | [web-accesslog-apipermin] 3 | 4 | ; rule against call of api (for all servers) 5 | enabled = true 6 | port = http,https 7 | filter = web-accesslog-limitapipermin 8 | logpath = /var/log/apache2/other_vhosts_access.log 9 | action = %(action_mw)s 10 | bantime = 60 ; 1 mn 11 | findtime = 60 ; 1 mn 12 | maxretry = 200 13 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/web-dolibarr-rulesbruteforce.conf: -------------------------------------------------------------------------------- 1 | 2 | [web-dol-bruteforce] 3 | 4 | ; rule against bruteforce hacking (login + api) 5 | ; disable this rule by setting enabled to false on non master servers or remove link in /etc/fail2ban/jail.d 6 | enabled = true 7 | port = http,https 8 | filter = web-dolibarr-rulesbruteforce 9 | logpath = /home/admin/wwwroot/dolibarr_documents/dolibarr.log 10 | action = %(action_mw)s 11 | bantime = 86400 ; 1 day 12 | findtime = 3600 ; 1 hour 13 | maxretry = 20 ; 10 login error in 1 hour, we ban 14 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/web-dolibarr-ruleslimitpublic.conf: -------------------------------------------------------------------------------- 1 | 2 | [web-dol-limitpublic] 3 | 4 | ; rule against DOS on /public/* 5 | ; disable this rule by setting enabled to false on non master servers or remove link in /etc/fail2ban/jail.d 6 | enabled = true 7 | port = http,https 8 | filter = web-dolibarr-ruleslimitpublic 9 | logpath = /home/admin/wwwroot/dolibarr_documents/dolibarr.log 10 | action = %(action_mw)s 11 | bantime = 4320000 ; 50 days 12 | findtime = 3600 ; 1 hour 13 | maxretry = 50 14 | 15 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/web-dolibarr-rulespassforgotten.conf: -------------------------------------------------------------------------------- 1 | 2 | [web-dol-passforgotten] 3 | 4 | ; rule against call of passwordforgottenpage 5 | ; disable this rule by setting enabled to false on non master servers or remove link in /etc/fail2ban/jail.d 6 | enabled = true 7 | port = http,https 8 | filter = web-dolibarr-rulespassforgotten 9 | logpath = /home/admin/wwwroot/dolibarr_documents/dolibarr.log 10 | action = %(action_mw)s 11 | bantime = 4320000 ; 50 days 12 | findtime = 86400 ; 1 day 13 | maxretry = 10 14 | -------------------------------------------------------------------------------- /etc/fail2ban/jail.d/web-dolibarr-rulesregisterinstance.conf: -------------------------------------------------------------------------------- 1 | 2 | [web-dol-registerinstance] 3 | 4 | ; rule against call to myaccount/register_instance.php (see file etc/fail2ban/filter.d/web-dolibarr-rulesregisterinstance) 5 | ; disable this rule by setting enabled to false on non master servers or remove link in /etc/fail2ban/jail.d 6 | enabled = false 7 | port = http,https 8 | filter = web-dolibarr-rulesregisterinstance 9 | logpath = /home/admin/wwwroot/dolibarr_documents/dolibarr_register.log 10 | action = %(action_mw)s 11 | bantime = 4320000 ; 50 days 12 | findtime = 86400 ; 1 day 13 | maxretry = 10 14 | 15 | -------------------------------------------------------------------------------- /etc/php/sellyoursaas.ini: -------------------------------------------------------------------------------- 1 | ; Setup PHP for SellyourSaas 2 | ; This file must be stored into /etc/php and linked with: 3 | ; ln -fs /etc/php/sellyoursaas.ini /etc/php/x.x/apache2/conf.d 4 | 5 | disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,passthru,system,proc_open,dl,apache_note,apache_setenv,show_source,virtual 6 | 7 | post_max_size = 20M 8 | upload_max_filesize = 20M 9 | max_input_vars = 4000 10 | 11 | memory_limit = 256M 12 | 13 | session.gc_maxlifetime = 14400 14 | 15 | session.use_strict_mode = 1 16 | session.use_only_cookies = 1 17 | session.cookie_httponly = 1 18 | session.cookie_samesite = Lax 19 | 20 | opcache.memory_consumption = 1024 21 | opcache.max_accelerated_files = 100000 22 | opcache.file_update_protection = 2 23 | 24 | 25 | ; Automatically add files before PHP document. 26 | ; http://php.net/auto-prepend-file 27 | auto_prepend_file = /usr/local/bin/phpsendmailprepend.php 28 | 29 | ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). 30 | ; http://php.net/sendmail-path 31 | sendmail_path = /usr/local/bin/phpsendmail.php 32 | 33 | ; The path to a log file that will log all mail() calls. Log entries include 34 | ; the full path of the script, line number, To address and headers. 35 | mail.log = /var/log/phpmail.log 36 | -------------------------------------------------------------------------------- /etc/sellyoursaas-public.conf: -------------------------------------------------------------------------------- 1 | # 2 | # File with public config for SellYourSaas 3 | # 4 | 5 | # Options for antispam system 6 | maxemailperday=50 7 | maxemailperdaypaid=500 8 | 9 | # Option to use a different path for spam (for public script) 10 | #pathtospamdir=/tmp/spam -------------------------------------------------------------------------------- /etc/sellyoursaas.d/sellyousaas-allowed-ip-mysql.conf: -------------------------------------------------------------------------------- 1 | # File /etc/sellyoursaas.d/sellyoursaas-allowed-ip-mysql.conf 2 | # Can be used to allow only some IP to MySQL 3 | 4 | # Example: 5 | #Require ip 1.2.3.4 6 | -------------------------------------------------------------------------------- /etc/sellyoursaas.d/sellyousaas-allowed-ip-ssh.conf: -------------------------------------------------------------------------------- 1 | # File /etc/sellyoursaas.d/sellyoursaas-allowed-ip-ssh.conf 2 | # Can be used to allow only some IP to SSH 3 | 4 | # Example: 5 | #Require ip 1.2.3.4 6 | -------------------------------------------------------------------------------- /etc/sellyoursaas.d/sellyousaas-allowed-ip.conf: -------------------------------------------------------------------------------- 1 | # File /etc/sellyoursaas.d/sellyoursaas-allowed-ip.conf 2 | # Can be used to allow only some IP to apache, ssh and mysql. Protection is done on firewall for ssh and mysql and into apache virtual host. 3 | # Use /etc/sellyoursaas.d/sellyoursaas-allowed-ip-ssh.conf to restrict only ssh 4 | # Use /etc/sellyoursaas.d/sellyoursaas-allowed-ip-mysql.conf to restrict only mysql 5 | 6 | # Example: 7 | #Require ip 1.2.3.4 8 | -------------------------------------------------------------------------------- /etc/ssh/sshd_config.d/sellyoursaas-users.conf: -------------------------------------------------------------------------------- 1 | # List of allowed sysadmin users. 2 | # This section is filled when managing users with the script: desktop_admin_users.php 3 | # Example: AllowUsers loginofsysadmin 4 | -------------------------------------------------------------------------------- /etc/ssh/sshd_config.d/sellyoursaas.conf: -------------------------------------------------------------------------------- 1 | # File sellyousaas.conf for SellYourSaas 2 | 3 | Port 22 4 | Protocol 2 5 | 6 | # Privilege Separation is turned on for security (deprecated) 7 | #UsePrivilegeSeparation yes 8 | # Permissions on files must be correct to allow login 9 | StrictModes yes 10 | 11 | Loglevel VERBOSE 12 | 13 | # MaxAuthTries 6 14 | MaxAuthTries 10 15 | # MaxSessions 10 16 | MaxSessions 25 17 | 18 | UsePAM yes 19 | 20 | # Disallow login to root 21 | PermitRootLogin no 22 | # Disallow empty passwords 23 | PermitEmptyPasswords no 24 | # Do not support the "keyboard-interactive" authentication scheme defined in RFC-4256. 25 | ChallengeResponseAuthentication no 26 | # Disable Agent forwarding 27 | AllowAgentForwarding no 28 | # Disable tunnel 29 | PermitTunnel no 30 | # Disable X11 forwarding 31 | X11Forwarding no 32 | 33 | # Define list of allowed method to authenticate 34 | PasswordAuthentication no # This will be allowed for osu users only into main sshd_config file with a Match User rule 35 | PubkeyAuthentication yes 36 | 37 | AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys_support 38 | 39 | # Legacy changes - To allow an old client (like old PHP) to connect to this SSH server 40 | # Warning: openssh accept only 1 line per option and does not support mixing + and - value in same option. 41 | HostKeyAlgorithms +ssh-rsa 42 | #HostKeyAlgorithms -ecdsa-sha2-nistp256 43 | #KexAlgorithms +diffie-hellman-group1-sha1 44 | KexAlgorithms -ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521 45 | #Ciphers +aes128-cbc 46 | 47 | ClientAliveInterval 30 48 | #ClientAliveCountMax 3 49 | 50 | DenyUsers guest 51 | 52 | AllowUsers admin osu* 53 | # other AllowUsers xxx are set during creation of users into /etc/ssh/sshd_config.d/sellyoursaas-users.conf 54 | 55 | -------------------------------------------------------------------------------- /etc/sudoers.d/myadminunixlogin: -------------------------------------------------------------------------------- 1 | myadminunixlogin ALL=(ALL) ALL 2 | # You can also add this lines to avoid user to re-enter a password when switching to 'admin' or 'osu*' 3 | # This allows to switch to admin or osu* with "sudo su - admin" or "sudo su - osu..." 4 | #myadminunixlogin ALL=(ALL) /usr/bin/su - admin 5 | #myadminunixlogin ALL=(ALL) /usr/bin/su - osu* 6 | -------------------------------------------------------------------------------- /etc/systemd/journald.conf: -------------------------------------------------------------------------------- 1 | # This file is part of systemd. 2 | # 3 | # systemd is free software; you can redistribute it and/or modify it 4 | # under the terms of the GNU Lesser General Public License as published by 5 | # the Free Software Foundation; either version 2.1 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # Entries in this file show the compile time defaults. 9 | # You can change settings by editing this file. 10 | # Defaults can be restored by simply deleting this file. 11 | # 12 | # See journald.conf(5) for details. 13 | 14 | [Journal] 15 | #Storage=auto 16 | #Compress=yes 17 | #Seal=yes 18 | SplitMode=none 19 | #SyncIntervalSec=5m 20 | #RateLimitInterval=30s 21 | #RateLimitBurst=1000 22 | SystemMaxUse=1G 23 | #SystemKeepFree= 24 | #SystemMaxFileSize=5M 25 | #SystemMaxFiles=100 26 | #RuntimeMaxUse= 27 | #RuntimeKeepFree= 28 | #RuntimeMaxFileSize= 29 | #RuntimeMaxFiles=100 30 | #MaxRetentionSec= 31 | #MaxFileSec=1month 32 | #ForwardToSyslog=yes 33 | #ForwardToKMsg=no 34 | #ForwardToConsole=no 35 | #ForwardToWall=yes 36 | #TTYPath=/dev/console 37 | #MaxLevelStore=debug 38 | #MaxLevelSyslog=debug 39 | #MaxLevelKMsg=notice 40 | #MaxLevelConsole=info 41 | #MaxLevelWall=emerg 42 | -------------------------------------------------------------------------------- /etc/watchdog.conf: -------------------------------------------------------------------------------- 1 | #ping = 172.31.14.1 2 | #ping = 172.26.1.255 3 | #interface = eth0 4 | #file = /var/log/messages 5 | #change = 1407 6 | 7 | # Uncomment to enable test. Setting one of these values to '0' disables it. 8 | # These values will hopefully never reboot your machine during normal use 9 | # (if your machine is really hung, the loadavg will go much higher than 25) 10 | max-load-1 = 24 11 | max-load-5 = 18 12 | max-load-15 = 12 13 | 14 | # Note that this is the number of pages! 15 | # To get the real size, check how large the pagesize is on your machine. 16 | # On ubuntu 64 serveur ovh, pagecode=4ko 17 | min-memory = 1000 18 | #allocatable-memory = 1 19 | 20 | repair-binary = /usr/sbin/repair 21 | #repair-timeout = 22 | #test-binary = 23 | #test-timeout = 24 | 25 | #watchdog-device = /dev/watchdog 26 | 27 | # Defaults compiled into the binary 28 | #temperature-device = 29 | #max-temperature = 120 30 | 31 | # Defaults compiled into the binary 32 | #admin = root 33 | #interval = 10 34 | #logtick = 1 35 | #log-dir = /var/log/watchdog 36 | 37 | # This greatly decreases the chance that watchdog won't be scheduled before 38 | # your machine is really loaded 39 | realtime = yes 40 | priority = 1 41 | 42 | # Check if syslogd is still running by enabling the following line 43 | #pidfile = /var/run/syslogd.pid 44 | -------------------------------------------------------------------------------- /img/dolicloud_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/dolicloud_logo.png -------------------------------------------------------------------------------- /img/dolidroid_512x512_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/dolidroid_512x512_en.png -------------------------------------------------------------------------------- /img/gfdl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/gfdl.png -------------------------------------------------------------------------------- /img/gplv3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/gplv3.png -------------------------------------------------------------------------------- /img/logo_sellyoursaas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/logo_sellyoursaas.png -------------------------------------------------------------------------------- /img/object_cancellation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/object_cancellation.png -------------------------------------------------------------------------------- /img/object_packages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/object_packages.png -------------------------------------------------------------------------------- /img/object_sellyoursaas.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/object_sellyoursaas.gif -------------------------------------------------------------------------------- /img/object_sellyoursaas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/object_sellyoursaas.png -------------------------------------------------------------------------------- /img/sellyoursaas-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/sellyoursaas-banner.png -------------------------------------------------------------------------------- /img/sellyoursaas.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/sellyoursaas.gif -------------------------------------------------------------------------------- /img/sellyoursaas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/img/sellyoursaas.png -------------------------------------------------------------------------------- /modulebuilder.txt: -------------------------------------------------------------------------------- 1 | # Can be edited by module builder 2 | -------------------------------------------------------------------------------- /myaccount/.gitignore: -------------------------------------------------------------------------------- 1 | /source 2 | main.inc.php -------------------------------------------------------------------------------- /myaccount/README.txt: -------------------------------------------------------------------------------- 1 | # Note 2 | 3 | Create a link xxx to Dolibarr /htdocs/xxx for xxx = 4 | - includes 5 | - core 6 | - theme 7 | 8 | -------------------------------------------------------------------------------- /myaccount/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/ajax-loader.gif -------------------------------------------------------------------------------- /myaccount/dist/css/alt-myaccount-example.css: -------------------------------------------------------------------------------- 1 | /* Alternative CSS for myaccount */ 2 | 3 | body{ 4 | padding: 0px; 5 | } 6 | 7 | a{ 8 | color:#608ef2; 9 | } 10 | .customregisterheader a { 11 | color: #FFF; 12 | } 13 | 14 | div.block header { 15 | background-color: #4c4970; 16 | } 17 | div.block header h1 { 18 | margin-bottom: 0; 19 | } 20 | 21 | .customregistermain{ 22 | display:flex; 23 | justify-content:space-around; 24 | max-width:100%; 25 | } 26 | .customregistermain > * { 27 | width:100%; 28 | padding:10px 29 | } 30 | 31 | .customregisterinformation{ 32 | display: flex; 33 | flex-direction: column-reverse; 34 | justify-content: space-around; 35 | padding-left: 100px; 36 | padding-right: 100px; 37 | } 38 | .customregisterinformation > *{ 39 | align-self: center; 40 | /* padding-left:200px; */ 41 | } 42 | form#formregister { 43 | padding-right: 100px; 44 | } 45 | .customcompanylogo{ 46 | display:block; 47 | } 48 | 49 | .customregisterheader { 50 | display:flex 51 | } 52 | .customregisterheader > h1{ 53 | margin: auto; 54 | margin-top: 7px; 55 | margin-bottom: 7px !important; 56 | padding-left: 100px; 57 | padding-top: 5px !important; 58 | padding-bottom: 5px !important; 59 | } 60 | .defaultheader{ 61 | display:none; 62 | } 63 | .page-header-top{ 64 | display:none; 65 | } 66 | 67 | .btnalreadyanaccount { 68 | border: 1px solid #fff; 69 | } 70 | 71 | 72 | /* For other sizes */ 73 | 74 | @media (max-width: 768px) { 75 | body{ 76 | padding-top: 0px!important; 77 | } 78 | 79 | div.block header h1 { 80 | margin-bottom: 0; 81 | font-size: 1.1em; 82 | } 83 | 84 | .customregistermain{ 85 | flex-direction:column; 86 | } 87 | 88 | .customregisterinformation { 89 | padding-left: 10px; 90 | padding-right: 10px; 91 | flex-direction: column; 92 | } 93 | .customregisterinformation > *{ 94 | max-width:90%; 95 | padding-left:0px; 96 | } 97 | 98 | form#formregister { 99 | padding-right: unset; 100 | } 101 | 102 | .customcompanylogo{ 103 | -webkit-box-ordinal-group: 1; 104 | -moz-box-ordinal-group: 1; 105 | -ms-flex-order: 1; 106 | -webkit-order: 1; 107 | order: 1; 108 | padding-bottom: 20px; 109 | } 110 | .register_text{ 111 | -webkit-box-ordinal-group: 2; 112 | -moz-box-ordinal-group: 2; 113 | -ms-flex-order: 2; 114 | -webkit-order: 2; 115 | order: 2; 116 | padding: 0 0; 117 | } 118 | 119 | .customregisterheader > h1{ 120 | margin-top: 0; 121 | padding-left:0px 122 | } 123 | } 124 | 125 | @media (max-width: 320px) { 126 | 127 | } -------------------------------------------------------------------------------- /myaccount/dist/css/stripe.css: -------------------------------------------------------------------------------- 1 | /** 2 | * The CSS shown here will not be introduced in the Quickstart guide, but shows 3 | * how you can use CSS to style your Element's container. 4 | */ 5 | .StripeElement { 6 | background-color: white; 7 | height: 40px; 8 | padding: 10px 12px; 9 | border-radius: 4px; 10 | border: 1px solid #aaa; 11 | box-shadow: 0 1px 3px 0 #e6ebf1; 12 | -webkit-transition: box-shadow 150ms ease; 13 | transition: box-shadow 150ms ease; 14 | } 15 | 16 | .StripeElement--focus { 17 | box-shadow: 0 1px 3px 0 #cfd7df; 18 | } 19 | 20 | .StripeElement--invalid { 21 | border-color: #fa755a; 22 | } 23 | 24 | .StripeElement--webkit-autofill { 25 | background-color: #fefde5 !important; 26 | } 27 | -------------------------------------------------------------------------------- /myaccount/img/american_express.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/american_express.png -------------------------------------------------------------------------------- /myaccount/img/dolicloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/dolicloud.png -------------------------------------------------------------------------------- /myaccount/img/dolicloud_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/dolicloud_logo.png -------------------------------------------------------------------------------- /myaccount/img/dolicloud_logo_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/dolicloud_logo_white.png -------------------------------------------------------------------------------- /myaccount/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/favicon.ico -------------------------------------------------------------------------------- /myaccount/img/flyve-mdm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/flyve-mdm.png -------------------------------------------------------------------------------- /myaccount/img/glpi-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/glpi-network.png -------------------------------------------------------------------------------- /myaccount/img/mastercard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/mastercard.png -------------------------------------------------------------------------------- /myaccount/img/novafirstcloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/novafirstcloud.png -------------------------------------------------------------------------------- /myaccount/img/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/paypal.png -------------------------------------------------------------------------------- /myaccount/img/sellyoursaas_automigration_step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/sellyoursaas_automigration_step1.png -------------------------------------------------------------------------------- /myaccount/img/sellyoursaas_automigration_step2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/sellyoursaas_automigration_step2.png -------------------------------------------------------------------------------- /myaccount/img/sepa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/sepa.png -------------------------------------------------------------------------------- /myaccount/img/visa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoliCloud/SellYourSaas/ed89ca90f11a8e8a3bd424db24d5b480be4558bf/myaccount/img/visa.png -------------------------------------------------------------------------------- /myaccount/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / 3 | -------------------------------------------------------------------------------- /scripts/.gitignore: -------------------------------------------------------------------------------- 1 | /allowed_hosts.txt 2 | /filetomigrate.ko 3 | /filetomigrate.ok 4 | /sellyoursaas.conf 5 | /filetomigrate.txt 6 | -------------------------------------------------------------------------------- /scripts/ansible/.gitignore: -------------------------------------------------------------------------------- 1 | /hosts 2 | /hosts-dolicloud 3 | /hosts-novafirstcloud 4 | /hosts-doliasso 5 | /hosts-sellyoursaas 6 | /ansible.cfg 7 | /ssh.cfg 8 | -------------------------------------------------------------------------------- /scripts/ansible/README.md: -------------------------------------------------------------------------------- 1 | # ANSIBLE TOOLS FOR SELLYOURSAAS # 2 | 3 | Tools to manage remotely several servers. 4 | 5 | 6 | 7 | Example: 8 | 9 | cd ~/git/sellyoursaas/scripts/ansible 10 | 11 | ansible-playbook -i hosts.example --limit myserver1 update_sellyoursaas_conf.yml key value 12 | ansible-playbook -i hosts.example --limit myserver1 launch_git_update_sellyoursaas.yml 13 | ansible-playbook -i hosts.example --limit myserver1 launch_clean.yml 14 | 15 | 16 | -------------------------------------------------------------------------------- /scripts/ansible/bannedip_ban.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to change an option=value of an entry into htdocs/conf/conf.php 3 | # 4 | # Examples to run the script: 5 | # ansible-playbook -K bannedip.yml -i hosts-xxx -e 'target=targethost option= value=' 6 | # ansible-playbook -K bannedip.yml -i hosts-xxx -e 'target=targethost option= value=' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Ban an IP by Fail2Ban 10 | hosts: '{{target}}' 11 | become: yes 12 | vars: 13 | ip_a_debannir: "IP_À_DÉBANNIR" # Remplacez IP_À_DÉBANNIR par l'adresse IP réelle à dé-bannir 14 | 15 | tasks: 16 | - name: Bban IP of a jails 17 | ansible.builtin.shell: | 18 | fail2ban-client set apache-badbots banip {{ip}} 19 | register: ban_result 20 | 21 | - name: Show result on ban 22 | ansible.builtin.debug: 23 | msg: "{{ban_result.stdout_lines}}" 24 | -------------------------------------------------------------------------------- /scripts/ansible/bannedip_list.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to change an option=value of an entry into htdocs/conf/conf.php 3 | # 4 | # Examples to run the script: 5 | # ansible-playbook -K bannedip.yml -i hosts-xxx -e 'target=targethost option= value=' 6 | # ansible-playbook -K bannedip.yml -i hosts-xxx -e 'target=targethost option= value=' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Get banned IP by Fail2Ban 10 | hosts: '{{target}}' 11 | become: yes 12 | 13 | tasks: 14 | - name: Get whitlisted IP 15 | ansible.builtin.shell: grep -r "^ignoreip" "/etc/fail2ban/" 16 | register: whitelist_ips 17 | 18 | - name: Show whitelisted IP 19 | ansible.builtin.debug: 20 | msg: "{{ whitelist_ips.stdout_lines }}" 21 | 22 | - name: Get IP banned by Fail2Ban 23 | ansible.builtin.shell: fail2ban-client status | grep "Jail list:" | sed 's/.*Jail list://' | tr -d '[:space:]' | tr ',' '\n' | xargs -I {} sh -c 'echo "{}:"; fail2ban-client status {} | grep "Banned IP list"' 24 | register: banned_ips 25 | 26 | - name: Show banned IP 27 | ansible.builtin.debug: 28 | msg: "{{ banned_ips.stdout_lines }}" 29 | -------------------------------------------------------------------------------- /scripts/ansible/bannedip_unban.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to change an option=value of an entry into htdocs/conf/conf.php 3 | # 4 | # Examples to run the script: 5 | # ansible-playbook -K bannedip.yml -i hosts-xxx -e 'target=targethost option= value=' 6 | # ansible-playbook -K bannedip.yml -i hosts-xxx -e 'target=targethost option= value=' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Unban an IP by Fail2Ban 10 | hosts: '{{target}}' 11 | become: yes 12 | vars: 13 | ip_a_debannir: "IP_À_DÉBANNIR" # Remplacez IP_À_DÉBANNIR par l'adresse IP réelle à dé-bannir 14 | 15 | tasks: 16 | - name: Uban IP of all jails 17 | ansible.builtin.shell: | 18 | for jail in $(fail2ban-client status | grep "Jail list:" | sed 's/.*Jail list://' | tr -d '[:space:]' | tr ',' '\n'); do 19 | fail2ban-client set $jail unbanip {{ip}} 20 | done 21 | register: deban_result 22 | 23 | - name: Show result on unban 24 | ansible.builtin.debug: 25 | msg: "{{deban_result.stdout_lines}}" 26 | -------------------------------------------------------------------------------- /scripts/ansible/change_config_dolibarr.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to change an option=value of an entry into htdocs/conf/conf.php 3 | # 4 | # Examples to run the script: 5 | # ansible-playbook -K change_sellyoursaas_config.yml -i hosts-xxx -e 'target=targethost option= value=' 6 | # ansible-playbook -K change_sellyoursaas_config.yml -i hosts-xxx -e 'target=targethost option= value=' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Change value in conf 10 | hosts: '{{target}}' 11 | become: yes 12 | 13 | tasks: 14 | - name: Change conf value 15 | ini_file: 16 | path: /home/admin/wwwroot/dolibarr/htdocs/conf/conf.php 17 | section: null 18 | option: "${{option}}" 19 | value: "'{{value}}';" 20 | no_extra_spaces: yes 21 | backup: yes 22 | -------------------------------------------------------------------------------- /scripts/ansible/change_config_sellyoursaas.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to change an option=value of an entry into sellyoursaas.conf 3 | # 4 | # Examples to run the script: 5 | # ansible-playbook -K change_sellyoursaas_config.yml -i hosts-xxx -e 'nameofconf=sellyoursaas target=targethost option= value=' 6 | # ansible-playbook -K change_sellyoursaas_config.yml -i hosts-xxx -e 'nameofconf=sellyoursaas target=targethost option= value=' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Change value in conf 10 | hosts: '{{target}}' 11 | become: yes 12 | 13 | tasks: 14 | - name: Change conf value 15 | ini_file: 16 | path: /etc/{{nameofconf}}.conf 17 | section: null 18 | option: "{{option}}" 19 | value: "{{value}}" 20 | no_extra_spaces: yes 21 | backup: yes 22 | -------------------------------------------------------------------------------- /scripts/ansible/change_crontab_server.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to change an option=value of an entry into htdocs/conf/conf.php 3 | # 4 | # Examples to run the script: 5 | # ansible-playbook -K change_sellyoursaas_config.yml -i hosts-xxx -e 'target=targethost option= value=' 6 | # ansible-playbook -K change_sellyoursaas_config.yml -i hosts-xxx -e 'target=targethost option= value=' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Change value in crontab 10 | hosts: '{{target}}' 11 | become: yes 12 | become_method: sudo 13 | become_user: root 14 | 15 | tasks: 16 | - name: Find backup_backup.sh line and change it if found 17 | replace: 18 | path: /var/spool/cron/crontabs/{{username}} 19 | regexp: 'backup_backup.sh' 20 | replace: 'backup_backup.sh' 21 | 22 | - name: Find perms.ksh line and change it into perms.sh if found 23 | replace: 24 | path: /var/spool/cron/crontabs/{{username}} 25 | regexp: 'perms.ksh' 26 | replace: 'perms.sh' 27 | 28 | 29 | -------------------------------------------------------------------------------- /scripts/ansible/change_password.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to change password of a user on a set of servers 3 | # 4 | # Examples to run the script for servers into targethost section of hosts-xxx file: 5 | # ansible-playbook change_password.yml -i hosts-xxx -e 'target=targethost my_remote_user= user_to_update= password=' 6 | # ansible-playbook change_password.yml -i hosts-xxx -e 'target=targethost my_remote_user= user_to_update= password=' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Playbook to change password on servers for a user 10 | hosts: '{{target}}' 11 | become: yes 12 | remote_user: "{{ my_remote_user }}" 13 | 14 | tasks: 15 | - name: Change password 16 | user: 17 | user: "{{ user_to_update }}" 18 | password: "{{ password |password_hash('sha512', 'mysalt') }}" 19 | -------------------------------------------------------------------------------- /scripts/ansible/demo.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script of demo for sellyoursaas ansible use. 3 | # 4 | # To run the script: 5 | # ansible-playbook demo.yml 6 | # 7 | 8 | - name: Demo task 9 | connection: ansible.netcommon.network_cli 10 | gather_facts: false 11 | hosts: all 12 | tasks: 13 | 14 | - name: Display the config 15 | debug: 16 | msg: "The hostname is {{ ansible_net_hostname }} and the OS is {{ ansible_net_version }}" -------------------------------------------------------------------------------- /scripts/ansible/hosts.example: -------------------------------------------------------------------------------- 1 | # Ansible example for the host file. 2 | # Declare here all your servers 3 | 4 | [master] 5 | admin.mysellyoursaasdomain.com 6 | 7 | [web] 8 | adminweb.mysellyoursaasdomain.com 9 | 10 | [deployment] 11 | with1.mysellyoursaasdomain.com 12 | with2.mysellyoursaasdomain.com 13 | 14 | [remotebackup] 15 | remotebackup.mysellyoursaasdomain.com 16 | -------------------------------------------------------------------------------- /scripts/ansible/launch_apt_upgrade.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to run apt update and upgrade command on servers 3 | # 4 | # To run the script: 5 | # ansible-playbook -K launch_apt_upgrade.yml -i hosts-xxx -e 'target=targethost' 6 | # ansible-playbook -K launch_apt_upgrade.yml -i hosts-xxx -e 'target=targethost reboot=1' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Update and upgrade apt packages 10 | hosts: '{{target}}' 11 | become: yes 12 | become_method: sudo 13 | become_user: root 14 | tasks: 15 | - name: Switch instances in maintenance mode 16 | command: /home/admin/wwwroot/dolibarr_sellyoursaas/scripts/make_instances_offlineonline.sh maintenance.php offline 17 | register: command_output 18 | 19 | - debug: 20 | var: command_output.stdout_lines 21 | 22 | - name: Launch apt 23 | apt: 24 | upgrade: yes 25 | update_cache: yes 26 | cache_valid_time: 86400 27 | register: command_output 28 | 29 | - name: Reboot the server and wait for it to come back up. 30 | reboot: 31 | when: 32 | - reboot is defined 33 | 34 | - debug: 35 | var: command_output.stdout_lines 36 | 37 | - name: Restore the production mode 38 | command: /home/admin/wwwroot/dolibarr_sellyoursaas/scripts/make_instances_offlineonline.sh maintenance.php online 39 | register: command_output 40 | 41 | - debug: 42 | var: command_output.stdout_lines 43 | 44 | 45 | -------------------------------------------------------------------------------- /scripts/ansible/launch_clean.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to run clean.sh SellYourSaas command on servers 3 | # 4 | # To run the script: 5 | # ansible-playbook -K launch_clean.yml -i hosts-xxx -e 'target=targethost command=(test|confirm)' 6 | # ansible-playbook -K launch_clean.yml -i hosts-xxx -e 'target=targethost command=(test|confirm)' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Cleanup servers 10 | hosts: '{{target}}' 11 | become: yes 12 | become_method: sudo 13 | become_user: root 14 | tasks: 15 | - name: Launch clean.sh 16 | command: "/home/admin/wwwroot/dolibarr_sellyoursaas/scripts/clean.sh {{command}}" 17 | register: command_output 18 | 19 | - debug: 20 | var: command_output.stdout_lines -------------------------------------------------------------------------------- /scripts/ansible/launch_git_update_sellyoursaas.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to run git_update_sellyoursaas.sh to update SellYourSaas on servers 3 | # 4 | # To run the script: 5 | # ansible-playbook -K launch_git_update_sellyoursaas.yml -i hosts-xxx -e 'target=targethost' 6 | # ansible-playbook -K launch_git_update_sellyoursaas.yml -i hosts-xxx -e 'target=targethost' --limit=*.mydomain.com 7 | 8 | - name: Update SellYourSaas on servers 9 | hosts: '{{target}}' 10 | become: yes 11 | become_method: sudo 12 | become_user: admin 13 | tasks: 14 | - name: Launch git_update_sellyoursaas.sh 15 | command: /home/admin/wwwroot/dolibarr_sellyoursaas/scripts/git_update_sellyoursaas.sh /home/admin/wwwroot/ 16 | register: command_output 17 | 18 | - debug: 19 | var: command_output.stdout_lines 20 | 21 | - name: Add upgrade.unlock 22 | ansible.builtin.file: 23 | path: "/home/admin/wwwroot/dolibarr_documents/upgrade.unlock" 24 | state: touch 25 | owner: "admin" 26 | group: "www-data" 27 | mode: "0660" 28 | register: command_output 29 | when: 30 | - unlock is defined 31 | - "'master' in group_names" 32 | -------------------------------------------------------------------------------- /scripts/ansible/user_deactivate.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to deactivate a system user on the servers 3 | # 4 | # To run the script: 5 | # ansible-playbook -K deactivate_user.yml -i hosts-xxx -e 'target=targethost login=username' 6 | # ansible-playbook -K deactivate_user.yml -i hosts-xxx -e 'target=targethost login=username' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Create user on target system(s) 10 | hosts: '{{target}}' 11 | become: yes 12 | become_user: root 13 | tasks: 14 | - name: Deactivate system user 15 | command: "chage -E0 {{login}}" 16 | register: command_output 17 | 18 | - debug: 19 | var: command_output.stdout_lines 20 | -------------------------------------------------------------------------------- /scripts/ansible/user_reactivate.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to reactivate a user on the servers 3 | # 4 | # To run the script: 5 | # ansible-playbook -K reactivate_user.yml -i hosts-xxx -e 'target=targethost login=username' 6 | # ansible-playbook -K reactivate_user.yml -i hosts-xxx -e 'target=targethost login=username allowroot=1' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Create user on target system(s) 10 | hosts: '{{target}}' 11 | become: yes 12 | #become_method: sudo 13 | become_user: root 14 | tasks: 15 | - name: Reactivate system user 16 | command: "chage -E-1 {{login}}" 17 | register: command_output 18 | 19 | - debug: 20 | var: command_output.stdout_lines 21 | 22 | - name: Add user {{login}} to the sudo group 23 | user: 24 | name: "{{login}}" 25 | groups: sudo 26 | append: yes 27 | when: 28 | - allowroot is defined 29 | 30 | - name: Remove user {{login}} of the sudo group 31 | become: true 32 | command: "gpasswd -d {{login}} sudo" 33 | register: command_result 34 | changed_when: "not 'is not a member of' in command_result.stderr" 35 | failed_when: false 36 | when: 37 | - disallowroot is defined 38 | -------------------------------------------------------------------------------- /scripts/ansible/user_remove.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Script to delete a user from the servers 3 | # 4 | # To run the script: 5 | # ansible-playbook -K remove_user.yml -i hosts-xxx -e 'target=targethost login=username' 6 | # ansible-playbook -K remove_user.yml -i hosts-xxx -e 'target=targethost login=username' --limit=*.mydomain.com 7 | # 8 | 9 | - name: Create user on target system(s) 10 | hosts: '{{target}}' 11 | become: yes 12 | become_user: root 13 | tasks: 14 | - name: Remove system user 15 | user: 16 | name: '{{ login }}' 17 | state: absent 18 | 19 | - name: Remove user from SSH conf 20 | lineinfile: 21 | path: /etc/ssh/sshd_config.d/sellyoursaas.conf 22 | line: "AllowUsers {{ login }}" 23 | state: absent 24 | register: removelineinsshconf 25 | 26 | - name: Remove user from SSH conf 27 | lineinfile: 28 | path: /etc/ssh/sshd_config.d/sellyoursaas-users.conf 29 | line: "AllowUsers {{ login }}" 30 | state: absent 31 | register: removelineinsshconf2 32 | 33 | - name: Restart SSH service to flush that user from in-memory configuration 34 | service: 35 | name: ssh 36 | state: restarted 37 | when: removelineinsshconf.changed|removelineinsshconf2.changed 38 | 39 | - name: Remove IP file from sellyoursaas.d 40 | ansible.builtin.file: 41 | path: "/etc/sellyoursaas.d/{{ login }}-allowed-ip.conf" 42 | state: absent 43 | -------------------------------------------------------------------------------- /scripts/backup_backups.exclude: -------------------------------------------------------------------------------- 1 | *.qcow 2 | *.qcow2 3 | *.fsa 4 | *_log 5 | *.log 6 | *.log.old 7 | *.log.1 8 | *log.*.gz 9 | *log.*.gz.old 10 | *log.*.zstd 11 | *log.*.zstd.old 12 | installmodules.lock 13 | _sessions/* 14 | _log/* 15 | _tmp/* 16 | */logs/* 17 | */temp/* 18 | .bzr/ 19 | .cpan/ 20 | .debris/ 21 | .git/ 22 | .hg/ 23 | .local/ 24 | .svn/ 25 | .android/ 26 | .ansible/ 27 | .bash_history 28 | .cache 29 | .config/google-chrome 30 | .config/Rambox 31 | .cpanm 32 | .duc.db 33 | .dvdcss 34 | .gradle 35 | .gvfs 36 | .lftp 37 | .lesshst 38 | .metadata 39 | .mozilla 40 | .nv 41 | .oracle_jre_usage 42 | .rnd 43 | .rpmdb 44 | .sane 45 | .settings 46 | .shotwell 47 | .spamassassin 48 | .thumbnails 49 | .thunderbird 50 | .teamviewer 51 | .pearrc 52 | .webex 53 | .wine 54 | .xsession-errors 55 | filelist-*-sellyoursaas.* 56 | backupold_*/ 57 | /home/jail/ 58 | -------------------------------------------------------------------------------- /scripts/backup_instance.exclude: -------------------------------------------------------------------------------- 1 | *_log 2 | *.log 3 | *.log.old 4 | *log.*.gz 5 | *log.*.gz.old 6 | installmodules.lock 7 | _sessions/* 8 | _log/* 9 | _tmp/* 10 | */temp/* 11 | 12 | .buildpath 13 | .duc.db 14 | .git 15 | .gitignore 16 | .settings 17 | .project 18 | *.com*SSL 19 | *.pdf_preview*.png 20 | (PROV*) 21 | */thumbs/* 22 | 23 | */documents/admin/backup/* 24 | */documents/admin/documents/* 25 | */documents/*/admin/backup/* 26 | */documents/*/admin/documents/* 27 | */htdocs/install/filelist-*.xml* 28 | */htdocs/includes/tecnickcom/tcpdf/font/ae_fonts_* 29 | */htdocs/includes/tecnickcom/tcpdf/font/dejavu-fonts-ttf-* 30 | */htdocs/includes/tecnickcom/tcpdf/font/freefont-* 31 | 32 | */_cache/* 33 | */_cron/* 34 | */_dumps/* 35 | */_graph/* 36 | */_lock/* 37 | */_log/* 38 | */_rss/* 39 | */_sessions/* 40 | */_uploads/* 41 | */_tmp/* 42 | */_plugins/fusioninventory/xml/* 43 | 44 | */_source/* 45 | */__MACOSX/* 46 | -------------------------------------------------------------------------------- /scripts/desktop_apt_upgrade.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------------- 3 | # This script allows to launch an apt update / upgrade on remote servers 4 | #---------------------------------------------------------------- 5 | 6 | 7 | #set -e 8 | 9 | source /etc/lsb-release 10 | 11 | export RED='\033[0;31m' 12 | export GREEN='\033[0;32m' 13 | export BLUE='\033[0;34m' 14 | export YELLOW='\033[0;33m' 15 | 16 | 17 | if [ "x$2" == "x" ]; then 18 | echo "***** Launch the command apt update/upgrade on remote servers *****"; 19 | echo "Execute an apt update and upgrade on remote servers. On deployment server, this switches all instances in maintenancemode."; 20 | echo "Usage: $0 hostfile [hostgrouporname] (reboot)" 21 | echo " [hostgrouporname] can be 'master', 'deployment', 'web', 'remotebackup', or list separated with comma like 'master,deployment' (default)" 22 | echo "Example: $0 myhostfile master,deployment" 23 | echo "Example: $0 myhostfile withX.mysellyoursaasdomain.com reboot" 24 | exit 1 25 | fi 26 | 27 | target=$2 28 | if [ "x$target" == "x" ]; then 29 | target="master" 30 | fi 31 | 32 | reboot=$3 33 | 34 | export currentpath=$(dirname "$0") 35 | 36 | cd $currentpath/ansible 37 | 38 | echo "Execute ansible for host group $1 and targets $target" 39 | pwd 40 | 41 | echo 42 | echo "This script will switch all instances in maintenance mode and restore them after !" 43 | echo "Press any key to start (or CTRL+C to cancel)..." 44 | read -r answer 45 | 46 | #command="ansible-playbook -K launch_apt_upgrade.yml -i hosts-$1 -e 'target="$target"' --limit=*.mydomain.com" 47 | 48 | if [ "x$reboot" == "x" ]; then 49 | command='ansible-playbook -K launch_apt_upgrade.yml -i hosts-'$1' -e "target='$target'"' 50 | else 51 | command='ansible-playbook -K launch_apt_upgrade.yml -i hosts-'$1' -e "target='$target' reboot='1'"' 52 | fi 53 | echo "$command" 54 | eval $command 55 | 56 | 57 | echo "Finished." 58 | echo "Warning: Check that the web server process is still alive..." 59 | echo 60 | 61 | -------------------------------------------------------------------------------- /scripts/desktop_bannedip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------------- 3 | # This script allows to edit crontab on remote servers using the change_crontab_server.yml playbook. 4 | #---------------------------------------------------------------- 5 | 6 | 7 | #set -e 8 | 9 | source /etc/lsb-release 10 | 11 | export RED='\033[0;31m' 12 | export GREEN='\033[0;32m' 13 | export BLUE='\033[0;34m' 14 | export YELLOW='\033[0;33m' 15 | 16 | 17 | if [ "x$3" == "x" ]; then 18 | echo "***** Get/Edit banned IP on a remote servers *****" 19 | echo "Usage: $0 hostfile [hostgrouporname] list|unban|ban IP [jail]]" 20 | echo " [hostgrouporname] can be 'master', 'deployment', 'web', 'remotebackup', or list separated with comma like 'master,deployment' (default)" 21 | echo "Example: $0 myhostfile master,deployment" 22 | echo "Example: $0 myhostfile withX.mysellyoursaasdomain.com" 23 | exit 1 24 | fi 25 | 26 | target=$2 27 | if [ "x$target" == "x" ]; then 28 | target="master" 29 | fi 30 | 31 | action=$3 32 | 33 | ip=$4 34 | 35 | jail=$5 36 | 37 | export currentpath=$(dirname "$0") 38 | 39 | cd $currentpath/ansible 40 | 41 | echo "Execute ansible for host group $1 and targets $target" 42 | pwd 43 | 44 | if [ "x$action" == "xlist" ]; then 45 | command='ansible-playbook -K bannedip_list.yml -i hosts-'$1' -e "target='$target'"' 46 | fi 47 | if [ "x$action" == "xunban" ]; then 48 | command='ansible-playbook -K bannedip_unban.yml -i hosts-'$1' -e "target='$target' ip='$ip'"' 49 | fi 50 | if [ "x$action" == "xban" ]; then 51 | command='ansible-playbook -K bannedip_ban.yml -i hosts-'$1' -e "target='$target' ip='$ip' jail='$jail'"' 52 | fi 53 | 54 | echo "$command" 55 | eval $command 56 | 57 | echo "Finished." 58 | 59 | 60 | -------------------------------------------------------------------------------- /scripts/desktop_clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #--------------------------------------------------------- 3 | # Script to run remotely the script clean.sh 4 | # 5 | # /pathto/desktop_clean.sh hostfile [hostgrouporname] 6 | #--------------------------------------------------------- 7 | 8 | #set -e 9 | 10 | source /etc/lsb-release 11 | 12 | export RED='\033[0;31m' 13 | export GREEN='\033[0;32m' 14 | export BLUE='\033[0;34m' 15 | export YELLOW='\033[0;33m' 16 | 17 | 18 | if [ "x$2" == "x" ]; then 19 | echo "***** Launch the script clean.sh on remote servers *****" 20 | echo "Usage: $0 hostfile [hostgrouporname] [confirm|test]" 21 | echo " [hostgrouporname] can be 'master', 'deployment', 'web', 'remotebackup', or list separated with comma like 'master,deployment'" 22 | echo "Example: $0 myhostfile deployment" 23 | echo "Example: $0 myhostfile withX.mysellyoursaasdomain.com test" 24 | exit 1 25 | fi 26 | 27 | target=$2 28 | if [ "x$target" == "x" ]; then 29 | target="master,deployment" 30 | fi 31 | 32 | test=$3 33 | 34 | export currentpath=$(dirname "$0") 35 | 36 | cd $currentpath/ansible 37 | 38 | echo "Execute ansible for host group $1 and targets $target" 39 | pwd 40 | 41 | 42 | #command="ansible-playbook -K launch_clean.yml -i hosts-$1 -e 'target="$target"' --limit=*.mydomain.com" 43 | if [ "x$test" == "x" ]; then 44 | command='ansible-playbook -K launch_clean.yml -i hosts-'$1' -e "target='$target' command='confirm'"' 45 | else 46 | command='ansible-playbook -K launch_clean.yml -i hosts-'$1' -e "target='$target' command='$test'"' 47 | fi 48 | echo "$command" 49 | eval $command 50 | 51 | echo "Finished." 52 | -------------------------------------------------------------------------------- /scripts/desktop_config_dolibarr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------------- 3 | # This script allows to update or fix the Dolibarr config file saved as: 4 | # /home/admin/wwwroot/dolibarr/htdocs/conf/conf.php 5 | # 6 | # It does not support config files of deployed instances. 7 | #---------------------------------------------------------------- 8 | 9 | 10 | #set -e 11 | 12 | source /etc/lsb-release 13 | 14 | export RED='\033[0;31m' 15 | export GREEN='\033[0;32m' 16 | export BLUE='\033[0;34m' 17 | export YELLOW='\033[0;33m' 18 | 19 | 20 | if [ "x$3" == "x" ]; then 21 | echo "***** desktop_config_dolibarr.sh *****" 22 | echo "This script allows to update or fix the Dolibarr config file /home/admin/wwwroot/dolibarr/htdocs/conf/conf.php" 23 | echo 24 | echo "Usage: $0 hostfile param value [hostgrouporname]" 25 | echo " [hostgrouporname] can be 'master', 'deployment', 'web', 'remotebackup', or list separated with comma like 'master,deployment'" 26 | echo 27 | echo "Example: $0 myhostfile dolibarr_main_data_root '/home/admin/wwwroot/dolibarr_documents' deployment" 28 | echo "Example: $0 myhostfile dolibarr_main_data_root '/home/admin/wwwroot/dolibarr_documents' withX.mysellyoursaasdomain.com" 29 | echo 30 | exit 1 31 | fi 32 | 33 | param=$2 34 | value=$3 35 | target=$4 36 | 37 | if [ "x$target" == "x" ]; then 38 | target="deployment" 39 | fi 40 | 41 | 42 | export currentpath=$(dirname "$0") 43 | 44 | cd $currentpath/ansible 45 | 46 | echo "Execute ansible for host group $1 and targets $target" 47 | pwd 48 | 49 | 50 | #command="ansible-playbook -K change_config_dolibarr.yml -i hosts-$1 -e 'target=\"$target\" option=\"$param\" value=\"$value\"' --limit=*.mydomain.com" 51 | command="ansible-playbook -K change_config_dolibarr.yml -i hosts-$1 -e 'target=\"$target\" option=\"$param\" value=\"$value\"'" 52 | 53 | echo "$command" 54 | eval $command 55 | 56 | echo "Finished." 57 | 58 | 59 | -------------------------------------------------------------------------------- /scripts/desktop_config_sellyoursaas.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------------- 3 | # This script allows to update or fix the SellYourSaas config files saved as: 4 | # /etc/sellyoursaas.conf OR the /etc/sellyoursaas-public.conf 5 | #---------------------------------------------------------------- 6 | 7 | 8 | #set -e 9 | 10 | source /etc/lsb-release 11 | 12 | export RED='\033[0;31m' 13 | export GREEN='\033[0;32m' 14 | export BLUE='\033[0;34m' 15 | export YELLOW='\033[0;33m' 16 | 17 | 18 | if [ "x$3" == "x" -o "x$4" == "x" ]; then 19 | echo "***** desktop_config_sellyoursaas.sh *****" 20 | echo "This script allows to update or fix the SellYourSaas config file /etc/sellyoursaas[-public].conf" 21 | echo 22 | echo "Usage: $0 hostsfile hostgrouporname param value [sellyoursaas|sellyoursaas-public]" 23 | echo " [hostgrouporname] can be 'master', 'deployment', 'web', 'remotebackup', or list separated with comma like 'master,deployment' (default)" 24 | echo " [sellyoursaasfile] can be 'sellyoursaas' (default) or 'sellyoursaas-public'" 25 | echo 26 | echo "Example: $0 myhostsfile master,deployment usecompressformatforarchive zstd" 27 | echo "Example: $0 myhostsfile master,deployment remotebackupserverport 22" 28 | echo "Example: $0 myhostsfile withX.mysellyoursaasdomain.com maxemailperday 500 sellyoursaas-public" 29 | echo 30 | exit 1 31 | fi 32 | 33 | target=$2 34 | param=$3 35 | value=$4 36 | nameofconf=$5 37 | 38 | if [ "x$nameofconf" == "x" ]; then 39 | nameofconf="sellyoursaas" 40 | fi 41 | 42 | 43 | export currentpath=$(dirname "$0") 44 | 45 | cd $currentpath/ansible 46 | 47 | echo "Execute ansible for host group $1 and targets $target" 48 | pwd 49 | 50 | 51 | #command="ansible-playbook -K change_config_sellyoursaas.yml -i hosts-$1 -e 'nameofconf=\"$nameofconf\" target=\"$target\" option=\"$param\" value=\"$value\"' --limit=*.mydomain.com" 52 | command="ansible-playbook -K change_config_sellyoursaas.yml -i hosts-$1 -e 'nameofconf=\"$nameofconf\" target=\"$target\" option=\"$param\" value=\"$value\"'" 53 | 54 | echo "$command" 55 | eval $command 56 | 57 | echo "Finished." 58 | 59 | 60 | -------------------------------------------------------------------------------- /scripts/desktop_crontab_server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------------- 3 | # This script allows to edit crontab on remote servers using the change_crontab_server.yml playbook. 4 | #---------------------------------------------------------------- 5 | 6 | 7 | #set -e 8 | 9 | source /etc/lsb-release 10 | 11 | export RED='\033[0;31m' 12 | export GREEN='\033[0;32m' 13 | export BLUE='\033[0;34m' 14 | export YELLOW='\033[0;33m' 15 | 16 | 17 | if [ "x$3" == "x" ]; then 18 | echo "***** Edit the crontab of remote servers*****" 19 | echo "Usage: $0 hostfile hostgrouporname (root|osusername)" 20 | echo " [hostgrouporname] can be 'master', 'deployment', 'web', 'remotebackup', or list separated with comma like 'master,deployment'" 21 | echo "Example: $0 myhostfile master root" 22 | echo "Example: $0 myhostfile withX.mysellyoursaasdomain.com osu123" 23 | exit 1 24 | fi 25 | 26 | target=$2 27 | if [ "x$target" == "x" ]; then 28 | target="master" 29 | fi 30 | 31 | username=$3 32 | if [ "x$username" == "x" ]; then 33 | username="root" 34 | fi 35 | 36 | export currentpath=$(dirname "$0") 37 | 38 | cd $currentpath/ansible 39 | 40 | echo "Execute ansible for host group $1 and targets $target" 41 | pwd 42 | 43 | 44 | command='ansible-playbook -K change_crontab_server.yml -i hosts-'$1' -e "target='$target' username='$username'"' 45 | 46 | echo "$command" 47 | eval $command 48 | 49 | echo "Finished." 50 | 51 | 52 | -------------------------------------------------------------------------------- /scripts/desktop_fix_unzip.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * or see http://www.gnu.org/ 18 | * 19 | * Update an instance on stratus5 server with new ref version. 20 | */ 21 | 22 | /** 23 | * \file sellyoursaas/scripts/desktop_fix_unzip.php 24 | * \ingroup sellyoursaas 25 | * \brief Script to fix the directory structure of badly unzipped zips. 26 | */ 27 | 28 | 29 | /** 30 | * 31 | * @param string $dirName Name of dir 32 | * @return string[] 33 | */ 34 | function dirIterator($dirName) 35 | { 36 | $dirlist = array(); 37 | $whatsInsideDir = scandir($dirName); 38 | foreach ($whatsInsideDir as $fileOrDir) { 39 | if ($fileOrDir == '.' || $fileOrDir == '..') { 40 | continue; 41 | } 42 | $dirlist[] = $dirName.'/'.$fileOrDir; 43 | if (is_dir($fileOrDir)) { 44 | $dirlist = array_merge($dirlist, dirIterator($dirName.'/'.$fileOrDir)); 45 | } 46 | } 47 | return $dirlist; 48 | } 49 | 50 | 51 | /* 52 | * Main 53 | */ 54 | 55 | $listofdirs = dirIterator('.'); 56 | 57 | 58 | foreach ($listofdirs as $file) { 59 | $filebis = str_replace('\\', '/', $file); 60 | print "Process path $file => dir ".dirname($filebis)."\n"; 61 | if (!preg_match('/\\\\/', $file) && !preg_match('/\//', $file)) { 62 | continue; 63 | } 64 | 65 | $tmparray = preg_split('/[\/\\\\]/', dirname($filebis)); 66 | if (isset($tmparray[1])) { 67 | $s = ""; 68 | foreach ($tmparray as $aaa) { 69 | if ($aaa == '.' || $aaa == '..') { 70 | continue; 71 | } 72 | $s = ($s ? $s."/" : "").$aaa; 73 | print "Create dir $s\n"; 74 | @mkdir($s); 75 | } 76 | print "Dir $s has been created."; 77 | if (is_file($file)) { 78 | print " Now rename $file into ".$s.'/'.basename($filebis)."\n"; 79 | rename($file, $s.'/'.basename($filebis)); 80 | } else { 81 | print "\n"; 82 | } 83 | } 84 | } 85 | 86 | // Delete dirs if empty 87 | foreach ($listofdirs as $file) { 88 | if (is_dir($file)) { 89 | print "Clean ".$file." ?\n"; 90 | if (count(scandir($file)) == 2) { 91 | print "Dir ".$file." is empty. We delete it\n"; 92 | rmdir($file); 93 | } 94 | } 95 | } 96 | 97 | print "Complete.\n"; 98 | -------------------------------------------------------------------------------- /scripts/desktop_switchipv6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #---------------------------------------------------------------- 3 | # This script allows you to enable/disable IP v6 on your desktop 4 | #---------------------------------------------------------------- 5 | 6 | #set -e 7 | 8 | source /etc/lsb-release 9 | 10 | export RED='\033[0;31m' 11 | export GREEN='\033[0;32m' 12 | export BLUE='\033[0;34m' 13 | export YELLOW='\033[0;33m' 14 | 15 | 16 | if [ "x$1" = "xdisable" ] ; 17 | then 18 | echo Disable IPV6 19 | sysctl -w net.ipv6.conf.all.disable_ipv6=1 20 | sysctl -w net.ipv6.conf.all.autoconf=0 21 | sysctl -w net.ipv6.conf.default.disable_ipv6=1 22 | sysctl -w net.ipv6.conf.default.autoconf=0 23 | ifconfig 24 | more /proc/net/if_inet6 25 | fi 26 | 27 | if [ "x$1" = "xenable" ] ; 28 | then 29 | echo Enable IPV6 30 | sysctl -w net.ipv6.conf.default.autoconf=1 31 | sysctl -w net.ipv6.conf.default.disable_ipv6=0 32 | sysctl -w net.ipv6.conf.all.autoconf=1 33 | sysctl -w net.ipv6.conf.all.disable_ipv6=0 34 | ifconfig 35 | more /proc/net/if_inet6 36 | fi 37 | 38 | echo You can try perf with 39 | echo Orange FRANCE: ./speedtest -s 24215 -vvv 40 | echo Lafibre.info: ./speedtest -s 21415 -vvv 41 | 42 | -------------------------------------------------------------------------------- /scripts/desktop_update_sellyoursaas.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #--------------------------------------------------------- 3 | # Script to run remotely the git_update_sellyour_saas.sh 4 | # 5 | # /pathto/desktop_update_sellyoursaas_remote.sh hostfile [hostgrouporname] 6 | #--------------------------------------------------------- 7 | 8 | source /etc/lsb-release 9 | 10 | export RED='\033[0;31m' 11 | export GREEN='\033[0;32m' 12 | export BLUE='\033[0;34m' 13 | export YELLOW='\033[0;33m' 14 | 15 | 16 | if [ "x$1" == "x" ]; then 17 | echo "Usage: $0 hostfile [hostgrouporname] [unlock]" 18 | echo " [hostgrouporname] can be 'master', 'deployment', 'web', 'remotebackup', or list separated with comma like 'master,deployment' (default)" 19 | echo "Example: $0 myhostfile master,deployment" 20 | echo "Example: $0 myhostfile withX.mysellyoursaasdomain.com [unlock]" 21 | exit 1 22 | fi 23 | 24 | target=$2 25 | if [ "x$target" == "x" ]; then 26 | target="master,deployment" 27 | fi 28 | 29 | unlock=$3 30 | 31 | export currentpath=$(dirname "$0") 32 | 33 | cd $currentpath/ansible 34 | 35 | echo "Execute ansible for host group=$1 and targets=$target, unlock=$unlock" 36 | pwd 37 | 38 | #command="ansible-playbook -K launch_git_update_sellyoursaas.yml -i hosts-$1 -e 'target="$target"' --limit=*.mydomain.com" 39 | if [ "x$unlock" == "x" ]; then 40 | command='ansible-playbook -K launch_git_update_sellyoursaas.yml -i hosts-'$1' -e "target='$target'"' 41 | else 42 | command='ansible-playbook -K launch_git_update_sellyoursaas.yml -i hosts-'$1' -e "target='$target' unlock='$unlock'"' 43 | fi 44 | echo "$command" 45 | eval $command 46 | 47 | echo "Finished." 48 | -------------------------------------------------------------------------------- /scripts/git_update_sellyoursaas.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #--------------------------------------------------------- 3 | # Script to update programs for Dolibarr and sell-your-saas 4 | # 5 | # To include into cron 6 | # /pathto/git_update_sellyoursaas.sh /home/admin/wwwroot > /pathto/git_update_sellyoursaas.log 2>& 7 | #--------------------------------------------------------- 8 | 9 | source /etc/lsb-release 10 | 11 | export RED='\033[0;31m' 12 | export GREEN='\033[0;32m' 13 | export BLUE='\033[0;34m' 14 | export YELLOW='\033[0;33m' 15 | 16 | 17 | if [ "x$1" == "x" ]; then 18 | echo "Usage: $0 dir_of_git_repositories_of_app" 19 | echo "Example: $0 /home/admin/wwwroot" 20 | exit 1 21 | fi 22 | 23 | if [ "$(id -u)" == "0" ]; then 24 | echo "This script must be run as admin, not as root" 1>&2 25 | exit 1 26 | fi 27 | 28 | error=0 29 | 30 | 31 | # Get domain of the GIT server with sources 32 | export gitserver=`grep '^gitserver=' /etc/sellyoursaas.conf | cut -d '=' -f 2` 33 | if [[ "x$gitserver" == "x" ]]; then 34 | export gitserver="github.com" 35 | fi 36 | gitserver=${gitserver//[^a-zA-Z0-9.]/} 37 | 38 | # Install fingerprint of github.com but only if it was never installed 39 | # If it is already present, we keep it so we will be protected if domain name is routed on another evil server 40 | # TODO Allow to choose the git domain name server in /etc/sellyousaas.conf 41 | echo "Install the known fingerprint of github if it was never installed" 42 | ssh-keygen -F "$gitserver" || ssh-keyscan "$gitserver" >>~/.ssh/known_hosts 43 | 44 | 45 | echo "Update git dirs found into $1." 46 | 47 | for dir in `ls -d $1/dolibarr* | grep -v documents` 48 | do 49 | # If a subdir is given, discard if not subdir 50 | #if [ "x$2" != "x" ]; then 51 | # if [ "x$1/$2" != "x$dir" ]; then 52 | # continue; 53 | # fi 54 | #fi 55 | 56 | echo -- Process dir $dir 57 | cd $dir 58 | if [ $? -eq 0 ]; then 59 | export gitdir=`basename $dir` 60 | 61 | if [ -d ".git" ]; then 62 | echo chmod -R u+w $dir 63 | chmod -R u+w $dir 64 | git pull 65 | if [ $? -ne 0 ]; then 66 | # If git pull fail, we force a git reset before and try again. 67 | echo Execute a git reset --hard HEAD 68 | git reset --hard HEAD 69 | # Do not use git pull --depth=1 here, this will make merge errors. 70 | git pull 71 | if [ $? -ne 0 ]; then 72 | export error=1 73 | fi 74 | fi 75 | echo Result of git pull = $? 76 | 77 | git rev-parse HEAD > gitcommit.txt 78 | else 79 | echo "Not a git dir. Nothing done." 80 | fi 81 | 82 | cd - 83 | fi 84 | done 85 | 86 | echo "Finished (exit=$error)." 87 | exit $error 88 | 89 | -------------------------------------------------------------------------------- /scripts/git_update_sources.exclude: -------------------------------------------------------------------------------- 1 | .codeclimate.yml 2 | .editorconfig 3 | .github 4 | .gitmessage 5 | .mailmap 6 | .scrutinizer.yml 7 | .stickler.yml 8 | .travis.yml 9 | .tx 10 | phpstan.neon 11 | conf.php 12 | -------------------------------------------------------------------------------- /scripts/old/renamesymblinks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Chemin du fichier cible 4 | target_file1="/etc/letsencrypt/live/with.novafirstcloud.com/cert.pem" 5 | target_file2="/etc/letsencrypt/live/with.novafirstcloud.com/chain.pem" 6 | target_file3="/etc/letsencrypt/live/with.novafirstcloud.com/privkey.pem" 7 | 8 | # Vérifier si le fichier cible existe 9 | if [ ! -f "$target_file1" ]; then 10 | echo "Le fichier cible $target_file1 n'existe pas." 11 | exit 1 12 | fi 13 | if [ ! -f "$target_file2" ]; then 14 | echo "Le fichier cible $target_file2 n'existe pas." 15 | exit 1 16 | fi 17 | if [ ! -f "$target_file3" ]; then 18 | echo "Le fichier cible $target_file3 n'existe pas." 19 | exit 1 20 | fi 21 | 22 | # Parcourir tous les liens symboliques se terminant par ".with.novafirstcloud.com.crt" 23 | find /etc/apache2 -type l -name "*.with.novafirstcloud.com.crt" 2>/dev/null | while read -r symlink; do 24 | # Supprimer le lien symbolique existant 25 | echo "Efface ancien lien $symlink" 26 | rm "$symlink" 27 | 28 | # Créer un nouveau lien symbolique pointant vers le fichier cible 29 | echo "Lien symbolique recréé par: ln -s $target_file1 $symlink" 30 | ln -s "$target_file1" "$symlink" 31 | done 32 | 33 | # Parcourir tous les liens symboliques se terminant par ".with.novafirstcloud.com.crt" 34 | find /etc/apache2 -type l -name "*.with.novafirstcloud.com-intermediate.crt" 2>/dev/null | while read -r symlink; do 35 | # Supprimer le lien symbolique existant 36 | echo "Efface ancien lien $symlink" 37 | rm "$symlink" 38 | 39 | # Créer un nouveau lien symbolique pointant vers le fichier cible 40 | echo "Lien symbolique recréé par: ln -s $target_file2 $symlink" 41 | ln -s "$target_file2" "$symlink" 42 | done 43 | 44 | # Parcourir tous les liens symboliques se terminant par ".with.novafirstcloud.com.crt" 45 | find /etc/apache2 -type l -name "*.with.novafirstcloud.com.key" 2>/dev/null | while read -r symlink; do 46 | # Supprimer le lien symbolique existant 47 | echo "Efface ancien lien $symlink" 48 | rm "$symlink" 49 | 50 | # Créer un nouveau lien symbolique pointant vers le fichier cible 51 | echo "Lien symbolique recréé par: ln -s $target_file3 $symlink" 52 | ln -s "$target_file3" "$symlink" 53 | done 54 | -------------------------------------------------------------------------------- /scripts/phpsendmailprepend.php: -------------------------------------------------------------------------------- 1 | &2 17 | exit 100 18 | fi 19 | 20 | # Disable cron 21 | echo "Stop cron begin" 22 | echo "Stop cron begin" >>/var/log/post_inst_script.log 23 | 24 | /etc/init.d/cron stop 2>&1 >>/var/log/post_inst_script.log 25 | echo result = $? >>/var/log/post_inst_script.log 26 | 27 | systemctl stop cron 2>&1 >>/var/log/post_inst_script.log 28 | systemctl disable cron 2>&1 >>/var/log/post_inst_script.log 29 | 30 | echo "Stop cron end" 31 | echo "Stop cron end" >>/var/log/post_inst_script.log 32 | 33 | # Disablepostfix 34 | echo "Stop postfix begin" 35 | echo "Stop postfix begin" >>/var/log/post_inst_script.log 36 | 37 | /etc/init.d/postfix stop >>/var/log/post_inst_script.log 38 | echo result = $? >>/var/log/post_inst_script.log 39 | 40 | echo "Stop postfix end" 41 | echo "Stop postfix end" >>/var/log/post_inst_script.log 42 | 43 | # Disable ufw 44 | echo "Stop ufw begin" 45 | echo "Stop ufw begin" >>/var/log/post_inst_script.log 46 | 47 | #/etc/init.d/ufw stop >>/var/log/post_inst_script.log 48 | ufw disable >>/var/log/post_inst_script.log 49 | echo result = $? >>/var/log/post_inst_script.log 50 | 51 | echo "Stop ufw end" 52 | echo "Stop ufw end" >>/var/log/post_inst_script.log 53 | 54 | # Disable datadog 55 | if [ -f /etc/init.d/datadog-agent ]; then 56 | sleep 1 57 | 58 | rm -f /etc/datadog-agent/datadog.yaml.disabled 59 | if [ -f /etc/datadog-agent/datadog.yaml ]; then 60 | mv /etc/datadog-agent/datadog.yaml /etc/datadog-agent/datadog.yaml.disabled 61 | fi 62 | echo "Stop datadog begin" 63 | echo "Stop datadog begin" >>/var/log/post_inst_script.log 64 | 65 | /etc/init.d/datadog-agent stop >>/var/log/post_inst_script.log 66 | echo result = $? >>/tmp/post_inst_script.log 67 | 68 | systemctl stop datadog-agent 2>&1 >>/var/log/post_inst_script.log 69 | systemctl disable datadog-agent 2>&1 >>/var/log/post_inst_script.log 70 | 71 | echo "Stop datadog end" 72 | echo "Stop datadog end" >>/var/log/post_inst_script.log 73 | fi 74 | 75 | 76 | exit 0 77 | -------------------------------------------------------------------------------- /scripts/templates/osuxxx.conf: -------------------------------------------------------------------------------- 1 | ;---------------------------------------------------- 2 | ; php-fpm config file for a pool for osuxxx instances 3 | ; 4 | ; All apache virtual hosts of user osuxxx will use this same pool 5 | ;---------------------------------------------------- 6 | 7 | [osuxxx] 8 | 9 | user = $pool 10 | group = $pool 11 | 12 | listen = /run/php/php7.4-fpm-$pool.sock 13 | listen.owner = $pool 14 | listen.group = $pool 15 | 16 | pm = dynamic 17 | 18 | pm.status_path = /status 19 | 20 | slowlog = log/$pool.log.slow 21 | 22 | php_admin_value[auto_prepend_file] = /usr/local/bin/phpsendmailprepend.php 23 | php_admin_value[sendmail_path] = /usr/local/bin/phpsendmail.php 24 | php_admin_value[mail.log] = /var/log/phpmail.log 25 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 26 | ;php_flag[display_errors] = off 27 | php_admin_value[error_log] = /var/log/php-fpm-error.$pool.log 28 | php_admin_flag[log_errors] = on 29 | ;php_admin_value[memory_limit] = 32M 30 | 31 | php_admin_value[open_basedir] = /tmp/:/home/jail/home/$pool 32 | 33 | ; a commenter si pb pour lancer php-fpm tourne en boucle 34 | apparmor_hat = sellyoursaas-instances 35 | -------------------------------------------------------------------------------- /scripts/templates/phppool-phpfpm.template: -------------------------------------------------------------------------------- 1 | ;---------------------------------------------------- 2 | ; php-fpm config file for a pool for sellyoursaas instances 3 | ; 4 | ; All apache virtual hosts of user osuxxx will use this same pool 5 | ;---------------------------------------------------- 6 | 7 | [__fqn__] 8 | 9 | user = __osUsername__ 10 | group = __osGroupname__ 11 | 12 | listen = /run/php/php__phpversion__-fpm-__fqn__.sock 13 | listen.owner = __osUsername__ 14 | listen.group = __osGroupname__ 15 | request_terminate_timeout = 0 16 | 17 | pm = dynamic 18 | pm.max_children = 50 19 | pm.start_servers = 5 20 | pm.min_spare_servers = 5 21 | pm.max_spare_servers = 35 22 | 23 | env[PATH] = /usr/local/bin:/usr/bin:/bin 24 | env[TMP] = /tmp 25 | env[TMPDIR] = /tmp 26 | env[TEMP] = /tmp 27 | 28 | php_admin_value[open_basedir] = __webAppPath__:/home/admin/wwwroot/dolibarr_sellyoursaas/scripts/:/tmp/:/usr/local/bin/ 29 | -------------------------------------------------------------------------------- /scripts/templates/poolservice-phpfpm.template: -------------------------------------------------------------------------------- 1 | ;---------------------------------------------------- 2 | ; php-fpm file for a pool service for sellyoursaas instances 3 | ; 4 | ;---------------------------------------------------- 5 | 6 | [Unit] 7 | Description=PHP-FPM for __fqn__ 8 | After=network.target 9 | 10 | [Service] 11 | Type=simple 12 | PIDFile=/run/php/php__phpversion__-fpm-__fqn__.pid 13 | Restart=always 14 | RestartSec=10 15 | ExecStart=/usr/sbin/php-fpm__phpversion__ --nodaemonize --fpm-config /etc/php/__phpversion__/fpm/pool.d/sellyoursaas/__fqn__.phpfpm.conf --allow-to-run-as-root 16 | ExecReload=/bin/kill -USR2 $MAINPID 17 | ExecStop=/bin/kill -QUIT $MAINPID 18 | 19 | [Install] 20 | WantedBy=multi-user.target 21 | -------------------------------------------------------------------------------- /scripts/templates/vhostHttps-phpfpm-sellyoursaas-suspended.template: -------------------------------------------------------------------------------- 1 | 2 | __VirtualHostHead__ 3 | 4 | # Allow access to /tmp and sellyoursaas scripts for mails. Allow also access to user dir. 5 | 6 | ServerName __webAppDomain__ 7 | ServerAdmin __webAdminEmail__ 8 | ServerAlias __webAppAliases__ 9 | DocumentRoot __webAppPath__/htdocs 10 | 11 | AddDefaultCharset UTF-8 12 | 13 | # Need mpm-itk module 14 | 15 | AssignUserID __osUsername__ __osGroupname__ 16 | 17 | 18 | 19 | Require all granted 20 | __AllowOverride__ 21 | Options -Indexes +FollowSymLinks 22 | 23 | 24 | # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. 25 | LogLevel info 26 | 27 | ErrorLog /var/log/apache2/apache_sellyoursaas_suspended_error.log 28 | #TransferLog /var/log/apache2/__webAppLogName___access_log 29 | 30 | # Compress returned resources of type php pages, text file export, css and javascript 31 | AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript 32 | 33 | # Netscape 4.x has some problems... 34 | BrowserMatch ^Mozilla/4 gzip-only-text/html 35 | 36 | # Netscape 4.06-4.08 have some more problems 37 | BrowserMatch ^Mozilla/4\.0[678] no-gzip 38 | 39 | # MSIE masquerades as Netscape, but it is fine 40 | BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 41 | 42 | # Make sure proxies don't deliver the wrong content 43 | #Header append Vary User-Agent env=!dont-vary 44 | 45 | DeflateFilterNote Input instream 46 | DeflateFilterNote Output outstream 47 | DeflateFilterNote Ratio ratio 48 | 49 | #LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate 50 | #CustomLog deflate_log deflate 51 | 52 | # SSL Engine Switch: 53 | # Enable/Disable SSL for this virtual host. 54 | SSLEngine on 55 | 56 | 57 | RewriteEngine on 58 | # This will enable the Rewrite capabilities 59 | 60 | RewriteRule ^(.*)$ __webMyAccount__/suspended.php?instance=%{SERVER_NAME} [L,R] 61 | # This redirect to the suspended page 62 | 63 | 64 | SSLOptions +StdEnvVars 65 | 66 | 67 | BrowserMatch ".*MSIE.*" \ 68 | nokeepalive ssl-unclean-shutdown \ 69 | downgrade-1.0 force-response-1.0 70 | 71 | SSLCertificateFile __webSSLCertificateCRT__ 72 | SSLCertificateKeyFile __webSSLCertificateKEY__ 73 | SSLCertificateChainFile __webSSLCertificateIntermediate__ 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /scripts/templates/vhostHttps-sellyoursaas-offline.template: -------------------------------------------------------------------------------- 1 | 2 | __VirtualHostHead__ 3 | 4 | ServerName __webAppDomain__ 5 | DocumentRoot /var/www/html 6 | 7 | AddDefaultCharset UTF-8 8 | 9 | 10 | Require all granted 11 | __AllowOverride__ 12 | Options -Indexes +FollowSymLinks 13 | 14 | 15 | # Possible values include: debug, info, notice, warn, error, crit, alert, emerg. 16 | LogLevel info 17 | 18 | ErrorLog /var/log/apache2/apache_sellyoursaas_offline_error.log 19 | #TransferLog /var/log/apache2/apache_sellyoursaas_offline_access_log 20 | 21 | # Compress returned resources of type php pages, text file export, css and javascript 22 | AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript 23 | 24 | # Netscape 4.x has some problems... 25 | BrowserMatch ^Mozilla/4 gzip-only-text/html 26 | 27 | # Netscape 4.06-4.08 have some more problems 28 | BrowserMatch ^Mozilla/4\.0[678] no-gzip 29 | 30 | # MSIE masquerades as Netscape, but it is fine 31 | BrowserMatch \bMSIE !no-gzip !gzip-only-text/html 32 | 33 | # Make sure proxies don't deliver the wrong content 34 | #Header append Vary User-Agent env=!dont-vary 35 | 36 | DeflateFilterNote Input instream 37 | DeflateFilterNote Output outstream 38 | DeflateFilterNote Ratio ratio 39 | 40 | #LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate 41 | #CustomLog deflate_log deflate 42 | 43 | # SSL Engine Switch: 44 | # Enable/Disable SSL for this virtual host. 45 | SSLEngine on 46 | 47 | 48 | RewriteEngine on 49 | # This will enable the Rewrite capabilities 50 | 51 | RewriteRule ^(.*)$ __webMyAccount__?instance=%{SERVER_NAME} [L,R] 52 | 53 | 54 | SSLOptions +StdEnvVars 55 | 56 | 57 | BrowserMatch ".*MSIE.*" \ 58 | nokeepalive ssl-unclean-shutdown \ 59 | downgrade-1.0 force-response-1.0 60 | 61 | SSLCertificateFile /etc/apache2/__webSSLCertificateCRT__ 62 | SSLCertificateKeyFile /etc/apache2/__webSSLCertificateKEY__ 63 | SSLCertificateChainFile /etc/apache2/__webSSLCertificateIntermediate__ 64 | SSLCACertificateFile /etc/apache2/__webSSLCertificateIntermediate__ 65 | 66 | -------------------------------------------------------------------------------- /scripts/testssh.php: -------------------------------------------------------------------------------- 1 | 'ecdsa-sha2-nistp256')); 14 | 15 | var_dump($connection); 16 | 17 | $methods = ssh2_methods_negotiated($connection); 18 | 19 | echo "Encryption keys were negotiated using: {$methods['kex']}\n"; 20 | echo "Server identified using an {$methods['hostkey']} with "; 21 | echo "fingerprint: " . ssh2_fingerprint($connection) . "\n"; 22 | -------------------------------------------------------------------------------- /sql/llx_packages.key.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) ---Put here your own copyright and developer email--- 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see http://www.gnu.org/licenses/. 15 | 16 | 17 | -- BEGIN MODULEBUILDER INDEXES 18 | ALTER TABLE llx_packages ADD INDEX idx_packages_rowid (rowid); 19 | ALTER TABLE llx_packages ADD INDEX idx_packages_ref (ref); 20 | ALTER TABLE llx_packages ADD INDEX idx_packages_entity (entity); 21 | ALTER TABLE llx_packages ADD INDEX idx_packages_import_key (import_key); 22 | ALTER TABLE llx_packages ADD INDEX idx_packages_status (status); 23 | -- END MODULEBUILDER INDEXES 24 | 25 | --ALTER TABLE llx_packages ADD CONSTRAINT llx_packages_field_id FOREIGN KEY (fk_field) REFERENCES llx_myotherobject(rowid); 26 | 27 | -------------------------------------------------------------------------------- /sql/llx_packages.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) ---Put here your own copyright and developer email--- 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see http://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_packages( 18 | -- BEGIN MODULEBUILDER FIELDS 19 | rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 20 | ref varchar(64) NOT NULL, 21 | entity integer DEFAULT 1 NOT NULL, 22 | label varchar(255), 23 | restrict_domains varchar(255), 24 | date_creation datetime NOT NULL, 25 | tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date 26 | fk_user_creat integer NOT NULL, 27 | fk_user_modif integer, 28 | import_key varchar(14), 29 | sqldump varchar(255), 30 | srcfile1 varchar(255), 31 | srcfile2 varchar(255), 32 | srcfile3 varchar(255), 33 | targetsrcfile1 varchar(255), 34 | targetsrcfile2 varchar(255), 35 | targetsrcfile3 varchar(255), 36 | conffile1 text, 37 | targetconffile1 text, 38 | datafile1 varchar(255), 39 | cliafter text, 40 | cliafterpaid text, 41 | sqlafter text, 42 | sqlpasswordreset text, 43 | sqlafterpaid text, 44 | crontoadd text, 45 | version_formula text, 46 | allowoverride varchar(255), 47 | status integer, 48 | register_text varchar(255), 49 | note_public text, 50 | note_private text 51 | -- END MODULEBUILDER FIELDS 52 | ) ENGINE=innodb; 53 | -------------------------------------------------------------------------------- /sql/llx_packages_extrafields.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) ---Put here your own copyright and developer email--- 2 | -- 3 | -- This program is free software; you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation; either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see http://www.gnu.org/licenses/. 15 | 16 | create table llx_packages_extrafields 17 | ( 18 | rowid integer AUTO_INCREMENT PRIMARY KEY, 19 | tms timestamp, 20 | fk_object integer NOT NULL, 21 | import_key varchar(14) -- import key 22 | ) ENGINE=innodb; 23 | 24 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistcontent.key.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | -- BEGIN MODULEBUILDER INDEXES 18 | ALTER TABLE llx_sellyoursaas_blacklistcontent ADD INDEX idx_sellyoursaas_blacklistcontent_date_creation (date_creation); 19 | -- END MODULEBUILDER INDEXES 20 | 21 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistcontent.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_sellyoursaas_blacklistcontent( 18 | -- BEGIN MODULEBUILDER FIELDS 19 | rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 20 | entity integer DEFAULT 1 NOT NULL, 21 | content varchar(128) NOT NULL, 22 | date_creation datetime NOT NULL, 23 | tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 24 | status integer DEFAULT 1 NOT NULL 25 | -- END MODULEBUILDER FIELDS 26 | ) ENGINE=innodb; 27 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistdir.key.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | -- BEGIN MODULEBUILDER INDEXES 18 | ALTER TABLE llx_sellyoursaas_blacklistdir ADD INDEX idx_sellyoursaas_blacklistddir_content (content); 19 | -- END MODULEBUILDER INDEXES 20 | 21 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistdir.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_sellyoursaas_blacklistdir( 18 | -- BEGIN MODULEBUILDER FIELDS 19 | rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 20 | entity integer DEFAULT 1 NOT NULL, 21 | content varchar(128) NOT NULL, 22 | noblacklistif varchar(255), 23 | date_creation datetime NOT NULL, 24 | tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 25 | status integer DEFAULT 1 NOT NULL 26 | -- END MODULEBUILDER FIELDS 27 | ) ENGINE=innodb; 28 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistfrom.key.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | -- BEGIN MODULEBUILDER INDEXES 18 | ALTER TABLE llx_sellyoursaas_blacklistfrom ADD UNIQUE INDEX uk_sellyoursaas_blacklistfrom_content (content); 19 | -- END MODULEBUILDER INDEXES 20 | 21 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistfrom.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_sellyoursaas_blacklistfrom( 18 | -- BEGIN MODULEBUILDER FIELDS 19 | rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 20 | entity integer DEFAULT 1 NOT NULL, 21 | content varchar(128) NOT NULL, 22 | date_creation datetime NOT NULL, 23 | tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 24 | status integer DEFAULT 1 NOT NULL 25 | -- END MODULEBUILDER FIELDS 26 | ) ENGINE=innodb; 27 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistip.key.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | -- BEGIN MODULEBUILDER INDEXES 18 | ALTER TABLE llx_sellyoursaas_blacklistip ADD UNIQUE INDEX uk_sellyoursaas_blacklistip_content (content); 19 | -- END MODULEBUILDER INDEXES 20 | 21 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistip.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_sellyoursaas_blacklistip( 18 | -- BEGIN MODULEBUILDER FIELDS 19 | rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 20 | entity integer DEFAULT 1 NOT NULL, 21 | content varchar(128) NOT NULL, 22 | comment varchar(255) NULL, 23 | date_use datetime NULL, 24 | date_creation datetime NOT NULL, 25 | tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 26 | status integer DEFAULT 1 NOT NULL 27 | -- END MODULEBUILDER FIELDS 28 | ) ENGINE=innodb; 29 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistmail.key.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | -- BEGIN MODULEBUILDER INDEXES 18 | ALTER TABLE llx_sellyoursaas_blacklistmail ADD INDEX idx_sellyoursaas_blacklistmail_date_creation (date_creation); 19 | -- END MODULEBUILDER INDEXES 20 | 21 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistmail.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_sellyoursaas_blacklistmail( 18 | -- BEGIN MODULEBUILDER FIELDS 19 | rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 20 | entity integer DEFAULT 1 NOT NULL, 21 | content text NOT NULL, 22 | date_creation datetime NOT NULL, 23 | tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 24 | status integer DEFAULT 1 NOT NULL 25 | -- END MODULEBUILDER FIELDS 26 | ) ENGINE=innodb; 27 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistto.key.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | -- BEGIN MODULEBUILDER INDEXES 18 | ALTER TABLE llx_sellyoursaas_blacklistto ADD UNIQUE INDEX uk_sellyoursaas_blacklistto_content (content); 19 | -- END MODULEBUILDER INDEXES 20 | 21 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_blacklistto.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_sellyoursaas_blacklistto( 18 | -- BEGIN MODULEBUILDER FIELDS 19 | rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 20 | entity integer DEFAULT 1 NOT NULL, 21 | content varchar(128) NOT NULL, 22 | date_creation datetime NOT NULL, 23 | tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 24 | status integer DEFAULT 1 NOT NULL 25 | -- END MODULEBUILDER FIELDS 26 | ) ENGINE=innodb; 27 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_clean_dbnotindisk.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_sellyoursaas_clean_dbnotindisk ( 18 | nom varchar(128) DEFAULT NULL, 19 | client tinyint(4) DEFAULT 0, 20 | rowid int(11) NOT NULL DEFAULT 0, 21 | ref varchar(50) DEFAULT NULL, 22 | ref_customer varchar(128) DEFAULT NULL, 23 | deployment_date_start datetime DEFAULT NULL, 24 | undeployment_date datetime DEFAULT NULL, 25 | deployment_host varchar(128) DEFAULT NULL, 26 | deployment_ip varchar(128) DEFAULT NULL 27 | ) ENGINE=innodb; 28 | 29 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_deploymentserver.key.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2022 SuperAdmin 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | -- BEGIN MODULEBUILDER INDEXES 18 | ALTER TABLE llx_sellyoursaas_deploymentserver ADD INDEX idx_sellyoursaas_deploymentserver_rowid (rowid); 19 | ALTER TABLE llx_sellyoursaas_deploymentserver ADD INDEX idx_sellyoursaas_deploymentserver_status (status); 20 | ALTER TABLE llx_sellyoursaas_deploymentserver ADD INDEX idx_sellyoursaas_deploymentserver_status (label); 21 | -- END MODULEBUILDER INDEXES 22 | 23 | --ALTER TABLE llx_sellyoursaas_deploymentserver ADD UNIQUE INDEX uk_sellyoursaas_deploymentserver_fieldxy(fieldx, fieldy); 24 | 25 | --ALTER TABLE llx_sellyoursaas_deploymentserver ADD CONSTRAINT llx_sellyoursaas_deploymentserver_fk_field FOREIGN KEY (fk_field) REFERENCES llx_sellyoursaas_myotherobject(rowid); 26 | 27 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_deploymentserver.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2022 SuperAdmin 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_sellyoursaas_deploymentserver( 18 | -- BEGIN MODULEBUILDER FIELDS 19 | rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 20 | ref varchar(128) NOT NULL, 21 | hostname varchar(64), 22 | label varchar(64), 23 | entity integer DEFAULT 1 NOT NULL, -- multi company id 24 | note_private text, 25 | note_public text, 26 | date_creation datetime NOT NULL, 27 | date_modification timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 28 | status integer NOT NULL, 29 | fk_country integer, 30 | fromdomainname varchar(128), 31 | ipaddress varchar(128) NOT NULL, 32 | servercountries varchar(128), 33 | servercustomerannouncestatus integer, 34 | servercustomerannounce text, 35 | serversignaturekey varchar(128), 36 | fk_user_modif int DEFAULT NULL 37 | -- END MODULEBUILDER FIELDS 38 | ) ENGINE=innodb; 39 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_stats.key.sql: -------------------------------------------------------------------------------- 1 | -- =================================================================== 2 | -- Copyright (C) 2013 Laurent Destailleur 3 | -- 4 | -- This program is free software; you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation; either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- =================================================================== 17 | 18 | ALTER TABLE llx_sellyoursaas_stats ADD INDEX uk_dolicloud_stats(x); 19 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_stats.sql: -------------------------------------------------------------------------------- 1 | -- =================================================================== 2 | -- Copyright (C) 2013 Laurent Destailleur 3 | -- 4 | -- This program is free software; you can redistribute it and/or modify 5 | -- it under the terms of the GNU General Public License as published by 6 | -- the Free Software Foundation; either version 3 of the License, or 7 | -- (at your option) any later version. 8 | -- 9 | -- This program is distributed in the hope that it will be useful, 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -- GNU General Public License for more details. 13 | -- 14 | -- You should have received a copy of the GNU General Public License 15 | -- along with this program. If not, see . 16 | -- =================================================================== 17 | 18 | CREATE TABLE llx_sellyoursaas_stats 19 | ( 20 | rowid integer AUTO_INCREMENT PRIMARY KEY, 21 | service varchar(24), -- old or xxx 22 | name varchar(24), 23 | x varchar(16), 24 | y double, 25 | tms timestamp 26 | ) ENGINE = innodb; 27 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_whitelistemail.key.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | -- BEGIN MODULEBUILDER INDEXES 18 | ALTER TABLE llx_sellyoursaas_whitelistemail ADD UNIQUE INDEX uk_sellyoursaas_whitelistemail_content (content); 19 | -- END MODULEBUILDER INDEXES 20 | 21 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_whitelistemail.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_sellyoursaas_whitelistemail( 18 | -- BEGIN MODULEBUILDER FIELDS 19 | rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 20 | entity integer DEFAULT 1 NOT NULL, 21 | content varchar(128) NOT NULL, 22 | comment varchar(255) NULL, 23 | date_creation datetime NOT NULL, 24 | tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 25 | status integer DEFAULT 1 NOT NULL 26 | -- END MODULEBUILDER FIELDS 27 | ) ENGINE=innodb; 28 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_whitelistip.key.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | -- BEGIN MODULEBUILDER INDEXES 18 | ALTER TABLE llx_sellyoursaas_whitelistip ADD UNIQUE INDEX uk_sellyoursaas_whitelistip_content (content); 19 | -- END MODULEBUILDER INDEXES 20 | 21 | -------------------------------------------------------------------------------- /sql/llx_sellyoursaas_whitelistip.sql: -------------------------------------------------------------------------------- 1 | -- Copyright (C) Laurent Destailleur 2 | -- 3 | -- This program is free software: you can redistribute it and/or modify 4 | -- it under the terms of the GNU General Public License as published by 5 | -- the Free Software Foundation, either version 3 of the License, or 6 | -- (at your option) any later version. 7 | -- 8 | -- This program is distributed in the hope that it will be useful, 9 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | -- GNU General Public License for more details. 12 | -- 13 | -- You should have received a copy of the GNU General Public License 14 | -- along with this program. If not, see https://www.gnu.org/licenses/. 15 | 16 | 17 | CREATE TABLE llx_sellyoursaas_whitelistip( 18 | -- BEGIN MODULEBUILDER FIELDS 19 | rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, 20 | entity integer DEFAULT 1 NOT NULL, 21 | content varchar(128) NOT NULL, 22 | comment varchar(255) NULL, 23 | date_creation datetime NOT NULL, 24 | tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 25 | status integer DEFAULT 1 NOT NULL 26 | -- END MODULEBUILDER FIELDS 27 | ) ENGINE=innodb; 28 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | /test.txt 2 | -------------------------------------------------------------------------------- /test/perf/test_create_instances.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export vhostfile="~/git/sellyoursaas/scripts/templates/vhostHttps-dolibarr.template" 4 | export targetdir="/home/test" 5 | 6 | 7 | if [ "$(id -u)" != "0" ]; then 8 | echo "This script must be run as root" 1>&2 9 | exit 1 10 | fi 11 | 12 | 13 | for i in {1..800} 14 | do 15 | if [[ -d $targetdir/test_$i/htdocs ]] 16 | then 17 | echo "Dir $targetdir/test_$i/htdocs already exists" 18 | else 19 | echo "Create dir $targetdir/test_$i/htdocs" 20 | useradd -m -d /home/test/test_$i test_$i 21 | mkdir -p "$targetdir/test_$i/htdocs" 22 | echo "HTML page for test_$i" > "$targetdir/test_$i/htdocs/index.html" 23 | fi 24 | 25 | if [[ ! -L "$targetdir/test_$i/htdocs/dolibarrtest" ]] 26 | then 27 | echo "Add link $targetdir/test_$i/htdocs/dolibarrtest to dolibarr files" 28 | ln -fs ~/git/dolibarr/htdocs "$targetdir/test_$i/htdocs/dolibarrtest" 29 | fi 30 | 31 | export apacheconf="/etc/apache2/sellyoursaas-available/test_$i.conf" 32 | if [[ -f $apacheconf ]] 33 | then 34 | echo "Apache conf $apacheconf already exists" 35 | else 36 | echo "Create apache conf $apacheconf from $vhostfile" 37 | cat $vhostfile | sed -e "s/@webAppDomain@/test_$i/g" | \ 38 | sed -e "s/@webAppAliases@/test_$i/g" | \ 39 | sed -e "s/@webAppLogName@/test_$i/g" | \ 40 | sed -e "s/@osUsername@/test_$i/g" | \ 41 | sed -e "s/@osGroupname@/test_$i/g" | \ 42 | sed -e "s/@webAppPath@/\/home\/test\/test_$i/" > $apacheconf 43 | #a2ensite test_$i.conf 44 | ln -fs /etc/apache2/sellyoursaas-available/test_$i.conf /etc/apache2/sellyoursaas-enabled 45 | fi 46 | 47 | if ! grep test_$i /etc/hosts >/dev/null; then 48 | echo Add name test_$i into /etc/hosts 49 | echo 127.0.0.1 test_$i >> /etc/hosts 50 | fi 51 | 52 | done 53 | 54 | echo "Finished. To launch apache: service apache2 reload" 55 | -------------------------------------------------------------------------------- /test/perf/test_delete_instances.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export vhostfile="~/git/sellyoursaas/scripts/templates/vhostHttps-dolibarr.template" 4 | export targetdir="/home/test" 5 | 6 | for i in {1..800} 7 | do 8 | if [[ -d $targetdir/test_$i ]] 9 | then 10 | echo "Dir $targetdir/test_$i exists. We delete it." 11 | deluser test_$i 12 | rm -fr "$targetdir/test_$i" 13 | else 14 | echo "Dir $targetdir/test_$i does not exists." 15 | fi 16 | 17 | export apacheconf="/etc/apache2/sellyoursaas-available/test_$i.conf" 18 | if [[ -f $apacheconf ]] 19 | then 20 | echo "Apache conf for $apacheconf exists. We delete it." 21 | rm "$apacheconf" 22 | else 23 | echo "Apache conf $apacheconf does not exists." 24 | fi 25 | 26 | done 27 | 28 | echo "Finished" 29 | -------------------------------------------------------------------------------- /test/perf/test_instances.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | for i in {1..800} 5 | do 6 | wget -nv http://test_$i -O - >/dev/null 7 | wget --no-check-certificate -nv https://test_$i -O - >/dev/null 8 | wget -nv http://test_$i/dolibarrtest/ -O - >/dev/null 9 | done 10 | 11 | echo "Finished." -------------------------------------------------------------------------------- /test/phpunit/CancellationTest.php: -------------------------------------------------------------------------------- 1 | 3 | * Copyright (C) ---Put here your own copyright and developer email--- 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | /** 20 | * \file test/unit/CancellationTest.php 21 | * \ingroup sellyoursaas 22 | * \brief PHPUnit test for Cancellation class. 23 | */ 24 | 25 | 26 | /** 27 | * Class CancellationTest 28 | * 29 | * @backupGlobals disabled 30 | * @backupStaticAttributes enabled 31 | * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. 32 | */ 33 | class CancellationTest extends PHPUnit\Framework\TestCase 34 | { 35 | /** 36 | * Global test setup 37 | * 38 | * @return void 39 | */ 40 | public static function setUpBeforeClass() 41 | { 42 | fwrite(STDOUT, __METHOD__ . "\n"); 43 | } 44 | 45 | /** 46 | * Unit test setup 47 | * 48 | * @return void 49 | */ 50 | protected function setUp() 51 | { 52 | fwrite(STDOUT, __METHOD__ . "\n"); 53 | } 54 | 55 | /** 56 | * Verify pre conditions 57 | * 58 | * @return void 59 | */ 60 | protected function assertPreConditions() 61 | { 62 | fwrite(STDOUT, __METHOD__ . "\n"); 63 | } 64 | 65 | /** 66 | * A sample test 67 | * 68 | * @return void 69 | */ 70 | public function testSomething() 71 | { 72 | fwrite(STDOUT, __METHOD__ . "\n"); 73 | 74 | $this->assertTrue(true); 75 | } 76 | 77 | /** 78 | * Verify post conditions 79 | * 80 | * @return void 81 | */ 82 | protected function assertPostConditions() 83 | { 84 | fwrite(STDOUT, __METHOD__ . "\n"); 85 | } 86 | 87 | /** 88 | * Unit test teardown 89 | * 90 | * @return void 91 | */ 92 | protected function tearDown() 93 | { 94 | fwrite(STDOUT, __METHOD__ . "\n"); 95 | } 96 | 97 | /** 98 | * Global test teardown 99 | * 100 | * @return void 101 | */ 102 | public static function tearDownAfterClass() 103 | { 104 | fwrite(STDOUT, __METHOD__ . "\n"); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /test/phpunit/CompanyPaymentModeTest.php: -------------------------------------------------------------------------------- 1 | 3 | * Copyright (C) ---Put here your own copyright and developer email--- 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | /** 20 | * \file test/unit/CompanyPaymentModeTest.php 21 | * \ingroup sellyoursaas 22 | * \brief PHPUnit test for CompanyPaymentMode class. 23 | */ 24 | 25 | 26 | /** 27 | * Class CompanyPaymentModeTest 28 | * 29 | * @backupGlobals disabled 30 | * @backupStaticAttributes enabled 31 | * @remarks backupGlobals must be disabled to have db,conf,user and lang not erased. 32 | */ 33 | class CompanyPaymentModeTest extends PHPUnit\Framework\TestCase 34 | { 35 | /** 36 | * Global test setup 37 | * 38 | * @return void 39 | */ 40 | public static function setUpBeforeClass() 41 | { 42 | fwrite(STDOUT, __METHOD__ . "\n"); 43 | } 44 | 45 | /** 46 | * Unit test setup 47 | * 48 | * @return void 49 | */ 50 | protected function setUp() 51 | { 52 | fwrite(STDOUT, __METHOD__ . "\n"); 53 | } 54 | 55 | /** 56 | * Verify pre conditions 57 | * 58 | * @return void 59 | */ 60 | protected function assertPreConditions() 61 | { 62 | fwrite(STDOUT, __METHOD__ . "\n"); 63 | } 64 | 65 | /** 66 | * A sample test 67 | * 68 | * @return void 69 | */ 70 | public function testSomething() 71 | { 72 | fwrite(STDOUT, __METHOD__ . "\n"); 73 | 74 | $this->assertTrue(true); 75 | } 76 | 77 | /** 78 | * Verify post conditions 79 | * 80 | * @return void 81 | */ 82 | protected function assertPostConditions() 83 | { 84 | fwrite(STDOUT, __METHOD__ . "\n"); 85 | } 86 | 87 | /** 88 | * Unit test teardown 89 | * 90 | * @return void 91 | */ 92 | protected function tearDown() 93 | { 94 | fwrite(STDOUT, __METHOD__ . "\n"); 95 | } 96 | 97 | /** 98 | * Global test teardown 99 | * 100 | * @return void 101 | */ 102 | public static function tearDownAfterClass() 103 | { 104 | fwrite(STDOUT, __METHOD__ . "\n"); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /test/test.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | \n"; 20 | print "checkdnsrr(idn_to_ascii(".$domainemail."), 'MX') = "; 21 | print checkdnsrr(idn_to_ascii($domainemail), 'MX')."
\n"; 22 | if (checkdnsrr(idn_to_ascii($domainemail), 'MX')) { 23 | $mxhosts=array(); 24 | $weight=array(); 25 | getmxrr(idn_to_ascii($domainemail), $mxhosts, $weight); 26 | var_dump($mxhosts); 27 | if (count($mxhosts) == 1 && empty($mxhosts[0])) { 28 | print "KO
\n"; 29 | } else { 30 | print "OK"; 31 | } 32 | } 33 | print "\n"; 34 | } 35 | -------------------------------------------------------------------------------- /test/testsmtp.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 |