Compare commits
6 Commits
pmoxos
...
dev-7_6_x-
| Author | SHA1 | Date | |
|---|---|---|---|
| a303d52854 | |||
| 0e21f49cd8 | |||
| 0f43875b44 | |||
| 6def25cb9e | |||
|
|
260462e9c4 | ||
| b9e8465f1b |
69
README.md
69
README.md
@@ -1,3 +1,70 @@
|
|||||||
# sprpcb
|
# sprpcb
|
||||||
|
|
||||||
Sistema Plurinacional de Registro del Patrimonio Cultural Boliviano
|
Sistema Plurinacional de Registro del Patrimonio Cultural Boliviano.
|
||||||
|
|
||||||
|
Modo de desarrollo en un servidor en modo tradicional (no contenedores). Clone este repositorio o descargue el script de instalacion de software requerido para un servidor Ubuntu.
|
||||||
|
|
||||||
|
### Guía rápida de instalación
|
||||||
|
para mas detalles, consulte la documentación oficial de [ArchesProject](https://arches.readthedocs.io/en/stable/installing/)
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#cd ~
|
||||||
|
git clone -b dev-7_6_x-nodocker https://gitea.patrimonio.org.bo/sysadmin/sprpcb.git dev_nodocker
|
||||||
|
cp ./dev_nodocker/instalar_arches7.6_ubuntu.sh ~/
|
||||||
|
source ./instalar_arches7.6_ubuntu.sh
|
||||||
|
python3.12 -m venv ENV
|
||||||
|
source ENV/bin/activate
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install arches==7.6.19
|
||||||
|
arches-admin startproject mi_proyecto
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configuración del idioma español
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# copiar paquete de idiomas
|
||||||
|
cp -r ~/dev_nodocker/es ~/ENV/lib/python3.12/site-packages/arches/locale/
|
||||||
|
```
|
||||||
|
|
||||||
|
### Crear carpetas para las extensiones adicionales
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# cd ~/mi_proyecto/mi_proyecto
|
||||||
|
mkdir -p templates/views/components/plugins
|
||||||
|
mkdir -p media/js/views/components/plugins
|
||||||
|
```
|
||||||
|
### Editar o añadir los siguientes parámetros del archivo de configuración ~/mi_proyecto/mi_proyecto/settings.py
|
||||||
|
```properties
|
||||||
|
#...
|
||||||
|
PUBLIC_SERVER_ADDRESS = "http://IP_LOCAL:8000/" # IP_LOCAL es la ip del servidor
|
||||||
|
#...
|
||||||
|
ENABLE_USER_SIGNUP = False
|
||||||
|
PERMISSION_FRAMEWORK = "arches_default_deny.ArchesDefaultDenyPermissionFramework"
|
||||||
|
#...
|
||||||
|
ALLOWED_HOSTS = ['IP_LOCAL','127.0.0.1']
|
||||||
|
LANGUAGE_CODE = "es"
|
||||||
|
|
||||||
|
# list of languages...
|
||||||
|
#...
|
||||||
|
LANGUAGES = [
|
||||||
|
# ('de', _('German')),
|
||||||
|
# ('en', _('English')),
|
||||||
|
# ('en-gb', _('British English')),
|
||||||
|
('es', _('Spanish')),
|
||||||
|
]
|
||||||
|
```
|
||||||
|
### Comandos finales para completar una instalación de arches en blanco
|
||||||
|
```bash
|
||||||
|
# se recomienda reiniciar el servidor y reconectar por ssh
|
||||||
|
# 1ra terminal:
|
||||||
|
source ENV/bin/activate
|
||||||
|
cd ~/mi_proyecto
|
||||||
|
python manage.py setup_db
|
||||||
|
python manage.py runserver IP_LOCAL:8000
|
||||||
|
# Conectar un segundo terminal al servidor de manera paralela
|
||||||
|
# 2da terminal:
|
||||||
|
source ENV/bin/activate
|
||||||
|
cd ~/mi_proyecto/mi_proyecto
|
||||||
|
npm run build_development
|
||||||
|
```
|
||||||
|
Finalmente, comprobar en un navegador web: http://IP_LOCAL:8000
|
||||||
BIN
es/LC_MESSAGES/django.mo
Normal file
BIN
es/LC_MESSAGES/django.mo
Normal file
Binary file not shown.
6483
es/LC_MESSAGES/django.po
Normal file
6483
es/LC_MESSAGES/django.po
Normal file
File diff suppressed because it is too large
Load Diff
142
instalar_arches7.6_ubuntu.sh
Executable file
142
instalar_arches7.6_ubuntu.sh
Executable file
@@ -0,0 +1,142 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Para Ubuntu 22.04+
|
||||||
|
# probado en Ubuntu 22.04
|
||||||
|
|
||||||
|
# Responda con 'yes' para instalar postgres/postgis,
|
||||||
|
# node/npm, y elasticsearch.
|
||||||
|
# para automatizar la instalación completa se puede utilizar:
|
||||||
|
# yes | source ./instalar_arches7.6_ubuntu.sh
|
||||||
|
|
||||||
|
function install_postgres {
|
||||||
|
sudo install -d /usr/share/postgresql-common/pgdg
|
||||||
|
sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
|
||||||
|
sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install postgresql-14 postgresql-contrib-14 -y
|
||||||
|
sudo apt-get install postgresql-14-postgis-3 -y
|
||||||
|
PGPASS=$(openssl rand -base64 14)
|
||||||
|
sudo -u postgres psql -d postgres -c "ALTER USER postgres with encrypted password '$PGPASS';"
|
||||||
|
sudo echo "*:*:*:postgres:$PGPASS" >> ~/.pgpass
|
||||||
|
sudo chmod 600 ~/.pgpass
|
||||||
|
sudo chmod 666 /etc/postgresql/14/main/postgresql.conf
|
||||||
|
sudo chmod 666 /etc/postgresql/14/main/pg_hba.conf
|
||||||
|
sudo echo "standard_conforming_strings = off" >> /etc/postgresql/14/main/postgresql.conf
|
||||||
|
sudo echo "listen_addresses = '*'" >> /etc/postgresql/14/main/postgresql.conf
|
||||||
|
sudo echo "#TYPE DATABASE USER CIDR-ADDRESS METHOD" > /etc/postgresql/14/main/pg_hba.conf
|
||||||
|
sudo echo "local all all trust" >> /etc/postgresql/14/main/pg_hba.conf
|
||||||
|
sudo echo "host all all 127.0.0.1/32 trust" >> /etc/postgresql/14/main/pg_hba.conf
|
||||||
|
sudo echo "host all all ::1/128 trust" >> /etc/postgresql/14/main/pg_hba.conf
|
||||||
|
sudo echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/14/main/pg_hba.conf
|
||||||
|
sudo chmod 664 /etc/postgresql/14/main/postgresql.conf
|
||||||
|
sudo chmod 664 /etc/postgresql/14/main/pg_hba.conf
|
||||||
|
sudo service postgresql restart
|
||||||
|
|
||||||
|
sudo -u postgres createdb -E UTF8 -T template0 --locale=en_US.utf8 template_postgis
|
||||||
|
sudo -u postgres psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis'"
|
||||||
|
sudo -u postgres psql -d template_postgis -c "CREATE EXTENSION postgis;"
|
||||||
|
sudo -u postgres psql -d template_postgis -c "CREATE EXTENSION \"uuid-ossp\";"
|
||||||
|
sudo -u postgres psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;"
|
||||||
|
sudo -u postgres psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;"
|
||||||
|
sudo -u postgres psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_npm {
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y ca-certificates curl gnupg
|
||||||
|
sudo mkdir -p /etc/apt/keyrings
|
||||||
|
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||||
|
echo NODE_MAJOR=18 >> ~/.profile
|
||||||
|
source ~/.profile
|
||||||
|
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list && sudo apt-get update
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install nodejs -y
|
||||||
|
}
|
||||||
|
|
||||||
|
function install_elasticsearch {
|
||||||
|
sudo apt-get install apt-transport-https
|
||||||
|
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
|
||||||
|
sudo sh -c 'echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" > /etc/apt/sources.list.d/elastic-8.x.list'
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install elasticsearch
|
||||||
|
sudo /bin/systemctl enable elasticsearch.service
|
||||||
|
sudo systemctl enable elasticsearch.service
|
||||||
|
sudo systemctl start elasticsearch.service
|
||||||
|
|
||||||
|
printf "y\nE1asticSearchforArche5\nE1asticSearchforArche5" | sudo /usr/share/elasticsearch/bin/elasticsearch-reset-password -i -u elastic
|
||||||
|
}
|
||||||
|
|
||||||
|
function main {
|
||||||
|
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
|
||||||
|
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get install -y make software-properties-common
|
||||||
|
#sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
|
||||||
|
|
||||||
|
sudo apt-get install -y build-essential
|
||||||
|
sudo apt-get install -y libxml2-dev
|
||||||
|
sudo apt-get install -y libproj-dev
|
||||||
|
sudo apt-get install -y libjson-c-dev
|
||||||
|
sudo apt-get install -y xsltproc
|
||||||
|
sudo apt-get install -y docbook-xsl
|
||||||
|
sudo apt-get install -y docbook-mathml
|
||||||
|
sudo apt-get install -y libgdal-dev
|
||||||
|
sudo apt-get install -y libpq-dev
|
||||||
|
|
||||||
|
sudo apt-get install -y python3.12
|
||||||
|
sudo apt-get install -y python3.12-dev
|
||||||
|
sudo apt-get install -y python3.12-venv
|
||||||
|
|
||||||
|
sudo apt-get install -y python3.12-pip
|
||||||
|
sudo apt-get install -y python3.12-setuptools
|
||||||
|
sudo apt-get install -y python3.12-wheel
|
||||||
|
sudo apt-get install -y python3.12-cffi
|
||||||
|
sudo apt-get install -y libcairo2
|
||||||
|
sudo apt-get install -y libpango-1.0-0
|
||||||
|
sudo apt-get install -y libpangocairo-1.0-0
|
||||||
|
sudo apt-get install -y libgdk-pixbuf2.0-0
|
||||||
|
sudo apt-get install -y libffi-dev
|
||||||
|
sudo apt-get install -y shared-mime-info
|
||||||
|
sudo apt-get install -y jbig2dec
|
||||||
|
|
||||||
|
echo -n "Quiere instalar elasticsearch? (y/N)? "
|
||||||
|
read answer
|
||||||
|
if echo "$answer" | grep -iq "^y" ;then
|
||||||
|
echo Sí, instalando Elasticsearch
|
||||||
|
install_elasticsearch
|
||||||
|
else
|
||||||
|
echo Omitiendo la instalación de Elasticsearch
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n "Quiere instalar y configurar postgres/postgis? (y/N)? "
|
||||||
|
read answer
|
||||||
|
if echo "$answer" | grep -iq "^y" ;then
|
||||||
|
echo Sí, Instalando Postgres/PostGIS
|
||||||
|
install_postgres
|
||||||
|
else
|
||||||
|
echo Omitiendo la instalación de Postgres/PostGIS
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -n "Quiere instalar y configurar nodejs/npm (y/N)? "
|
||||||
|
read answer
|
||||||
|
if echo "$answer" | grep -iq "^y" ;then
|
||||||
|
echo Sí, instalando Node/npm
|
||||||
|
install_npm
|
||||||
|
else
|
||||||
|
echo Omitiendo la instalación de Node/npm
|
||||||
|
fi
|
||||||
|
echo "*******************************************************"
|
||||||
|
echo Pasos restantes para la implementación de archesproject
|
||||||
|
echo "*******************************************************"
|
||||||
|
echo -e "\t1. python3.12 -m venv ENV"
|
||||||
|
echo -e "\t2. source ENV/bin/activate"
|
||||||
|
echo -e "\t3. python -m pip install --upgrade pip"
|
||||||
|
echo -e "\t4. pip install arches==7.6.19"
|
||||||
|
echo -e "\t5. arches-admin startproject mi_proyecto"
|
||||||
|
echo -e "\t cd mi_proyecto"
|
||||||
|
echo -e "\t6. python manage.py setup_db"
|
||||||
|
echo -e "\t7. python manage.py runserver"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
main
|
||||||
Reference in New Issue
Block a user